Announcement

Collapse
No announcement yet.

How do I change the Thread name length ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I change the Thread name length ?

    Hi
    I'm using this code to display the latest threads on my page.
    Code:
    <script type="text/javascript" src="http://fuzzy.phpwebhosting.com/~b4ne/apb/board/external.php?type=js"></script>
    
    <script type="text/javascript">
    
    <!--
    	for (var i = 0; i < threads.length; i++)
    	{
    		
    	    document.write('Board-Ticker:<br><img src="http://fuzzy.phpwebhosting.com/~b4ne/apb/images/boardticker/boardticker.png"><b><a class="dark" href="http://fuzzy.phpwebhosting.com/~b4ne/apb/board/showthread.php?t=' + threads[i]['threadid'] + '">' + threads[i]['title'] + '</a></b><br />');
    	}
    //-->
    </script>
    What do I? have to change that long threads get shortend like this:

    Excample: This is going to be a vetu long thread name
    TO: This is going to be a very...

    And what do I have to change so only 10 latest threads are displayed ?

    Many Thankd in advance

  • #2
    fixed it :
    Code:
    <script type="text/javascript" src="http://fuzzy.phpwebhosting.com/~b4ne/apb/board/external.php?type=js"></script>
    
    <script type="text/javascript">
    
    <!--
    var max = 40;
    if(threads.length < max) max = threads.length;
    for(i = 0; i < max; i++)
    { 
        if (threads[i].title.length > 50)
    { threads[i].title = threads[i].title.substring(0, 50) + '...'; }
            
    document.write('<img src="http://fuzzy.phpwebhosting.com/~b4ne/apb/images/boardticker/boardticker.png"><b><a class="dark" href="http://fuzzy.phpwebhosting.com/~b4ne/apb/board/showthread.php?t=' + threads[i]['threadid'] + '">' + threads[i]['title'] + '</a></b><br />');
        }
    //-->
    </script>

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X