Seite 1 von 2

BBCode Button problem

Verfasst: 03.07.2004 13:40
von danysahne333
Habe das album von smartor und hab jetzt einen mod gefunden um bilder mit nem post zu verlinken das diese angezeigt werden.
## EasyMod 0.0.7 compliant
##############################################################
## Mod Title: Local Links
## Mod Version: 1.1.0p
## Author: netclectic < adrian@netclectic.com > Adrian Cockburn - http://www.netclectic.com
## webmedic < bah@webmedic.net > Brook Humphrey - http://www.webmedic.net
## Description: This MOD will cause any local URLs (i.e. www.YOURDOMAIN.com) posted to your
## board to open in the same window instead of in a new window, ( i.e. _self instead of _blank ).
## This does not effect external URLs. Might not be to your liking if you do not have your own domain name.
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: (2) includes/bbcode.php,
## templates/subSilver/bbcode.tpl
## Included Files: n/a
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Note:
##
## Change History:
## 1.1.0p- Changed the preg matches to use urll for local url's
## for use with the press mod.
## - Also removed the code for local urls's when not using
## [urll]
## - added code for siteurl which allows for local linking of
## images from smartors album mod.
## 1.1.0 - Confirmed with 2.0.4. Updated to be EasyMod compliant.
## 1.0.3 - Aarrgghhh! Regular expressions!!!.
## 1.0.2 - Fixed small bug in script - .
## 1.0.1 - Fixed some dodgy regular expressions.
## 1.0.0 - Original release.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]------------------------------------------
#
$bbcode_tpl['url1'] = str_replace('{URL}', '\1\2', $bbcode_tpl['url']);

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// MOD LOCAL URL BEGIN
$bbcode_tpl['url_local1'] = str_replace('{URL}', '\\1\\2\\3', $bbcode_tpl['url_local']);
$bbcode_tpl['url_local1'] = str_replace('{DESCRIPTION}', '\\1\\2\\3', $bbcode_tpl['url_local1']);

$bbcode_tpl['url_local2'] = str_replace('{URL}', 'http://\\1\\2', $bbcode_tpl['url_local']);
$bbcode_tpl['url_local2'] = str_replace('{DESCRIPTION}', '\\1\\2', $bbcode_tpl['url_local2']);

$bbcode_tpl['url_local3'] = str_replace('{URL}', '\\1\\2\\3', $bbcode_tpl['url_local']);
$bbcode_tpl['url_local3'] = str_replace('{DESCRIPTION}', '\\4', $bbcode_tpl['url_local3']);

$bbcode_tpl['url_local4'] = str_replace('{URL}', 'http://\\1\\2', $bbcode_tpl['url_local']);
$bbcode_tpl['url_local4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url_local4']);
// MOD LOCAL URL END

// site img code for doing local images in the press mod.
$bbcode_tpl['siteimg'] = str_replace('{IMG_NUM}', '\\1', $bbcode_tpl['siteimg']);
$bbcode_tpl['siteimgleft'] = str_replace('{IMG_NUM}', '\\1', $bbcode_tpl['siteimgleft']);
$bbcode_tpl['siteimgright'] = str_replace('{IMG_NUM}', '\\1', $bbcode_tpl['siteimgright']);
$bbcode_tpl['siteimgcenter'] = str_replace('{IMG_NUM}', '\\1', $bbcode_tpl['siteimgcenter']);
// end site image

#
#-----[ FIND ]------------------------------------------
#
// [img]image_url_here[/img] code..
// This one gets first-passed..

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// MOD LOCAL URL BEGIN
// do any local urls first...
// [urll]xxxx://www.phpbb.com[/url] code..
$local_patterns[1] = "#\[urll\]([a-z]+?://){1}(".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\[/url\]#si";
$local_replacements[1] = $bbcode_tpl['url_local1'];

// [urll]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$local_patterns[2] = "#\[urll\](".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\[/url\]#si";
$local_replacements[2] = $bbcode_tpl['url_local2'];

// [urll=xxxx://www.phpbb.com]phpBB[/url] code..
$local_patterns[3] = "#\[urll=([a-z]+?://){1}(".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\](.*?)\[/url\]#si";
$local_replacements[3] = $bbcode_tpl['url_local3'];

// [urll=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$local_patterns[4] = "#\[urll=(".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\](.*?)\[/url\]#si";
$local_replacements[4] = $bbcode_tpl['url_local4'];

//site image for printing press
// [siteimg]image number here[/img]
$local_patterns[5] = "#\[siteimg:$uid\]([0-9]+)\[/siteimg:$uid\]#si";
$local_replacements[5] = $bbcode_tpl['siteimg'];

// [siteimg=left]image number here[/img]
$local_patterns[6] = "#\[siteimg=left:$uid\]([0-9]+)\[/siteimg:$uid\]#si";
$local_replacements[6] = $bbcode_tpl['siteimgleft'];

// [siteimg=right]image number here[/img]
$local_patterns[7] = "#\[siteimg=right:$uid\]([0-9]+)\[/siteimg:$uid\]#si";
$local_replacements[7] = $bbcode_tpl['siteimgright'];

// [siteimg=center]image number here[/img]
$local_patterns[8] = "#\[siteimg=center:$uid\]([0-9]+)\[/siteimg:$uid\]#si";
$local_replacements[8] = $bbcode_tpl['siteimgcenter'];
// site image-end

$text = preg_replace($local_patterns, $local_replacements, $text);
// now with the local urls done, it's safe to do any external urls
// MOD LOCAL URL END

#
#-----[ FIND ]------------------------------------------
#

// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

#
#-----[ BEFORE, ADD ]------------------------------------------


// [siteimg]image_url_here[/img] code..
$text = preg_replace("#\[siteimg\]([0-9]+)\[/siteimg\]#sie", "'[siteimg:$uid]\\1[/siteimg:$uid]'", $text);
$text = preg_replace("#\[siteimg=left\]([0-9]+)\[/siteimg\]#sie", "'[siteimg=left:$uid]\\1[/siteimg:$uid]'", $text);
$text = preg_replace("#\[siteimg=right\]([0-9]+)\[/siteimg\]#sie", "'[siteimg=right:$uid]\\1[/siteimg:$uid]'", $text);
$text = preg_replace("#\[siteimg=center\]([0-9]+)\[/siteimg\]#sie", "'[siteimg=center:$uid]\\1[/siteimg:$uid]'", $text);
// siteimg-end

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- BEGIN url_local --><a href="{URL}" target="_self" class="postlink">{DESCRIPTION}</a><!-- END url_local -->
<!-- BEGIN siteimg --><a href="album_pic.php?pic_id={IMG_NUM}" target="_blank" class="postlink"><img src="album_thumbnail.php?pic_id={IMG_NUM}" alt="Image" title="Image" border="0" /></a><!-- END siteimg -->
<!-- BEGIN siteimgleft --><a href="album_pic.php?pic_id={IMG_NUM}" target="_blank" class="postlink"><img src="album_thumbnail.php?pic_id={IMG_NUM}" border="0" align="left" /></a><!-- END siteimgleft -->
<!-- BEGIN siteimgright --><a href="album_pic.php?pic_id={IMG_NUM}" target="_blank" class="postlink"><img src="album_thumbnail.php?pic_id={IMG_NUM}" border="0" align="right" /></a><!-- END siteimgright -->
<!-- BEGIN siteimgcenter --><a href="album_pic.php?pic_id={IMG_NUM}" target="_blank" class="postlink"><img src="album_thumbnail.php?pic_id={IMG_NUM}" border="0" align="center" /></a><!-- END siteimgcenter -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
der bbcode ist [siteimg] [/siteimg]

doch muss ich den immer von hand eingeben. wie schaff ich das das ich den auch in der bbcode-auswahlleiste habe und nur anklicken brauche.

kann mir wer helfen?

Verfasst: 03.07.2004 14:20
von Fabse
Schau dir die bbcode.php und die bbcode.tpl an. Da is alles drin was du brauchst!

Verfasst: 03.07.2004 14:23
von danysahne333
leider hab ich nicht so viel ahnung davon. kann mir nicht jemand helfen?

hatte es schon selbst grad versuchst. der button ist zu sehen nur wenn ich den anklicke tut sich nichts. die naderen buttons gehen auhc nicht mehr.

kann mir nicht jemand helfen?

Verfasst: 03.07.2004 14:24
von Fabse
Die anderen gehen auch nicht mehr?

Hast du ein backup von den dateien gemacht die du ändern musst?

Verfasst: 03.07.2004 14:26
von danysahne333
ja ,hab das auch esrtmal wieder aufgespielt. weiss nich was da los ist.

soll ich die originalen und meine geänderten mal als txt. dateien verlinken?

hatte gestern den center bbcode installiert und wollte den buttpon siteimg nach dem gleichen schema hinzufügen. nur tut sich nichts. aber sehen kann ichd en button

Verfasst: 03.07.2004 14:31
von Fabse
Der center BBCode hat auch nicht funktioniert?

Verfasst: 03.07.2004 14:36
von danysahne333
doch der funktioniert wunderbar.

hab denn einfach die wörter "center" durch "siteimg" in der anleitung ersetzt und denn den code unter die tags mit dem code center vom center-mod gesetzt.

wie gesagt der button ist da, aber es tut sich bei keinem button mehr was.

Verfasst: 03.07.2004 14:50
von Fabse
Ja das ist klar, wenn du an der bbcode.php nichts angepasst hast! ;)

Verfasst: 03.07.2004 14:53
von danysahne333
was muss ich denn da anpassen? habe aber die buchstaben angepasst. bei center wars ein y und ich hab das x gewählt.

bin voll der noob sry

was muss ich tun?

Verfasst: 03.07.2004 15:11
von Fabse
Ja das was in der install datei halt steht.