Allow full HTML in posts for admin only

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
Black Vivi
Registered User
Posts: 52
Joined: Tue Dec 24, 2002 10:23 am
Location: Belgium
Contact:

Allow full HTML in posts for admin only

Post by Black Vivi »

Hey,
I'd like to put html and javascript codes in my posts, like I would do it in Notepad. And so it's supposed to be for admin only as well.
Thanks in advance.

-Laurent
Sephiseraph
Registered User
Posts: 73
Joined: Sun Jan 16, 2005 11:19 am

Post by Sephiseraph »

k, I'll make this mod for you. Gimme half an hour or so (will be my first mod :D)
Black Vivi
Registered User
Posts: 52
Joined: Tue Dec 24, 2002 10:23 am
Location: Belgium
Contact:

Post by Black Vivi »

Sephiseraph wrote: k, I'll make this mod for you. Gimme half an hour or so (will be my first mod :D)

Thanks! I really appreciate that :D
User avatar
eman
Registered User
Posts: 254
Joined: Wed Jun 22, 2005 7:51 pm

Post by eman »

why do i have a feeling that this will be alot tougher than you think it will :wink:

actually, if you get it, great, more power to you :)
Sephiseraph
Registered User
Posts: 73
Joined: Sun Jan 16, 2005 11:19 am

Post by Sephiseraph »

Okay I haven't tested it, but try this:

Code: Select all

##############################################################
## MOD Title: Admin HTLM in Posts Mod
## MOD Author: sephiseraph < omega_vangelis@hotmail.com > (Joe Green) http://uiv2.com
## MOD Description: Allows site administrators to use HTML and Javascript fully in their posts
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 5 Minutes
## Files To Edit: viewtopic.php
## Included Files: (N/A)
## License: http://opensource.org/licenses/gpl-license.php GNU 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:
##
##############################################################
## MOD History:
##
##   2005-08-06 - Version 1.0.0
##      - This is the first release... as this is a simple mod perhaps the only release, but bugs sometimes have a way of cropping up.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid

#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_level, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid

#
#-----[ FIND ] ------------------------------------------
#
		if ( $postrow[$i]['enable_html'] )
		{
			$message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message);
		}

#
#-----[ REPLACE WITH ] ----------------------------------------
#
		// START OF ADMIN HTML IN POSTS MOD
		if ( ( $postrow[$i]['enable_html'] ) && ( $postrow[$i]['user_level'] != 1 ) )
		{
			$message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message);
		}
		// END OF ADMIN HTML IN POSTS MOD

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Black Vivi
Registered User
Posts: 52
Joined: Tue Dec 24, 2002 10:23 am
Location: Belgium
Contact:

Post by Black Vivi »

Sephiseraph wrote: Okay I haven't tested it, but try this:

Thanks! I just need to go eating so I'll try it later when I'm back. Then I'll try it out and say if it works.
In meanwhile, other users may of course try it out. Or you? lol
Well, i'll be back.
Black Vivi
Registered User
Posts: 52
Joined: Tue Dec 24, 2002 10:23 am
Location: Belgium
Contact:

Post by Black Vivi »

Sorry, but it doesn't seem to work. You shoudl try it out to be sure if it works with you..
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati »

In the MODs database there's an awesome MOD entitled html bbcode or something like that. It takes into account all of the pitfalls that come with allowing html, and you can even put javascript in the posts.
Image
ComputerBob
Registered User
Posts: 239
Joined: Tue Jun 29, 2004 2:16 am
Location: The Gulf Coast of the Sunshine State
Contact:

Post by ComputerBob »

Joe Belmaati wrote: In the MODs database there's an awesome MOD entitled html bbcode or something like that. It takes into account all of the pitfalls that come with allowing html, and you can even put javascript in the posts.

http://www.phpbb.com/phpBB/viewtopic.php?t=235489
ComputerBob - Making Geek-Speak Chic™
http://www.computerbob.com
One Of The Largest One-Person Sites In The World
With Tons of Information, Software, Help, and Fun
Post Reply

Return to “[2.0.x] MOD Requests”

cron