The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Need a little code
I'm using this code to display forum thread titles on a custom vb page:
<script type="text/javascript" src="external.php?forumids=111,112,113,114,115,133 ,148,154&type=js"></script> <script language="" type="text/javascript"> <!-- for (x = 0; x < 3; x++) { document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"\">"); document.writeln("<b>"+threads[x].title+"</b><br />"); document.writeln("</a>"); document.writeln("Posted "+threads[x].threaddate+" at "+threads[x].threadtime+" by "+threads[x].poster+"<br />"); } //--> </script> I'm trying to figure out how to limit the number of characters that are displayed in the title. document.writeln("<b>"+threads[x].title+"</b><br />"); I tried inserting this code inside the javascript but I can't seem to get it to work <?php $len = 30; if (strlen($thread['title']) > $len) { $thread['title'] = substr($thread['title'],0,$len); $thread['title'] .= "..."; } else { $thread['title'] = $thread['title']; } ?> Ideally I would like to limit the character length of threads.title and append a ... when it gets cut off. Any coders out there have a solution for me? Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|