active.24h.

Started by Luca, November 26, 2013, 10:40:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

Best code to grab 08 mods from is the codex installer, its in here somewhere or i can post it, its got shit loads in it, easy to split as well, formality basically.

DarkMaster

Quote from: Luca on November 28, 2013, 09:55:49 PM
hello las7h0p3
thank you mate,

Thank you all for help,DarkMaster, cm27 and  las7h0p3
I did, now,everything is ok.

Thank you again

glad we could help
Please Place All Support Questions In The Right Section

Luca

#10
hello las7h0p3
thank you mate,

Thank you all for help,DarkMaster, cm27 and  las7h0p3
I did, now,everything is ok.

Thank you again

las7h0p3

Hey Luca,

Is it something like this that you are looking for? This script is for tbdev 2008.

print("<table width=722 border=1 cellspacing=0 cellpadding=5>\n");

print("<tr><td class=colhead>Users online in the past 24 hours.</td></tr>\n");


$forum_t = gmtime() - 86400; //you can change this value to whatever span you want
$forum_t = sqlesc(get_date_time($forum_t));
$res = mysql_query("SELECT id, username, class FROM users WHERE forum_access >= $forum_t ORDER BY username ASC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($forumusers) $forumusers .= ",\n";


if ($CURUSER)
$forumusers .= "<a href=userdetails.php?id={$arr["id"]}><b>{$arr["username"]}</b></a>";
}
if (!$forumusers)
$forumusers = "No active users in the past 24 hours.";

if ($CURUSER) {
print("<tr><td>" . $forumusers . "</td></tr>\n");

}
print("</table>");

Luca

hello cm27,
thank you mate,for reply and help,I'll try, but I do not think great chances,
However I think it is hard :-\

cm27

That is in the V3 as its been modded a bit more for the new look of V4. If you look in the V3 Repo and go under the block folder you will find and index folder then look for active 24h user then mess with the HTML part of it . Not hard but if you get stuck post here or pm me I can help you make it look the same or what your after . BUT please give it a shoot first so I know you really want to learn .


Thanks
CM27

code below

Code (php) Select
<?php
//== Last24 start - pdq
$keys['last24'] = 'last24';
if ((
$last24_cache $mc1->get_value($keys['last24'])) === false) {
    
$last24_cache = array();
    
$time24 $_SERVER['REQUEST_TIME'] - 86400;
    
$activeusers24 '';
    
$arr mysqli_fetch_assoc(sql_query('SELECT * FROM avps WHERE arg = "last24"'));
    
$res sql_query('SELECT id, username, class, donor, title, warned, enabled, chatpost, leechwarn, pirate, king '.'FROM users WHERE last_access >= '.$time24.' '.'AND perms < '.bt_options::PERMS_STEALTH.' ORDER BY username ASC') or sqlerr(__FILE____LINE__);
    
$totalonline24 mysqli_num_rows($res);
    
$_ss24 = ($totalonline24 != 's' '');
    
$last24record get_date($arr['value_u'], '');
    
$last24 $arr['value_i'];
    if (
$totalonline24 $last24) {
        
$last24 $totalonline24;
        
$period $_SERVER['REQUEST_TIME'];
        
sql_query('UPDATE avps SET value_s = 0, '.'value_i = '.sqlesc($last24).', '.'value_u = '.sqlesc($period).' '.'WHERE arg = "last24"') or sqlerr(__FILE____LINE__);
    }
    while (
$arr mysqli_fetch_assoc($res)) {
        if (
$activeusers24$activeusers24.= ",\n";
        
$activeusers24.= '<b>'.format_username($arr).'</b>';
    }
    
$last24_cache['activeusers24'] = $activeusers24;
    
$last24_cache['totalonline24'] = number_format($totalonline24);
    
$last24_cache['last24record'] = $last24record;
    
$last24_cache['last24'] = number_format($last24);
    
$last24_cache['ss24'] = $_ss24;
    
$mc1->cache_value($keys['last24'], $last24_cache$INSTALLER09['expires']['last24']);
}
if (!
$last24_cache['activeusers24']) $last24_cache['activeusers24'] = 'There&nbsp;have&nbsp;been&nbsp;no&nbsp;active&nbsp;users&nbsp;in&nbsp;the&nbsp;last&nbsp;15&nbsp;minutes.';
$last_24 '<div class="headline">'.$lang['index_active24'].'<small>&nbsp;-&nbsp;List&nbsp;updated&nbsp;hourly</small></div>
<div class="headbody">
<!--<a href=\'javascript: klappe_news("a2")\'><img border=\'0\' src=\'pic/plus.gif\' id=\'pica2\' alt=\'[Hide/Show]\' /></a><div id=\'ka2\' style=\'display: none;\'>-->
<!--<a class="altlink" title="Click for more info" id="div_open" style="font-weight:bold;cursor:pointer;"><img border=\'0\' src=\'pic/plus.gif\' alt=\'[Hide/Show]\' /></a>
<div id="div_info" style="display:none;background-color:#FEFEF4;max-width:940px;padding: 5px 5px 5px 10px;">-->
<p align="center"><b>'
.$last24_cache['totalonline24'].' Member'.$last24_cache['ss24'].' visited during the last 24 hours</b></p>
<p align="center">'
.$last24_cache['activeusers24'].'</p>
<p align="center"><b>Most ever visited in 24 hours was '
.$last24_cache['last24'].' Member'.$last24_cache['ss24'].' on '.$last24_cache['last24record'].'</b></p>
</div><!--</div>--><br />'
;
$HTMLOUT.= $last_24;
//== last24 end
// End Class
// End File


Now this code is off the REPO ... BUT it will not work on TBDev 08 unless you mod it backwards ...Now if you give that a shot I can fix your errors or help you make it what your after . Cheers
Never fall to those that just sit there.. Always look for the way to the top even if you have to code it your self and mistakes and all... quote from BonZO...

DarkMaster

its part of the new V4 code that will be released very soon
Please Place All Support Questions In The Right Section

Luca

hello again,

I just gave an example, this pic..but where can I get this script,
   

DarkMaster

if your wanting one just like your pic.. ( which is the v4 code on test site) then its just a matter of playing with the HTML side of that code
Please Place All Support Questions In The Right Section

Luca

hello,DarkMaster,
thank you for reply,
so,about this script is discussed,or at least one like that is,,, functional of course in TBDEV2008
http://imm.io/1l3uQ

DarkMaster

you will need to give us more info to enable us to help you....

but make sure you provide us with as much info as possible
Please Place All Support Questions In The Right Section

Luca

hello guys
Does can someone help me with this scripts active.24h.users
for Tbdev2008?
Thank you