Your ultimate PunBB resource!
You are not logged in.
## ## ## 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. ## ##
Offline
All normal tags are working but the advanced tags (embed src, bgsound src etc) doesn't work...
Is that normal?
Offline
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
[sorry i'm french
]
some mods to allow html in preview message
#
#---------[ 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
###############
#
# 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
###############
#
# 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
$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
$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
to allow html in signatures.
in viewtopic.php search (l 350)
$signature = parse_signature($cur_post['signature']);
replace with:
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
$cur_post['g_id'] == 1 || $cur_post['g_id'] =2 could be replace by $cur_pos['g_id'] <= PUN_MOD
Offline
I understand this is for Administrator / Moderator's only but is there a way to enable it for trusted members?
Offline
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 13:46:15)
Offline
Hey is there someway I can allow html to be allowed for JUST for ADMINS and MODS in SIGNATURES?
Thanks ![]()
Last edited by p0Wer (2007-02-22 11:27:02)
Offline
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" ![]()
Offline
Any chance of a decent error message? Just 'fatal error' can mean anything.
Offline
p0Wer wrote:
Code:
if ($cur_post['g_id'] == 1 || $cur_post['g_id'] =2)
That doesn't look right.
Offline
guardian34 wrote:
p0Wer wrote:
Code:
if ($cur_post['g_id'] == 1 || $cur_post['g_id'] =2)That doesn't look right.
![]()
Can you make it better for me? ![]()
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 ![]()
Last edited by p0Wer (2007-02-22 12:54:47)
Offline
if ($cur_post['g_id'] == 1 || $cur_post['g_id'] == 2)
Offline
Thanks elbekko, I'll try that now ![]()
EDIT:
Still no difference:
Last edited by p0Wer (2007-02-22 13:23:09)
Offline
Are you sure the function parse_signature() exists?
Oh, and bumping threads is of no use.
Offline
Sorry I was just frustrated ![]()
What do you mean pasre_signature ?
Elbekko can you go on IRC please?
Offline
It's a function that is called... check if it exists.
Offline
Where would I check it? (Sorry for the newbie questions)
Offline
In parser.php I'd say. As that's the only file affected...
Offline
Ok I'll have a look now,
In the meantime, elbekko, are you able to get online IRC?
Offline
Ok,
Here is the only line including parse signature:
function parse_signature($text)
Last edited by p0Wer (2007-02-22 14:40:29)
Offline
So can anyone help me? (Sorry for double post)
Offline