Author Topic: Change category sortorder to left-right (row-based)  (Read 4121 times)

0 Members and 1 Guest are viewing this topic.

Offline thevilone

  • Pre-Newbie
  • Posts: 2
    • View Profile
Change category sortorder to left-right (row-based)
« on: June 02, 2008, 09:55:31 PM »
Hi All,

I would like to change the automatic category sortorder.

Currently, the overview page sorts the categories columnbased. As we use the gallery for displaying party-images, this results in the most recent parties to be displayed on the lower half of the page.

I would the categories to be sorted row-based. To make it a more understandable, here's an example:

Current situation:

Party01  Party05 Party09
Party02  Party06 Party10
Party03  Party07 Party11
Party04  Party08 Party12

What I would Like:
Party01  Party02  Party03
Party04  Party05  Party06
Party07  Party08  Party09
Party10  Party11  Party12

Many thanks for your follow-up!

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Change category sortorder to left-right (row-based)
« Reply #1 on: June 02, 2008, 11:03:12 PM »
... there is a modification by v@no here in the forum exactly for your request ...
... but I can't find the thread to give you a link ... sorry ...
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 thevilone

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Change category sortorder to left-right (row-based)
« Reply #2 on: June 03, 2008, 08:34:21 PM »
Hi Mawenzi,

An advanced search with the username you provided drastically limited the number of search results, after only a few minutes I was able to find the solution! Thanks BIG TIME!!!  :D

For all you out there looking for the same, here's how to do it:


In includes/functions.php find:

Code:

  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<tr>\n<td valign=\"top\">\n";

Replace with Code:

  $categories .= "<tr>\n";
  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<td valign=\"top\">\n";


Find Code:

    $categories .= "</td>\n</tr>\n";

    if ($count == $table_rows && $count2 < sizeof($visible_cat_cache)) {
      $categories .= "</table></td>\n";
      $categories .= "<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
      $categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";

      $total = $total - $count2;
      $table_columns = $table_columns - 1;


Replace with Code:

    $categories .= "</td>\n";

    if ($count == $table_columns && $count2 < sizeof($visible_cat_cache)) {
      $categories .= "</tr>\n<tr>\n";

      $total = $total - $count2;
      $table_rows = $table_rows - 1;