Wicher Site Admin
Joined: 16 Dec 2005 Posts: 1144 User's local time: 2024 Sep 11 - 9:51 AM Country IP : Country of choice:
Was This Post Helpful?
Users postingpoints:
Posts points:
Post gradiation:
|
Posted: Tue Dec 20, 2005 10:43 pm Post subject: |
Wicher
Items with prefix * are permanent. | Close |
|
|
Full mod is attached at the bottom of this post.
Code: |
- #################################################################
- ## MOD Title: Img_BBcode_Admin_Only
- ## MOD Author: Wicher < N/A > (N/A) http://www.wichersmods.nl
- ## MOD Description: This mod replaces the [img] bbcode tag with a [pic] tag and is only visible to admins.
- ## Very usefull if you have attachment mod installed and dont want users to post images
- ## from a remote site, forcing them to use the attachmentpanel to upload there images,
- ## this way you will never have those broken images at your phpbb.
- ## It will not affect the remote images that are allready on your board that did use the [img] tag.
- ## It will also create an admin switch witch you can use anywhere in any
- ## tpl file where there is code that is not to be seen by normal users or moderaters.
- ##
- ## MOD Version: 4.0.0
- ##
- ## Installation Level: easy
- ## Installation Time: 5-10 Minutes (1 minute with easymod)
- ## Files To Edit: bbcode.php, posting_body.tpl, page_header.php
- ##
- ## Included Files: N/A
- ##
- ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
- ##############################################################
- ## For security purposes, please check: http://www.phpbb.com/mods/
- ## for the latest version of this MOD. Although MODs are checked
- ## before being allowed in the MODs Database there is no guarantee
- ## that there are no security problems within the MOD. No support
- ## will be given for MODs not found within the MODs Database which
- ## can be found at http://www.phpbb.com/mods/
- ##############################################################
- ## Author Notes:
- ## [N/A]
- ##############################################################
- ## MOD History:
- ##
- ## 2006-Feb-25 - 4.0.0
- ## - 5t release
- ## 2006-?-? - 3.0.0
- ## - 3rd release
- ## 2006-Feb-25 - 2.0.0
- ## - 3rd release
- ## - no changes in the code, only added website adres for support.
- ##
- ## 2005-Nov-9 - 1.0.1
- ## - Second release
- ##
- ## 2005-Nov-2nd - 1.0.0
- ## - First 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['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']);
-
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
-
- $bbcode_tpl['pic'] = str_replace('{URL}', '\\1', $bbcode_tpl['pic']);
-
- #
- #-----[ FIND ]------------------------------------------
- #
-
- // [img]image_url_here[/img] code..
- // This one gets first-passed..
- $patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";
- $replacements[] = $bbcode_tpl['img'];
-
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
-
- $patterns[] = "#\[pic:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/pic:$uid\]#i";
- $replacements[] = $bbcode_tpl['img'];
-
- #
- #-----[ FIND ]------------------------------------------
- #
-
- // [img]image_url_here[/img] code..
- $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
-
- #
- #-----[ REPLACE WITH ]----------------------------------
- #
-
- // [pic]image_url_here[/pic] code..
- $text = preg_replace("#\[pic\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/pic\]#sie", "'[pic:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/pic:$uid]'", $text);
-
- #
- #-----[ OPEN ]------------------------------------------
- #
-
- templates/subSilver/posting_body.tpl
-
- #
- #-----[ FIND ]------------------------------------------
- #
- bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
- #
- #-----[ IN-LINE FIND ]------------------------------------------
- #
- ,'[img]','[/img]'
-
- #
- #-----[ IN-LINE REPLACE WITH ]----------------------------------
- #
-
- ,'[pic]','[/pic]'
-
- #
- #-----[ FIND ]------------------------------------------
- #
-
- document.post.addbbcode14.value = "Img"; // Return button back to normal state
-
-
- #
- #-----[ REPLACE WITH ]----------------------------------
- #
-
- document.post.addbbcode14.value = "Pic"; // Return button back to normal state
-
- #
- #-----[ FIND ]------------------------------------------
- #
-
- <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" />
-
- #
- #-----[ REPLACE WITH ]----------------------------------
- #
-
- <!-- BEGIN switch_admin_logged_in -->
- <input type="button" class="button" accesskey="p" name="addbbcode14" value="Pic" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" />
- <!-- END switch_admin_logged_in -->
-
- #
- #-----[ OPEN ]------------------------------------------
- #
-
- includes/page_header.php
-
- #
- #-----[ FIND ]------------------------------------------
- #
-
- $template->assign_block_vars('switch_user_logged_in', array());
-
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
-
- if ( $userdata['user_level'] == ADMIN )
- {
- $template->assign_block_vars('switch_admin_logged_in', array());
- }
-
- #
- #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
- #
- # EoM
|
_________________
Wicher's phpBB2 Mods | Wicher's phpBB3 Mods | Statistics Mod 4.x.x |
|