It is currently Tue Sep 07, 2010 9:16 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: About username
PostPosted: Mon Jul 19, 2010 3:15 pm 
Offline

Joined: Sat Jun 26, 2010 11:03 am
Posts: 1
Actually if you want to fix the welcome message to Welcome back, toto you have to modify the main index.php

Include the missing class to get the username:
include_once("./plug-ins/username/username.class.php");

// line 31
// show user login welcome message
$user = new umUser();

replace by : $user = new umUsername(); since this class in a extend of umUser()

also change welcome_message function :

function welcome_message($user){
global $lang;

$user->get_username();

$html = "";
if($user->loginCount == 0){
$html .= sprintf($lang['text']['welcome'],$user->username);
}else{
$html .= sprintf($lang['text']['welcomeBack'],$user->username, $user->lastLoginIP, date($lang['timeFormat'], strtotime($user->lastLoginTime)));
}
return $html;
}

// change file : languages/eng.php

'welcome' => '<b>Welcome, %s</b><br>This is your first login.',
'welcomeBack' => "<b>Welcome back, %s</b><br>Your previous login was from %s at %s.",


Top
 Profile  
 
 Post subject: Re: About username
PostPosted: Mon Jul 19, 2010 6:13 pm 
Offline

Joined: Wed May 13, 2009 5:52 pm
Posts: 494
Thanks for the great post.

_________________
PHPMembers Support Team
We are here to help...


Top
 Profile  
 
 Post subject: Re: About username
PostPosted: Mon Jul 26, 2010 2:25 am 
Offline

Joined: Fri May 21, 2010 3:31 am
Posts: 1
Hi,
please have look. i have done every thing as per your instruction but now i am getting this error.

Fatal error: Class 'umUser' not found in H:\wamp\www\phpmembers\plug-ins\username\username.class.php on line 6

Regards,


Top
 Profile  
 
 Post subject: Re: About username
PostPosted: Mon Jul 26, 2010 2:32 am 
Offline

Joined: Wed May 13, 2009 5:52 pm
Posts: 494
You will need to include /lib/user.class.php and other supporting files. Try to put the following code at the beginning of your PHP script. You may need to change the path to include the files.

Code:
include('../lib/config.inc.php');

include_once("../lib/page.class.php");

$page = new umPage(); // create page object

$page->get_language(); // get language id from client site

include_once("../languages/".$cfg['language'].".php"); // load language file

include_once("../lib/user.class.php");


_________________
PHPMembers Support Team
We are here to help...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron