|
|
| |
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
|
View previous topic :: View next topic |
| Author |
Message |
gabriele Newbie


Offline Joined: Mar 01, 2005 Posts: 9 Location: rome, italy
|
Posted: 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...
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 |
|
 |
MrMastah Newbie


Offline Joined: Jun 21, 2004 Posts: 37 Location: Sweden
|
Posted: 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 |
|
 |
Jeruvy Security Team


Offline Joined: Apr 23, 2004 Posts: 1432 Location: Canada
|
Posted: 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 |
|
 |
safecracker4hire 500+ Posts Club


Offline Joined: Nov 26, 2004 Posts: 525 Location: Ontario - CANADA
|
Posted: 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 |
|
 |
gabriele Newbie


Offline Joined: Mar 01, 2005 Posts: 9 Location: rome, italy
|
Posted: 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...  )]
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 |
|
 |
NEMINI Diamond Supporter


Offline Joined: Apr 22, 2004 Posts: 4551
|
Posted: 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 |
|
 |
safecracker4hire 500+ Posts Club


Offline Joined: Nov 26, 2004 Posts: 525 Location: Ontario - CANADA
|
Posted: 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 |
|
 |
NEMINI Diamond Supporter


Offline Joined: Apr 22, 2004 Posts: 4551
|
Posted: 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 |
|
 |
safecracker4hire 500+ Posts Club


Offline Joined: Nov 26, 2004 Posts: 525 Location: Ontario - CANADA
|
Posted: 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 |
|
 |
Katrina Newbie


Offline Joined: Oct 02, 2005 Posts: 30 Location: Michigan
|
Posted: 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 |
|
 |
winock Nice poster


Offline Joined: Jul 15, 2005 Posts: 55 Location: Austria
|
Posted: 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
_________________ 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 |
|
 |
onebuckwild Nice poster


Offline Joined: Nov 01, 2005 Posts: 68 Location: elkton, md
|
Posted: 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 |
|
 |
onebuckwild Nice poster


Offline Joined: Nov 01, 2005 Posts: 68 Location: elkton, md
|
Posted: 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 |
|
 |
designSumpf Nice poster


Offline Joined: Jan 01, 2005 Posts: 84 Location: Germany/Franconia
|
Posted: 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 |
|
 |
HEairsoft Nice poster


Offline Joined: Jul 26, 2005 Posts: 58
|
Posted: 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 |
|
 |
|
|
All times are GMTGo to page 1, 2 Next
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
|
| |
 |
 Welcome Anonymous
|
|
|
|