vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Problem with BBcode Removal (https://vborg.vbsupport.ru/showthread.php?t=133243)

SS9267547 12-04-2006 11:22 PM

Problem with BBcode Removal
 
I was hoping someone could shed some light on a problem I'm having with my glossary script I'm working on. Now the problem is that I have information being accessed from a function and once that information is accessed and found it is to display the results in the script itself. Now the results is not to show any bbcode, html, quotes, etc. This is the code I want to use in the function.

PHP Code:

$glossarydescription htmlspecialchars_uni(strip_bbcode(fetch_trimmed_title(strip_quotes($foundterms['glossarydescription']), 100), falsetrue)); 

Now the result is that only half the bbcode is removed, for example the formatting tags like '[b]' but none of the tags like '[php], [code]', etc as well as smiles are removed. I've also tried it like this too.

PHP Code:

$glossarydescription strip_tags($foundterms['glossarydescription']); 
$glossarydescription strip_bbcode($foundterms['glossarydescription'], falsetrue);
$glossarydescription strip_strip_quotes($foundterms['glossarydescription']); 

However again only half the bbcodes and quotes are removed. Everything else still loads. Any ideas that someone might have on the issue?

SS9267547 12-07-2006 01:13 AM

So no one here at all has a clue? Ah I need to learn some better programming haha.

StarBuG 12-11-2006 06:20 AM

Come on, help this man.

We are all eagerly awaiting the new version of his hack. ;)

It is this one by the way: https://vborg.vbsupport.ru/showthread.php?p=1136110

StarBuG

RS_Jelle 12-12-2006 12:34 PM

To strip BBCode you need to include /includes/functions.php in your script, I think you are forgetting that :)

The options of the function:
PHP Code:

$stripped strip_bbcode($oldcode$stripquotes false$fast_and_dirty false$showlinks false); 

Don't set fast_and_dirty to true, that's not a very good thing (everyting with [x] [/x] is stripped).

SS9267547 12-13-2006 03:37 AM

StarBuG: There will be no update ever again! ;)

RS_Jelle: Thanks for the reply on the issue however it dosn't help to much. See normally I'm able to strip info, I know how to do this however in the function where I want it there is a werid problem. The result it shows is only half the bbcode being removed, for example the formatting tags like '[b]' but none of the tags like '[php], [code]', etc and even smiles aren't removed. This is the issue at hand, so I think I will need to figure something else to try. :tired:

timetunnel 12-15-2006 09:10 PM

Hello.

Is there a central location e.g. 'class_bbcode.php' or hook whereby a particular tag (custom or otherwise) and its contents can be stripped globally (across all features e.g. calendar, forums, pm, signatures, etc.)? If so, how?

Thanks in advance.

SS9267547 12-15-2006 10:38 PM

Well I'm not sure what you want to strip, but the code used to srtip bbcode is in the 'functions.php' file under 'function strip_bbcode'. There are also other 'strip' commands in this file.

timetunnel 12-15-2006 11:21 PM

Thanks for your reply.

I want to create a custom tag but only want to use it under varying conditions. For example, it may be by usergroup or after a member reaches a certain number of posts, etc.

If I knew 1 location where I can 'unset' that custom tag from the $tag_list array based on one or both conditions previously mentioned, or find that function that nearly all message code regardless of the application (forum, pm, etc.) and strip out that custom tag, then that would be a great help.

Thanks again, in advance.

EDIT: Answer: http://www.vbulletin.com/forum/showthread.php?t=152002

RS_Jelle 12-20-2006 12:20 PM

Quote:

Originally Posted by SS9267547 (Post 1137534)
RS_Jelle: Thanks for the reply on the issue however it dosn't help to much. See normally I'm able to strip info, I know how to do this however in the function where I want it there is a werid problem. The result it shows is only half the bbcode being removed, for example the formatting tags like '[b]' but none of the tags like '[php], [code]', etc and even smiles aren't removed. This is the issue at hand, so I think I will need to figure something else to try. :tired:

I always want to take a look at it on my test site if you send me the files, there should be something else, cause it should work fine normally :)

StarBuG 12-21-2006 05:39 PM

I have talked to Andreas, a vBulletin developer.

He said you should try:

Code:

$glossarydescription = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($foundterms['glossarydescription'], true), 100);
(No warranty)

I also send this as PM to you but got no response ;)

Greetings

StarBuG


All times are GMT. The time now is 08:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01263 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete