Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2013, 07:46 PM
Infernette Infernette is offline
CODE CODE CODE CODE CODE
 
Join Date: Jan 2013
Location: Where I live? I live home.
Posts: 164
Gender: Female
Credits: 9,036
Infernette is on a distinguished road
Default Error with usergroup changing

Code:
<?php  

include("inc/init.php"); 

//***************// 
//  START SCRIPT // 
//***************// 

if(!$mysidia->user->isloggedin){
   // The user is not logged in, show generic login error message
   $mysidia->displayerror("guest");
}
else{
$newgroup= 7; 
$mysidia->db->update("users", array("usergroup" => $newgroup), "username='{$mysidia->user->username}'"); 
$article_title = "Hello, {$username}!"; 
$article_content = "You are now a part of the faction of Plutas."; 
$mysidia->page->addcontent($article_content,TRUE);
} 

//***************// 
//  OUTPUT PAGE  // 
//***************//

$mysidia->output(); 

?>
So, the script works Perfectly,it changes your usergroup to the desired one, but for some reason the usergroup isn't working. I made the group with the admin CP, and it registred that it was a viable group, and it even has the right ID i changed it to. Yet I get this error:
Fatal error: Uncaught exception 'Exception' with message 'Cannot recognize usergroup category for this user, he/she may be a guest, a bot, or else...' in /home/infern/public_html/classes/class_membercreator.php:28 Stack trace: #0 /home/infern/public_html/classes/class_membercreator.php(32): MemberCreator->getgroupcategory() #1 /home/infern/public_html/classes/class_mysidia.php(89): MemberCreator->create() #2 /home/infern/public_html/classes/class_mysidia.php(39): Mysidia->getcurrentuser() #3 /home/infern/public_html/inc/init.php(27): Mysidia->initialize() #4 /home/infern/public_html/index.php(3): require('/home/infern/pu...') #5 {main} thrown in /home/infern/public_html/classes/class_membercreator.php on line 28

And by manually editing in the usergroup, I get the same error. So I don't think it is my script doing it.
http://www.iaza.com/work/130212C/iaza13908980085500.png
http://www.iaza.com/work/130212C/iaza13908984561500.png - usergroups
__________________
No, I have no idea what I'm doing. But it works. Barely.
Reply With Quote
  #2  
Old 02-11-2013, 08:10 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is online now
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: Somerville
Posts: 4,388
Gender: Male
Credits: 123,222
Hall of Famer is on a distinguished road
Default

Oh my goodness, thanks for bringing it up. It seems to be a minor glitch resulted from my playing with the usergroup system lol. Go to classes/class_membercreator.php file and find this:

PHP Code:
  public function getgroupcategory(){
     
// This feature will be fully implemented in Mys v1.3.3 or v1.3.4.
     
if($this->usergroup == or $this->usergroup == 2) return "Admin";
     elseif(
$this->usergroup == or $this->usergroup == 6) return "Mod";
     elseif(
$this->usergroup == 3) return "Registered";
     elseif(
$this->usergroup == 5) return "Banned";
     else throw new 
Exception('Cannot recognize usergroup category for this user, he/she may be a guest, a bot, or else...');
  } 
Replace by:
PHP Code:
  public function getgroupcategory(){
     
// This feature will be fully implemented in Mys v1.3.3 or v1.3.4.
     
if($this->usergroup == or $this->usergroup == 2) return "Admin";
     elseif(
$this->usergroup == 5) return "Banned";
     else return 
"Registered";
  } 
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 02-11-2013, 08:25 PM
Infernette Infernette is offline
CODE CODE CODE CODE CODE
 
Join Date: Jan 2013
Location: Where I live? I live home.
Posts: 164
Gender: Female
Credits: 9,036
Infernette is on a distinguished road
Default

Yaaaayyy It worked ^.^
__________________
No, I have no idea what I'm doing. But it works. Barely.
Reply With Quote
  #4  
Old 02-11-2013, 10:58 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is online now
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: Somerville
Posts: 4,388
Gender: Male
Credits: 123,222
Hall of Famer is on a distinguished road
Default

Thats so good to know. ^^
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page that changes player's usergroup Derpstra Tutorials and Tips 2 01-16-2017 10:04 AM
Editing Usergroup Restriction for Shops Hwona Questions and Supports 5 08-13-2014 03:44 PM
ACP Error : Fatal error: Class 'AppController' not found in... Isura Questions and Supports 39 06-17-2013 02:26 AM
Help with changing css MaximumRide Questions and Supports 5 04-25-2012 12:37 AM
Parse error: syntax error, unexpected T_ELSE in /home/.nyles/ Saphira Questions and Supports 11 05-26-2009 11:45 AM


All times are GMT -5. The time now is 02:39 AM.

Currently Active Users: 224 (1 members and 223 guests)
Threads: 3,927, Posts: 31,310, Members: 15,511
Welcome to our newest members, StivenDrew.
BER





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636