Announcement

Collapse
No announcement yet.

RSS Feeds

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

  • #16
    Originally posted by dwjngs
    Ok, I've been trying to get this to work and it's making me nuts. Here's what I've got going:

    The javascript external thing is enabled via admin cp. I have a test page here http://www.bccymca.org/javaRSStest.htm with the following code:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]"> <html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>External JS Printing</title> </head> <body> <script type="text/javascript" src="<A href="http://www.bccymca.org/forums/external.php?type=js"></script">http://www.bccymca.org/forums/external.php?type=js"></script> <script type="text/javascript"> <!-- for (var i = 0; i < threads.length; i++) { document.write('<a href="[url="http://www.bccymca.org/forums/showthread.php?t='"]http://www.bccymca.org/forums/showthread.php?t='[/url] + threads[i]['threadid'] + '">' + threads[i]['title'] + '</a> <em>Posted on: ' + threads[i]['threaddate'] + ' by ' + threads[i]['threadtime'] + '</em><br />'); } //--> </script> </body> </html>
    When I call the page I get a blank. It loads alright, and takes a sec to do it, but nothing. I'm trying to insert forum info on the front page of the site, here: http://www.bccymca.org.

    I'm using XP SP2, IE latest version, FTPVoyager to upload. Any ideas?

    Thanks.
    Uncompress the code and it works. Alternatively, you can remove the comments.
    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

    Comment


    • #17
      Thanks, daemon.

      Comment


      • #18
        This information is available from external.php for JS embedding:

        threads[i]['threadid'] -- threadid
        threads[i]['title'] -- title of thread
        threads[i]['threaddate'] -- creation date of thread
        threads[i]['threadtime'] -- creation time of thread
        threads[i]['poster'] ? -- creator of thread

        I hope that vB3.5 adds, at a minimum:

        forumid, lastpostdate, lastposttime, lastposter, lastposttext, numposts, numreplies

        For a "latest news" type of thread list, do people really care when a topic was created?


        Thank God for http://www.vbulletin.org/forum/showthread.php?t=69834 but I don't know if it addresses the desires of JS functionality.
        Last edited by feldon23; Wed 8 Jun '05, 4:45pm.

        Comment


        • #19
          I use http://www.rss2js.com/ to convert the RSS feed from external.php to JavaScript to include in a standard HTML page.

          Hope this helps

          Chris.

          Comment


          • #20
            I couldn't mess with that RSS stuff, I just did a direct feed off the database...

            But for some reason its running really slow when I load the script, it probably takes 2-3 seconds to load the page...

            PHP Code:
            $result = mysql_query("SELECT * FROM vb3_thread WHERE forumid != 23 ORDER BY lastpost DESC LIMIT 0,10");


            while($r=mysql_fetch_array($result)){

            $threadid=$r["threadid"];
            $title=$r["title"];
            $postusername=$r["postusername"];
            $forumid=$r["forumid"];
            $replycount=$r["replycount"];
            $posterid=$r["postuserid"];
            $views=$r["views"];


            ?>
            <tr align="middle">
                        <td class="alt2" align="left"><a href="http://www.example.com/forums/showthread.php?t=<? echo $threadid?>"><? echo $title?></a></td>
                        <td class="alt1Active" id="f44" align="center"><? echo $replycount?></td>
                        <td class="alt2" noWrap width="32"><? echo $views?></td>
                        <td class="alt1"><a href="http://www.example.com/forums/member.php?u=<? echo $posterid ?>"><? echo $postusername?></a></td>
                    </tr>
            <?
            }
            ?>
            Is there something wrong with doing it this way?

            Thanks
            Steve

            Comment


            • #21
              No, there's nothing wrong with doing a direct query of the database. However code modifications cannot be discussed here; you'll need to go to vBulletin.org to do so.
              Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

              Comment


              • #22
                oh, sorry I wasn't aware of that, I was just tyring to input some of my ideas

                Comment


                • #23
                  Sorry to bump this up from the dead, but I need a bit of help. I'm currently using the following code to show the latest threads from my forum on my main site.

                  Code:
                  <script type="text/javascript" src="http://www.mysite.com/forum/external.php?type=js"></script>
                  
                  <script type="text/javascript">
                  <!--
                  CutOff = 16 // Number of maximum chars to cut off before adding '...'
                  
                  	function cutOffTitle(title)
                  	{
                  		if (title.length > CutOff)
                  		{
                  			title = title.substring(0, 16) + '..'
                  		}
                  		
                  		return title
                  	}
                  
                  	for (var i = 0; i < 7; i++)
                  	{
                  		document.write('<a href="http://www.mysite.com/forum/showthread.php?t=' + threads[i]['threadid'] + '">' + cutOffTitle(threads[i]['title']) + '</a><br />');
                  	}
                  //-->
                  </script>

                  My question is - what do I need to change/add to make the listings show the most recently updated threads? For example, if a thread is made, and then a week later somebody posts a new reply, it will show up in the list as the latest change to that thread. Because right now it merely shows the latest NEW threads.

                  Comment


                  • #24
                    Sorry to bump the thread again, but it's important!

                    Does anybody know how to change the above code like I asked?

                    Comment


                    • #25
                      bump again...

                      Comment


                      • #26
                        Please ask over at vbulletin.org for help with code modifications.
                        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                        Change CKEditor Colors to Match Style (for 4.1.4 and above)

                        Steve Machol Photography


                        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                        Comment


                        • #27
                          So it is my understand that if you use RSS you need to install a third party program just to decypher the code and get it to show on the site where as java can be done with no other program? Sorry but I'm just so confused?
                          Danny
                          My Site ---->www.montrealracing.com

                          Comment


                          • #28
                            Originally posted by DannyITR
                            So it is my understand that if you use RSS you need to install a third party program just to decypher the code and get it to show on the site where as java can be done with no other program? Sorry but I'm just so confused?
                            Yes, that's right. You will need a news reader such as CARP or similar running on the site.

                            That's why I had some code written that does this;


                            ... that allows any other site to display the last 'n' posts from my site, on theirs. Doesn't need any software on their site, just html placed wherever they want that module to appear.

                            Cool eh!
                            John

                            Comment


                            • #29
                              Originally posted by boske

                              But for some reason its running really slow when I load the script, it probably takes 2-3 seconds to load the page...
                              I use Javascript and I'm noticing the 2-3 second wait before the page loads too. Does the RSS option do this as well? Can you get around this with Java?
                              Danny
                              My Site ---->www.montrealracing.com

                              Comment


                              • #30
                                still lookting for solution to delay.
                                Danny
                                My Site ---->www.montrealracing.com

                                Comment

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