Author Topic: rearrange categories  (Read 19020 times)

0 Members and 1 Guest are viewing this topic.

Offline jerseygirl

  • Newbie
  • *
  • Posts: 22
    • View Profile
rearrange categories
« 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...

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: rearrange categories
« Reply #1 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
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 jerseygirl

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: rearrange categories
« Reply #2 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

Offline Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: rearrange categories
« Reply #3 on: February 11, 2006, 07:18:20 PM »
I need the same is there a way for it?

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: rearrange categories
« Reply #4 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
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: rearrange categories
« Reply #5 on: February 15, 2006, 03:29:28 PM »
Not what I hoped for but I think it could also help me, thanks

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: rearrange categories
« Reply #6 on: February 16, 2006, 12:41:48 AM »

hm, then i might be misunderstood you.
what you exactly wanted to do?
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: rearrange categories
« Reply #7 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???

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: rearrange categories
« Reply #8 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;
« Last Edit: February 17, 2006, 02:29:19 PM by V@no »
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 Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: rearrange categories
« Reply #9 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...

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: rearrange categories
« Reply #10 on: February 17, 2006, 02:29:53 PM »
It works now, redo all the steps. :oops:
« Last Edit: February 17, 2006, 03:01:07 PM by V@no »
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 Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: rearrange categories
« Reply #11 on: February 17, 2006, 02:36:10 PM »
Ah that's it !
Thank you so much you're great!

Offline musicsurfer

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: rearrange categories
« Reply #12 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 ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: rearrange categories
« Reply #13 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. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline musicsurfer

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: rearrange categories
« Reply #14 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