4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: jerseygirl on September 24, 2005, 10:20:21 PM

Title: rearrange categories
Post by: jerseygirl on September 24, 2005, 10:20:21 PM
Hi,

the way the categories are set up now look like this :

cat #1      cat #4
cat #2      cat #5
cat #3      cat #6

I would like to change it to this:

cat #1      cat #2
cat #3      cat #4
cat #5      cat #6

if anyone has any idea...
Title: Re: rearrange categories
Post by: mawenzi on September 25, 2005, 12:20:34 AM
ACP -> categories sort -> cat #1, cat #3, cat #5, cat #2, cat #4, cat #6 ...  :wink:

mawenzi
Title: Re: rearrange categories
Post by: jerseygirl on September 25, 2005, 08:47:42 AM
yeah but if you have like a hundred categories and subcats, it's gonna be a real pain  :wink: I was actually looking for a way to do that automatically, you know, fill a row before moving to the next one
Title: Re: rearrange categories
Post by: Lunique on February 11, 2006, 07:18:20 PM
I need the same is there a way for it?
Title: Re: rearrange categories
Post by: IcEcReaM on February 11, 2006, 09:45:18 PM
May be a help for you could be the Mod Sort Categories in ACP by Number.

http://www.4homepages.de/forum/index.php?topic=11236.0
Title: Re: rearrange categories
Post by: Lunique on February 15, 2006, 03:29:28 PM
Not what I hoped for but I think it could also help me, thanks
Title: Re: rearrange categories
Post by: IcEcReaM on February 16, 2006, 12:41:48 AM

hm, then i might be misunderstood you.
what you exactly wanted to do?
Title: Re: rearrange categories
Post by: Lunique on February 16, 2006, 03:28:05 PM
At the moment there is
Cat 1      Cat 4      Cat 7
Cat 2      Cat 5      Cat 8
Cat 3      Cat 6

but I like to have
Cat 1      Cat 2      Cat 3
Cat 4      Cat 5      Cat 6
Cat 7      Cat 8

And I have MANY subcategories in each maincategory and it would be big work to change it everywhere by hand
I know if I only made them in one row then it would be no problem but I really want to have 3 rows cause it would be much to scroll down if I only take one row...
So isn't there a chance to let it sort this other way automatically???
Title: Re: rearrange categories
Post by: V@no on February 17, 2006, 03:13:53 AM
In includes/functions.php find:
Code: [Select]
  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<tr>\n<td valign=\"top\">\n";
Replace with:
Code: [Select]
  $categories .= "<tr>\n";
  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<td valign=\"top\">\n";

Find:
Code: [Select]
    $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: [Select]
    $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;
Title: Re: rearrange categories
Post by: Lunique on February 17, 2006, 01:57:24 PM
Hm that's still not what I need.
If I take your mod then I have only one row with categories, if that was what I want then I had changed it in APC/Settings
but I want to have three rows and they should sort from left to right instead of sorting from top to bottom and then change to the next row where it's also sorted from top to bottom again.
Anyone know what I mean? Maybe I just can't explain it...
Title: Re: rearrange categories
Post by: V@no on February 17, 2006, 02:29:53 PM
It works now, redo all the steps. :oops:
Title: Re: rearrange categories
Post by: Lunique on February 17, 2006, 02:36:10 PM
Ah that's it !
Thank you so much you're great!
Title: Re: rearrange categories
Post by: musicsurfer on September 14, 2007, 11:56:26 AM
after copy the code in the category-picture MOD the table is very small
when i coby the code in a original template, the table is 100% wide
 why doesn't it work with the MOD ?
Title: Re: rearrange categories
Post by: thunderstrike on September 14, 2007, 12:14:14 PM
Quote
$categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";

The bold is for ACP - > setting for edit space.

Quote
$categories .= "<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";

This is for width with image width (table size by image). If problem resize, you can edit. ;)
Title: Re: rearrange categories
Post by: musicsurfer on September 14, 2007, 12:39:13 PM
One Question (with my bad english :) )

What must I do with the 2 Codes ?

I replace the code above, and the tabel isn't 100% wide, and now ?

Greets
Title: Re: rearrange categories
Post by: musicsurfer on September 14, 2007, 12:41:08 PM
One Question (with my bad english :) )

What must I do with the 2 Codes ?

I replace the code above, and the tabel isn't 100% wide, and now ?

When I put in in a original functions.php it works 100%
When I put in the Category-Image MOD it works not realy
But the same Properities in the Admin center

Greets
Title: Re: rearrange categories
Post by: musicsurfer on February 08, 2008, 01:36:49 PM
Hallo

Ich habe das hier angewandt um die reihenfolge der Kategoerien zu ändern
Das hat auch geklappt
Aber jetzt sind meine Kategorien total zusammengrückt, obwohl ich im Admin 100% Breite angegeben habe

Woran kann das liegen und wie bekomme ich das denn evtl. wieder hin ?

Gruss
Title: Re: rearrange categories
Post by: Sebas Bonito on July 06, 2009, 08:15:58 PM
Thx, this works great!  8)

I know it's a kind of double-post (http://www.4homepages.de/forum/index.php?topic=25138.0), but it's similar to this topic...

I'd like to limit the number of categories in the home. So e.g. only the first 4 categories. Any ideas? Ifnot, there are too many on the homepage.