Sorry habe das script vergessen:
Code: Alles auswählen
// Begin select Topics from Topics Table
if( isset($HTTP_GET_VARS['offset']) || isset($HTTP_POST_VARS['offset']) )
{
$offset = ( isset($HTTP_POST_VARS['offset']) ) ? intval($HTTP_POST_VARS['offset']) : intval($HTTP_GET_VARS['offset']);
}
else
{
$offset = 0;
}
$sql = "SELECT t.topic_id, t.topic_title
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE f.forum_id = t.forum_id
ORDER BY t.topic_last_post_id DESC
LIMIT $offset, $offsetstat";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query topic info', '', __LINE__, __FILE__, $sql);
}
$numrows = $db->sql_numrows($result);
while ( $row = $db->sql_fetchrow($result) )
{
$topics = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a><br>';
$template->assign_block_vars('sitemap_topics', array(
'TOPIC_LINKS' => $topics)
);
}
$offset = $offset + $offsetstat;
$offsetminus = $offset - $offsetstat - $offsetstat;
if ( $HTTP_GET_VARS['offset'] == $offsetstat )
{
$offseturl = '<a href="sitemap.php">back</a>';
}
else
{
$offseturl = '<a href="sitemap.php?offset=' . $offsetminus . '">back</a>';
}
if ( $offset > $offsetstat )
{
$new_back = $offseturl;
$new_next = '<a href="sitemap.php?offset=' . $offset . '">Next</a>';
}
else
{
$new_next = '<a href="sitemap.php?offset=' . $offset . '">Next</a>';
}
// End select Topics from Topics Table
Das ganze zeigt alle in der DB vorhandenen Topics (es werden immer nur 2 gleichzeitig angezeigt die User können dann über links weiterschalten ) an mein problem ist das ich verhindern möchte das der $new_next link angezeigt wird auch wenn keine Topics mehr vorhanden sind daher meine idee mit $Numrows aber das scheint irgendwie net zu gehen!Hat irgendjemand verstanden was ich meine und ne idee wie ich das lösen kann?
Grüße Calli