Top Poster Today 4 Lava

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

2 replies · 466 views · started 16 years ago · 1 min read

2 participants
centi Developer · 159 posts #1

5 people wanted this here it is if you want more to the list u knw what to do add this to index.php

////////////////////////////top poster today
if($page=="" || $page<=0)$page=1;
    $today = time();
    $today -= (24*60*60);
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid)  FROM ibwf_posts WHERE dtpost>'".$today."';"));
    $num_items = $noi[0]; //changable
    $items_per_page= 1;
    $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

        $sql = "SELECT uid, COUNT(*) as nops FROM ibwf_posts  WHERE dtpost>'".$today."'  GROUP BY uid ORDER BY nops 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))
    {
        $unick = getnick_uid($item[0]);
      $lnk = "<b>Top Poster Today</b> <a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\">$unick</a>  <b>P</b> <a href=\"lists.php?action=uposts&who=$item[0]&sid=$sid\">$item[1]</a>";
      echo "$lnk<br/>";
    }
    }

/////////////////////////////

😳 .................................... http://photomag.lk/ .................................... 🤨

i_love_php_mysql Junior · 34 posts #2

something like this?

////////////////////////////top poster today 
elseif($action==topposter){

if($page=="" || $page<=0)$page=1; 
    $today = time(); 
    $today -= (24*60*60); 
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid)  FROM ibwf_posts WHERE dtpost>'".$today."';")); 
    $num_items = $noi[0]; //changable 
    $items_per_page= 1; 
    $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 

        $sql = "SELECT uid, COUNT(*) as nops FROM ibwf_posts  WHERE dtpost>'".$today."'  GROUP BY uid ORDER BY nops 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)) 
    { 
        $unick = getnick_uid($item[0]); 
      $lnk = "<b>Top Poster Today</b> <a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\">$unick</a>  <b>P</b> <a href=\"lists.php?action=uposts&who=$item[0]&sid=$sid\">$item[1]</a>"; 
      echo "$lnk<br/>"; 
    } 
    } 
}

action=topposter&sid=$sid

?

centi Developer · 159 posts #3

thanx for no thanx grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

😳 .................................... http://photomag.lk/ .................................... 🤨

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