Last Post

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

10 replies · 994 views · started 17 years ago · 1 min read

5 participants
honkytonkman Senior · 252 posts #1

this is the last post mod by wappyCODE<? //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;tid=$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 ?>

is it possible to change it this code for making show not only last post but LAST 5 o 10 POSTS ?..

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

something else Fellow · 2,296 posts #2

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

honkytonkman Senior · 252 posts #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't works..

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

something else Fellow · 2,296 posts #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 🙂

honkytonkman Senior · 252 posts #5

QUOTE (something else @ Dec 7 2008, 06:39 PM) <{POST_SNAPBACK}>

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 :)

okay.. now i'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.. 'cause after all it show always the ONLY ONE last post.. 😛

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

metulj Super moderator Principal · 1,726 posts #6

QUOTE (honkytonkman @ Dec 7 2008, 06:51 PM) <{POST_SNAPBACK}>

okay.. now i'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.. 'cause after all it show always the ONLY ONE last post.. 😛

 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&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&sid=$sid&tid=$item[2]&go=last\">$a</a>";
        $d = "<a href=\"index.php?action=viewuser&sid=$sid&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&sid=$sid\">Home</a>";
     echo "</p>";
     echo "</card>";
 }

usage

echo "<a href=\"index.php?action=last15&sid=$sid\">Last 15 posts</a>
";

done with autorefreshing if you want to change to only 10 last posts(or other) then change line

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ノ刀ノイリ!

metulj Super moderator Principal · 1,726 posts #10

Dj-marc wrote: thank you very much metulj

stop posting ''THANKS'' replies! use THANKS button instead😠

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ノ刀ノイリ!

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