Last 3 Posts Help

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

    Last 3 Posts Help

    I have last 3 posts and that i`m alone modified but it not working
    have some errors and no display correctly who is answer in topics

    i copy my code if anybody may to rewrite or give me your`s which you know to work!

    #2
    this is my code



    Code:
    echo "
    Poslednja 3.Posta:";
         echo "
    ================»
    ";
         $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;tid=$lpt[0]&amp;go=last\">$tlnm</a>";
          $vulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$tluid\">$tlnick</a>";
          echo "[size="1"]1: $tpclnk od: $vulnk[/size]
    ";
    
    
           $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 1,2"));
          $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 1, 2"));
    
            $tluid = $pinfo[0];
          }
          $tlnm = htmlspecialchars($lpt[1]);
          $tlnick = getnick_uid($tluid);
          $tpclnk = "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$lpt[0]&amp;go=last\">$tlnm</a>";
          $vulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$tluid\">$tlnick</a>";
          echo "[size="1"]2: $tpclnk od: $vulnk[/size]
    ";
    
           $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics ORDER BY lastpost DESC LIMIT 2,3"));
          $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 2, 3"));
    
            $tluid = $pinfo[0];
          }
          $tlnm = htmlspecialchars($lpt[1]);
          $tlnick = getnick_uid($tluid);
          $tpclnk = "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$lpt[0]&amp;go=last\">$tlnm</a>";
          $vulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$tluid\">$tlnick</a>";
          echo "[size="1"]3: $tpclnk od: $vulnk[/size]";
          echo "
    ================»
    ";
    //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
    ?>

    Comment


      #3
      double post, sorry =[

      please delete.


      Thanks,
      kwah

      Comment


        #4
        Any chance that you could use [code][/code] tags to post code, please? Thanks


        And I think it would be useful for you to post what you have done so far? That way, we can give you hints / teach you about where you made your mistakes =)

        I don&#39;t know about you, but to me, managing to fix your own code is more satisfying than copy pasting (and possibly tweaking) somebody elses code =]

        Regards,
        Kwah =]

        Comment


          #5
          is anybody know to help me about this

          Comment


            #6
            Please read my post. The one just above yours..

            We cannot help you unless you either:
            a) Tell us what script you are using so that we can look it up ourselves
            B) Post a copy of the script you are using / wanting to add to/modify

            Otherwise, all that anybody else can do is guess at what you want and hope that it helps you.

            For us to give you exactly what you want, you should tell us exactly what you want.
            a) If you want us to code it for you, tell us that you want us to code it for you
            B) If you want us to help you to fix/add-to your code, tell us that you want us to help fix/add-to your code, but please see a+B) above


            My apologies for the ranting, but if you want our help, you need to make it easy for us. If you don&#39;t, most people simply won&#39;t bother.

            Regards,
            Kwah

            Comment


              #7
              me need for my wml lavalair script....can anybody have last 3 post to work

              Comment


                #8
                You made long and wrong code.its as short as
                Code:
                else if($action=="last3")
                {
                
                  addonline(getuid_sid($sid),"Viewing Last 3 Posts","index.php?action=$action");
                    echo "<card id=\"main\" title=\"Last 3 Posts\">";
                    $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 , 3";
                   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&sid=$sid&tid=$item[2]&go=last\">$a</a>";
                      $d = "<a href=\"index.php?action=viewuser&sid=$sid&who=$item[1]\">$b</a>";
                      echo "[size="1"]$c By $d[/size]
                ";
                }
                
                echo "</p>";
                
                
                  echo "<p align=\"center\">";
                  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                echo "Home</a>";
                  echo "</p>";
                  echo "</card>";
                }

                Comment

                Working...
                X