Sorry about that - there should be a '0' instead of '1' in the substr call:
Code:
<script type="text/javascript" src="http://localhost/forum4/external.php?type=js"></script>
<script type="text/javascript">
<!--
var maxlen = 30;
for (var i = 0; i < threads.length; i++)
{
var title = (threads[i]['title'].length > maxlen ? threads[i]['title'].substr(0, maxlen - 3) + "..." : threads[i]['title']);
document.write ('<a href="http://www.My-Site.net/forum/showthread.php?t=' + threads[i]['threadid'] + '"> <span style="color:#FFFF00"> ' + ' <img src="images/star.png" alt="star icon"/> ' + title + ' </span> </a> <em>Posted by: ' + threads[i]['poster'] + '</em><br />');
}
//-->
</script>
Quote:
Also how to make it output the first 200 characters of a thread ?
Is there a online document with all the "threads[i]['poster']" things ? Cause the one from vBulletin lacks a LOT of information...
|
I just look at the external.php file to see what it's doing. In the case of a javascript output it only provides threadid, title, poster, date, time. You could probably modify external.php to provide more (I don't think it can be done with plugins, you'd havew to edit the file. In any case, the JS output section is around line 403.