Seite 1 von 1
Begrenzung nur 3 [img] Tags/Smilies pro Beitrag
Verfasst: 16.01.2004 10:44
von WWW-Schizo
Gibt es einen Mod wo man registrierten Usern nur 3 Smilies bzw. [img] Tags pro Beitrag erlauben kann?
Es geht darum das man mit dem phpBB den IE zum Absturz bringen kann wenn man 800x Smilies bzw. [img] Tag in einen Beitrag setzt.
Verfasst: 16.01.2004 11:18
von Firestarter
Code: Alles auswählen
##############################################################
## MOD Title: Limit Images/Smilies
## MOD Author: Fubonis < php@fubonis.com > (JW Frazier) http://www.fubonis.com
## MOD Description: Limits the amount of images/smilies that can be used in posts and such.
## MOD Version: Beta 1.0.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: admin/admin_board.php, includes/bbcode.php, language/lang_english/lang_admin.php, templates/subSilver/admin/board_config_body.tpl
## Included Files: N/A
##############################################################
## 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 Notes:
## You need to run this SQL command. Add your prefix if neccessary.
## INSERT INTO config (config_name, config_value) VALUES('image_limit', 10)
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_IMAGE_LIMIT' => $lang['Image_Limit'], // Limit Images/Smilies Mod
'IMAGE_LIMIT' => $new['image_limit'], // Limit Images/Smilies Mod
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
function bbencode_second_pass($text, $uid)
{
global $lang, $bbcode_tpl;
#
#-----[ REPLACE WITH ]------------------------------------------
#
function bbencode_second_pass($text, $uid)
{
// Limit Images/Smilies Mod
global $lang, $bbcode_tpl, $board_config;
#
#-----[ FIND ]------------------------------------------
#
$patterns[0] = "#\[img:$uid\](.*?)\[/img:$uid\]#si";
$replacements[0] = $bbcode_tpl['img'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Limit Images/Smilies Mod
$text = preg_replace('#\[img:' . $uid . '\](.*?)\[/img:' . $uid . '\]#si', $bbcode_tpl['img'], $text, $board_config['image_limit']);
$text = preg_replace('#\[img:' . $uid . '\](.*?)\[/img:' . $uid . '\]#si', '[img]\\1[/img]', $text);
#
#-----[ FIND ]------------------------------------------
#
$message = preg_replace($orig, $repl, ' ' . $message . ' ');
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Limit Images/Smilies Mod
$message = preg_replace($orig, $repl, ' ' . $message . ' ', $board_config['image_limit']);
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Limit Images/Smilies Mod
$lang['Image_Limit'] = 'Image Limit in Posts';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_IMAGE_LIMIT}</td>
<td class="row2"><input type="text" name="image_limit" value="{IMAGE_LIMIT}" /></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Verfasst: 16.01.2004 12:42
von WWW-Schizo
Dankesssseeeeeeeeeeeeeehr!

Edit:
HILFE....
alle Smilies werden jetzt als Text ausgeführt (so als wenn Smilies deaktiviert wurden).....
.... [img] hingegen werden dargestellt........
irgendwelche Ideen zur Problemlösung?
Danke im Voraus.
Nicht innerhalb von wenigen Stunden (s. Topic Bumping).
Acid
Verfasst: 17.01.2004 15:26
von WWW-Schizo
Sorry aber muss nochmal nach oben....
Problem nach Ausführung dieses Mods:
Smilies werden nur noch als Text in Forumbeiträgen dargestellt also z.b. so :) , innerhalb der PNs klappt die Darstellung hingegen.
Das Problem liegt in der bbcode.php:
wenn ich dies:
, $board_config['image_limit']
bei
// Limit Images/Smilies Mod
$message = preg_replace($orig, $repl, ' ' . $message . ' ', $board_config['image_limit']);
herausnehme, werden die Smilies korrekt abgebildet...... irgendwo muss ein Error sein, ich benutze phpBB 2.0.0
Wo liegt der Fehler?