Link
#
#-----[ OPEN ]------------------------------------------
#
album_page.php
#
#-----[ FIND ]------------------------------------------
#
/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Next
$sql = "SELECT new.pic_id, new.pic_time
FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
WHERE cur.pic_id = $pic_id
AND new.pic_id <> cur.pic_id
AND new.pic_cat_id = cur.pic_cat_id
AND new.pic_time >= cur.pic_time";
$sql .= ($thispic['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= " ORDER BY pic_time ASC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if( empty($row) )
{
$u_next = "";
$l_next = "";
}
else
{
$new_pic_id = $row['pic_id'];
$u_next = append_sid("album_page.$phpEx?pic_id=$new_pic_id");
$l_next = $lang['Next'] . " »";
}
// Prev
$sql = "SELECT new.pic_id, new.pic_time
FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
WHERE cur.pic_id = $pic_id
AND new.pic_id <> cur.pic_id
AND new.pic_cat_id = cur.pic_cat_id
AND new.pic_time <= cur.pic_time";
$sql .= ($thispic['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= " ORDER BY pic_time DESC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if( empty($row) )
{
$u_prev = "";
$l_prev = "";
}
else
{
$new_pic_id = $row['pic_id'];
$u_prev = append_sid("album_page.$phpEx?pic_id=$new_pic_id");
$l_prev = "« " . $lang['Previous'];
}
// end
#
#-----[ FIND ]------------------------------------------
#
'U_NEXT' => append_sid("album_page.$phpEx?pic_id=$pic_id&mode=next"),
'U_PREVIOUS' => append_sid("album_page.$phpEx?pic_id=$pic_id&mode=previous"),
'L_NEXT' => $lang['Next'],
'L_PREVIOUS' => $lang['Previous'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
'U_NEXT' => $u_next,
'U_PREVIOUS' => $u_prev,
'L_NEXT' => $l_next,
'L_PREVIOUS' => $l_prev,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/album_page_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<span class="cattitle">« <a href="{U_PREVIOUS}" class="cattitle">{L_PREVIOUS}</a> - <a href="{U_NEXT}" class="cattitle">{L_NEXT}</a> »</span>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<span class="cattitle"><a href="{U_PREVIOUS}" class="cattitle">{L_PREVIOUS}</a> - <a href="{U_NEXT}" class="cattitle">{L_NEXT}</a></span>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
#-----[ OPEN ]------------------------------------------
#
album_page.php
#
#-----[ FIND ]------------------------------------------
#
/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Next
$sql = "SELECT new.pic_id, new.pic_time
FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
WHERE cur.pic_id = $pic_id
AND new.pic_id <> cur.pic_id
AND new.pic_cat_id = cur.pic_cat_id
AND new.pic_time >= cur.pic_time";
$sql .= ($thispic['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= " ORDER BY pic_time ASC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if( empty($row) )
{
$u_next = "";
$l_next = "";
}
else
{
$new_pic_id = $row['pic_id'];
$u_next = append_sid("album_page.$phpEx?pic_id=$new_pic_id");
$l_next = $lang['Next'] . " »";
}
// Prev
$sql = "SELECT new.pic_id, new.pic_time
FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
WHERE cur.pic_id = $pic_id
AND new.pic_id <> cur.pic_id
AND new.pic_cat_id = cur.pic_cat_id
AND new.pic_time <= cur.pic_time";
$sql .= ($thispic['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= " ORDER BY pic_time DESC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if( empty($row) )
{
$u_prev = "";
$l_prev = "";
}
else
{
$new_pic_id = $row['pic_id'];
$u_prev = append_sid("album_page.$phpEx?pic_id=$new_pic_id");
$l_prev = "« " . $lang['Previous'];
}
// end
#
#-----[ FIND ]------------------------------------------
#
'U_NEXT' => append_sid("album_page.$phpEx?pic_id=$pic_id&mode=next"),
'U_PREVIOUS' => append_sid("album_page.$phpEx?pic_id=$pic_id&mode=previous"),
'L_NEXT' => $lang['Next'],
'L_PREVIOUS' => $lang['Previous'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
'U_NEXT' => $u_next,
'U_PREVIOUS' => $u_prev,
'L_NEXT' => $l_next,
'L_PREVIOUS' => $l_prev,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/album_page_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<span class="cattitle">« <a href="{U_PREVIOUS}" class="cattitle">{L_PREVIOUS}</a> - <a href="{U_NEXT}" class="cattitle">{L_NEXT}</a> »</span>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<span class="cattitle"><a href="{U_PREVIOUS}" class="cattitle">{L_PREVIOUS}</a> - <a href="{U_NEXT}" class="cattitle">{L_NEXT}</a></span>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM