[Beta] - who wisited last 24 Hours

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
yakusha
Registered User
Posts: 71
Joined: Mon Apr 03, 2006 8:30 pm

[Beta] - who wisited last 24 Hours

Post by yakusha » Wed May 23, 2007 8:52 pm

MOD Title: who wisited who wisited last 24 Hours
MOD Description: Show, who wisited last 24 Hours, showing how many users wisited and wisited dates.
MOD Version: Beta: 0.3.0

MOD Download: files in topic

Using Board: http://www.yoldusleri.com/index.php

Code: Select all

##############################################################
## MOD Title: who wisited last 24 Hours
## MOD Author: angelside < n/a > (Sevdin Filiz) http://www.phpbbturkiye.net
## MOD Author: yakusha < n/a > (Sabri Ünal) http://www.yakusha.net
## MOD Description: Show, who wisited last 24 Hours, showing how many users wisited and wisited dates.
## MOD Version: Beta: 0.3.0
##
## Installation Level: Easy
## Installation Time: 3 minutes
##
## Files To Edit: 3
## -- functions.php
## -- styles/prosilver/template/index_body.html
## -- language/en/common.php
##
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## Whats the easy, its a perfect.
## Mod Reguests:
## Modx Support
## SubSilver2 Support
##############################################################
## MOD History:
## 2007-05-29 - Version 0.3.0
## Added multi language support
##
## 2007-05-08 - Version 0.2.0
## Added date format from board config default date format...
##
## MOD History:
## 2007-04-24 - Version 0.1.0
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#

includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

// Which timezone?
$tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']));

#
#-----[ AFTER ADD ]------------------------------------------
#

//--- [ + ] --- who viseted today ----
$sql = 'SELECT user_id, username, user_type, user_colour, user_lastvisit
	FROM ' . USERS_TABLE . '
	WHERE user_type <> 2
		AND user_lastvisit >=' . strtotime("-1 day") . '
	ORDER BY user_colour DESC';
$result = $db->sql_query($sql);

while( ($row = $db->sql_fetchrow($result)) && ($row['username'] != '') )
{
	$last24h_userlist = '';
	$user_last24h_link = $row['username'];

	if ($row['user_colour'])
	{
		$user_colour = ' style="color:#' . $row['user_colour'] . '"';
		$row['username'] = '<strong>' . $row['username'] . '</strong>';
	}
	else
	{
		$user_colour = '';
	}

	if ($row['user_type'] <> USER_IGNORE)
	{
		$user_last24h_link = '<a title ="'. $user->format_date($row['user_lastvisit'], $config['default_dateformat'], true) . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '"' . $user_colour . '>' . $user_last24h_link . '</a>';
	}
	else
	{
		$user_last24h_link = ($user_colour) ? '<span' . $user_colour . '>' . $user_last24h_link . '</span>' : $user_last24h_link;
	}

	$last24h_userlist .= ($last24h_userlist != '') ? ', ' . $user_last24h_link : $user_last24h_link;

	if (!$last24h_userlist)
	{
		$$last24h_userlist = $user->lang['NO_ONLINE_USERS'];
	}

	$template->assign_block_vars('last24h', array(
			'LAST24H_USERLIST' => $last24h_userlist,
		)
	);
}
$db->sql_freeresult($result);

$msql = 'SELECT count(user_id) as total
	FROM ' . USERS_TABLE . '
	WHERE user_type <> 2
		AND user_lastvisit >=' . strtotime("-1 day") . '';
$mresult = $db->sql_query($msql);
if( $mresult )
{
	$mrow = $db->sql_fetchrow($mresult);
	$wisited_user_count = $mrow['total'];
}
//--- [ - ] --- who viseted today ----


#
#-----[ FIND ]------------------------------------------
#

'S_USER_UNREAD_PRIVMSG'   => $user->data['user_unread_privmsg'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

'LAST24H_WISITED_USER_COUNT' 	=> $wisited_user_count,
'WHO_WISITED_TODAY' 			=> $user->lang['WHO_WISITED_TODAY'],

#
#-----[ OPEN ]------------------------------------------
#

index_body.html

#
#-----[ FIND ]------------------------------------------
#

<!-- IF S_DISPLAY_ONLINE_LIST -->
	<h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3>
	<p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}
	<!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p>
<!-- ENDIF -->

#
#-----[ BEFORE, ADD ]------------------------------------------
#

<h3>{WHO_WISITED_TODAY} : {LAST24H_WISITED_USER_COUNT}</h3>
&bull;
<!-- BEGIN last24h -->
{last24h.LAST24H_USERLIST} &bull;
<!-- END last24h_login -->

#
#-----[ OPEN ]------------------------------------------
#

language/en/common.php

#
#-----[ FIND ]------------------------------------------
#

	'WRONG_PASSWORD'	=> 'You entered an incorrect password.',

#
#-----[ AFTER, ADD ]------------------------------------------
#

	'WHO_WISITED_TODAY' => 'Who wisited today',

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Last edited by yakusha on Tue Aug 14, 2007 7:30 am, edited 5 times in total.

Zheverling
Registered User
Posts: 33
Joined: Mon May 21, 2007 7:02 pm

Re: [beta] - who wisited today

Post by Zheverling » Wed May 23, 2007 10:02 pm

at the bottom i see'

GUNUN ZIYARETCILERI : 3
• Admin_Zack • Tracy • Demo •

how do you change this to english?

Zheverling
Registered User
Posts: 33
Joined: Mon May 21, 2007 7:02 pm

Re: [beta] - who wisited today

Post by Zheverling » Wed May 23, 2007 10:19 pm

Changed this myself posted here for everyone to see


#-----[ OPEN ]------------------------------------------
#

index_body.html

#
#-----[ FIND ]------------------------------------------
#

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
<form method="post" action="{S_LOGIN_ACTION}" class="headerspace">
<h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a></h3>
<fieldset class="quick-login">
<label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />
<label for="password">{L_PASSWORD}:</label>&nbsp;<input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" /> |
<label for="autologin">{L_LOG_ME_IN} <input type="checkbox" name="autologin" id="autologin" class="checkbox" /></label> <input type="submit" name="login" value="{L_LOGIN}" class="button2" />
</fieldset>
</form>
<!-- ENDIF -->

#
#-----[ ADD ]------------------------------------------
#

<h3>Visitors within the Last 24 Hours : {LAST24H_WISITED_USER_COUNT}</h3>
&bull;
<!-- BEGIN last24h -->
{last24h.LAST24H_USERLIST} &bull;
<!-- END last24h_login -->

User avatar
3Di
Former Team Member
Posts: 13901
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [beta] - who wisited today

Post by 3Di » Wed May 23, 2007 10:59 pm

Hello,

We see that you've posted your MOD's contents in your topic starter. Please instead offer your MOD as a textfile download (uploading your MOD's install textfile to a server and giving a direct link, with no registration restrictions), rather than posting the MOD's contents in your post, as you have done.

Please edit your topic starter as outlined in MOD Development forum rules section 3.f.5. This will allow people to see what your MOD is about at a glance.

Thank you for your cooperation,
The phpBB MOD Team
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

NeilUK
Registered User
Posts: 276
Joined: Fri Oct 28, 2005 7:54 pm

Re: [Alpha] - who wisited today

Post by NeilUK » Thu May 24, 2007 8:11 pm

I've tried to install this MOD but nothing happens. The mod mentions that index.php needs to be edited but it doesn't get mentioned in the the code instructions

Zheverling
Registered User
Posts: 33
Joined: Mon May 21, 2007 7:02 pm

Re: [Alpha] - who wisited today

Post by Zheverling » Thu May 24, 2007 8:43 pm

styles/prosilver/template/index_body.html

is where you want to edit then purge the cache it works for me

NeilUK
Registered User
Posts: 276
Joined: Fri Oct 28, 2005 7:54 pm

Re: [Alpha] - who wisited today

Post by NeilUK » Thu May 24, 2007 8:48 pm

Ahh, ok would it make a difference that I was using subSilver2 and so I edited the index-body for that style?

User avatar
JunglistPerfection
Registered User
Posts: 611
Joined: Mon Apr 09, 2007 11:58 pm
Location: Chicago, IL

Re: [Alpha] - who wisited today

Post by JunglistPerfection » Thu May 24, 2007 9:20 pm

What the fudge is wisited? :lol: Someone please clue me in this, thank you.

thebluebus
Registered User
Posts: 155
Joined: Sat Dec 31, 2005 6:50 pm
Location: England, UK

Re: [Alpha] - who wisited today

Post by thebluebus » Fri May 25, 2007 8:14 am

instructions are a little bit confusing. Couldn't find certain things, had to shorten search string. Files said to be edited not actually needed (index.php). Also the last instruction should be [AFTER ADD] shouldnt it?

but thanks. Works well, just what i needed. I did move it underneath the normal 'who is online' bit though, think it looks a bit neater

NeilUK
Registered User
Posts: 276
Joined: Fri Oct 28, 2005 7:54 pm

Re: [Alpha] - who wisited today

Post by NeilUK » Sun May 27, 2007 6:41 pm

JunglistPerfection wrote:What the fudge is wisited? :lol: Someone please clue me in this, thank you.
Ahh another one enjoys taking the mickey out of people speaking in a foreign language!

How is your Turkish???

User avatar
JunglistPerfection
Registered User
Posts: 611
Joined: Mon Apr 09, 2007 11:58 pm
Location: Chicago, IL

Re: [Alpha] - who wisited today

Post by JunglistPerfection » Mon May 28, 2007 7:45 am

NeilUK wrote:
JunglistPerfection wrote:How is your Turkish???
My Turkish is horrible. :)

LeClair
Registered User
Posts: 17
Joined: Fri Sep 29, 2006 8:17 pm

Re: [Alpha] - who wisited today

Post by LeClair » Mon May 28, 2007 8:20 pm

Work this version phpBB3 RC1 ?

User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: [Alpha] - who wisited today

Post by nickvergessen » Mon May 28, 2007 8:38 pm

No Support via PM

yakusha
Registered User
Posts: 71
Joined: Mon Apr 03, 2006 8:30 pm

Re: [Alpha] - who wisited today

Post by yakusha » Tue May 29, 2007 12:28 am

yes work in RC 1

and demo in topic...
this one works perfect
no: but, this mod showing last login time on title and showing how many users come

we mods created on : 2007-04-24 - Version 0.1.0

and editing only 2 files...
functions.php
styles/prosilver/template/index_body.html
Not using any additional SQL

and showing on all pages or index page

whats the perfect: Whats the easy, its perfect

:geek:

BuffettWorld
Registered User
Posts: 41
Joined: Fri Dec 17, 2004 5:31 am

Re: [Alpha] - who wisited today

Post by BuffettWorld » Tue May 29, 2007 3:08 am

It would be nice if the mod alphabetized the list and didn't display hidden users :D

Locked

Return to “[3.0.x] MODs in Development”