Results 1 to 5 of 5

Thread: Category number of links variable

  1. #1
    Join Date
    May 2004
    Location
    New Zealand
    Posts
    600

    Default Category number of links variable

    Could a block help do the following,

    Some categories might have say 11 listings, so it seems pretty pointless if you have 10 as your number of links per page, then it will split it up into 2 pages, 1 page with 10 and 1 page with 1.

    So this got me thinking, could we set it up, so that if a category has say 21 links... it could make say 3 pages of 7 links... instead of 2 pages of 10, and 1 page of 1.

    Of course it probibly sounds easier than it looks, because it needs to have an equation to figure out what it should do for each category.

    So ive spent the time to come up with a equation that can help spread the listings over the pages.

    Ive attached a copy of the spreadsheet, which shows how it would calculate.
    The number of links in a category is in the first col, and in the last is a explation of how the links would end up...

    This is based on the fact that Links per page would be of a max of 10.

    Im just wondering what effect this would have on sites, page load times for example... would it be faster to load 3 pages of 7 links, than it would be to load 2 pages of 10 and 1 page of 1?

    Also would this put much extra load on the server? Would it be run everytime a person goes to a browse page, or could it be calculated when the number of links is being calculated?

    Cheers Ezy
    Attached Images Attached Images
    Last edited by ezykiwi; 09-21-2006 at 02:39 AM.

  2. #2
    Join Date
    Jul 2006
    Location
    Paris, France
    Posts
    108

    Default

    I think you don't search the good way to display the links.

    In my mind, the first thing to consider is the height of the page compared to the vertical size of the screen.

    Most of the visitors use 1024x768 screens.
    If the list is too long, the visitor will never click on all the links, and the page will not by easy to read (more than 2 clicks in the vertical "elevator" to see all the page).

  3. #3
    Join Date
    May 2004
    Location
    New Zealand
    Posts
    600

    Default

    Howdy Mickey,

    That was just working on the fact that people have it currently set at 10 (which is what it comes with)...

    You could set the number you want to anything, such as 5, or 6 links per page, which would be fine, This is more refering to the fact sometimes people will click on a page of results, only to find 1 link...

    for example... if you had your links per page set to 5, and a category has 16 links, then there is going to be 4 pages of results, the first 3 fulled with 5 and the 4th page filled with only 1 result,

    With my calculation there would be 4 links on 4 pages.... just spreading out the links in a more logical fashion....

    I guess its just more a pet hate of mine when i have to load a whole new page just for 1 result, when maybe it could have been spread out.... thats all

  4. #4
    Join Date
    May 2004
    Location
    New Zealand
    Posts
    600

    Default

    Here is another example, Ive done the top half if the number of links per page was 10, and the bottom half is if it was set to 5 ....

    You basically just have to think about it in regards to but differant number of listings would effect the number of pages of results that are needed.
    Attached Images Attached Images

  5. #5
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Block can not do this. You must hacking browse.php. I think it's not that's hard. You just need to play with the following codes and compute number of links it should be displayed according with the total links in the current category.

    Code:
        $links_obj->table_name            = "idx_link";
        $links_obj->category_table_name   = "idx_category";
        $links_obj->user_table_name       = "idx_users";
        $links_obj->editor_table_name     = "idx_editor";
        $links_obj->template_file         = $theme_path . "rows.html";
        $links_obj->date_format           = $msg["10014"];
        $links_obj->rating_image_path     = "themes/" . $theme_name . "/images/rating/";
        $links_obj->rev_rating_image_path = "themes/" . $theme_name . "/images/review/";
        $links_obj->header                = $msg["10013"];
        $links_obj->paging                = true;
        $links_obj->pg_size               = $max_rows;
        $links_obj->href                  = "browse.php";
        $links_obj->more_param            = "&cat=$cat";
        $links_obj->category_file         = "browse.php";
        $links_obj->category_separator    = $category_separator;
        $links_obj->page_file             = "browse";                                         // for mod rewrite
        $links_obj->page_title            = strtolower($category_obj->GetCategoryName($cat)); // for mod rewrite
        $link                             = $links_obj->Display();
        $num_rows                         = $links_obj->record_count_of_display + @count($lid);
        $pagination                       = $links_obj->pagination;

Similar Threads

  1. Replies: 3
    Last Post: 09-21-2005, 04:28 AM
  2. Category number
    By Bruceper in forum v5.x
    Replies: 1
    Last Post: 07-14-2005, 03:49 AM
  3. Number of listings in each category
    By kservik in forum v5.x
    Replies: 6
    Last Post: 03-13-2005, 10:45 PM
  4. Replies: 3
    Last Post: 01-30-2005, 06:59 AM
  5. Admin search category by number ?
    By Frank71 in forum v5.x
    Replies: 2
    Last Post: 08-13-2004, 08:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •