Last Post

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

    Last Post

    this is the last post mod by wappy<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?
    //LAST POST MOD BY WAPPY
    $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 0,1"));
    $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts"));
    if($nops[0]==0)
    {
    $pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM ibwf_topics"));
    $tluid = $pinfo[0];

    }else{
    $pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_posts ORDER BY dtpost DESC LIMIT 0, 1"));

    $tluid = $pinfo[0];
    }
    $tlnm = htmlspecialchars($lpt[1]);
    $tlnick = getnick_uid($tluid);
    $tpclnk = "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;t id=$lpt[0]&amp;go=last\">$tlnm</a>";
    $vulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$tluid\">$tlnick</a>";
    echo "

    Forum
    ultimo post: $tpclnk
    di: $vulnk
    ";
    //Removing the copyright line is NOT permited and will invalidate your license to use this modification and giving the owner (wappy) full rights to contact your host and have it removed without warning or notice. You may however remove this line and modify/update the mod/code. Make sure to read ALL documentation before installing this modification :-)
    //©2004-2006 wappyCULT
    //END OF LAST POST MOD
    ?></div>

    is it possible to change it this code for making show not only last post but LAST 5 o 10 POSTS ?..
    sigpicthe italian/international COMMUNITY of friendship
    http://people2000.netne.net
    WAP/WEB
    peoplemailbox@katamail.com

    #2
    $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 0,5"));

    Comment


      #3
      $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 0,10"));

      do it..but it shows always 1..
      i have changed also


      $pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_posts ORDER BY dtpost DESC LIMIT 0, 1"));

      $tlnm = htmlspecialchars($lpt[1]);

      into:

      $pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_posts ORDER BY dtpost DESC LIMIT 0, 10"));

      $tlnm = htmlspecialchars($lpt[10]);

      but don&#39;t works..
      sigpicthe italian/international COMMUNITY of friendship
      http://people2000.netne.net
      WAP/WEB
      peoplemailbox@katamail.com

      Comment


        #4
        in arrays $lpt[0] will be id
        $lpt[1] will be name

        there is no such thing as $lpt[10]

        and then end number is the number of items you would like to show eg. DESC LIMIT 0, 10
        will shw the last 10 items in database

        Comment


          #5
          <div class='quotetop'>QUOTE (something else @ Dec 7 2008, 06:39 PM) <{POST_SNAPBACK}></div>
          in arrays $lpt[0] will be id
          $lpt[1] will be name

          there is no such thing as $lpt[10]

          and then end number is the number of items you would like to show eg. DESC LIMIT 0, 10
          will shw the last 10 items in database [/b]
          okay.. now i&#39;ve done only the change you told me:
          $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 0,5"));

          it must show last 5 posts ..right?.. only in teory..
          &#39;cause after all it show always the ONLY ONE last post..
          sigpicthe italian/international COMMUNITY of friendship
          http://people2000.netne.net
          WAP/WEB
          peoplemailbox@katamail.com

          Comment


            #6
            <div class='quotetop'>QUOTE (honkytonkman @ Dec 7 2008, 06:51 PM) <{POST_SNAPBACK}></div>
            okay.. now i&#39;ve done only the change you told me:
            $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 0,5"));

            it must show last 5 posts ..right?.. only in teory..
            &#39;cause after all it show always the ONLY ONE last post..
            [/b]
            Code:
             else if($action=="last15")
              {
               addonline(getuid_sid($sid),"looking last 15 posts list","");
                 echo "<card id=\"main\" title=\"Last 15 posts\" ontimer=\"index.php?action=last15&amp;sid=$sid\">";
                 echo "<timer value=\"100\"/>";
                   $sql = "SELECT a.name, b.uid, b.tid
                   FROM ibwf_topics a
                   INNER JOIN ibwf_posts b ON a.id = b.tid
                   ORDER BY b.id DESC
                   LIMIT 0 , 15";
                 echo "
            
            ";
                   $items = mysql_query($sql);
                 echo mysql_error();
                   while ($item = mysql_fetch_array($items))
                   {
                    $a = htmlspecialchars($item[0]);
                    $b = getnick_uid($item[1]);
                    $c = "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$item[2]&amp;go=last\">$a</a>";
                    $d = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[1]\">$b</a>";
                 echo "$c Od $d
            ";
                   }
                 echo "</p>";
                 echo "<p align=\"center\">";
                 echo "<img src=\"images/home.gif\" alt=\"\"/><a href=\"index.php?action=main&amp;sid=$sid\">Home</a>";
                 echo "</p>";
                 echo "</card>";
             }
            usage
            Code:
            echo "<a href=\"index.php?action=last15&amp;sid=$sid\">Last 15 posts</a>
            ";
            done with autorefreshing
            if you want to change to only 10 last posts(or other)
            then change line
            Code:
            LIMIT 0 , 15";
            to whatever you want
            It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
            ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
            ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
            キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

            Comment


              #7
              thanks buddy!
              sigpicthe italian/international COMMUNITY of friendship
              http://people2000.netne.net
              WAP/WEB
              peoplemailbox@katamail.com

              Comment


                #8
                <div class='quotetop'>QUOTE (honkytonkman @ Dec 8 2008, 01:02 PM) <{POST_SNAPBACK}></div>
                thanks buddy! [/b]
                only a little trouble..code works very well but the timer is in wml..
                i use a xhtml version of wapdesire..
                i will try to recode timer in xhtml..i could do it
                sigpicthe italian/international COMMUNITY of friendship
                http://people2000.netne.net
                WAP/WEB
                peoplemailbox@katamail.com

                Comment


                  #9
                  thank you very much metulj

                  WapCHAT Forum Currenltly changing over to xhtml

                  My Dowloads Site

                  Comment


                    #10
                    Originally posted by Dj-marc View Post
                    thank you very much metulj
                    stop posting ''THANKS'' replies!
                    use THANKS button instead:mad:
                    It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
                    ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
                    ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
                    キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

                    Comment


                      #11
                      Nice it works.. Thanks

                      Comment

                      Working...
                      X