[ALPHA] RWinner's HTML Free 0.0.1

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
RWinner
Registered User
Posts: 12
Joined: Tue Jul 01, 2003 2:36 pm
Location: Moscow
Contact:

[ALPHA] RWinner's HTML Free 0.0.1

Post by RWinner »

Hi!

1. With this mod, all of your phpbb visitors can see the normal HTML-formatted text in posts, instead text&tags (for example text&tags:

Code: Select all

<b>Hi!</b> With this <i>mod</i>...
2. And one user of your choice, be able to post a HTML-formatted text, where used all HTML-tags.

This features independent of phpbb settings.

3. Also, you may change the code in this mod - and all Administrators in your phpbb, receive the ability, like user in p.2

If you want this - simply replace the

Code: Select all

$userdata['username'] != "SomeUserName" 
with

Code: Select all

$userdata['user_level'] != 1


***

and replace the

Code: Select all

$userdata['username'] == "SomeUserName"


with

Code: Select all

$userdata['user_level'] == 1
in mod code

***

Code: Select all

##############################################################
## MOD Title: RWinner's HTML Free :-)
## MOD Author: RWinner < winner_at_2winners_dot_com > (Roman) www.2winners.com
## MOD Description: All users can view html-formatted posts, 
## and one user of your choice, may posted a posts with all html-tags
## MOD Version: 0.0.1
##
## Installation Level: (Easy)
## Installation Time: ~ 3 - 5 Minutes
## Files To Edit: viewtopic.php
##                     includes/functions_post.php
## Included Files: (n/a)
##############################################################
## 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: You may change the user name "SomeUserName" 
## in the text below (in two places) at your will   
##
##############################################################
## MOD History:
##
##   2006-01-20 - Version 0.0.1 - it's working on my forum =)
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

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

# 
#-----[ FIND ]------------------------------------------ 
# 
global $board_config, $html_entities_match, $html_entities_replace;

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
global $board_config, $html_entities_match, $html_entities_replace, $userdata;

# 
#-----[ FIND ]------------------------------------------ 
# 
$message = trim($message);

        if ($html_on)

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
$message = trim($message);

        if ($html_on && ($userdata['username'] != "SomeUserName"))

# 
#-----[ FIND ]------------------------------------------ 
# 
else
        {
                $message = preg_replace($html_entities_match, $html_entities_replace, $message);

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
/*RWinner's HTML Free begin*/
        elseif($userdata['username'] == "SomeUserName"){

                $message = trim($message);
              
        }
/*RWinner's HTML Free end*/

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

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

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
 	    /* RWinner's HTML Free begin
                if ( $postrow[$i]['enable_html'] )
                {
                        $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message);
                }
                RWinner's HTML Free end */ 

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
***

I use this mod with [2.0.6] FIND - Forum Integrated News Delivery - Input - http://www.phpbb.com/phpBB/viewtopic.php?t=130271 - where SomeUserName - the user name of my RSS-bot. It is very comfortably for me :roll:

Of course, you may have any number of user, with Full-HTML-posting-ability :D If it desired - write it in comments below.

Good luck!

P.S. Sorry for my English :roll: :D
Kain Elderan
Registered User
Posts: 7
Joined: Thu Dec 22, 2005 7:41 am
Location: Iraq
Contact:

Post by Kain Elderan »

OMG I love you! You fixed it!!!! You're my hero! :D
User avatar
RWinner
Registered User
Posts: 12
Joined: Tue Jul 01, 2003 2:36 pm
Location: Moscow
Contact:

Post by RWinner »

Kain Elderan wrote: OMG I love you! You fixed it!!!! You're my hero! :D


Tnx! :D

Is this mod working correctly on your board :?:
Kain Elderan
Registered User
Posts: 7
Joined: Thu Dec 22, 2005 7:41 am
Location: Iraq
Contact:

Post by Kain Elderan »

Yes, except the extra spaces character shows up. Example...

News from &nbsq; google
User avatar
RWinner
Registered User
Posts: 12
Joined: Tue Jul 01, 2003 2:36 pm
Location: Moscow
Contact:

Post by RWinner »

Kain Elderan wrote: Yes, except the extra spaces character shows up. Example...

News from &nbsq; google


OK. The
&nbsq;


is not valid HTML-tag, the right space-tag is
&nbsp;


and it is working correctly on my board :wink:

I check it, right now.
locazo.com
Registered User
Posts: 4
Joined: Tue Nov 29, 2005 10:31 pm

Post by locazo.com »

Junt wondering ... :

Can I use this with 2.0.19 ?

I tried installing it but it didn't really work, maybe i'm missing something?

Thanks
vred
Registered User
Posts: 3
Joined: Wed Jan 04, 2006 11:53 pm

didn't work on 2.0.19 for me either

Post by vred »

locazo.com wrote: Junt wondering ... :

Can I use this with 2.0.19 ?

I tried installing it but it didn't really work, maybe i'm missing something?

Thanks


must be something that needs to be tweekedl, it didn't work for me either
vred
Registered User
Posts: 3
Joined: Wed Jan 04, 2006 11:53 pm

Re: didn't work on 2.0.19 for me either

Post by vred »

vred wrote:
locazo.com wrote:Junt wondering ... :

Can I use this with 2.0.19 ?

I tried installing it but it didn't really work, maybe i'm missing something?

Thanks


must be something that needs to be tweekedl, it didn't work for me either


update: I used Rwinner's updated code in the thread, instead of the original mod, and it worked.
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Just to be clear on this...

Is this ONLY an add on for FIND?

OR:

-Does it essentially make any and all HTML posted within posts viewable by all members--without having to activate HTML in their profiles--such as tables, etc, whatever I may post there? I use Iframes occasionally, and think this could solve much of our problems.

-Does the single user permission override any tags that have been permitted in the ACP? In other words, if I have permission to post HTML, can I post any and all HTML? Would I need to still activate any HTML within ACP?

Sorry for all the questions, but I just want to be certain I'm on the right track. :wink:
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
mdvaldosta
Registered User
Posts: 353
Joined: Sat Mar 26, 2005 12:26 am
Contact:

Post by mdvaldosta »

posting to save the post in my "view your posts"

good stuff.
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Anyone have any idea as to the questions I asked above?
Is anyone using this?
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
mdvaldosta
Registered User
Posts: 353
Joined: Sat Mar 26, 2005 12:26 am
Contact:

Post by mdvaldosta »

I used this mod, it works as advertised. Anyone you setup with the permission can put html into their posts and it gets parsed that way. It's not just for the FIND mod. And I don't see how it could affect any ACP settings. All it does is allows a user (or user level) to post html so you don't have to give it to everyone.
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

A quick question:

What sort of syntax should I consider adding if I want to ALSO allow my user_levels 3, ans 4 to be able to post HTML?
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Hmmm...I've tried:

Code: Select all

if ($html_on && ($userdata['username'] != 1 || ($userdata['username'] != 2 || $userdata['username'] != 3 ))) 

---

/*RWinner's HTML Free begin*/
        elseif($userdata['username'] == 1 && ($userdata['username'] == 2 && $userdata['username'] == 3 && ))
But, to no avail...what am I screwing up in my syntax here?
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
romans1423
Registered User
Posts: 1560
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman
Contact:

Post by romans1423 »

You're using username where you should be using user_level... ;)
RickBeckman.org | The Fellowship Hall – Diversity-friendly Religious Forums
Post Reply

Return to “[2.0.x] MODs in Development”