Author Topic: [Mod] Category order / Kategorien ordnen  (Read 66593 times)

0 Members and 1 Guest are viewing this topic.

Offline CannabisCow

  • Pre-Newbie
  • Posts: 6
    • View Profile
[Mod] Category order / Kategorien ordnen
« on: February 25, 2003, 12:45:13 AM »
###############################################################
##
## 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  :wink:

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
« Reply #1 on: February 25, 2003, 01:07:07 AM »
Nice! :D
I didnt try the mod (yet?), but whant make it clear: it wont affect catogory sort in admin control panel -> edit categories. Right?
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 CannabisCow

  • Pre-Newbie
  • Posts: 6
    • View Profile
[Mod] Category order / Kategorien ordnen
« Reply #2 on: February 25, 2003, 01:22:13 AM »
sorry, my english isn`t so good, but this mod allow you to sort categories by name (ASC|DESC) or manually (see "edit categories")


e.g.
==========
your categories:
==========
mgi
abc
zxy
def

============
activate this mod
============
abc
def
mgi
zxy[/img]

Offline Der_Nick

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://www.fetteseite.com
[Mod] Category order / Kategorien ordnen
« Reply #3 on: February 25, 2003, 12:03:39 PM »
schon wieder ich mit nem doofen problem!

Quote
===============================================================
== SQL
===============================================================
Code:

INSERT INTO `babes_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'c.cat_name ASC'
);  

wo finde ich diese SQL datei zu editieren???

where can i find the SQL file to edit?

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
« Reply #4 on: February 25, 2003, 12:38:11 PM »
Quote from: Der_Nick
schon wieder ich mit nem doofen problem!

Quote
===============================================================
== SQL
===============================================================
Code:

INSERT INTO `babes_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'c.cat_name ASC'
);  

wo finde ich diese SQL datei zu editieren???

where can i find the SQL file to edit?

This u'll need run in your mysql control program (phpmyadmin for example)
also, babes_settings by default should be 4images_settings it's all depence how u installed 4images.
or u can use this installer
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 Der_Nick

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://www.fetteseite.com
[Mod] Category order / Kategorien ordnen
« Reply #5 on: February 25, 2003, 01:09:12 PM »
thank you again V@no!!!

genialer mod! korrekt! hab mit dem sortieren schon langsam die krise bekommen!!

Offline CannabisCow

  • Pre-Newbie
  • Posts: 6
    • View Profile
[Mod] Category order / Kategorien ordnen
« Reply #6 on: February 25, 2003, 03:40:55 PM »
thx V@no for this installer

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
[Mod] Category order / Kategorien ordnen
« Reply #7 on: May 01, 2003, 03:35:59 AM »
Does anyone have a demo or screenshot of this mod in action? Id like to see how it is incorperated into 4images. Thank you

Carl

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
[Mod] Category order / Kategorien ordnen
« Reply #8 on: May 04, 2003, 04:20:16 AM »
It's ok I know how it works now, I'm having a dumb day lol ignore me

Offline blitzy

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://www.cs-media.org
Re: [Mod] Category order / Kategorien ordnen
« Reply #9 on: April 01, 2005, 02:34:08 AM »
Has anyone tried this mod in 1.7.1 because this mod will save me a LOT of trouble from having to manually re-alphabetize new category folders.  :lol:

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Category order / Kategorien ordnen
« Reply #10 on: April 03, 2005, 02:24:52 AM »
Hi,

meine Kategoerien werden auf der Hauptseite zur Zeit so angezeigt


a - d - g
b - e - h
c - f - i


Ich möchte aber das sie so angezeigt werden

a - b - c
d - e - f
g - h - i


Was muss ich tun damit das so klappt???

Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Legendary

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.idols-unlimited.com
Re: [Mod] Category order / Kategorien ordnen
« Reply #11 on: April 05, 2005, 03:20:06 AM »
can you make one that would work w/ 1.71?

because in global.php

I didnt not get this the same code as you do.  I get this.

Code: [Select]
  $sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
          FROM ".CATEGORIES_TABLE."
          ORDER BY cat_order, cat_name ASC";

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
« Reply #12 on: April 05, 2005, 03:36:14 AM »
thats close enough, replace
Code: [Select]
         ORDER BY cat_order, cat_name ASC"; with
Code: [Select]
         ORDER BY ".$config['cat_order'];
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 JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Category order / Kategorien ordnen
« Reply #13 on: April 05, 2005, 11:05:26 AM »
Quote
ORDER BY ".$config['cat_order'];

I have this in 1.7 and it has not the effect i want....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [Mod] Category order / Kategorien ordnen
« Reply #14 on: April 16, 2005, 07:57:34 PM »
Code: [Select]
DB Error: Bad SQL Query: SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_image FROM girls_categories ORDER BY c.cat_name ASC
Unknown table 'c' in order clause

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ascanio/domains/girlsandgirls.net/public_html/includes/db_mysql.php:188) in /home/ascanio/domains/girlsandgirls.net/public_html/includes/sessions.php on line 84

Warning: Cannot modify header information - headers already sent by (output started at /home/ascanio/domains/girlsandgirls.net/public_html/includes/db_mysql.php:188) in /home/ascanio/domains/girlsandgirls.net/public_html/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/ascanio/domains/girlsandgirls.net/public_html/includes/db_mysql.php:188) in /home/ascanio/domains/girlsandgirls.net/public_html/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home/ascanio/domains/girlsandgirls.net/public_html/includes/db_mysql.php:188) in /home/ascanio/domains/girlsandgirls.net/public_html/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home/ascanio/domains/girlsandgirls.net/public_html/includes/db_mysql.php:188) in /home/ascanio/domains/girlsandgirls.net/public_html/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/ascanio/domains/girlsandgirls.net/public_html/includes/db_mysql.php:188) in /home/ascanio/domains/girlsandgirls.net/public_html/admin/admin_functions.php on line 172

Why i get this error :S

does this mod workfor 1.7.1?