Author Topic: category and subcategory  (Read 11471 times)

0 Members and 1 Guest are viewing this topic.

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
category and subcategory
« on: July 13, 2010, 01:38:19 AM »
hi evry one
can i make Number of table cells for the category Different from Number of table cells for the subcategory

for example when i make Number of table cells for the category 3 the Number of table cells for the subcategory will be 3 i want to make it 5

thanks for all ypur help

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #1 on: July 13, 2010, 01:57:04 AM »
for all subcategories or for a specific subcategory?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: category and subcategory
« Reply #2 on: July 13, 2010, 04:04:52 PM »
thanks for your replay

will my site has a 144 category and evry category has about 30 to 40 subcategory so all i need is to make the Number of table cells for the category is 5 and the Number of table cells for any subcategory is 2

waiting for your replay

thanks
« Last Edit: July 14, 2010, 05:59:42 PM by nameless »

Offline nagmat

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • نغمات
Re: category and subcategory
« Reply #3 on: July 15, 2010, 04:46:26 AM »
thanks for your replay

will my site has a 144 category and evry category has about 30 to 40 subcategory so all i need is to make the Number of table cells for the category is 5 and the Number of table cells for any subcategory is 2

waiting for your replay

thanks

Good idea  8) V@no will help you  :wink:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #4 on: July 15, 2010, 05:45:48 AM »
try this, in includes/functions.php find:
  $cattable_width ceil((intval($config['cat_table_width'])) / $config['cat_cells']);

Insert above :above:  $cat_cells $config['cat_cells'];
  
$config['cat_cells'] += ($cat_cache[$cat_id]['cat_parent_id'] ? 2); //increase number of cells to 2 on home page



Then find:
  return $categories;

Insert above :above:  $config['cat_cells'] = $cat_cells;
« Last Edit: July 15, 2010, 06:05:33 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: category and subcategory
« Reply #5 on: July 15, 2010, 07:52:50 PM »
thanks for your replay

increase number of cells to 2 in home page and the subcategory also

waiteing for your replay

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #6 on: July 15, 2010, 08:19:01 PM »
mmm what? is there a question? if so, what is it?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: category and subcategory
« Reply #7 on: July 15, 2010, 10:25:27 PM »
Sorry
i make what you say
but both of category and subcategory are increase number of cells to 2  not the category only

i hope you can understand me

you can see here

http://www.welcome2net.com/cars/ this ok but when you go to subcategory like ABT the first one I need it to be 2 not 5

waiting

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #8 on: July 15, 2010, 10:30:44 PM »
then try this line:
  $config['cat_cells'] += ($cat_cache[$cat_id]['cat_parent_id'] || $cat_cache[$cat_cache[$cat_id]['cat_parent_id']]['cat_parent_id']? 2); //increase number of cells to 2 on home page
« Last Edit: July 15, 2010, 11:23:42 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: category and subcategory
« Reply #9 on: July 15, 2010, 10:45:11 PM »
i replace
this
  $config['cat_cells'] += ($cat_cache[$cat_id]['cat_parent_id'] && $cat_cache[$cat_cache[$cat_id]['cat_parent_id']]['cat_parent_id']? 0 : 2); //increase number of cells to 2 on home page

with this

$config['cat_cells'] += ($cat_cache[$cat_id]['cat_parent_id'] ? 0 : 2); //increase number of cells to 2 on home page

and it does't work
it still the same

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #10 on: July 15, 2010, 11:24:33 PM »
Ops, there should've been || instead of &&
I've updated the code above.

P.S. at the moment I don't have ability test it. hopefully it will work now.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: category and subcategory
« Reply #11 on: July 15, 2010, 11:45:56 PM »
sorry V@no
it still the same

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #12 on: July 16, 2010, 02:45:43 AM »
Then perhaps I didn't understand your question.

Here is screenshots after my modifications:

Home page - 4 columns:




Main category - 4 columns:




Subcategory - 2 columns:

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: category and subcategory
« Reply #13 on: July 16, 2010, 12:06:49 PM »
thanks V@no for your help
ok I need
Home page - 5 columns:
Main category - 2 columns:

thanks againe

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: category and subcategory
« Reply #14 on: July 16, 2010, 03:01:44 PM »
That how it was with the "original" code I propose
http://www.4homepages.de/forum/index.php?topic=27533.msg149034#msg149034
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)