|
|
#1 |
|
Member
Join Date: Nov 2008
Posts: 64
Rep Power: 3 ![]() |
Hey,
Does anybody know how to display the user's registered city on the homepage in the same way the username is displayed in the welcome note? I'm not sure on how to code a cookie session for that. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Mar 2006
Posts: 4,114
Rep Power: 100 ![]() ![]() |
The login process doesnt pull any of the users address from the database when they login so to get it to display you would have to alter the login function to first collect that info. Then you would have to modify all the cookie and session related functions to include the existing data as well.
__________________
Larry. (Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free) Set your site apart from the competition with one of my modules...... Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
|
|
|
|
#3 |
|
Member
Join Date: Nov 2008
Posts: 64
Rep Power: 3 ![]() |
Would the altering of the function be in includes/classes/kernal/Login.php alone?
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Mar 2006
Posts: 4,114
Rep Power: 100 ![]() ![]() |
yep. The other session and cookie functions should be in there as well.
__________________
Larry. (Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free) Set your site apart from the competition with one of my modules...... Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
|
|
|
|
#5 |
|
Member
Join Date: Nov 2008
Posts: 64
Rep Power: 3 ![]() |
Sorry to bug again, I'm not too good at coding, but I made these changes:
/** * Update the users table session information * * @access private * @return void * @internal requires that _userData be set */ function _saveSession() { $sSQL = 'UPDATE ' . PREFIX . 'users SET lastlogin=NOW(), cookie=' . $this->_db->quoteInto(md5($this->_userData['username'])) . ', cookie=' . $this->_db->quoteInto(md5($this->_userData['country'])) . ', session = ' . $this->_db->quoteInto(session_id()) . ', custip = ' . $this->_db->quoteInto($_SERVER['REMOTE_ADDR']) . ' WHERE id =' . $this->_userData['id']; $this->_db->query($sSQL); } /** * Set a users session * * @access private * @return void * @internal requires that _userData be set */ function _setUserSession() { $_SESSION['uid'] = $this->_userData['id']; $_SESSION['username'] = htmlspecialchars($this->_userData['username']); $_SESSION['country'] = htmlspecialchars($this->_userData['country']); $_SESSION['cookie'] = md5($this->_userData['username']); $_SESSION['cookie'] = md5($this->_userData['country']); $_SESSION['userlevel'] = $this->_userData['level']; $_SESSION['logged'] = true; $_SESSION['hash'] = $this->_hash; } Am I heading in the right direction here? |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Mar 2006
Posts: 4,114
Rep Power: 100 ![]() ![]() |
The changes you made simply place the a variable into a session or a cookie, but nothing you did actually collected that data from the database. Thats done by the _checklogin function (I may have that name wrong, im just going from memory).
__________________
Larry. (Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free) Set your site apart from the competition with one of my modules...... Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
|
|
|
|
#7 |
|
Member
Join Date: Nov 2008
Posts: 64
Rep Power: 3 ![]() |
Am I adding a query in here somewhere?
function checkLogin($username, $password, $remember='N') { $password = $this->hashPassword($password); if (defined('IN_ADMIN')) { if (!$this->_checkAdminLogin($username, $password)) { //failed $this->_checkLoginFailed();//assign error to template return false; } $this->_setHash(); $this->_setAdminSession(); $this->_saveSession(); if ($remember <> 'N') { $this->_setCookie(); } return true; } if (!$this->_checkUserLogin($username, $password)) { //failed $this->_checkLoginFailed();//assign error to template return false; } if (!$this->_checkEmailValidation()) { //hasn't validated email $this->_checkLoginFailed();//assign error to template return false; } if ($this->_checkBanned()) { //banned $this->_checkLoginFailed();//assign error to template return false; } $this->_setHash(); $this->_setUserSession(); $this->_saveSession(); if ($remember <> 'N') { $this->_setCookie(); } return true; } |
|
|
|
|
|
#8 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,776
Rep Power: 110 ![]() |
Open Login and find the function _setUserSession().
Next inside this find: $_SESSION['username'] = htmlspecialchars($this->_userData['username']); Just below it add: $_SESSION['city'] = htmlspecialchars($this->_userData['city']); Then in the template: {$smarty.session.city}
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#9 |
|
Member
Join Date: Nov 2008
Posts: 64
Rep Power: 3 ![]() |
Thanks Eric
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shumen.biz - City Classified Ads | SecondShoe | Site Critiques | 7 | 10-24-2008 06:58 PM |
| listing address different from user's addesss | anna245 | v4 Questions & Support | 1 | 04-18-2008 01:42 PM |
| Pre-populated Town/City | teg | v3.1 Questions & Support | 4 | 10-22-2007 12:49 PM |
| When not using Address or City | Grebogreen | v4 Questions & Support | 2 | 07-05-2007 11:46 AM |
| User's credit ??? | Unregistered | Pre Sales Questions | 1 | 06-08-2007 09:02 AM |