Last 3 Posts Help

Started on the old forum in May 2008 · view the original in the archive · old links redirect here

7 replies · 637 views · started 18 years ago · 1 min read

Guest #1

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!

Guest #2

this is my code External image (may be gone)

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&sid=$sid&tid=$lpt[0]&go=last\">$tlnm</a>";
      $vulnk = "<a href=\"index.php?action=viewuser&sid=$sid&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&sid=$sid&tid=$lpt[0]&go=last\">$tlnm</a>";
      $vulnk = "<a href=\"index.php?action=viewuser&sid=$sid&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&sid=$sid&tid=$lpt[0]&go=last\">$tlnm</a>";
      $vulnk = "<a href=\"index.php?action=viewuser&sid=$sid&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
?>
Guest #3

double post, sorry =[

please delete.

Thanks, kwah

Guest #4

Any chance that you could use 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'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 =]

Guest #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't, most people simply won't bother.

Regards, Kwah

Guest #7

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

rukiya Lead · 569 posts #8

You made long and wrong code.its as short as

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>";
}

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close