PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2005-09-26 16:49:22

Dwaggy
New member
Registered: 2005-09-26
Posts: 2

Administrator / Moderator posts as HTML 1.0

Code:

##
##
##        Mod title:  Administrator / Moderator posts as HTML
##
##      Mod version:  1.0
##   Works on PunBB:  1.2, 1.2.6 (And up?)
##     Release date:  2005-09-25
##           Author:  Dwaggy
##
##      Description:  This mod parses admin & mod posts as html
##
##   Affected files:  /include/parser.php
##
##       Affects DB:  No
##
##            Notes:  Linebreaks and paragraphs are still handled by the parser.
##                      
##              This mod is offered as-is. Use at your own risk.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download here

Offline

 

#2 2005-12-28 18:13:35

Bunnywunnyja
New member
Registered: 2005-12-23
Posts: 4

Re: Administrator / Moderator posts as HTML 1.0

All normal tags are working but the advanced tags (embed src, bgsound src etc) doesn't work...
Is that normal?

Offline

 

#3 2006-02-03 04:36:45

Artic Chill
Member
From: Oklahoma, USA
Registered: 2006-01-15
Posts: 54
Website

Re: Administrator / Moderator posts as HTML 1.0

Does it automaticaly make it this way or do you have to edit them in... It could cause problems if it changes when it wants to!

Offline

 

#4 2006-03-14 00:27:51

Chatissimus
New member
From: France
Registered: 2006-03-13
Posts: 4

Re: Administrator / Moderator posts as HTML 1.0

[sorry i'm french wink ]


some mods to allow html in preview message

Code:

#
#---------[ 1. OPEN ]---------------------------------------------------------
#

post.php

#
#---------[ 2. FIND (line: 443) ]----------------------------------------------
#

$preview_message = parse_message($message, $hide_smilies);

#
#---------[ 3. REPLACE WITH ]-------------------------------------------------
#

    if ($pun_user['g_id'] < PUN_GUEST) { //Mod or admin
        $preview_message = parse_admin_message($message, $hide_smilies);
    }
    else
    {
        $preview_message = parse_message($message, $hide_smilies);
    }
    
#
#---------[ 4. OPEN ]---------------------------------------------------------
#

edit.php

#
#---------[ 5. FIND (line: 178) ]----------------------------------------------
#

$preview_message = parse_message($message, $hide_smilies);

#
#---------[ 6. REPLACE WITH ]-------------------------------------------------
#

    if ($pun_user['g_id'] < PUN_GUEST) { //Mod or admin
        $preview_message = parse_admin_message($message, $hide_smilies);
    }
    else
    {
        $preview_message = parse_message($message, $hide_smilies);
    }

view & preview html in easy poll

Code:

###############
#
# for Easy pool
#
#
#
#---------[ 1. OPEN ]---------------------------------------------------------
#

viewpoll.php

#
#---------[ 2. FIND (line: 448) ]----------------------------------------------
#

$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);

#
#---------[ 3. REPLACE WITH ]-------------------------------------------------
#

    if ($cur_post['g_id'] == 1 || $cur_post['g_id'] == 2) 
    { //Mod or admin
        $cur_post['message'] = parse_admin_message($cur_post['message'], $cur_post['hide_smilies']);
    }
        else
    {
        $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
    }

#
#---------[ 4. OPEN ]---------------------------------------------------------
#

poll.php

#
#---------[ 5. FIND (line: 437) ]----------------------------------------------
#

$message = parse_message(trim($_POST['req_message']), $hide_smilies);

#
#---------[ 6. REPLACE WITH ]-------------------------------------------------
#

    if ($pun_user['g_id'] < PUN_GUEST) 
        { //Mod or admin
            $message = parse_admin_message(trim($_POST['req_message']), $hide_smilies);
        }
        else
        {
            $message = parse_message(trim($_POST['req_message']), $hide_smilies);
        }

#
#---------[ 5. FIND (line: 709) ]----------------------------------------------
#

$message = parse_message($message, $hide_smilies);

#
#---------[ 6. REPLACE WITH ]-------------------------------------------------
#

    if ($pun_user['g_id'] < PUN_GUEST) 
    { //Mod or admin
        $message = parse_admin_message($message, $hide_smilies);
    }
    else
    {
        $message = parse_message($message, $hide_smilies);
    }

and view html in private message system

Code:

###############
#
# for Private message system
#
#
#
#---------[ 1. OPEN ]---------------------------------------------------------
#

message_list.php

#
#---------[ 2. FIND (line: 240) ]----------------------------------------------
#

$cur_post['message'] = parse_message($cur_post['message'], (int)(!$cur_post['smileys']));

#
#---------[ 3. REPLACE WITH ]-------------------------------------------------
#

    if ($cur_post['g_id'] == 1 || $cur_post['g_id'] == 2) { //Mod or admin
        $cur_post['message'] = parse_admin_message($cur_post['message'], (int)(!$cur_post['smileys']));
    }
    else
    {
        $cur_post['message'] = parse_message($cur_post['message'], (int)(!$cur_post['smileys']));
    }

-


and a mod by nico_somb to not parse html placed between CODE tag

in function "parse_admin_message($text, $hide_smilies)" provides by the mod
replace

Code:

$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';

by

Code:

$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.htmlentities($inside[$i]).'</pre></div></div></div><p>';

Offline

 

#5 2006-03-28 02:48:29

Chatissimus
New member
From: France
Registered: 2006-03-13
Posts: 4

Re: Administrator / Moderator posts as HTML 1.0

to allow html in signatures.

in viewtopic.php search (l 350)

Code:

$signature = parse_signature($cur_post['signature']);

replace with:

Code:

if ($cur_post['g_id'] == 1 || $cur_post['g_id'] =2) 
            { //Mod or admin
                $signature = parse_admin_message($cur_post['signature'],true);
            }else
            {
                $signature = parse_signature($cur_post['signature']);
            }

Warning: Signatures for Admin and Mod are parsed like a message.

Offline

 

#6 2006-03-28 16:42:50

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

$cur_post['g_id'] == 1 || $cur_post['g_id'] =2 could be replace by $cur_pos['g_id'] <= PUN_MOD


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#7 2006-06-10 12:24:56

Ryan
New member
Registered: 2006-06-06
Posts: 3

Re: Administrator / Moderator posts as HTML 1.0

I understand this is for Administrator / Moderator's only but is there a way to enable it for trusted members?

Offline

 

#8 2006-10-11 21:45:49

equineguardian
New member
Registered: 2006-10-10
Posts: 3

Re: Administrator / Moderator posts as HTML 1.0

Awesome Mod, just what I was looking for but didn't quite know what file to open for the last part of your second post.

Last edited by equineguardian (2006-10-11 21:46:15)

Offline

 

#9 2006-10-11 21:49:09

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1165

Re: Administrator / Moderator posts as HTML 1.0

###############
#
# for Private message system


Cant find something you want? try searching
Also try the wiki

Offline

 

#10 2007-02-22 20:26:40

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Hey is there someway I can allow html to be allowed for JUST for ADMINS and MODS in SIGNATURES?

Thanks wink

Last edited by p0Wer (2007-02-22 20:27:02)

Offline

 

#11 2007-02-22 21:25:20

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Chatissimus wrote:

to allow html in signatures.

in viewtopic.php search (l 350)

Code:

$signature = parse_signature($cur_post['signature']);

replace with:

Code:

if ($cur_post['g_id'] == 1 || $cur_post['g_id'] =2) 
            { //Mod or admin
                $signature = parse_admin_message($cur_post['signature'],true);
            }else
            {
                $signature = parse_signature($cur_post['signature']);
            }

Warning: Signatures for Admin and Mod are parsed like a message.

I tried that and it gave me a "Fatal error" hmm

Offline

 

#12 2007-02-22 21:32:44

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

Any chance of a decent error message? Just 'fatal error' can mean anything.


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#13 2007-02-22 21:40:37

guardian34
Member
Registered: 2006-06-03
Posts: 114

Re: Administrator / Moderator posts as HTML 1.0

p0Wer wrote:

Code:

if ($cur_post['g_id'] == 1 || $cur_post['g_id'] =2)

That doesn't look right.

Offline

 

#14 2007-02-22 21:46:05

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

guardian34 wrote:

p0Wer wrote:

Code:

if ($cur_post['g_id'] == 1 || $cur_post['g_id'] =2)

That doesn't look right.

neutral

Can you make it better for me? smile

Thanks

EDIT:

I installed the mod on this first post, works fine, and then I tried that html in signatures again, it doesn't give me an error... But the html code does nothing and just shows up in your sig as code hmm

Last edited by p0Wer (2007-02-22 21:54:47)

Offline

 

#15 2007-02-22 22:02:39

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

Code:

if ($cur_post['g_id'] == 1 || $cur_post['g_id'] == 2)

FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#16 2007-02-22 22:18:26

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Thanks elbekko, I'll try that now wink

EDIT:

Still no difference:

http://img501.imageshack.us/img501/151/errorlu0.jpg

Last edited by p0Wer (2007-02-22 22:23:09)

Offline

 

#17 2007-02-22 22:56:21

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

Are you sure the function parse_signature() exists?

Oh, and bumping threads is of no use.


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#18 2007-02-22 23:30:38

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Sorry I was just frustrated sad

What do you mean pasre_signature         ?

Elbekko can you go on IRC please?

Offline

 

#19 2007-02-22 23:34:01

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

It's a function that is called... check if it exists.


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#20 2007-02-22 23:35:17

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Where would I check it? (Sorry for the newbie questions)

Offline

 

#21 2007-02-22 23:37:00

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

In parser.php I'd say. As that's the only file affected...


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#22 2007-02-22 23:38:31

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Ok I'll have a look now,

In the meantime, elbekko, are you able to get online IRC?

Offline

 

#23 2007-02-22 23:39:09

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1353

Re: Administrator / Moderator posts as HTML 1.0

Not now, I'm off soon.


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#24 2007-02-22 23:40:05

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

Ok,

Here is the only line including parse signature:

function parse_signature($text)

Last edited by p0Wer (2007-02-22 23:40:29)

Offline

 

#25 2007-02-23 16:56:57

p0Wer
Member
Registered: 2006-09-23
Posts: 87

Re: Administrator / Moderator posts as HTML 1.0

So can anyone help me? (Sorry for double post)

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.