Gallery.template.php
................................
<tr class="windowbg2">
<td align="center"><b>
<a href="', $scripturl, '?action=gallery;sa=prev;id=', $context['gallery_pic']['ID_PICTURE'], '">', $txt['gallery_text_prev'], '</a> |
<a href="', $scripturl, '?action=gallery;sa=next;id=', $context['gallery_pic']['ID_PICTURE'], '">', $txt['gallery_text_next'], '</a>
</b>
</div>
</td>
</tr>
.............................
the buttons are visible! but does not commute, kicks about on a main page the photo of gallery when want to pass to the following...
how to do that did work, what I had forgotten? where to look?
Gallery.php
...................................
function PreviousDownload()
{
global $db_prefix, $txt, $scripturl;
$id = (int) $_REQUEST['id'];
// if (empty($id))
// fatal_error($txt['downloads_error_no_file_selected']);
// Get the category
$dbresult = db_query("
SELECT
ID_PICTURE, ID_CAT
FROM {$db_prefix}gallery_pic
WHERE ID_PICTURE = $id LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
$ID_CAT = $row['ID_CAT'];
mysql_free_result($dbresult);
// Get previous download
$dbresult = db_query("
SELECT
ID_PICTURE
FROM {$db_prefix}gallery_pic
WHERE ID_CAT = $ID_CAT AND approved = 1 AND ID_PICTURE > $id LIMIT 1", __FILE__, __LINE__);
if (db_affected_rows() != 0)
{
$row = mysql_fetch_assoc($dbresult);
$ID_PICTURE = $row['ID_PICTURE'];
}
else
$ID_PICTURE = $id;
mysql_free_result($dbresult);
redirectexit('action=gallery;sa=view;id=' . $ID_PICTURE);
}
function NextDownload()
{
global $db_prefix, $txt, $scripturl;
$id = (int) $_REQUEST['id'];
// if (empty($id))
// fatal_error($txt['downloads_error_no_file_selected']);
// Get the category
$dbresult = db_query("
SELECT
ID_PICTURE, ID_CAT
FROM {$db_prefix}gallery_pic
WHERE ID_PICTURE = $id LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
$ID_CAT = $row['ID_CAT'];
mysql_free_result($dbresult);
// Get download
$dbresult = db_query("
SELECT
ID_PICTURE
FROM {$db_prefix}gallery_pic
WHERE ID_CAT = $ID_CAT AND approved = 1 AND ID_PICTURE < $id
ORDER BY ID_PICTURE DESC LIMIT 1", __FILE__, __LINE__);
if (db_affected_rows() != 0)
{
$row = mysql_fetch_assoc($dbresult);
$ID_PICTURE = $row['ID_PICTURE'];
}
else
$ID_PICTURE = $id;
mysql_free_result($dbresult);
redirectexit('action=gallery;sa=view;id=' . $ID_PICTURE);
}
..................................