Schleife einbauen
Verfasst: 22.01.2005 11:30
wo hast du die Schleife eingebaut - und werden dann auch die Satzzeichen etc. vernünftig dargestellt...
LG Dirk
LG Dirk
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
$first_post = preg_replace('/[^a-z A-Z0-9,.=\-äöüÄÖÜß?!():;]/', '', $first_post);Code: Alles auswählen
$row = $db->sql_fetchrow($result);
$first_post = $row['post_text'];
$first_post = str_replace('"', "''", $first_post);Code: Alles auswählen
##############################################################
## MOD Title: display first message as title
## MOD Author: emrag < emrah987@hotmail.com > (Emrah Türkmen) www.canver.net
## MOD Description: with this hack when you hover the mouse on topic link you
## will see first message as title like vBulletin Boards ;)
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time : ~3 minutes
## Files to Edit: viewforum.php
## templates/subsilver/viewforum_body.tpl
##
## Ýncluded Files: n/a
##############################################################
##
## Author Note: -
##
##############################################################
##
## MOD History: 25.09.2004
## - First release
##
## 07.10.2004
## - Fixed a bug - thanx to Clock
##
##############################################################
##
## Before Adding This Hack To Your Forum, You Should Back Up All Files Related To This Hack
##
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#----[ FIND ]------------------------------------------
#
$topic_id = $topic_rowset[$i]['topic_id'];
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// display first message as title by emrag ;)
//
$sql = "SELECT p.*, pt.post_text, pt.post_id
FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
AND pt.post_id = p.post_id
ORDER BY p.post_time
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$first_post = $row['post_text'];
$first_post = str_replace('"', "''", $first_post);
//
// display first message as title by emrag ;)
//
#
#----[ FIND ]------------------------------------------
#
'TOPIC_FOLDER_IMG' => $folder_image,
'TOPIC_AUTHOR' => $topic_author,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'FIRST_POST' => $first_post,
#
#-----[ OPEN ]------------------------------------------
#
templates/subsilver/viewforum_body.tpl
#
#----[ FIND ]------------------------------------------
#
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">
#
#----[ REPLACE WITH ]------------------------------------------
#
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle" title="{topicrow.FIRST_POST}">
#
#-----[ SAVE ALL FILES/CLOSE ]------------------------------------------
#
# EoMCode: Alles auswählen
//
// Mouse hover topic preview MOD - BEGIN
//
function bbencode_strip($message, $uid)
{
$message = strip_tags($message);
// url #2
$message = str_replace("[url]","", $message);
$message = str_replace("[/url]", "", $message);
// url /\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\](.*?)\[/url\]/si
$message = preg_replace("/\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\]/si", "", $message);
$message = str_replace("[/url:$uid]", "", $message);
$message = preg_replace("/\[.*?:$uid:?.*?\]/si", '', $message);
$message = preg_replace('/\[url\]|\[\/url\]/si', '', $message);
$message = str_replace('"', "'", $message);
return $message;
}
//
// Mouse hover topic preview MOD - END
//