Announcement

Collapse
No announcement yet.

how to use javascript content syndication ?

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

  • how to use javascript content syndication ?

    How do I use the javascript content syndication provider ? I'd like to know how to format the information to use it on a html page.
    The documantation only tells you how to swith it on !! Some example code for non-programmers would be useful.

    I'm trying to use it to post latest threads with hotlinks on a non vbulletin page.
    This is a really basic request ! I've tried using the "last X threads" hack by Robinhood with no success and nobody seems to be supporting the hack

    help .!!?............

  • #2
    A working example of JavaScript syndication can be found in my post here: Just replace the URLs of my site with the ones for your site.
    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

    Comment


    • #3
      I was JUST coming over to ask this specific question. I need JSS for Dummies.


      Specifically, I only want to place the info from a specific thread on another site, and I'd like to have it fit in a [relatively] small space. Is there a way to limit the number of posts that appear, and to specify a forum?

      (again...'for dummies' please...)

      Comment


      • #4
        Many Thanks Daemon


        THat was a big help
        In the mean time I came across a couple of scripts, including one from a phpBB mod. I hacked them together and came up with this:

        <TABLE ALIGN=CENTER cellSpacing=0 cellPadding=2 bgColor=#ffcc00 border=0>
        <tr>
        <td colspan=3 align=center>
        <span class="blk"><b> latest threads in forum:</b></span><br/></td></tr>
        <script type="text/javascript" src="<A href="http://www.mydomain.com/forums/external.php?forumids=2,5&type=js"></script">http://www.mydomain.com/forums/external.php?forumids=2,5&type=js"></script>
        <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 > 40)
        { threads[i].title = threads[i].title.substring(0, 40) + '...'; }
        document.writeln("<tr><td><a href=\"http://www.mydomain.com/forums/showthread.php?t=" + threads[i].threadid + "\" class=\"menu2\"
        target=\"_blank\"> <img src=\"http://www.mydomain.com/forums/images/buttons/lastpost.gif\" alt=\"View latest post\" title=\"View latest post\"
        border=\"0\" hspace=\"4\" />" + threads[i].title + "</a> </td><td><span class=\"blk\"> (by " + threads[i].poster + ")</span></td><td><span
        class=\"blk\">" + threads[i].threaddate + "</span> </td></tr>");

        }
        //-->
        </script>

        </TABLE>


        Hope someone else can make use of it too. You just need to insert the table into any external HTML page.

        1. First of all you need to turn on the external data provider in the vbulletin CP Admin (vBulletin Options > vBulletin Options > External Data
        Provider > Enable External Javascript > Yes)
        2. Change www.mydomain.com/forums/ to suit your needs
        3. The maximum number of threads to be posted can be modified by changing this:
        var max = 10;
        Same goes for the length of characters currently set to 40. See "length > 40" and "substring(0, 40)" settings.
        4. The forum ids can be edited to suit your needs or if you don't want the script to point to specific forums then find & delete this:
        forumids=2,5
        5. I'm using css classes to style the text. TO REMOVE CSS CLASS FIND AND DELETE THE FOLLOWING class=\"menu2\" AND <span class=\"blk\">
        6. I'm also using a lastpost image in front of the hyperlink title. TO REMOVE THIS IMAGE FIND AND DELETE THE FOLLOWING <img
        src=\"http://www.mydomain.com/forum/templates/mydomain/images/icon_latest_reply.gif\" alt=\"View latest post\" title=\"View latest post\"
        border=\"0\" />
        You might also want to change the target=\"_blank\" target to suit your needs.

        Well there you go - maybe someone else will be able to put this to good use too.
        Good luck & thanks

        Comment


        • #5
          Thank you!

          Comment

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