3 shouts in main page (waplive)

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

    3 shouts in main page (waplive)

    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 "<small>";
    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&amp;who=$item[2]\">$shnick</a>: $sht<br/>$shdt ";
    if(ismod(getuid_sid($sid)))
    {
    $dlsh = "<a href=\"mprocpl.php?action=delsh&amp;shid=$item[0]\">[X]</a>";
    }else{
    $dlsh = "";
    }
    echo " $lnk $dlsh<br/><br/>";
    }
    }
    echo "</small></td>";
    echo "</tr>";
    echo "</table>";
    echo "</div>";
    echo "</div>";

    echo "</div>";










    http://www.youtube.com/watch?v=vsLkpcFKbOk
Working...
X