Advertisement:

Author Topic: category icon plugin  (Read 3226 times)

zahoorkayani

  • Newbie
  • *
  • Posts: 13
category icon plugin
« on: April 21, 2016, 04:44:15 pm »
Hi osclass
I installed this plug in but it is not working I am using purple bender theme.
Can't see icons in category?



http://market.osclass.org/plugins/appearance/category-icon_554
 Any video tutorial available for this plugin?
« Last Edit: May 31, 2016, 09:28:14 am by _CONEJO »

zahoorkayani

  • Newbie
  • *
  • Posts: 13
Re: category icon plugin
« Reply #1 on: June 09, 2016, 11:08:04 pm »
I don't know how to configure?
where code goes and which file to add? 

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: category icon plugin
« Reply #2 on: June 12, 2016, 02:10:25 pm »
@WTEH
Hello congratulations for the plugin icon category very good work!
can you tell me which file must be modified please?
thank you
cordially

osclassLover

  • Newbie
  • *
  • Posts: 39
  • thinking to achieve new in osclass
Re: category icon plugin
« Reply #3 on: June 14, 2016, 08:31:42 am »
Hello zahoorkayani,

the category icon plugin is a old plugin, we cant assure that it will work for new versions.
I have solved the same issue in my friend's site, there the category icon plugin does not
worked well.
If you tell me the site details (admin username, password), i can try to find the issues and will
give you my suggestion.

you can find my email id, in my signature area.

Thanks.

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: category icon plugin
« Reply #4 on: August 06, 2017, 08:39:16 pm »
Where we add code?
bender [removed] theme
1- open [removed]
2- find:
Code: [Select]
while ( osc_has_categories() ) {about line 225
3-about line 237
find:
Code: [Select]
       <ul class="r-list">
            <li>
                 <h1>

4- added this code after <h1> or after <li>
Code: [Select]
                    <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>

5- at end it like this:
Code: [Select]
        <ul class="r-list">
            <li>
                 <h1>
                    <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>   
                    <?php
                    $_slug      
osc_category_slug();
                    
$_url       osc_search_category_url();
                    
$_name      osc_category_name();
                    
$_total_items osc_category_total_items();
                    if ( 
osc_count_subcategories() > ) { ?>

                    <span class="collapse resp-toogle"><i class="fa fa-caret-right fa-lg"></i></span>

6- also you can added this code for sub categories:
find several line after that code
Code: [Select]
                 </h1>
                 <?php if ( osc_count_subcategories() > ) { ?>
                   <ul>
                         <?php while ( osc_has_subcategories() ) { ?>
                             <li>
and after <li> add this code:
Code: [Select]
                    <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>
« Last Edit: August 06, 2017, 09:40:37 pm by abc500x500 »

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: category icon plugin
« Reply #5 on: August 06, 2017, 09:43:28 pm »
for sub categories this edit is better
put this code between <a...></a>

Code: [Select]
                    <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>

finally u.r-list block will be like this code:

Code: [Select]
        <ul class="r-list">
            <li>
                 <h1>
                    <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>   
                    <?php
                    $_slug      
osc_category_slug();
                    
$_url       osc_search_category_url();
                    
$_name      osc_category_name();
                    
$_total_items osc_category_total_items();
                    if ( 
osc_count_subcategories() > ) { ?>

                    <span class="collapse resp-toogle"><i class="fa fa-caret-right fa-lg"></i></span>
                    <?php ?>
                    <?php if($_total_items 0) { ?>
                    <a class="category <?php echo $_slug?>" href="<?php echo $_url?>"><?php echo $_name ?></a> <span>(<?php echo $_total_items ?>)</span>
                    <?php } else { ?>
                    <a class="category <?php echo $_slug?>" href="#"><?php echo $_name ?></a> <span>(<?php echo $_total_items ?>)</span>
                    <?php ?>
                 </h1>
                 <?php if ( osc_count_subcategories() > ) { ?>
                   <ul>
                         <?php while ( osc_has_subcategories() ) { ?>
                             <li>
                 
                             <?php if( osc_category_total_items() > ) { ?>
                                 <a class="category sub-category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>">
                    <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>
                                 <?php echo osc_category_name() ; ?>
                                 </a> <span>(<?php echo osc_category_total_items() ; ?>)</span>
                             <?php } else { ?>
                                 <a class="category sub-category <?php echo osc_category_slug() ; ?>" href="#">
                     <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>             
                                 <?php echo osc_category_name() ; ?>
                                 </a> <span>(<?php echo osc_category_total_items() ; ?>)</span>
                             <?php ?>
                             </li>
                         <?php ?>
                   </ul>
                 <?php ?>
             </li>
        </ul>


abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: category icon plugin
« Reply #6 on: August 08, 2017, 07:10:46 pm »
If you use following code for main categories it will be better because picture become background and you can use CSS for control that.

Code: [Select]
      <ul class="r-list">
            <li>
                 <h1
            <?php //added by me - category icon ?>
                   <?php if(get_category_icon(osc_category_id())) { ?>                   
                     class="r-list-icon" style="background-image:url('<?php echo get_category_icon(osc_category_id()); ?>'); background-repeat:no-repeat;"                           
                   <?php ?>
            <?php //added by me - category icon ?>                 
                 >
                    <?php
                    $_slug      
osc_category_slug();
                    
$_url       osc_search_category_url();
                    
$_name      osc_category_name();

« Last Edit: August 08, 2017, 07:14:18 pm by abc500x500 »

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: category icon plugin
« Reply #7 on: August 08, 2017, 07:32:22 pm »
Hi
I saw Moderator removed bender fileNAME.php
please say why you do that?

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: category icon plugin
« Reply #8 on: August 10, 2017, 08:14:11 pm »
Because osclass is open source editing files is legal.
why moderator removed functions.php ?

Quote
Where we add code?
bender [removed] theme
1- open [removed]
2- find:

madany

  • Newbie
  • *
  • Posts: 1
Re: category icon plugin
« Reply #9 on: October 19, 2017, 05:56:32 am »
So...I dunno what's being on moderator's mind...
1. We need to know version of Bender theme
2. We need to know what file must be edited  ( I guess it's "functions.php" )

I did all what abc500x500 explained here but no luck. I guess there's something I miss...maybe the version of Bender theme?
If moderator doesn't allow abc500x500 to share...please abc500x500, could you contact me?

Thanks to abc500x500...thanks to moderator