Verfasst: 17.04.2006 01:07
ich fasse den mod die tage auch nochmal in einem anderen beitrag zusammen.
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
include "./extension.inc";
include "./config.".$phpEx;
include "./includes/db.".$phpEx;
#
#-----[ FIND ]------------------------------------------
#
function make_clickable($text)
{
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function get_post_titel($id)
{
global $db;
$sql = "SELECT post_subject FROM " . POSTS_TEXT_TABLE . " WHERE post_id = '$id'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain post information", '', __LINE__, __FILE__, $sql);
}
$post_titel = $db->sql_fetchrow();
$sql = "SELECT t.topic_title FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = '$id'
AND t.topic_id = p.topic_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
$topic_titel = $db->sql_fetchrow();
if ($post_titel['post_subject'] != '')
{
return $post_titel['post_subject'];
} else
{
return $topic_titel['topic_title'];
}
}
function get_topic_titel($id)
{
global $db;
$sql = "SELECT topic_title FROM " . TOPICS_TABLE . " WHERE topic_id = '$id'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
$titel = $db->sql_fetchrow();
return $titel['topic_title'];
}
function get_forum_titel($id)
{
global $db;
$sql = "SELECT forum_name FROM " . FORUMS_TABLE . " WHERE forum_id = '$id'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older Forum information", '', __LINE__, __FILE__, $sql);
}
$titel = $db->sql_fetchrow();
return $titel['forum_name'];
}
function preg_replace_callback_func_raw_url_to_url_with_titel($subpattern)
{
$url = $subpattern[2].$subpattern[3].$subpattern[4].$subpattern[5];
if($subpattern[3] == "viewtopic.php?t=")
$titel = get_topic_titel($subpattern[4]);
else if($subpattern[3] == "viewtopic.php?p=")
$titel = get_post_titel($subpattern[4]);
else
$titel = get_forum_titel($subpattern[4]);
return $subpattern[1]."<a href=\"".$url."\" target=\"_self\">".$titel."</a>";
}
function raw_url_to_url_with_titel($ret)
{
$phpbb_url = $_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/";
$phpbb_url = preg_replace("(\/\/)", "/", $phpbb_url);
$phpbb_url = "http://".$phpbb_url;
$ret = preg_replace_callback
(
"#([\n ])(".$phpbb_url.")(viewtopic\.php\?t=|viewtopic\.php\?p=|index\.php\?f=)(\d+)([^ \"\n\r\t<]*)(\#*)(\n*)#i", 'preg_replace_callback_func_raw_url_to_url_with_titel',
$ret
);
return $ret;
}
#
#-----[ FIND ]------------------------------------------
#
function make_clickable($text)
{
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$ret = raw_url_to_url_with_titel($ret);
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
include "./extension.inc";
include "./config.".$phpEx;
include "./includes/db.".$phpEx;
ist nicht zutreffend, ersten muss ich nach der (alten) Aussage in Deiner Signatur den Link nicht anklicken und zweitens ist es einem neueren phpBB der Versionsstand äußerlich nicht anzusehen.techno-com hat geschrieben:Das hättest du aber auch mit einem Klick auf den Forenlink darin selbst ersehen können das da alles aktuell ist !