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

0 Members and 1 Guest are viewing this topic.

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 #90 on: August 06, 2006, 10:24:52 PM »
add it to home.html template as well
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 #91 on: August 06, 2006, 11:35:41 PM »
thx, now I can see the paging. but unfortunately I got the same problem like some of the other users, I can't go to any of the other pages, beause the links are incorrect:

domain/categories.php?cat_id=0&cat_page=2

 [1]  2  3  4  5  ...  »  Last Page » Go to page:   
Found 97 categories on 10 page(s). Displayed category 1 to 10

even if I try do copy the URL and paste it directly in my browser with a correct cat_id is is impossible to view any of the other pages

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 #92 on: August 07, 2006, 01:27:28 AM »
ok, replace in functions.php
Code: [Select]
$link_arg = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id);
with:
Code: [Select]
$link_arg = $site_sess->url(ROOT_PATH.($cat_id ? "categories.php?".URL_CAT_ID."=".$cat_id : "index.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 08-06-2006)
« Reply #93 on: August 07, 2006, 01:22:15 PM »
v@no, can't thank you enough for your help! now everything works perfectly!  :mrgreen:
great mod and great support, what more can you ask for!  :D

Offline peti

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #94 on: September 18, 2007, 04:51:21 PM »
hi i woud like to see the new paging.php file since i can't download it from the link.
Ty very much.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #95 on: September 18, 2007, 05:11:02 PM »
@peti
... the [MOD] Universal Paging Class v1.1 (the new paging.php) you can find here ...
http://www.4homepages.de/forum/index.php?topic=6926.0
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline navyseal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #96 on: April 05, 2008, 02:59:25 AM »
Its not working with categories and sub categories...works one the images paging...using 1.7.6 :(

Offline navyseal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #97 on: April 05, 2008, 03:13:42 AM »
oops..missed the last step..my bad...works all ok :)

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #98 on: July 18, 2009, 09:30:54 PM »
Hi V@no

I'm using v1.7.7 and have added all the code but I get a white page when I go to a Cat.

Thanks

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 08-06-2006)
« Reply #99 on: July 18, 2009, 10:42:48 PM »
Hi V@no

I'm using v1.7.7 and have added all the code but I get a white page when I go to a Cat.

Thanks
Restore backups and try install mod again. There must an error you've made.
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 cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #100 on: July 18, 2009, 11:13:17 PM »
Restore backups and try install mod again. There must an error you've made.
Hi V@no

I get a white page when I enter this code:

Code: [Select]
//Begin configuration:

$perpage = 10; //how many categories per page
$cat_text = "Found {total_cat_images} categories on {total_pages} page(s). Displayed category {first_page} to {last_page}";

//u can use those tags:
//{total_cat_images} - total categories
//{total_pages} - total pages
//{first_page} - displayed from (number first category displayed)
//{last_page} - displayed to (number last category displayed)
//End configuration

$page = (isset($HTTP_GET_VARS['cat_page'])) ? $HTTP_GET_VARS['cat_page'] : 0;
if (!class_exists("Paging")) {
  include(ROOT_PATH.'includes/paging.php');
}
$link_arg = $site_sess->url(ROOT_PATH.($cat_id ? "categories.php?".URL_CAT_ID."=".$cat_id : "index.php"));
$getpaging = new Paging($page, $perpage, $total, $link_arg, $cat_text, "", "cat_page");
$offset = $getpaging->get_offset();
$limit = ($offset + $perpage > $total) ? $total : $offset + $perpage - 1;
$total = $limit - $offset;
$site_template->register_vars(array(
  "cat_paging" => $getpaging->get_paging(),
  "cat_paging_stats" => $getpaging->get_paging_stats()
));
$cache = array();
$i = 0;
foreach ($visible_cat_cache as $key => $category_id) {
  if ($i >= $offset && $i <= $limit) {
    $cache[] = $category_id;
    $cache_sql .= (($cache_sql != "") ? ", " : "").$category_id;
  }
  $i++;
}
$total = count($cache);

Also there a 2 lines with this code:

Code: [Select]
  $total = sizeof($visible_cat_cache);
I've tried after both lines and still get the white page???

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 08-06-2006)
« Reply #101 on: July 18, 2009, 11:54:24 PM »
In unmodified 4images there is only one such line.
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 cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #102 on: July 19, 2009, 12:09:16 AM »
In unmodified 4images there is only one such line.
I given, I removed 1 line of that code added the main code again and still got a white page.

Offline okey

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #103 on: August 22, 2009, 05:02:45 PM »
In unmodified 4images there is only one such line.
I given, I removed 1 line of that code added the main code again and still got a white page.

We need to replace paging.php this file
Try it should work

Offline cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] limited number of categories per page (updated 08-06-2006)
« Reply #104 on: December 02, 2009, 08:16:36 PM »
Hi

I've added this to my new site and got the paging to show but my categories show like this:



But when this mod isn't added to my site the categories show in a list, the way they should, any ideas?

Thanks