Author Topic: [MOD] limited number of categories per page (updated 08-06-2006)  (Read 119469 times)

0 Members and 1 Guest are viewing this topic.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] limited number of categories per page
« Reply #75 on: April 25, 2006, 07:46:37 PM »
i've made 4 categories:

1,9,28,29

1 and 9 category works fine but 28 and 29 give me this error:

Quote
Fatal error: Cannot redeclare class paging in /home/blacktra/public_html/includes/paging.php on line 28

But inside this categories i've added subcategories, and them work fine, what need i do to fix it ?

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: [MOD] limited number of categories per page
« Reply #76 on: April 26, 2006, 12:05:44 AM »
did you miss Step 2?
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 aletapety

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Problem with cache function unsing this MOD
« Reply #77 on: June 07, 2006, 08:31:27 AM »
When I use the cache function of the script I get a problem with this mod.

It caches first site of my categories but then I can't get to page 2 or 3. Paging does not work anymore. Has anyone a solution for this ?

I have the same problem  :?

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: [MOD] limited number of categories per page
« Reply #78 on: June 07, 2006, 03:41:13 PM »
Not tested:

In categories.php find:
Code: [Select]
    isset($user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 0, 8) : 0,
Insert above:
Code: [Select]
    isset($HTTP_GET_VARS['cat_page']) ? $HTTP_GET_VARS['cat_page'] : 0,
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 aletapety

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD] limited number of categories per page
« Reply #79 on: June 07, 2006, 08:10:59 PM »
Yes V@no you are the best  8O solved ! but the same action we mast do in index.php and that all, thank ! ,now work when cache is enable  :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: [MOD] limited number of categories per page
« Reply #80 on: June 08, 2006, 02:07:33 AM »
Alright then, I've added Step 4 that fixes this issue :)
thanks for getting back with the result ;)
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 magaxine

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #81 on: August 04, 2006, 08:24:28 PM »
really good mod, but unfortunately it doesn't work at my website. I tried several times to add it at my gallery, but I every time get this error-message at top of categoeries.php:

Warning: Division by zero in /www/htdocs/v093029/partypics/includes/functions.php on line 966

do you have an idea what could be the problem?

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: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #82 on: August 04, 2006, 08:46:55 PM »
I have no idea what is on line 966 in your functions.php...
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 magaxine

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #83 on: August 05, 2006, 07:15:01 AM »
I think the problem was that the line
foreach ($visible_cat_cache as $key => $category_id) {
appears two times in the code, I online replaced the first one.

now the "division by zero" error is fixed, but my categories-page shows not one gallery. here is the code of my functions.php, would be great if you could help me!
« Last Edit: August 05, 2006, 10:00:56 AM by V@no »

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: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #84 on: August 05, 2006, 10:02:06 AM »
That line must be inside get_categories function
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 magaxine

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #85 on: August 05, 2006, 07:17:01 PM »
hi v@no, sorry if I get on your nerves with my problem ;) but it just doesn't work. when I replace just the line

foreach ($visible_cat_cache as $key => $category_id) {
with
foreach ($cache as $category_id){

in the get_categories function, the "division by zero" error appears again. I just tried for 2 hours to get a solution, but I have no idea what the problem is  :roll:

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: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #86 on: August 05, 2006, 07:35:02 PM »
There is no any division in the mod, so I need to know what is on your 966 line.
Or even better, please show what is on 966 line plus 10 lines above and below 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 magaxine

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #87 on: August 05, 2006, 08:33:31 PM »
thx for your helb v@no  :D

here is the code:

956  $categories .= "</table></td>\n";
957      $categories .= "<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
958      $categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";
959
960      $total = $total - $count2;
961      $table_columns = $table_columns - 1;
962      if ($total <= $table_columns && $table_columns > 1) {
963        $table_rows = 1;
964      }
965      else {
966        $table_rows = $total / $table_columns;
967        if ($total >= $table_columns && !is_integer($table_rows)) {
968          $table_rows = intval($table_rows) + 1;
969        }
970      }
971      $count = 0;
972    }
973  }
974
975  $categories .= "</table>\n</td>\n</tr>\n</table>\n";
976  return $categories;

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
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 magaxine

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] limited number of categories per page (updated 07-06-2006)
« Reply #89 on: August 06, 2006, 05:18:23 PM »
Yes I use version 1.7, thx :) now I see 10 categories, but no paging, which means there is noch link to page 2,3,4...

I fell like an idiot because i got so much problems with your mod ;) but i got no idea what could be the problem. I added {cat_paging} to my categories.html and uploaded your version of paging.php, but nothing happens.