Seite 1 von 1
Bookmark-Mod
Verfasst: 12.11.2009 14:52
von Holger
Hallo,
ich benutze den Bookmark-Mod 1.1.2 von PhilippK (danke dafür!).
Ich würde nun gerne in dem Navi-Link anzeigen, wieviele Bookmarks man gesetzt hat.
Also "Bookmarks (x)".
Geht das?
Gruss
Holger
Re: Bookmark-Mod
Verfasst: 13.11.2009 08:30
von jensdd
Hallo Holger,
da ich den Mod auch nutze und die Idee gut finde, habe ich Deinen Vorschlag mal umgesetzt:
In der includes/page_header.php einfügen (die if-Abfrage kann entfallen, wenn Du die Bookmarks auch für Gäste erlaubt hast):
Code: Alles auswählen
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT count(t.topic_id) as total_bookmarks
FROM " . TOPICS_TABLE . " t, " . BOOKMARK_TABLE . " b
WHERE t.topic_id = b.topic_id
AND b.user_id = " . $userdata['user_id'];
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get bookmark data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$bookmark_ids = $row['total_bookmarks'];
}
$db->sql_freeresult($result);
}
else
{
$bookmark_ids = 0;
}
Abschließend noch ändern:
Code: Alles auswählen
'L_BOOKMARKS' => $lang['Bookmarks'] . " (" . $bookmark_ids . ")",
Alternativ könnte man bei 0 Lesezeichen auch den Link ausblenden.
Gruß Jens