Announcement

Collapse
No announcement yet.

Display latest threads externally

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

  • Display latest threads externally

    Hello!



    This is a very helpful forum I see, I always search and find the answers I need. But this time I've encountered on a problem.

    I am using a code I found on this forum to display the 10 latest threads on a external .htm file. (http://www.vbulletin.com/forum/showt...t=latest+posts)

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Test vBulletin 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <script type="text/javascript" src="http://www.opensc.ws/forums/external.php?type=js&amp;forumids=3"></script>
    <b>Last 10 Threads :</b><br><table width="20%">
    <script type="text/javascript">
    <!--
    var max = 10;
    if(threads.length < max) 
    max = threads.length;
    for(i = 0; i < max; i++)
    { 
    
    if (threads[i].title.length > 20)
    { threads[i].title = threads[i].title.substring(0, 20) + '...'; }
    document.writeln("<tr><td colspan=2 height=18><span class=smallfont><b><a href=\"http://www.opensc.ws/forums/showthread.php?threadid="+threads[i].threadid+"\">"+threads[i].title+"</i><br /></span></td></tr>");
    
    }
    //-->
    </script>
    
    </body>
    </html>

    Now lets head over to the actual problem.
    The code works fine when you have forumids=3. That will get the 10 latest threads from sub-forum (#3). But what I want is to get 10 latest threads from the whole forum, not just the one sub-forum.
    So the forumid for the whole forum is 1. so I tried with forumids=1, but it give s me a blank page.

    Forum id 3 -->http://www.opensc.ws/test2.htm
    Forum id 1 -->http://www.opensc.ws/test.htm

  • #2
    You want to pull threads from a parent forum such that the parent's children are automatically included? You would need to specify the forumids of the children.

    Comment


    • #3
      http://www.opensc.ws/forums/

      yes exactly that I want.
      Where in the code should i specify the child forum ids. There is only space for one.

      forumids=2,3,4,6,7,8,10,11
      like that?

      Comment


      • #4
        I don't know.

        I will ask the others.

        Comment


        • #5
          Originally posted by heyboy
          forumids=2,3,4,6,7,8,10,11
          like that?
          I am told that is correct.

          Comment


          • #6
            Oh hehe... it worked.
            Thank you!!

            Comment


            • #7
              How to set it to fetch 20 latest threads?
              .

              Comment


              • #8
                I don't know exactly. This thread contains a few links to examples and documention on the RSS feature.

                Comment


                • #9
                  Dont works for me, my firefox not show anything and internet explorer show this error:

                  'threads' is undefined

                  Anyone can help-me ?

                  Comment

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