Thread: vBExternal v1.6
View Single Post
  #349  
Old 07-27-2006, 05:06 PM
NeilFawcett NeilFawcett is offline
 
Join Date: Mar 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by chrisjp88
BTW. The maker of this mod hasn't posted since January, 7 months ago. I'm guessing he doesn't have an interest in vb anymore.



I've been spending ages looking at all the files it uses, and can't find anywhere where it says to NOT use QUOTE tags.

The thing is it's such a HUGE flaw. So many news articles contain quotes, it's a must have. Does anybody know of a smilar script without such a flaw?
Quote:
Originally Posted by got haggis?
i have the same problem..also using 3.5.4

edit: duh, one page back (23) there is the answer that solved this.

Now, where can i modify <fieldset> so it doesn't span across the entire page.

Well, the problem is basically that the standard code that calls the BBCode parser and this will handle all the standard tags, but not some of the ones that require a template definitions for a forum. These include QUOTE and CODE.

To be honest this makes sense, as the template you probably use on your forum probably will not match the one you will use on your news page.


What I did was to simply process QUOTE tages (I'm not interested in CODE) ones prior to the BBCode parser call. Viola!


Here's my modified code (Due to BBCodes on these forums cocking stuff up I've changed the stuff below so QUOTE=ETOUQ)

Code:
// Load Template
$NewsTemplate = LoadTemplate("news.html");

// Collect Data
$NewestNews = $db->query("
	select t.*,p.pagetext
	from ".TABLE_PREFIX."thread t
	left join ".TABLE_PREFIX."post p on(p.postid=t.firstpostid)
	where t.forumid = $Forum
	order by dateline desc
	limit 0,$Amount");

$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

while($News = $db->fetch_array($NewestNews)){
	$neils_text = $News['pagetext'];

	// Convert QUOTE tag
	$convert_from = array("[ETOUQ]", "[/ETOUQ]",);
	$convert_to = array("<DIV CLASS=news-quote>", "</DIV>");
	$neils_text = str_replace($convert_from, $convert_to, $neils_text);

	// Convert BBCodes
	$neils_text = $bbcode_parser->do_parse(unhtmlspecialchars($neils_text), true, true, true); 

	$Data .= ParseTemplate($NewsTemplate,
		array(
		'threadid'	=> $News['threadid'],
		'threadname'	=> $News['title'],
		'postusername'	=> $News['postusername'],
		'post'         	=> $neils_text,
		'comments'	=> vb_number_format($News['replycount']),
		'postdate' 	=> date( "l j-M-Y", $News['dateline']),
		)
	);
}
This isn't all my code - I've also put in stuff so I can ignore a thread, and also put a "more break" in so you could post a 10 page story, but put in a "more break" about 12 lines in, so the news page only displays upto that point. I'm also doing an "all news stories" thing as well...

For all my posting no one really helped me, so I hope this helps you!

ps: If you don't want to allow HTML conversion, then I guess you could disable that in the do_parse call, and instead replace the QUOTE tags with something else prior to the do_parse call, and then replace them again back to the HTML format afterwards... Just as long as you don't leave the QUOTE tags in there in their standard BBCode form before the do_parse call you'll be fine
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01190 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete