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

Gr@n@dE
Thread Author: icebreaker
Thread ID: 4191
Thread Info
Es gibt 5 Beiträge zu diesem Thema, und es wurde 3132 mal angesehen.
 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:
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_order LIMIT ".$_GET['rowstart'].",".$settings['thumbs_per_page']
                                        );


und ersetze diesen Block mit:
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_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:
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: