Seite 2 von 3

Verfasst: 15.10.2004 14:16
von mgutt
kann das nicht jemand machen. das echt ne fette sache.

man müsste da glaube ich doch nur in die bbcode.php ne abfrage machen so:

(ich kann das leider nicht, aber so stelle ich mir das vor ;) )

wenn viewtopic.php & "t" oder viewforum & "f" im beitrag gepostet wird
dann such die nummer "t" oder "f", den dazu gehörigen gespeicherten Titel, und kopiere Ihn als Hyperlink in den Beitrag.

so wird dann z.B. aus:

http://www.phpbb.de/viewtopic.php?t=66509

dann:

Interne Links automatisch Thread-Titel zuordnen

Verfasst: 19.02.2005 17:57
von mgutt
bump

Verfasst: 19.02.2005 22:41
von Tealc
http://forum.2lucky.de/suma/ <-- Macht links wie z. Bsp. sowas:

Code: Alles auswählen

http://emuleworld.de/forum,3,e1b5b0d6caa86f7d59ec9b8ea452292b,-emule-mods---allgemein.html

Verfasst: 20.02.2005 12:11
von mgutt
Darum geht es nicht. Es geht um die automatische Umsetzung eines internen Forumlinks zu dem Titel des Beitrages mit Link in Beiträgen.

als wenn ich jetzt hier schreiben würde (in einem Beitrag, sonst nirgends)

www.phpbb.de

dann soll er nach dem Klick auf "Absenden" daraus machen:

phpBB.de :: offizielles deutsches Support-Forum für phpBB

Das soll natürlich nur auf internen phpbb Foren, Thread und Beitragsurls funktionieren.

Ich schätze eine Abfrage in der bbcode.php müsste in diesem Fall die Lösung bringen.

Verfasst: 15.04.2006 23:04
von SyneX
Hallo,

ich wollte fragen ob es jetzt sowas gibt wie hier gesucht worden ist. Es ist ja immerhin schon ein Jahr her.

MfG
SyneX

Verfasst: 15.04.2006 23:36
von austrian-i
Ja bitte, sagt doch endlich, wie dieser Mod heisst!! :D

Verfasst: 15.04.2006 23:45
von mgutt
den mod findet ihr bei www.oxpus.de

sucht mal nach "raw converter"

Verfasst: 15.04.2006 23:52
von SyneX
Ich finde den Mod nicht

Verfasst: 16.04.2006 00:05
von austrian-i
Ich auch nicht leider

Verfasst: 17.04.2006 00:35
von Ramona_FP
Tante Google hat geholfen :wink:

Code: Alles auswählen

   1. ##############################################################
   2. ## MOD Title: Raw Url Converter
   3. ## MOD Version: 0.9
   4. ## MOD Author: Dimah; Gerard Choinka
   5. ## MOD Description: This mod converts raw urls of topics or forums to urls with the topic or forum titel.
   6. ##
   7. ## Installation Level: easy
   8. ## Installation Time: 5 Minutes
   9. ## Files To Edit: bbcode.php
  10. ## Included Files:
  11. ##############################################################
  12. ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
  13. ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
  14. ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
  15. ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
  16. ##############################################################
  17. ## This program is free software; you can redistribute it and/or modify
  18. ## it under the terms of the GNU General Public License as published by
  19. ## the Free Software Foundation; either version 2 of the License, or
  20. ## (at your option) any later version.
  21. ##############################################################
  22. ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
  23. ############################################################## 
  24.
  25. #
  26. #-----[ OPEN ]------------------------------------------
  27. #
  28.
  29. includes/bbcode.php
  30.
  31. #
  32. #-----[ FIND ]------------------------------------------
  33. #
  34.
  35. if ( !defined('IN_PHPBB') )
  36. {
  37.    die("Hacking attempt");
  38. }
  39.
  40. #
  41. #-----[ AFTER, ADD ]------------------------------------------
  42. #
  43.
  44. include "./extension.inc";
  45. include "./config.".$phpEx;
  46. include "./includes/db.".$phpEx;
  47.
  48. #
  49. #-----[ FIND ]------------------------------------------
  50. #
  51.
  52. function make_clickable($text)
  53. {
  54.
  55.    // pad it with a space so we can match things at the start of the 1st line.
  56.    $ret = ' ' . $text;
  57.
  58. #
  59. #-----[ BEFORE, ADD ]------------------------------------------
  60. #
  61.
  62. function get_topic_titel($id)
  63. {
  64.     global $db;   
  65.     $sql = "SELECT topic_title FROM " . TOPICS_TABLE . " WHERE topic_id = '$id'";
  66.     if ( !($result = $db->sql_query($sql)) )
  67.     {
  68.         message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
  69.     }
  70.     $titel = $db->sql_fetchrow(); 
  71.     return $titel['topic_title'];
  72. }
  73.
  74. function get_forum_titel($id)
  75. {
  76.     global $db;   
  77.     $sql = "SELECT forum_name FROM " . FORUMS_TABLE . " WHERE forum_id = '$id'";
  78.     if ( !($result = $db->sql_query($sql)) )
  79.     {
  80.         message_die(GENERAL_ERROR, "Could not obtain newer/older Forum information", '', __LINE__, __FILE__, $sql);
  81.     }
  82.     $titel = $db->sql_fetchrow();
  83.     return $titel['forum_name'];
  84. }
  85.
  86. function preg_replace_callback_func_raw_url_to_url_with_titel($subpattern)
  87. {
  88.     $url = $subpattern[2].$subpattern[3].$subpattern[4].$subpattern[5];
  89.     if($subpattern[3] == "viewtopic.php?t=")
  90.         $titel = get_topic_titel($subpattern[4]);
  91.     else
  92.         $titel = get_forum_titel($subpattern[4]);
  93.     return $subpattern[1]."<a href=\"".$url."\" target=\"_blank\">".$titel."</a>";
  94. }
  95.
  96. function raw_url_to_url_with_titel($ret)
  97. {
  98.     $phpbb_url = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/";
  99.
 100.     $ret = preg_replace_callback
 101.     (
 102.         "#(\s)(".$phpbb_url.")(viewtopic\.php\?t=|viewforum\.php\?f=)(\d+)(\S*)([^ \"\n\r\t<]*)#i",
 103.         'preg_replace_callback_func_raw_url_to_url_with_titel',
 104.         $ret
 105.     );
 106.     return $ret;
 107. }
 108.
 109. #
 110. #-----[ FIND ]------------------------------------------
 111. #
 112.
 113. function make_clickable($text)
 114. {
 115.
 116.    // pad it with a space so we can match things at the start of the 1st line.
 117.    $ret = ' ' . $text;
 118.    
 119. #
 120. #-----[ AFTER, ADD ]------------------------------------------
 121. #
 122.
 123.     $ret = raw_url_to_url_with_titel($ret);
 124.    
 125. #
 126. #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
 127. #
 128. # EoM
Wobei noch geschrieben wurde dass man

Code: Alles auswählen

32. #-----[ FIND ]------------------------------------------
  33. #
  34.
  35. if ( !defined('IN_PHPBB') )
  36. {
  37.    die("Hacking attempt");
  38. }
  39.
  40. #
  41. #-----[ AFTER, ADD ]------------------------------------------
  42. #
  43.
  44. include "./extension.inc";
  45. include "./config.".$phpEx;
  46. include "./includes/db.".$phpEx;
  47.
weglassen soll da die bbcode.php bereits includiert wird!

Ein Bugfix; http://www.amigalink.de/phpbb2/viewtopic.php?t=226