4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: CannabisCow on February 25, 2003, 12:45:13 AM

Title: [Mod] Category order / Kategorien ordnen
Post by: CannabisCow 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 (http://come.no-ip.com/install/install_categoriessort.zip) (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:
Title: [Mod] Category order / Kategorien ordnen
Post by: V@no 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?
Title: [Mod] Category order / Kategorien ordnen
Post by: CannabisCow 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]
Title: [Mod] Category order / Kategorien ordnen
Post by: Der_Nick 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?
Title: [Mod] Category order / Kategorien ordnen
Post by: V@no 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 (http://come.no-ip.com/install/install_categoriessort.zip)
Title: [Mod] Category order / Kategorien ordnen
Post by: Der_Nick 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!!
Title: [Mod] Category order / Kategorien ordnen
Post by: CannabisCow on February 25, 2003, 03:40:55 PM
thx V@no for this installer
Title: [Mod] Category order / Kategorien ordnen
Post by: uksoreeyes 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
Title: [Mod] Category order / Kategorien ordnen
Post by: uksoreeyes 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
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: blitzy 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:
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: JensF 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???

Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Legendary 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";
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no 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'];
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: JensF 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....
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: ascanio 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?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: ascanio on April 16, 2005, 07:59:18 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_order
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/encuestas.php on line 19

Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on April 16, 2005, 10:51:45 PM
no it doesnt work with 1.7.1 u need change in lang/<yourlang>/admin.php
Code: [Select]
$cat_order_array = array(
'c.cat_order' => 'Manuell',
'c.cat_name ASC' => 'Name Aufsteigend',
'c.cat_name DESC' => 'Name Absteigend'
);
to this:
Code: [Select]
$cat_order_array = array(
'cat_order' => 'Manuell',
'cat_name ASC' => 'Name Aufsteigend',
'cat_name DESC' => 'Name Absteigend'
);
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: ascanio on April 16, 2005, 11:04:08 PM
no it doesnt work with 1.7.1 u need change in lang/<yourlang>/admin.php
Code: [Select]
$cat_order_array = array(
'c.cat_order' => 'Manuell',
'c.cat_name ASC' => 'Name Aufsteigend',
'c.cat_name DESC' => 'Name Absteigend'
);
to this:
Code: [Select]
$cat_order_array = array(
'cat_order' => 'Manuell',
'cat_name ASC' => 'Name Aufsteigend',
'cat_name DESC' => 'Name Absteigend'
);

if doesnot work for 1.7.1 why i have to change that? if i change that will work?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on April 16, 2005, 11:08:07 PM
if doesnot work for 1.7.1 why i have to change that? if i change that will work?
please, dont be so dificult.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: michi-w. on April 17, 2005, 09:19:26 PM
Installer Link geht nicht.

Hat den jemand für mich?

Gruß
michi-w.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on April 17, 2005, 10:10:30 PM
it sais in my sig:

My site is down, please use a mirror site to download MODs: #2 (http://mirror2.vano.org) or #3 (http://mirror3.vano.org) or #4 (http://mirror4.vano.org) or #5 (http://mirror5.vano.org)
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: jamstave on May 29, 2005, 05:25:43 PM
Hi.. I have installed categories sort order for v 1.7.1 I got this error message why I'm getting this error message.

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 cat_name ASC
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND i.image_active = 1) GROUP BY c.cat_id O

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

Jamestave.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on May 29, 2005, 08:56:31 PM
u probably replaced/deleted the line that starts with $new_cutoff
put it back.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: mag on May 30, 2005, 08:50:25 AM
hi,

ich würde gern die kategorien so ordnen:

A
B
C
D
E
F

usw.

Kann mir da einer weiterhelfen?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: michi-w. on May 30, 2005, 01:36:00 PM
Im ACP unter Einstellungen

Kategorie Einstellungen
"Wieviele Zellen soll die Tabelle der Kategorien haben" auf 1 stellen.

Und bau diesen Bugfix ein: http://www.4homepages.de/forum/index.php?topic=6677.0

Gruß
michi-w.
 
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Guerillia on June 20, 2005, 02:52:20 PM
Ich würde gernde nicht nach ABC / ZYX sortieren, sondern nach neuerster / ältester Kategorie zuerst..
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Nova on July 25, 2005, 12:02:38 AM
Could someone change it so that it works for 1.7.1?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on July 25, 2005, 12:39:07 AM
Could someone change it so that it works for 1.7.1?
it works just fine if u read only 1.5 pages of the replys.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: DaMIKE on July 28, 2005, 09:44:25 AM
Could someone change it so that it works for 1.7.1?
it works just fine if u read only 1.5 pages of the replys.

nope

SQL for 1.7.1 has to be

Quote
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'cat_name ASC'
);


instead of

Quote
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'c.cat_name ASC'
);
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: JensF on July 29, 2005, 03:53:52 PM
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???



Gibt es die Möglichkeit das so zu sortieren??? Irgendwie bekomm eich das nicht hin...
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: lovetamil on September 05, 2005, 08:28:45 PM
i am gettin this error..when i update my database...please advice... :?

Code: [Select]
DB Error: Bad SQL Query: INSERT INTO 4imagesga_settings (`setting_name`, `setting_value`) VALUES ('cat_order', 'c.cat_name ASC')
Duplicate entry 'cat_order' for key 1
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Lunique on October 16, 2005, 12:33:33 AM
I've Installed the mod and it worked fine thanks for it!
But I have a question about something Vano allready asked. Is there any way that it ALSO affect category sort in "admin control panel -> edit categories"
Would be great cause that's what I really need!

Habe den Mod installiert und funktioniert alles prima. Vielen Dank dafür!
Aber ne Frage zu dem was Vano schon fragte. Ist es möglich das man das ganze AUCH BEIM "admin control panel -> Kategorien bearbeiten" nutzen kann?
Denn sowas such ich dringend!
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: salimiali on October 21, 2005, 01:22:59 PM
After go to gallery show this message with any pictures and categories!!


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. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND i.image_active = 1) GROUP BY c.cat_id O


Link: http://www.singersfan.com/gallery/
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: salimiali on October 22, 2005, 10:49:41 AM
admin help me please! my web site is down and i can not run this mode please help me how i can run this
mode because now my data base have problem!! (after setup mysql installer) if you can run this mode tell
me i send to you my user & password of ftp


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 FROM 4images_categories ORDER BY c.cat_name ASC
Unknown table 'c' in order clause
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: niad on November 05, 2005, 08:08:25 PM
Hello,
I have read this post very carefully more than 10 times and also some other post with the same subject and I have done everything exactly as I should.
The problem is that the sorting  doesn't work with my language.
I have the correct $lang['charset'] = at the main.php of my language, but doesn't sort the categories.
Everything are working fine,  the sorting options at the Admins settings are there, but there is no correct sorting!
It does some kind of sorting, but it puts first B and then A for example!

Is there any way that this MOD can work with a foreign languages?

PLEASE, I need some help :oops:

.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on November 05, 2005, 08:35:54 PM
I think its not about this mod, its about how your MySQL handles sorting...what about images? can you sort them by name?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: niad on November 06, 2005, 12:25:09 AM
Dear V@no, no, the images can't be sorted by name correctly also!



Please help, there must be an answer to solve this problem!

.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: niad on November 07, 2005, 03:55:45 PM
.

Is there any way that this MOD can work with a foreign languages?

PLEASE, can someone  help  ?

.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: V@no on November 08, 2005, 12:23:44 AM
I have answered your question already, its not this mod's problem, in fact its not 4images problem, its MySQL problem...if MySQL can't sort it properly nothing you can do about it...
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: niad on November 08, 2005, 07:56:13 AM
.
Thank you very much for your answer V@no,
I have understand what you have said,
I was just hoping that you or someone else may have some answer to this MySQL problem of sorting...
Where can I check or what can I add to MySQL settings to solve the sorting problem?
.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: fgallery on November 08, 2005, 02:09:21 PM
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'cat_name ASC'
);
Thanks for the hint DaMike !

V@no I think you should specify that your installer is for 1.7 vesion.
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: djith on November 18, 2005, 11:40:33 PM
hello,
i tried this mod and at the last line there was something whit phpmyadmin, where can i find it and how to use it and install the last line....?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Acidgod on November 19, 2005, 11:04:22 AM
please read the bold text below...

===============================================================
== SQL (add this with phpmyadmin or run this installer --> installer (http://come.no-ip.com/install/install_categoriessort.zip) (thx V@no for this installer)
===============================================================

Title: Re: [Mod] Category order / Kategorien ordnen
Post by: djith on November 19, 2005, 11:14:42 AM
yes i read , but i'm such a newbie that i don't know where to find phpmyadmin, what to do with, how to run an installer ....
do i have to look for phpmyadmin in the control panel of my server ?
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Acidgod on November 19, 2005, 11:20:18 AM
please read the bold text below...

===============================================================
== SQL (add this with phpmyadmin or run this installer --> installer (http://come.no-ip.com/install/install_categoriessort.zip) (thx V@no for this installer)
===============================================================

You dont need to make any changes with phpmyadmin, please use the installer!
Download the *.zip File, put it in your 4images root folder and then use your Browser to execute the Installer
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: djith on November 19, 2005, 01:42:38 PM
oh, thank you very much :)
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Jan-Lukas on January 22, 2008, 07:23:23 PM
Hi,
Gibt es das nicht wo für die 1.7.4  :cry:

hatte es in der 1.7.1 nur hier stimmt der code schon in der global.php nicht überein

gruss Harald
Title: Re: [Mod] Category order / Kategorien ordnen
Post by: Jan-Lukas on January 22, 2008, 10:56:07 PM
Hi Ivan,
Ein ganz großes Dankeschön, werde ich nachher noch einbauen, und bin sicher das es jetzt klappt.

Harald

Edit: SUPER, hat alles geklappt, auf zu neuen Taten  :lol: