The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
PHP +only output X number of words (or letters?)
Code:
function output_News($a = 5,$f = ""){ global $db, $Data, $vbulletin; // Define amount to show $Amount = ($a)? intval($a) : 5; // Define Forum To Pull From $Forum = ($f)? intval($f): ''; if(!$Forum){ RunError("No specified forum to pull news from."); } // Load Template $Template = 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)){ $Data .= ParseTemplate($Template, array( 'threadid' => $News['threadid'], 'threadname' => $News['title'], 'postuserid' => $News['postuserid'], 'postusername' => $News['postusername'], 'post' => $bbcode_parser->parse(unhtmlspecialchars($News['pagetext']), $f), 'comments' => vb_number_format($News['replycount']), ) ); } doOutput(); } Code:
'post' => $bbcode_parser->parse(unhtmlspecialchars($News['pagetext']), $f), __________________________________________________ ___ Figured it out, it was easier than I thought Code:
'post' => $bbcode_parser->parse(unhtmlspecialchars(substr($News['pagetext'], 0, 100)), $f), |
#2
|
|||
|
|||
I answered this in the vBExternal Threads.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|