close× Call Us +49 (1805) 01 29 59

Datalus
Thread Author: icebreaker
Thread ID: 4191
Thread Info
Es gibt 5 Beiträge zu diesem Thema, und es wurde 3133 mal angesehen.
Wer ist hier? 1 Gäste
 Thema drucken
Reihenfolge der Bilder im Album ändern
icebreaker
Hallo,

leider ist es ja so, dass die neu hoch geladenen Bilder im Fotoalbum hinten eingesetzt werden und nur manuell im Adminmenü vorgerückt werden können. Was muss ich tun, dass die neuesten Bilder im Album automatisch ganz vorne landen?

Mfg icebreaker
 
SC-Ad-Bot
 
Dat Tunes
Öffne die Photogallery.php und suche nach:

opentable($locale['430']);
            if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
            $result = dbquery(
               "SELECT tp.photo_id, tp.photo_title, tp.photo_description, tp.photo_thumb1, tp.photo_views, tp.photo_datestamp, tp.photo_allow_comments, tp.photo_allow_ratings,
               tu.user_id, tu.user_name, tu.user_status, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes
               FROM ".DB_PHOTOS." tp
               LEFT JOIN ".DB_USERS." tu ON tp.photo_user=tu.user_id
               LEFT JOIN ".DB_RATINGS." tr ON tr.rating_item_id = tp.photo_id AND tr.rating_type='P'
               WHERE album_id='".$_GET['album_id']."' GROUP BY photo_id ORDER BY photo_order LIMIT ".$_GET['rowstart'].",".$settings['thumbs_per_page']
                                        );


und ersetze diesen Block mit:

opentable($locale['430']);
            if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
            $result = dbquery(
               "SELECT tp.photo_id, tp.photo_title, tp.photo_description, tp.photo_thumb1, tp.photo_views, tp.photo_datestamp, tp.photo_allow_comments, tp.photo_allow_ratings,
               tu.user_id, tu.user_name, tu.user_status, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes
               FROM ".DB_PHOTOS." tp
               LEFT JOIN ".DB_USERS." tu ON tp.photo_user=tu.user_id
               LEFT JOIN ".DB_RATINGS." tr ON tr.rating_item_id = tp.photo_id AND tr.rating_type='P'
               WHERE album_id='".$_GET['album_id']."' GROUP BY photo_id ORDER BY photo_order LIMIT ".$_GET['rowstart'].",".$settings['thumbs_per_page']."
                                        ORDER BY tp.photo_datestamp DESC");


Sollte die reihenfolge noch nicht Stimmen, dann änder DESC in ASC.
Ungetestet, vorher also eine Sicherungmachen.
Leute ohne Macke, sind Kacke Dickeslachen
Oh Herr, schmeiss Grundwissen von Himmel !
 
icebreaker
Funktioniert leider nicht, auch nicht mit ASC.

Es kommt folgende Fehlermeldung:

"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 'ORDER BY tp.photo_datestamp ASC' at line 7"

und die Bilder werden nicht angezeigt

(Wenn man es mit DESC macht, steht in der Fehlermeldung auch DESC statt ASC)
 
Dat Tunes
Hab Flasch gedacht und das ORDER BY übersehen.

Nimm mal diesen Code:

opentable($locale['430']);
            if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
            $result = dbquery(
               "SELECT tp.photo_id, tp.photo_title, tp.photo_description, tp.photo_thumb1, tp.photo_views, tp.photo_datestamp, tp.photo_allow_comments, tp.photo_allow_ratings,
               tu.user_id, tu.user_name, tu.user_status, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes
               FROM ".DB_PHOTOS." tp
               LEFT JOIN ".DB_USERS." tu ON tp.photo_user=tu.user_id
               LEFT JOIN ".DB_RATINGS." tr ON tr.rating_item_id = tp.photo_id AND tr.rating_type='P'
               WHERE album_id='".$_GET['album_id']."' GROUP BY photo_id ORDER BY photo_datestamp DESC LIMIT ".$_GET['rowstart'].",".$settings['thumbs_per_page']);


Getestet und klappt bei mir auch ;)
Leute ohne Macke, sind Kacke Dickeslachen
Oh Herr, schmeiss Grundwissen von Himmel !
 
icebreaker
Super, klappt einwandfrei. Danke Smile
 
Springe ins Forum:

 Ähnliche Themen 

TEST
Thema Forum Antworten Letzter Beitrag
Avatar Bilder Allgemeine Support Fragen 2 11.12.2016 00000012 17:11
Theme Schriftfarbe Ändern Grafik und Design 4 11.10.2013 00000010 17:25
Benutzergruppen-ID ändern Allgemeine Support Fragen 3 26.04.2013 00000004 12:42
Pcpin Chat Aussehen ändern Infusionen 5 14.02.2013 00000002 07:50
Hintergrundfarbe IM-Pop-Up ändern Allgemeine Support Fragen 6 03.09.2012 00000009 07:44
Datalus