Author Topic: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6  (Read 33030 times)

0 Members and 1 Guest are viewing this topic.

bildergallery

  • Guest
[MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« on: February 22, 2008, 05:46:36 PM »
Beschreibung:
Hallo zusammen, mit diesem [MOD] werden die Kategorien sortiert.
  • Kategorien im Admin Control Panel
  • Kategorien in den Templates

Features:
  • Kategorien sortieren Manuell
  • Kategorien sortieren absteigend
  • Kategorien sortieren aufsteigend

global.php
suche
Code: [Select]
if (defined("GET_CACHES")) {
  $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";

ersetze
Code: [Select]
if (defined("GET_CACHES")) {
  $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 ".$config['cat_order']."";


lang/deutsch/admin.php
suche
Code: [Select]
/*-- Setting-Group 3 --*/
ersetze
Code: [Select]
$setting['cat_order'] = "Kategorien sortieren<br /><span class=\"smalltext\">Manuell, Kategoriename aufsteigend oder absteigend</span>";
$cat_order_optionlist = array(
'cat_order, cat_name ASC' => 'Manuell',
'cat_name ASC' => 'Aufsteigend',
'cat_name DESC' => 'Absteigend'
);

/*-- Setting-Group 3 --*/


admin/settings.php
suche
Code: [Select]
  show_setting_row("num_subcats");
ersetze
Code: [Select]
  show_setting_row("num_subcats");
  show_setting_row("cat_order", "show_cat_order_select");

suche
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>";
}

ersetze
Code: [Select]
function show_cat_order_select($setting_name, $setting_value) {
  global $cat_order_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($cat_order_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</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>";
}


admin/categories.php
suche 3mal
Code: [Select]
ORDER BY cat_order, cat_name ASC";
ersetze durch
Code: [Select]
ORDER BY ".$config['cat_order']."";

SQL importieren
Code: [Select]
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'cat_name ASC'
);
« Last Edit: February 22, 2008, 06:06:40 PM by ivan »

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #1 on: February 22, 2008, 07:47:12 PM »
Das ist es doch mal wert es Einzubauen.

Danke Ivan  :thumbup:

nobby

rinaldos

  • Guest
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #2 on: February 23, 2008, 09:08:16 AM »
Klappt wunderbar, aber nachdem ich mir den MOD eingebaut hatte, war der MOD CATEGORIE Image nicht mehr vorhanden :-( Also habe ich der Änderung der GLOGBAL.PHP nur anstelle von

Code: [Select]
if (defined("GET_CACHES")) {
  $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 ".$config['cat_order']."";

das geändert

Code: [Select]
          ORDER BY ".$config['cat_order']."";

Dann funktionierte auch der andere MOD wieder :-)

Tolle Arbeit.

Gruß
Ingo

Offline musicsurfer

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #3 on: February 23, 2008, 05:45:37 PM »
Wie mache ich denn das mit dem SQL importieren ?

Offline sribhavan143

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #4 on: April 30, 2009, 03:44:53 PM »
Hello!!!

I have's Erreur   :(

requête SQL:

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

MySQL a répondu:Documentation
#1062 - Duplicate entry 'cat_order' for key 1


Can you help me

bhavan


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 1.7.4 - 1.7.6
« Reply #5 on: April 30, 2009, 04:19:25 PM »
Can you help me
Don't worry, the new database entry was previously added and ready to use.
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 cch

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #6 on: July 14, 2009, 05:22:08 PM »
Hi

Does this work with 1.7.7?

Thanks

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #7 on: July 14, 2009, 05:24:35 PM »
testen, und das Ergebnis hier posten

Danke
Danke Harald




Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.423
    • View Profile
    • 4images - Image Gallery Management System
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #8 on: July 14, 2009, 09:12:42 PM »
this mod is integrated in 1.7.7 ;)

... but without changing sql ;)
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #9 on: April 20, 2010, 03:25:10 AM »
Hi -

Using v.1.7.7

Just started going through all 17 pages of the MODs and came across this one.  Read the last two posts that says this function [MOD] is integrated into v1.7.7

Yes, that's true, I do have the categories sorted in the order I want from the ACP 'Edit Categories' link ... but ... on the home.html template, the categories still list in alphabetical order.

Any ideas how to solve that? I really want my categories to display in the order I have selected in the ACP.

Thanks,

Brian

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 1.7.4 - 1.7.6
« Reply #10 on: April 20, 2010, 04:28:54 AM »
Then it must be some other modifications you've added.. 4images uses the same block of code to sort the categories on home page and in a category.
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 surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #11 on: April 20, 2010, 04:53:23 AM »
Hi -

Thanks for the ideas. That made me consult my modification installation log.  I changed the desc to the asc here:

3/16/2010 - installed the Tag Cloud MOD - topic=16812.0; pretty simple installation. had to add a bar for the 'New Images' on the search page; copied from the home.html;
            also added a bar for the keywords and for the {lang_keyword} and {show_tag_clouds}; changed the settings in the includes/functions.php to the following:
            in the mysql function, changed the last two lines:
            ORDER BY  i.word_text ASC   <<<<<<<<<<<<<<<<<<<<<<----------------------------------------------------------
         LIMIT 60"; <-- this is for # of keywords to display
            changed the font min/max to following %'s: 325 & 100
            changed the rgb colors to the following: 0, 175 for all three groupings.

Do you think the ASC code change is causing the problem? I mean, do you think it could cause the problem from the includes/functions.php file?

Thanks,

Brian

Offline Jockl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • fanpage-der-wiener-linien
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #12 on: December 27, 2010, 12:02:06 AM »
Hallo!

Ich habe diesen MOD in meiner 4images-Installation eingebaut und habe soeben auf Version 1.7.9 upgedatet. Sobald ich nun aber einmal die Einstellungsseite im Admin Panel aufruf, wird in der Tabelle 4images_settings ein Fehler erzeugt, der dazu führt, dass die gesamte Seite nicht mehr aufrufbar ist, da in der SQL Abfrage 2x ASC vorkommt.

An was kann das liegen?

Vielen Dank im Voraus!

Mfg,
Jockl

Rembrandt

  • Guest
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #13 on: December 27, 2010, 04:55:47 AM »
....
An was kann das liegen?
...

dieser mod ist in der 1.7.7 - 9 schon inkludiert.

mfg Andi

Offline Jockl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • fanpage-der-wiener-linien
Re: [MOD] Category order / Kategorien ordnen 1.7.4 - 1.7.6
« Reply #14 on: December 27, 2010, 10:24:10 AM »
Und wie kann ich ihn dann "ausbauen", damit ich mir nicht jedes Mal die Datenbank zerstöre, wenn ich die Einstellungs-Seite aufrufe?