Author Topic: [Mod] Category order / Kategorien ordnen (by CannabisCow)  (Read 23371 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
[Mod] Category order / Kategorien ordnen (by CannabisCow)
« on: March 20, 2005, 09:26:40 PM »
This mod was written by CannabisCow before the hack and I'm just restoring it.

###############################################################
##
## Dieser Hack erlaubt euch, die Kategorien beliebig zu ordnen.
##
##############################################################


===============================================================
== ./global.php
===============================================================
///////////////////////////////////////////
// search
///////////////////////////////////////////

Code: [Select]
  $sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
          FROM ".CATEGORIES_TABLE." c
          LEFT JOIN ".IMAGES_TABLE." i ON (i.cat_id = c.cat_id AND i.image_date >= $new_cutoff AND i.image_active = 1)
          GROUP BY c.cat_id
          ORDER BY c.cat_order, c.cat_name ASC";

 


//////////////////////////////
// replace with
//////////////////////////////

Code: [Select]
  $sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
          FROM ".CATEGORIES_TABLE." c
          LEFT JOIN ".IMAGES_TABLE." i ON (i.cat_id = c.cat_id AND i.image_date >= $new_cutoff AND i.image_active = 1)
          GROUP BY c.cat_id
          ORDER BY ".$config['cat_order']."";

 



===============================================================
== ./lang/{lang}/admin.php
===============================================================
///////////////////////////////////////////
// search
///////////////////////////////////////////

Code: [Select]
/*-- Setting-Group 3 --*/



///////////////////////////////////////////
// add before
///////////////////////////////////////////
 
Code: [Select]
$setting['cat_order'] = "Nach welchem Prinzip, sollen die Kategorien bzw. Subkategorien geordnet werden";
$cat_order_array = array(
'c.cat_order' => 'Manuell',
'c.cat_name ASC' => 'Name Aufsteigend',
'c.cat_name DESC' => 'Name Absteigend'
);

 


===============================================================
== ./admin/settings.php
===============================================================
///////////////////////////////////////////
// search
///////////////////////////////////////////
 
Code: [Select]
show_setting_row("num_subcats");
 


///////////////////////////////////////////
// add after
///////////////////////////////////////////

Code: [Select]
show_setting_row("cat_order", "show_cat_order");


///////////////////////////////////////////
// search
///////////////////////////////////////////

Code: [Select]
function show_image_order_select($setting_name, $setting_value) {
  global $image_order_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($image_order_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}

 

///////////////////////////////////////////
// add after
///////////////////////////////////////////

Code: [Select]
function show_cat_order($setting_name, $setting_value) {
global $cat_order_array;

  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($cat_order_array as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}



===============================================================
== SQL (add this with phpmyadmin or run this installer --> installer (thx V@no for this installer)
===============================================================


Code: [Select]
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'c.cat_name ASC'
);

 


PS: Viel Spass, hoffe hab nix vergessen ;)
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 AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #1 on: March 21, 2005, 04:56:41 AM »
Tried to install this mod, have no errors, but when I look in my ACP everything looks the same as it did before I installed this mod... using 4images 1.7 ..

Ive double checked everything twice..... is there some setting I cant find in ACP ti do this ?
As long as I can finish my site before I die.

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] Category order / Kategorien ordnen (by CannabisCow)
« Reply #2 on: March 21, 2005, 07:19:54 AM »
there should be a new option below "number of subcategories" option
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 AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #3 on: March 21, 2005, 12:19:51 PM »
I know that this is not my hugest problem....

But I checked and I still cant find were I went wrong or the option in the ACP......

 :oops: :oops:

I hate to draw your attention from the other mods Im having some serious issues with  :|

perhaps tere is a problem with this mod (or yet I made a mistake?)

Robert

As long as I can finish my site before I die.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #4 on: March 21, 2005, 02:12:30 PM »
Ok... My mistake... I thought this was the mod that allowed you to move subcategoriesw up easier thatn clicking on them over and over in the ACP....

I realise now this is to rearrange their order....

I see the settings in the ACP under category settings...

Problem... my categories are now rearranged by name which is not a good thing.

Everytime I try to change the setting to manual and click save the ACP page refreshes, however the page is not saved and the categories remain sorted alphabetically,  and the setting still says name... not manual like I tried to save...

I hate to uninstall the mod.  You know why the settungs wont stay saved in the ACP?
As long as I can finish my site before I die.

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] Category order / Kategorien ordnen (by CannabisCow)
« Reply #5 on: March 21, 2005, 07:54:13 PM »
one possible explanation is that u didnt update database.
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 AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #6 on: March 22, 2005, 06:37:05 AM »
I have added the tables to my database and the values.... I guess the only way to do it is to change the values in theDB manually if I cant figure it out...
As long as I can finish my site before I die.

Offline DirtyCycloN

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #7 on: March 24, 2005, 12:22:54 PM »
mh mist hab da auch so nen fehler ...

DB Error: Bad SQL Query: SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images FROM 4images_categories c LEFT JOIN 4images_images i ON (i.cat_id = c.cat_id AND i.image_date >= AND i.image_active = 1) GROUP BY c.cat_id ORDER BY c.cat_name ASC
You have an error in your SQL syntax near 'AND i.image_active = 1) GROUP BY c.cat_id ORDER BY c.cat_n' at line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/htdocs/d-wallpapers.de/includes/db_mysql.php:188) in /home/www/htdocs/d-wallpapers.de/includes/sessions.php on line 84

Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/d-wallpapers.de/includes/db_mysql.php:188) in /home/www/htdocs/d-wallpapers.de/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/d-wallpapers.de/includes/db_mysql.php:188) in /home/www/htdocs/d-wallpapers.de/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/d-wallpapers.de/includes/db_mysql.php:188) in /home/www/htdocs/d-wallpapers.de/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/d-wallpapers.de/includes/db_mysql.php:188) in /home/www/htdocs/d-wallpapers.de/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/d-wallpapers.de/includes/db_mysql.php:188) in /home/www/htdocs/d-wallpapers.de/admin/admin_functions.php on line 172

was dat für nen prob ? wäre kewl wenn mir jemand helfen könnte - big thx


gruß dirtycyclon

Offline Moustacy

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #8 on: April 20, 2005, 03:00:59 AM »
The only thing I see on here is how to put the pictures in order by ascending or descending and not the categories this mod didn't do anything but add errors to my gallery if someone comes up with a real way for the categories to automatically go in alphabetical order please keep me posted.

Offline Guerillia

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #9 on: June 04, 2005, 10:24:52 PM »
In Version 1.7.1  gibt es in der global.php den Code nicht mehr..


Code: [Select]
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
          FROM ".CATEGORIES_TABLE." c
          LEFT JOIN ".IMAGES_TABLE." i ON (i.cat_id = c.cat_id AND i.image_date >= $new_cutoff AND i.image_active = 1)
          GROUP BY c.cat_id
          ORDER BY c.cat_order, c.cat_name ASC";

Offline Bilal

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #10 on: November 26, 2006, 06:09:54 PM »
is this mod is working with v1.7.4? also can someone please translate it into english?
Regards,
Bilal

Offline sribhavan143

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Category order / Kategorien ordnen (by CannabisCow)
« Reply #11 on: June 28, 2008, 02:26:41 AM »
C'est possible d'avoir le code pour Category order pour la version 1.7.4 SVP

Merci d'avance bhavan