FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » "Last visit" in "members"
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: "Last visit" in "members" [message #31127 is a reply to message #29033] Mon, 03 April 2006 18:57 Go to previous messageGo to previous message
confridín is currently offline  confridín   France
Messages: 11
Registered: November 2005
Karma:
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&amp;' . _rsid . '&amp;';
			if ($usr_login) {
				$pg .= 'usr_login='.urlencode($usr_login) . '&amp;';
			}
			if (isset($_GET['pc'])) {
				$pg .= 'pc=1&amp;';
			}
			if (isset($_GET['us'])) {
				$pg .= 'us=1&amp;';
			}
			if (isset($_GET['js_redr'])) {
				$pg .= 'js_redr='.urlencode($_GET['js_redr']).'&amp;';
			}
			$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

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fetch search-results via API ?
Next Topic: Viewing the same message from different threads
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 16:38:38 GMT 2024

Total time taken to generate the page: 0.04415 seconds