3 shouts in main page (waplive)

Started on the old forum in October 2009 · view the original in the archive · old links redirect here

#shouts-in-main-page

No replies · 604 views · started 17 years ago · 1 min read

rap-4ever Developer · 180 posts #1

just add this in index.php?action=main

echo "<table border="0" width="99%" cellspacing="0" cellpadding="0" class="boxed" align="center">"; echo "<tr>"; echo "<td class="boxedTitle" height="20">"; echo "<h1 align="center" class="boxedTitleText">Shouts</h1></td>"; echo "</tr>";

echo "<td class="boxedContent">";

echo ""; if($page=="" || $page<=0)$page=1; if($who=="") { $noi = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_shouts")); }else{ $noi = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_shouts WHERE shouter='".$who."'")); } $num_items = $noi[0]; //changable $items_per_page= 3; //number shouts $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page;

                                                //changable sql
                                                if($who =="")
                                                {
                                                    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
                                            }else{
                                                $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
                                            }

                                                $items = mysql_query($sql);
                                                echo mysql_error();
                                                if(mysql_num_rows($items)>0)
                                                {
                                                while ($item = mysql_fetch_array($items))
                                                {
                                                    $shnick = getnick_uid($item[2]);
                                                    $sht = htmlspecialchars($item[1]);
                                                    $sht = parsepm($sht, $sid);
                                                    $shdt = date("d/m/y-H:i", $item[3]);                                                    

$lnk = "<a href="index.php?action=viewuser&who=$item[2]">$shnick</a>: $sht $shdt "; if(ismod(getuid_sid($sid))) { $dlsh = "<a href="mprocpl.php?action=delsh&shid=$item[0]">[X]</a>"; }else{ $dlsh = ""; } echo " $lnk $dlsh

"; } } echo "</td>"; echo "</tr>"; echo "</table>"; echo ""; echo "";

echo "";

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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