Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How to remove HTML tags from thread preview (good for HTML-enabled forums especially) Details »»
How to remove HTML tags from thread preview (good for HTML-enabled forums especially)
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 02-09-2004 Last Update: Never Installs: 7
 
No support by the author.

Don't you just hate it when thread previews show HTMl tags even though browsers don't interprete those tags in popup menus? Well then this hack is just right for you!

This hack will remove all HTML tags such as <b>, <i>, <strong> and even closing tags like </b>, </i>, and </strong> so that they don't show up in the thread preview. It's genius they say!

Anyways here we go:

open up forumdisplay.php and find
PHP Code:
                eval('$threadbit .= "' fetch_template('threadbit') . '";'); 
Above, add

PHP Code:
                $thread[preview] = eregi_replace('(")','',strip_tags(unhtmlspecialchars($thread[preview]))); // solution #2 
If the above code doesn't show some thread previews properly, try the one below:
PHP Code:

                $thread
[preview] = eregi_replace('(&[a-z]+;|&lt;[a-zA-Z]+&gt;[a-zA-Z]+&lt;/[a-zA-Z]+&gt;)','',strip_tags($thread[preview])); 
All done

Show Your Support

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

Comments
  #12  
Old 02-11-2004, 06:21 PM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is this about, can't get the idaea...
Reply With Quote
  #13  
Old 03-23-2004, 12:51 PM
cybermomcafe cybermomcafe is offline
 
Join Date: Mar 2003
Location: Ohio
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to make this stop what is happening in the attached image...

What I was doing was using a replacement variable, {ebaylist} or {paypaldonate} for example to insert a preformatted paypal cart form or ebay listing into a post...

I don't care so much about the mouseover thread preview, just the "> that shows up by the thread title...

Thanks in advance!

Here's a link to the forum with the post I'm talking about... http://www.cybermomcafe.com/vb/forumdisplay.php?f=3
Reply With Quote
  #14  
Old 03-23-2004, 01:34 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cybermomcafe
Is there any way to make this stop what is happening in the attached image...

What I was doing was using a replacement variable, {ebaylist} or {paypaldonate} for example to insert a preformatted paypal cart form or ebay listing into a post...

I don't care so much about the mouseover thread preview, just the "> that shows up by the thread title...

Thanks in advance!

Here's a link to the forum with the post I'm talking about... http://www.cybermomcafe.com/vb/forumdisplay.php?f=3
I copied the code used in your post, and now there is nothing in the thread preview for me (which is a good thing, since you'd rather have nothing than broken stuff.)

Did you use the first replacement code I suggested in my instructions?
Reply With Quote
  #15  
Old 03-23-2004, 02:18 PM
cybermomcafe cybermomcafe is offline
 
Join Date: Mar 2003
Location: Ohio
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I tried both of them...

If I put the code straight into the post (enabling HTML on the forum, which I am trying to avoid) it doesn't add the "> above the thread title, but if I do it as a replacement variable it does...?

I turned on guest posting in that forum also...

I spose I could just turn on HTML LOL

I was using {ebaylisting} to be replaced with:

Code:
<script language="JavaScript" src="http://lapi.ebay.com/ws/eBayISAPI.dll?EKServer&ai=avm%7dz%7em.%26%28%26&bdrcolor=FFCC00&cid=0&endcolor=FF0000&endtime=y&fntcolor=000000&fs=0&hdrcolor=FFFFCC&img=y&num=25&numbid=y&popup=n&prvd=0&query=baby+clothing&siteid=0&sort=MetaEndSort&sortby=endtime&sortdir=asc&srchdesc=n&tlecolor=FFCE63&track=&width=570"></script>
Thanks for taking a look!
Reply With Quote
  #16  
Old 06-12-2004, 12:44 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work Gary_King. I've installed and it works apart from one thing. I have another hack that replaces <br> with <br />. How would I also exclude <br /> as well?
Reply With Quote
  #17  
Old 06-12-2004, 01:28 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Intex
Nice work Gary_King. I've installed and it works apart from one thing. I have another hack that replaces <br> with <br />. How would I also exclude <br /> as well?
You should remove that other hack, then, then see what the results are.
Reply With Quote
  #18  
Old 06-12-2004, 01:30 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That particular hack is pretty important to me and needs to stay. I want to use this hack as well, so if there is a way to specifically exclude <br /> that would be great, otherwise I'll have to remove this one- which I don't really want to do.
Reply With Quote
Reply


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 10:27 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.04619 seconds
  • Memory Usage 2,282KB
  • Queries Executed 22 (?)
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
  • (1)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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