TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 19, 2024, 03:37:10 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 128
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

New members Block

Started by akulion, October 09, 2006, 07:08:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

akulion

nope dosent seem to be the issue

i just used opera to register a new member
and the counter for tody still at 0

but week and month progressed forward by 1

JPDeni

Is the account activated?

The only thing you can do is change

$today = strtotime("today");

to

$today = strtotime("24 hours ago");

which will give you the number of registrations within a rolling 24-hour period. I know that the strtotime("today") code gives the Unix time for midnight on the current calendar day.

Jpg

Nice...me likey...I might add this to the boardindex!! WOOT WOOT!

[Nice idea for a mod]

akulion

holy cazambo gubu gubu!!! IT WORKS!!!
(whatever tht means - i just made it up!)


Total Members: 1040
New This Month: 19
New This Week: 8
New Today: 5

:D Thanks so much!! ur the best!! :D

Jpg

LMAO....
You get alot of members....daaaamn..

Good it works now.
Great work Just Plain.
I like the idea/concept. *Gives Thumbs Up*

JPDeni

 :2funny:

What did you do, aku? Did you change it to 24 hours?

Glad it worked for you.  ;D

Glad you like it too, Jpg.

It worked out nicely because I just really understood something new (to me) in mysql and it was what made this work. It's great when I'm able to apply something I've just learned.

akulion

#16
yes the 24 hour one worked :D

thanks again :D

<<<-- Demo click the dude

and then look in left bar at the bottom near the stats

rbh

#17
i tweaked the code a little and placed it within my stats box, but i cannot get it to '
';

look at the picture and right after the latest members name you will see what i mean where it says Kalo then new this month. i have placed the break code in several places but it wont return the next line. any suggestions? thanks


here is my template code with the added above code
   // members stats
            echo '
                 <img src="'.$settings['images_url'].'/icons/members.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=mlist"><b>'.$txt[19].'</b></a>
                 <br />'.$bullet.$txt[488].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
                 <br />'.$bullet.$txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>', $modSettings['latestRealName'], '</b></a>';
       if(isset($context['TPortal']['userbox']['stats_all']))
global $db_prefix,$modSettings;

$today = strtotime("today");
date('j') == 1 ? $thismonth = $today : $thismonth = strtotime(date('F') . ' 1');
date('l') == 'Sunday' ? $thisweek = $today : $thisweek = strtotime('last Sunday');
date('M') == 'January' ? $thisyear = $thismonth : $thisyear = strtotime('January 1');

$query = db_query("SELECT
COUNT(dateRegistered > $thisyear OR NULL) as year,
COUNT(dateRegistered > $thismonth OR NULL) as month,
COUNT(dateRegistered > $thisweek OR NULL) as week,
COUNT(dateRegistered > $today OR NULL) as today
FROM {$db_prefix}members
WHERE is_activated = 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($query);

settype($row['today'], "integer");
settype($row['week'], "integer");
settype($row['month'], "integer");

echo 'New This Month: ', $row['month'],'<br />';
echo 'New This Week: ', $row['week'],'<br />';
echo 'New Today: ', $row['today'];


JPDeni

echo '<br />New This Month: ', $row['month'],'<br />';

That should do it.

rbh

that did the trick, thanks ;D just one more little thing if you don't mind. i have been trying to add bullets in front of the stats to match the rest of the stats box. i have gotten the bullets to show up in a couple different places, but not in the front of the text, and i have gotten parse errors at least 10 times. :-\ where would i place the $bullet to make it show before the stats text? thanks again.