Home Private Messages Search
CPG Dragonfly™ CMS Dedicated Server & Bandwidth Sponsored by DedicatedNOW
Toggle Content
 
Forums ⇒ DragonflyCMS ⇒ Explain Please ⇒ "User last visit" field in user list menu?


"User last visit" field in user list menu?
Ask questions and read explanations on how to use things/settings or why "X" is on page "Y."
Go to page 1, 2  Next
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  Explain Please

View previous topic :: View next topic  
Author Message
gabriele
Newbie
Newbie

Offline Offline
Joined: Mar 01, 2005
Posts: 9
Location: rome, italy
PostPosted: Tue Mar 01, 2005 3:13 pm
Post subject: "User last visit" field in user list menu?

Hi all! Is it possible to have in the user list page a "user last visit" field? I saw the user_lastvisit field in the SQL database but I can't do it by myself... Embarassed
Thanks!! Gabriele


gabriele's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Mandrake10.1-XPSP2/Apache1.3.26/MySQL4.0.22-standard/PHP4.3.10/Dragonfly 9.0.3-PH2 theme


Last edited by gabriele on Fri Mar 04, 2005 3:46 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website ICQ Number AIM Address MSN Messenger Yahoo Messenger
MrMastah
Newbie
Newbie

Offline Offline
Joined: Jun 21, 2004
Posts: 37
Location: Sweden
PostPosted: Thu Mar 03, 2005 1:00 pm
Post subject: Re: "User last visit" field in user list menu?

Yes! Exactly what I want too! Can anyone explain how to do it? Please?

//Mastah


MrMastah's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Win 2003 Server/Apache 2.0.55/MySQL 4.0.26/PHP 4.4.2/Dragonfly CMS v9.0.6.1
Back to top
View user's profile Visit poster's website ICQ Number MSN Messenger
Jeruvy
Security Team
Security Team

Offline Offline
Joined: Apr 23, 2004
Posts: 1432
Location: Canada
PostPosted: Thu Mar 03, 2005 2:04 pm
Post subject: Re: "User last visit" field in user list menu?

I would suggest this is a good idea and it should be posted in requests and ideas.

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger Photo Gallery
safecracker4hire
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Nov 26, 2004
Posts: 525
Location: Ontario - CANADA
PostPosted: Thu Mar 03, 2005 2:07 pm
Post subject: Re: "User last visit" field in user list menu?

Hi gabriele;
Open modules/Members_List/index.php

FIND
Code::
$template->assign_vars(array(
	'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
	'L_USERNAME' => $lang['Username'],
	'L_EMAIL' => $lang['Email'],
	'L_WEBSITE' => $lang['Website'],
	'L_FROM' => $lang['Location'],
	'L_ORDER' => $lang['Order'],
	'L_PRIVATE_MESSAGE' => $lang['Private_Message'],
	'L_SORT' => $lang['Sort'],
	'L_SUBMIT' => $lang['Sort'],
	'L_AIM' => $lang['AIM'],
	'L_YIM' => $lang['YIM'],
	'L_MSNM' => $lang['MSNM'],
	'L_ICQ' => $lang['ICQ'],
	'L_JOINED' => $lang['Joined'],
	'L_POSTS' => $lang['Posts'],
	'L_PM' => $lang['Private_Message'],

ADD AFTER
Code::
	'L_LASTVISIT' => $lang['Last_Visit'],

FIND
Code::
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar

CHANGE TO
Code::
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_lastvisit

FIND
Code::
		$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
		$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

ADD AFTER
Code::
                $lastvisit = date('M d, Y @ g:ia', $row['user_lastvisit']);

Right under that you will see
Code::
		$template->assign_block_vars('memberrow', array(
			'ROW_NUMBER' => $i + 1 + $start,
			'ROW_COLOR' => '#' . $row_color,
			'ROW_CLASS' => $row_class,
			'USERNAME' => $username,
			'FROM' => $from,
			'JOINED' => $joined,
			'POSTS' => $posts,
			'AVATAR_IMG' => $poster_avatar,
			'PROFILE_IMG' => $profile_img,
			'PROFILE' => $profile,
			'SEARCH_IMG' => $search_img,
			'SEARCH' => $search,
			'PM_IMG' => $pm_img,
			'PM' => $pm,
			'EMAIL_IMG' => $email_img,
			'EMAIL' => $email,
			'WWW_IMG' => $www_img,
			'WWW' => $www,
			'ICQ_STATUS_IMG' => $icq_status_img,
			'ICQ_IMG' => $icq_img,
			'ICQ' => $icq,
			'AIM_IMG' => $aim_img,
			'AIM' => $aim,
			'MSN_IMG' => $msn_img,
			'MSN' => $msn,
			'YIM_IMG' => $yim_img,
			'YIM' => $yim,

ADD AFTER
Code::
			'LASTVISIT' => $lastvisit,

SAVE AND CLOSE /modules/Members_List/index.php

OPEN themes/{YOUR THEME}/template/memberslist.html
FIND
Code::
  <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
    <tr>
      <th height="25" class="thCornerL" nowrap="nowrap">#</th>
      <th class="thTop" nowrap="nowrap" align="center"> </th>
      <th class="thTop" nowrap="nowrap" align="center">{L_USERNAME}</th>
      <th class="thTop" nowrap="nowrap" align="center">{L_EMAIL}</th>
      <th class="thTop" nowrap="nowrap" align="center">{L_FROM}</th>
      <th class="thTop" nowrap="nowrap" align="center">{L_JOINED}</th>

ADD AFTER
Code::
      <th class="thTop" nowrap="nowrap" align="center">{L_LASTVISIT}</th>

FIND
Code::
    <!-- BEGIN memberrow -->
    <tr>
      <td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"> {memberrow.ROW_NUMBER} </span></td>
      <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.PM_IMG} </td>
      <td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" 

class="gen">{memberrow.USERNAME}</a></span></td>
      <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"> {memberrow.EMAIL_IMG} </td>
      <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.FROM}</span></td>
      <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.JOINED}</span></td>

ADD AFTER
Code::
      <td class="{memberrow.ROW_CLASS}" align="left"><span class="gensmall">{memberrow.LASTVISIT}</span></td>

FIND
Code::
      <td class="catbottom" colspan="8" height="28"> </td>

CHANGE TO
Code::
      <td class="catbottom" colspan="9" height="28"> </td>


SAVE AND CLOSE themes/{YOUR THEME}/template/memberslist.html

OPEN langauge/english/forums.php with a UTF-8 compliant editor, such as Notepad2!!
FIND
Code::
    // Memberslist 
    'Select_sort_method' => 'Select sort method',
    'Sort' => 'Sort',
    'Sort_Top_Ten' => 'Top Ten Posters',
    'Sort_Joined' => 'Joined Date',
    'Sort_Username' => 'Username',
    'Sort_Location' => 'Location',
    'Sort_Posts' => 'Posts',
    'Sort_Email' => 'Email',
    'Sort_Website' => 'Website',
    'Sort_Ascending' => 'Ascending',
    'Sort_Descending' => 'Descending',
    'Order' => 'Order',

ADD AFTER
Code::
    'Last_Visit' => 'Last Visit',   

SAVE AND CLOSE language/english/forums.php

This was originally a post on my site where I was helping a member with the same request --> www.kylestubbins.com/i...c&t=13


safecracker4hire's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
RHE Linux / 2.0.52 / 4.0.22 / 4.3.10 / 9.0.6.1-CVS
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
gabriele
Newbie
Newbie

Offline Offline
Joined: Mar 01, 2005
Posts: 9
Location: rome, italy
PostPosted: Thu Mar 03, 2005 9:35 pm
Post subject: Re: "User last visit" field in user list menu?

Hi!! Thank you (as usual!) for your replies... It is what I was looking for.
I made other changes in modules\Members_List\index.php to make the list sortable by Last Visit.
[Probably it was, and I missed some steps (as usual... Embarassed )]

changed

Quote::

'S_MODE_SELECT' => select_box('mode', $mode, array('joindate'=>'Joined date', 'username'=>'Username', 'location'=>'Location', 'posts'=>'Posts', 'website'=>'Website',))

with

Quote::

'S_MODE_SELECT' => select_box('mode', $mode, array('joindate'=>'Joined date', 'username'=>'Username', 'location'=>'Location', 'posts'=>'Posts', 'website'=>'Website', 'lastvisit'=>'Lastvisit'))

And under

Quote::

case 'website':
$order_by = "user_website $sort_order LIMIT $start, " . $members_per_page;
break;

added:

Quote::

case 'lastvisit':
$order_by = "user_lastvisit $sort_order LIMIT $start, " . $members_per_page;
break;


Thanks again!!
Ciao!!

G


gabriele's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Mandrake10.1-XPSP2/Apache1.3.26/MySQL4.0.22-standard/PHP4.3.10/Dragonfly 9.0.3-PH2 theme
Back to top
View user's profile Visit poster's website ICQ Number AIM Address MSN Messenger Yahoo Messenger
NEMINI
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 4551

PostPosted: Thu Mar 03, 2005 10:24 pm
Post subject: Re: "User last visit" field in user list menu?

good idea, but how do I add a time offset? that field is GMT and my site isn't. Thanks. Optimally this field should be offset by whatever the user has set in their account.

_________________
NEMINI.org, NEMINI.us, NEMINI.info, NYMINI.org

NEMINI's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
1.3.34 (Unix)/4.1.18-standard/4.4.2 /9.1.0.8 CVS
Back to top
View user's profile Visit poster's website Photo Gallery
safecracker4hire
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Nov 26, 2004
Posts: 525
Location: Ontario - CANADA
PostPosted: Fri Mar 04, 2005 1:46 pm
Post subject: Re: "User last visit" field in user list menu?

I haven't tried it, but will be glad to test it out when I get home this evening...

It should be a simple matter of calculating the users time zone.

Code::
$tz = $userinfo['user_timezone'];
$lastvisit = date('M d, Y @ g:ia', $row['user_lastvisit'] + (3600 * $tz));


safecracker4hire's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
RHE Linux / 2.0.52 / 4.0.22 / 4.3.10 / 9.0.6.1-CVS
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
NEMINI
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 4551

PostPosted: Sat Mar 05, 2005 8:49 pm
Post subject: Re: "User last visit" field in user list menu?

seems to be working so far, it should work at the very least until someones DST kicks in lol.

_________________
NEMINI.org, NEMINI.us, NEMINI.info, NYMINI.org

NEMINI's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
1.3.34 (Unix)/4.1.18-standard/4.4.2 /9.1.0.8 CVS
Back to top
View user's profile Visit poster's website Photo Gallery
safecracker4hire
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Nov 26, 2004
Posts: 525
Location: Ontario - CANADA
PostPosted: Thu Sep 29, 2005 12:28 am
Post subject: Re: "User last visit" field in user list menu?

This would probably be better for time conversion.

PHP:
$lastvisit = formatDateTime($row['user_lastvisit'], _DATESTRING);

Which uses the core time class. _DATESTRING is defined in /language/english/main.php.

PHP:
define('_DATESTRING','%A, %B %d, %Y (%H:%M:%S)');


safecracker4hire's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
RHE Linux / 2.0.52 / 4.0.22 / 4.3.10 / 9.0.6.1-CVS
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
Katrina
Newbie
Newbie

Offline Offline
Joined: Oct 02, 2005
Posts: 30
Location: Michigan
PostPosted: Fri Jan 27, 2006 4:43 pm
Post subject: Re: "User last visit" field in user list menu?

Ok I want to do this but with a custom field that I made. I'm by no means good with php, so I spent hours last night trying to find a variable for it with no avail. In my db I have the field I want labeled as "gw_name".


Katrina's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.37 (Unix)/4.1.21-standard-log/4.4.4/ 9.0.6.1
Back to top
View user's profile Visit poster's website
winock
Nice poster
Nice poster

Offline Offline
Joined: Jul 15, 2005
Posts: 55
Location: Austria
PostPosted: Sun Mar 26, 2006 11:00 am
Post subject: Re: "User last visit" field in user list menu?

is there also a possibility to display only a special group, what i meaning is i have to show only a group with translators. thinking in the members account section to use the field my occupation for the mother language and the field my interests for the other languages....

its verry important for me Praying

_________________
Never be afraid to try something new. Remember, amateurs built the ark; professionals built the Titanic.

winock's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
xp apache2triad 123
Back to top
View user's profile
onebuckwild
Nice poster
Nice poster

Offline Offline
Joined: Nov 01, 2005
Posts: 68
Location: elkton, md
PostPosted: Mon Jun 26, 2006 7:35 pm
Post subject: Re: "User last visit" field in user list menu?

ok, for some reason the last visit colum shows the total post and the website shows the last visited date. If I post the original mytheme/templete/memberslist.php it all shows in the right place with out the last visit colum but the drop down will sort by last visit. So im thinking the problem is in the page. I tried it with my hl2 theme and cpgnuke theme with the same results. I will start over at home later and try the mod of that page again to see if I did something but wanted to see if anyone else had this problem that could let me know what I did to make things easier. thanks

_________________
Linux/Apache version 1.3.34 (Unix) /MySQL version 4.0.27-standard-log /PHP version 4.4.1 /DflyCMS 9.1.1

onebuckwild's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache version 1.3.34 (Unix) /MySQL version 4.0.27-standard-log /PHP version 4.4.1 /DflyCMS 9.1.1
Back to top
View user's profile Visit poster's website
onebuckwild
Nice poster
Nice poster

Offline Offline
Joined: Nov 01, 2005
Posts: 68
Location: elkton, md
PostPosted: Mon Jun 26, 2006 7:51 pm
Post subject: Re: "User last visit" field in user list menu?

found the problem, had one of the lines on that page in the wrong place and that put them all out of order. thanks anyway

_________________
Linux/Apache version 1.3.34 (Unix) /MySQL version 4.0.27-standard-log /PHP version 4.4.1 /DflyCMS 9.1.1

onebuckwild's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache version 1.3.34 (Unix) /MySQL version 4.0.27-standard-log /PHP version 4.4.1 /DflyCMS 9.1.1
Back to top
View user's profile Visit poster's website
designSumpf
Nice poster
Nice poster

Offline Offline
Joined: Jan 01, 2005
Posts: 84
Location: Germany/Franconia
PostPosted: Wed Jun 28, 2006 1:40 pm
Post subject: Re: "User last visit" field in user list menu?

I have had a similar problem and had to realize, that (sometimes?) the user_lastvisit is older then the user_session_time (is this relevant?). And I'm not so interested in the date, but in the number of days a user was not loged in.
Code::
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, LEAST(DATEDIFF(NOW(), FROM_UNIXTIME(user_session_time)), DATEDIFF(NOW(), FROM_UNIXTIME(user_lastvisit))) AS lastvisit

_________________
If I'm not observed, it's possible due to quantum-mechanical effects, that I either stop to exist or change to an indefinite condition.

designSumpf's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
LINUX/Apache /MySQL 5.0.32/PHP 5.2.0-8+etch11/DF 9.1.2.1
Back to top
View user's profile Visit poster's website
HEairsoft
Nice poster
Nice poster

Offline Offline
Joined: Jul 26, 2005
Posts: 58

PostPosted: Fri Aug 11, 2006 9:42 pm
Post subject: Re: "User last visit" field in user list menu?

Don't Like 24 hour time format? Use this:

PHP:
$lastvisit = formatDateTime($row['user_lastvisit'], "%b %d, %Y @ %r");

Ex: Aug 10, 2006 @ 11:46:38 PM

Use all the symbols you want by checking out the strftime manual


HEairsoft's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.0.27/4.4.4/9.1.1
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  Explain Please
Page 1 of 2
All times are GMT
Go to page 1, 2  Next



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

Διαβάστε περισσότερα ...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy