Announcement

Collapse
No announcement yet.

[RELEASE v2] Last XX Posts on non-vB page

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

  • #76
    Nice hack tubedogg, it fit right in with what I was needing. Here is how I used it.
    Last edited by wajones; Sat 5 May '01, 10:31pm.

    Comment


    • #77
      looks good, wajones!

      Comment


      • #78
        Thought I'd share this, a few of my users wanted to include tubedogg's last10 hack on a vbulletin page and this is what I came up with...

        In a copy of the last10.php script comment out or delete the following

        require("$path/config.php");
        $db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
        mysql_select_db($dbname) or die("Can't select database");

        now add this to the phpinclude template

        ob_start();
        include_once("./last10.php");
        $last10 = ob_get_contents();
        ob_end_clean();

        Then I was able to add $last10 into any vbulletin template to display the last10 table. Saved a lot of work trying to create templates and changing his code, plus if he changes it, it's simple to upgrade.

        Comment


        • #79
          very cool idea. thanks, wajones!

          Comment


          • #80
            tubedogg

            any plans to add javascript, so that last posts can be shown in remote sites without actually accessing mysql.? I think it will be very useful for many ppl.

            Comment


            • #81
              Originally posted by tubedogg
              very cool idea. thanks, wajones!
              I like this better...
              Create another copy of the last10.php named thelatest.php so you can set different param's.
              Create a new forum and name it 'The latest posts" or what ever set it to "act as forum = no and open for posts = no" now put this into the phpinclude in place of what I told you before... $forumid being that forum you created

              ob_start();
              if ($forumid==34){
              include_once("./thelatest.php");
              $thisweek= ob_get_contents();
              }else{
              include_once("./last10.php");
              $last10 = ob_get_contents();
              }
              ob_end_clean();


              Now in the forumdisplay template find...

              $forumdisplay[forumslist]

              then right above it put $thisweek

              Now the last10 or $thisweek in this case will show as a forum and be in the jumpforum box for quick access

              Let me know if you see any conflicts....

              Comment


              • #82
                this is wierd....

                I am having a problem with the topic icons. The hack is posting the wrong ones!

                I don't know how to explain it, check out:

                http://www.juniorsailing.com/

                I have the hack on the very bottom of the page. Look at the icons, then click on the forum name and look in the thread list...the icon is different?!?!

                Comment


                • #83
                  Topic Starter

                  How do we show the topic starter for each thread?
                  .

                  Comment


                  • #84
                    I think it's better to remove the "&goto=newpost" part for the thread url. Think it's better for the reader to start from the first post.
                    .

                    Comment


                    • #85
                      If it's the first time you connect, you go to the first post anyway (last post for you is the first post of the thread).

                      Comment


                      • #86
                        i have a question. When $showforumtitle = "1" in the last10config.php, and at the same time $includeforums = "3,4", it displays "can't select info".

                        If I leave $showforumtitle = "0" or $excludeforums and $includeforums blank, everything ok. Any idea?

                        Another request: if i want to display the threads starter, threads start time (can be ordered by this?) and the massege of the threads' first post, would you plaese add these variables into your hack?

                        Thanks again for the great hack.

                        Comment


                        • #87
                          bbqfan: Do me a favor and download the zip file from the first post again. I have added mysql_error() so it will give the exact error. Run that and then let me know what exactly the error is. ("Can't select info" is a generic error I put in there when I first wrote it and never changed it.)

                          I'll look into those requests.

                          Comment


                          • #88
                            Re: this is wierd....

                            Originally posted by Snoozy
                            I have the hack on the very bottom of the page. Look at the icons, then click on the forum name and look in the thread list...the icon is different?!?!
                            It appears to be displaying the icon minus one. So for example, if the icon's file name is icon18.gif, it is showing icon17.gif. I don't know why this is and I'm looking into it.

                            Edit: I just realized what the problem is and I'll post a fix in a minute.

                            Comment


                            • #89
                              Here's a fix for the problem in the previous post.

                              In last10.php, find
                              Code:
                              		if ($postii != "0" && $postii != "") {
                              and right below it, add
                              Code:
                              			$postii = $postii+1;
                              Then find
                              Code:
                              		if (($postii == "0" || $postii == "") && $threads[iconid] != "0" && $threads[iconid] != "") {
                              and right below it, add
                              Code:
                              			$threads[iconid] = $threads[iconid]+1;
                              Or you can just download the updated zip file in the first post in this thread, and reupload last10.php (no need to reupload last10config.php).

                              Comment


                              • #90
                                tubedogg,

                                this time it display:

                                MySQL reported this error while trying to retreive the info: Column: 'forumid' in where clause is ambiguous

                                Comment

                                Related Topics

                                Collapse

                                Working...
                                X