HowTo Display Latest Active Threads on ANY normal HTML page ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paddy Murphy
    Member
    • Jun 2014
    • 33
    • 4.2.x

    [Forum] HowTo Display Latest Active Threads on ANY normal HTML page ?

    Hi,

    I'm trying to display 10 of my latest threads into a page on my website. Enable External Javascript is on. I put this code into a HTML block on a test page on my website.


    Code:
     
     [I][COLOR=#000080][FONT=inherit]<!-- show latest active threads -->[/FONT][/COLOR][/I] [COLOR=#008080][FONT=inherit]<table cellpadding=[COLOR=#0000FF][FONT=inherit]"6"[/FONT][/COLOR] cellspacing=[COLOR=#0000FF][FONT=inherit]"1"[/FONT][/COLOR] border=[COLOR=#0000FF][FONT=inherit]"0"[/FONT][/COLOR] width=[COLOR=#0000FF][FONT=inherit]"100%"[/FONT][/COLOR] align=[COLOR=#0000FF][FONT=inherit]"center"[/FONT][/COLOR]>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]<tbody>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]<tr>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]<td colspan=[COLOR=#0000FF][FONT=inherit]"2"[/FONT][/COLOR]>[/FONT][/COLOR] [COLOR=#008000][FONT=inherit]<a href=[COLOR=#0000FF][FONT=inherit]"search.php?do=getnew"[/FONT][/COLOR]>[/FONT][/COLOR]Latest Active Threads[COLOR=#008000][FONT=inherit]</a>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]</td>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]</tr>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]</tbody>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]<tbody>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]<tr>[/FONT][/COLOR]   [COLOR=#008080][FONT=inherit]<td width=[COLOR=#0000FF][FONT=inherit]"100%"[/FONT][/COLOR]>[/FONT][/COLOR]   [COLOR=#000080][FONT=inherit]<div>[/FONT][/COLOR] [COLOR=#800000][FONT=inherit]<script type=[COLOR=#0000FF][FONT=inherit]"text/javascript"[/FONT][/COLOR] src=[COLOR=#0000FF][FONT=inherit]"external.php?type=js"[/FONT][/COLOR]>[/FONT][/COLOR][COLOR=#800000][FONT=inherit]</script>[/FONT][/COLOR]  [COLOR=#800000][FONT=inherit]<script language=[COLOR=#0000FF][FONT=inherit]""[/FONT][/COLOR] type=[COLOR=#0000FF][FONT=inherit]"text/javascript"[/FONT][/COLOR]>[/FONT][/COLOR] [I][COLOR=#000080][FONT=inherit]<!-- for (var x in threads) { document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> (Posted By: "+threads[x].poster+")<br />"); } //-->[/FONT][/COLOR][/I] [COLOR=#800000][FONT=inherit]</script>[/FONT][/COLOR][COLOR=#000080][FONT=inherit]</div>[/FONT][/COLOR]   [COLOR=#008080][FONT=inherit]</td>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]</tr>[/FONT][/COLOR] [COLOR=#008080][FONT=inherit]</tbody>[/FONT][/COLOR] [I][COLOR=#000080][FONT=inherit]<!-- show latest active threads -->[/FONT][/COLOR][/I] [COLOR=#008080][FONT=inherit]</table>[/FONT][/COLOR] [COLOR=#000080][FONT=inherit]<br />[/FONT][/COLOR]
    But all that is displayed on the page is the subject, "Latest Active Threads" - page: http://www.norml.ie/test-page

    Could some please help with this please?

    Regards,

    Paddy
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2


    That file doesn't exist where you say it does. You need to link it to your vBulletin external.php file.



    Also, I'd personally drop the www. off infront of the forum url.

    Comment

    • Paddy Murphy
      Member
      • Jun 2014
      • 33
      • 4.2.x

      #3
      Originally posted by Zachery
      http://www.norml.ie/test-page/external.php?type=js

      That file doesn't exist where you say it does. You need to link it to your vBulletin external.php file.

      Hi Zachery,

      Not exactly sure what you mean by that comment? The test page is at - http://www.norml.ie/test-page

      My external js is here - http://www.forum.norml.ie/external.php?type=js


      Originally posted by Zachery
      http://www.forum.norml.ie/external.php?type=js

      Also, I'd personally drop the www. off infront of the forum url.
      Ok, how would I do that?

      Regards,

      Paddy

      Comment

      • Zachery
        Former vBulletin Support
        • Jul 2002
        • 59097

        #4
        Your example code, you are linking to src="external.php?type=js" and because of how the internet works, its looking in its current folder. You need to point it to the correct place.

        Comment

        • Paddy Murphy
          Member
          • Jun 2014
          • 33
          • 4.2.x

          #5
          Ah sorry I see what you mean now. I didn't realise this was suppose to be the file address, I got this code from another post in the vB3 forum.

          I have this working code now. I've decided for the moment anyway to just show the 5 latest threads - http://www.norml.ie/test-page

          But, one thing that I can't figure out is, under the 5 threads is "undefined" 6 times. Can you advise on how to removed that please?

          ####

          Edit

          Fixed it myself, thanks.
          Last edited by Paddy Murphy; Tue 6 Jan '15, 12:18pm.

          Comment

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