Seite 1 von 2
Auszug der letzten Topics im Index
Verfasst: 03.05.2004 20:03
von DLDS
Hi Leute,
bitte schlagt mich nicht, ich habe die suchfunktion benutzt. Ich suche folgenden MOD welcher emröglicht auf der index.php rechts im Last Post Fenster den letzten Thread Titel anzeigt, anstatt "Fri Apr 30, 2004 10:10 am" - " schönen gruss aus Ö" (z.B.)
Ich weiss diesen MOD gibt es, aber ich finde ihn partou nicht wieder

Beispiel der funktion sieht man z.b. hier (der admin weiss auch nimmer wie er hies *g*)
http://pbhub.de/forum/
Vielen Dank für eure Hilfe,
Dennis
Verfasst: 03.05.2004 20:56
von rabbit
weiß nicht mehr, woher ich ihn habe, aber:
Code: Alles auswählen
##############################################################
## Mod Title: shows topic of last made post on index
## Mod Version: 1.4.0
## Author: e-sven <sven@e-sven.net> http://www.e-sven.net
## Description: -adds lasts post topic to each forum on
## the index page (based on read-access)
## -word censorship is used
## -topic title with more then 27 chars are cut off
## -mouseover info displays the full title
##
## Installation Level: easy
## Installation Time: 2-5 Minutes
## Files To Edit: index.php
## Included Files: index.php (pre-modded)
##############################################################
## History:
## 0.9 not released beta
## 1.0 first working release
## 1.1 optimized db access
## 1.2 made implementation easier
## (only two replaces have to be made)
## 1.2a just a minor bug (thanks to Acid)
## 1.3 empty forums where not displayed correctly
## 1.4 optimized db-query
##############################################################
## Before Adding This MOD To Your Forum,
## You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
index.php
#
#-----[ ACTION Find ]-----------------------------------------
#
default:
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
.
.
.
//
//
// Obtain a list of topic ids which contain
#
#-----[ REPLACE WITH ]----------------------------------------
#
default:
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_last_post_id " .
" FROM ((( " . FORUMS_TABLE . " f " .
" LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )" .
" LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) " .
" LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id ) " .
" ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
$topic_last_ary = array();
$i=0;
while( $row = $db->sql_fetchrow($result) )
{
if (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0) {
$topic_last_ary[i]=$row['topic_last_post_id'];
$i++;
$forum_data[] = $row;
}
}
unset($topic_last_ary);
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Filter topic_title not allowed to read
//
if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
$auth_read_all = array();
$auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$auth_data = '';
for($i=0; $i<count($forum_data); $i++)
{
if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
$forum_data[$i]['topic_title']='';
}
}
}
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//
// Obtain a list of topic ids which contain
#
#-----[ ACTION Find ]-----------------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
...
}
#
#-----[ ACTION Replace With ]---------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$topic_title = $forum_data[$j]['topic_title'];
$topic_title2 = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
$topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
}
if (strlen($topic_title)>27) {
$topic_title = substr($topic_title,0,24) . '...';
}
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
$last_post .= $last_post_time . ' <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . ' ';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
}
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------
#
Verfasst: 03.05.2004 21:17
von DLDS
danke
hast du vielleicht auch schon die fertige datei ?
ich tu mich im code immer bisschen schwer

*versteck*
Verfasst: 03.05.2004 22:41
von rabbit
nee, sorry. aber das ist ja auch recht einfach einzubauen...

Verfasst: 04.05.2004 00:42
von Peggy
http://www.phpbbhacks.com/viewhack.php?id=566
Du kannst dir den Mod auch da runterladen. In der zip-Datei ist bereits eine gemoddete index.php drin.

Verfasst: 04.05.2004 10:11
von Markus67
Hi ...
die fertige Datei würde ich aber nur verwenden wenn sonst noch keine MOD's eingebaut sind .... denn sonst funktioniert mit 100 %iger Sicherheit was anderes nicht mehr
Markus
Verfasst: 04.05.2004 11:01
von unTouched
habe ich gleich mal eine frage und zwar lasse ich momentan (noch auf localhost *g*) die letzten xyz posts durchlaufen (xyz=20) als marquee... nur opera unterstützt ja keines oder? würde gerne wissen ob es ein javascript gibt was einen lauftext generiert? (welches anhält wenn maus drüber ist?)
danke schonmal... der Pete

Verfasst: 04.05.2004 11:09
von Markus67
Hi ....
Schon mal unter Hotscripts.com geschaut ?
http://www.hotscripts.com/JavaScript/Sc ... index.html
Viel Spaß bei der Auswahl
Markus
Verfasst: 04.05.2004 15:13
von unTouched

jeah danke genau das was ich gesucht hab
kannte die seite noch gar nicht
Pete®
Verfasst: 05.05.2004 00:08
von DLDS
Markus67 hat geschrieben:Hi ...
die fertige Datei würde ich aber nur verwenden wenn sonst noch keine MOD's eingebaut sind .... denn sonst funktioniert mit 100 %iger Sicherheit was anderes nicht mehr
Markus
nur attachment mod, dürfte also ohne probleme klappen die datei zu ersetzen oder?
