|
Re: "Last visit" in "members" [message #29040 is a reply to message #29033] |
Sun, 27 November 2005 16:21 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
No, but you can add it easily enough by modifying the fetch query to get the last_visit field from the users table.
FUDforum Core Developer
|
|
|
|
Re: "Last visit" in "members" [message #29071 is a reply to message #29049] |
Mon, 28 November 2005 00:46 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You need to edit the main retrieval query to fetch the last_visit field, which you can then use to display the user's time of last visit.
FUDforum Core Developer
|
|
|
|
|
|
Re: "Last visit" in "members" [message #31101 is a reply to message #31083] |
Sat, 01 April 2006 18:05 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You need to modify the SQL query inside the finduser.php.t to select the "last_visit" column.
FUDforum Core Developer
|
|
|
Re: "Last visit" in "members" [message #31127 is a reply to message #29033] |
Mon, 03 April 2006 18:57 |
|
confridÃn
Messages: 11 Registered: November 2005
Karma: 0
|
Junior Member |
|
|
Ok.
I tried several modifications but nothing works...
I know i'm a real novice at php but where can i modify the SQL query inside the "finduser.php.t" file in order to select the "last_visit" column?
I think it's in this part but i don't know what to do...
/*{POST_HTML_PHP}*/
if (!isset($_GET['start']) || !($start = (int)$_GET['start'])) {
$start = 0;
}
if (isset($_GET['pc'])) {
$ord = 'posted_msg_count DESC';
} else if (isset($_GET['us'])) {
$ord = 'alias';
} else {
$ord = 'id DESC';
}
$usr_login = !empty($_GET['usr_login']) ? trim((string)$_GET['usr_login']) : '';
if ($usr_login) {
$qry = 'alias LIKE '._esc(char_fix(htmlspecialchars(addcslashes($usr_login.'%','\\')))).' AND';
} else {
$qry = '';
}
$find_user_data = '';
$c = uq('SELECT /*!40000 SQL_CALC_FOUND_ROWS */ home_page, users_opt, alias, join_date, posted_msg_count, id FROM {SQL_TABLE_PREFIX}users WHERE ' . $qry . ' id>1 ORDER BY ' . $ord . ' LIMIT '.qry_limit($MEMBERS_PER_PAGE, $start));
while ($r = db_rowobj($c)) {
$find_user_data .= '{TEMPLATE: find_user_entry}';
}
unset($c);
if (!$find_user_data) {
$find_user_data = '{TEMPLATE: find_user_no_results}';
}
$pager = '';
if (($total = (int) q_singleval('SELECT /*!40000 FOUND_ROWS(), */ -1')) < 0) {
$total = q_singleval('SELECT count(*) FROM {SQL_TABLE_PREFIX}users WHERE ' . $qry . ' id > 1');
}
if ($total > $MEMBERS_PER_PAGE) {
if ($FUD_OPT_2 & 32768) {
$pg = '{ROOT}/ml/';
if (isset($_GET['pc'])) {
$pg .= '1/';
} else if (isset($_GET['us'])) {
$pg .= '2/';
} else {
$pg .= '0/';
}
$ul = $usr_login ? urlencode($usr_login) : 0;
$pg2 = '/' . $ul . '/';
if (isset($_GET['js_redr'])) {
$pg2 .= '1/';
}
$pg2 .= _rsid;
$pager = tmpl_create_pager($start, $MEMBERS_PER_PAGE, $total, $pg, $pg2);
} else {
$pg = '{ROOT}?t=finduser&' . _rsid . '&';
if ($usr_login) {
$pg .= 'usr_login='.urlencode($usr_login) . '&';
}
if (isset($_GET['pc'])) {
$pg .= 'pc=1&';
}
if (isset($_GET['us'])) {
$pg .= 'us=1&';
}
if (isset($_GET['js_redr'])) {
$pg .= 'js_redr='.urlencode($_GET['js_redr']).'&';
}
$pager = tmpl_create_pager($start, $MEMBERS_PER_PAGE, $total, $pg);
}
}
/*{POST_PAGE_PHP_CODE}*/
Thanks for your help.
[Updated on: Wed, 05 April 2006 07:09] Report message to a moderator
|
|
|
|
|
|
Odp: "Last visit" in "members" [message #32636 is a reply to message #29033] |
Wed, 12 July 2006 11:47 |
kroku
Messages: 30 Registered: July 2006
Karma: 0
|
Member |
|
|
Hi, I made some changes in files and mod works fine, but it's one thing i can't do. When I click on tilte "Last visit" data should be sorted by last visit date, by they are still sorted by registration date.
I've edited some things, some added to sort by last visit date, but it doesn't work. Could you check what I've forgot to add or edit? I've already no idea what to do.
Here are my edited files (v2.7.5)
|
|
|