Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Parsing html for certain members Details »»
Parsing html for certain members
Version: , by Boofo Boofo is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-06-2003 Last Update: Never Installs: 0
 
No support by the author.

When a member is replying to a message, the threadbitlist lists out below the replybox with all the posts from that thread. I want to be able to have it parse any html code that is in those message ONLY from the Admins and Supermods who the message belong to. If an Admin or Supermod wrote a message with html, I want to parse the html code so anyone reading it will see it like it should be. But not on anyone else's messages. Does this make any sense?

Here is the code I am using so far and it doesn't quite work right, for some reason. Anyone have any idea what I am doing wrong?

PHP Code:
    if ($post[usergroupid]==OR $post[usergroupid]==5) {
    
$reviewmessage bbcodeparse2($post[pagetext],1,1,1,1);
    } else {
    
$reviewmessage bbcodeparse($post[pagetext],$threadinfo[forumid],$post[allowsmilie]);
    } 
And it isn't a security risk doing this, is it? Only Admins and Mods are allowed to use html on the site. No one else.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-06-2003, 11:30 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's ok and no security risk, but you have forgotten, that messages are preparsed also, so you have to edit newreply as well
Reply With Quote
  #3  
Old 03-06-2003, 12:00 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where would I out that in the newreply.php to parse the threadlisting below the replybox? And will that code work ok? I have been trying to find the place to put it but can't seem to get it to take.
Reply With Quote
  #4  
Old 03-06-2003, 12:07 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
    $title=censortext($title);
    
$message=censortext($message); 
censortext calls bbcodepars at least it did last time
Reply With Quote
  #5  
Old 03-06-2003, 12:17 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It didn't work there. Any other ideas?
Reply With Quote
  #6  
Old 03-06-2003, 01:03 PM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Boofo!!
I have this goodie installed by Logician and it works like a charm. Its not the same that you want, but maybe it helps you... [Link]
Reply With Quote
  #7  
Old 03-06-2003, 01:38 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using the hack that only allows Admins and Supermods to use html and no one else. All I'm trying to do is get it to parse the html in the threadreview (the listing of messages below the newreply box when you are replying) for only those messages that belong to the Admins and Supermods. Everyone else's messages I want it to show the actual code and not parse it. And I'm close but not having very much luck.
Reply With Quote
  #8  
Old 03-06-2003, 02:59 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh sorry, i missread something

you have to edit this part:
PHP Code:
$posts=$DB_site->query("
        SELECT IF(post.userid=0,post.username,user.username) AS username,
        post.pagetext,post.allowsmilie,post.userid FROM post
        LEFT JOIN user ON user.userid=post.userid
        WHERE post.visible=1 AND post.threadid='
$threadid'
        ORDER BY dateline DESC LIMIT " 
. ($maxposts+1)); // return +1 so that check later will still work

  
$threadreviewbits '';
  while (
$post=$DB_site->fetch_array($posts)) {
    if (
$postcounter++ < $maxposts) {
            if (
$postcounter%== 0) {
                
$backcolor "{firstaltcolor}";
                
$post[bgclass] = "alt1";
            } else {
                
$backcolor "{secondaltcolor}";
                
$post[bgclass] = "alt2";
            }
            
$username=$post[username];
            if (
$ignore[$post[userid]]) {
                
$reviewmessage $ignoreduser;
            } else {
                
$reviewmessage bbcodeparse($post[pagetext],$threadinfo[forumid],$post[allowsmilie]);
            }
            eval(
"\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
        } else {
            break;
        }
  } 
andd the usergroupid to the query at first and then make your ifclause
Reply With Quote
  #9  
Old 03-06-2003, 03:08 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's what I have for that piece of code.

PHP Code:
  $posts=$DB_site->query("
        SELECT IF(post.userid=0,post.username,user.username) AS username,
        post.pagetext,post.allowsmilie,post.userid FROM post
        LEFT JOIN user ON user.userid=post.userid
        WHERE "
.iif($bbuserinfo[usergroupid]==or $bbuserinfo[usergroupid]==or $bbuserinfo[usergroupid]==7,"","post.visible=1 AND ")."post.threadid='$threadid'
        ORDER BY dateline DESC LIMIT " 
. ($maxposts+1)); // return +1 so that check later will still work

  
$threadreviewbits '';
  while (
$post=$DB_site->fetch_array($posts)) {
    if (
$postcounter++ < $maxposts) {
            if (
$postcounter%== 0) {
                
$backcolor "{firstaltcolor}";
                
$post[bgclass] = "alt1";
            } else {
                
$backcolor "{secondaltcolor}";
                
$post[bgclass] = "alt2";
            }
            
$username=$post[username];
            if (
$ignore[$post[userid]]) {
                
$reviewmessage $ignoreduser;
            } else {
                
$reviewmessage bbcodeparse($post[pagetext],$threadinfo[forumid],$post[allowsmilie]);
            }

    if (
$post[usergroupid]==OR $post[usergroupid]==5) {
    
$reviewmessage bbcodeparse2($post[pagetext],1,1,1,1);
    } else {
    
$reviewmessage bbcodeparse($post[pagetext],$threadinfo[forumid],$post[allowsmilie]);
    }

            eval(
"\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
        } else {
            break;
        }
  } 
How would I add it?
Reply With Quote
  #10  
Old 03-06-2003, 03:10 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

change this line:
PHP Code:
post.pagetext,post.allowsmilie,post.userid FROM post 
into this:
PHP Code:
post.pagetext,post.allowsmilie,post.userid,user.usergroupid FROM post 
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05066 seconds
  • Memory Usage 2,329KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete