Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2014, 05:39 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,179
Hwona is on a distinguished road
Default Editing Usergroup Restriction for Shops

Hi there! I was wondering what files I'd have to edit the usergroup restriction for shops... with v.1.3.2. I'm trying to copy that piece of code, but I can't find it. Thanks.
Edit: Sorry, I was unclear. I wanted to add a piece of code that would only allow users of a certain faction to enter. I was planning to edit the part of code that only allows certain usergroups into certain shops, but I simply can't find it. XP
__________________

Last edited by Hwona; 08-13-2014 at 03:10 PM.
Reply With Quote
  #2  
Old 08-09-2014, 12:20 AM
squiggler's Avatar
squiggler squiggler is offline
Squiggling since 1995
 
Join Date: Jul 2013
Posts: 185
Gender: Unknown/Other
Credits: 8,105
squiggler is on a distinguished road
Default

I think that's an ACP or a PHPMyAdmin thing.
__________________
Avatar courtesy of Doll Divine.
Reply With Quote
  #3  
Old 08-09-2014, 05:09 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,179
Hwona is on a distinguished road
Default Re

I'm trying to use that code to make a new one.. but I'll check there. ^.^
__________________
Reply With Quote
  #4  
Old 08-13-2014, 03:10 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,179
Hwona is on a distinguished road
Default

Still need! Sorry, I've been procrastinating with this project!
__________________
Reply With Quote
  #5  
Old 08-13-2014, 03:19 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,681
Hall of Famer is on a distinguished road
Default

Well the shop permission for Mys v1.3.x is not set for usergroups, but rather for each individual users if you enable user-based access. To make it for usergroups, you need to create a new field/column in table prefix.groups called 'canshop', and play around it.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #6  
Old 08-13-2014, 03:44 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,179
Hwona is on a distinguished road
Default

Ah, I see in that case, do you know how to add this to the shop code? I've tried comparing the user's faction to the shop's faction in this file, but the page just breaks. O.o:

PHP Code:
<?php

require("inc/init.php");

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

$mysidia->user->getstatus();
if(!
$mysidia->user->isloggedin){
   
// The user is not logged in, show generic login error message
   
$mysidia->displayerror("guest");
}
elseif(
$mysidia->user->status->canshop == "no"){
   
// The user's permission to browse shops is banned, show error message
   
$mysidia->page->settitle($lang->global_guest_title);
   
$mysidia->page->addcontent($lang->denied);
}  
elseif(!
$mysidia->input->get("shopname")){
   
// The user has yet to enter a shop, so we may as well list the shop
   
$mysidia->page->settitle($lang->access);
   
$mysidia->page->addcontent($lang->tfype);
   
$shoplist = new Shoplist($mysidia->input->post("shoptype"));
   
$shoplist->display();
}
elseif(!
$mysidia->input->get("itemname") and !$mysidia->input->get("adopttype")){
   
// The user has entered a shop but not yet specified the item or adoptables to purchase
   
$stmt $mysidia->db->select("shops", array(), "shopname = '{$mysidia->input->get(shopname)}'");
   
   if(
$row $stmt->fetchObject()){
   
    
$shoptype trim($row->shoptype);
    
$shopimagetrim($row->shopimage);
    
$shopcolortrim($row->shopcolor);
    
$textcolortrim($row->textcolor);
    
$description = ($row->description);
    
    if(isset(
$shopcolor) AND $shopcolor!="none"){
        
$pagetext ="<div style=' background:#".$shopcolor.";";
        
        if(isset(
$textcolor) AND $textcolor !="none"){
            
$pagetext .=" color: #".$textcolor.";'>";
        }
        
        else{
            
$pagetext .="'>";
        }
    }
    
    if((!isset(
$shopcolor) OR $shopcolor=="none") AND (isset($textcolor) AND $textcolor !="none")){
         
$pagetext ="<div style=' color: #".$textcolor.";'>";
    }
      
  
        
        
$pagetext .="<center><img src='".$shopimage."'><br />".$description."<br /><br /></center>";
        

    if((isset(
$shopcolor) AND $shopcolor!="none") OR (isset($textcolor) AND $textcolor !="none")){
        
$pagetext .="</div>";
    }

    
$mysidia->page->addcontent($pagetext); 
    
    
    
$shoplist = new Shoplist($shoptype);
    
$shop $shoplist->createshop($mysidia->input->get("shopname"));
    
$mysidia->page->settitle($lang->welcome);
    
$shop->display();
    
$mysidia->page->addcontent("<center><FORM><INPUT Type='button' VALUE='Back' onClick='history.go(-1);return true;'></FORM></center>"); 
    
   }
   
   else{
      
$mysidia->page->addcontent($lang->denied); 
   }
}
elseif(
$mysidia->input->get("itemname") and !$mysidia->input->get("adopttype")){
   
// The user has specified an item to purchase, let's process this request
   
$shop = new Itemshop($mysidia->input->get("shopname"));
   
$item $shop->getitem($mysidia->input->get("itemname"));
   
$item->assign($mysidia->user->username);
   
$oldquantity $item->getoldquantity();
   
$newquantity $oldquantity $mysidia->input->post("quantity");
   
   if(!
is_numeric($mysidia->input->post("quantity"))){
      
$mysidia->page->settitle($lang->global_action_title);
      
$mysidia->page->addcontent($lang->invalid_quantity);
   }
   elseif(
$newquantity $item->cap){
      
$mysidia->page->settitle($lang->global_error);
      
$mysidia->page->addcontent($lang->full_quantity);   
   }
   elseif(
$shop->purchase($item)){
      
// The item is purchased successfully, now let's process the request
      
$mysidia->page->addcontent("<center>{$lang->purchase_item}{$item->getcost($shop->salestax)} {$mysidia->settings->cost} <p><a href='http://felkyocreatures.com/inventory.php'>Click here to go to your inventory</a><p><FORM><INPUT Type='button' VALUE='Back' onClick='history.go(-1);return true;'></FORM></center>");
   }
   else{
      
$mysidia->page->settitle($lang->global_error);
      
$mysidia->page->addcontent($lang->money);  
   }   
}
elseif(!
$mysidia->input->get("itemname") and $mysidia->input->get("adopttype")){
   
// The user has specified an adoptable to purchase, let's process this request
   
$shop = new Adoptshop($mysidia->input->get("shopname"));
   
$adopt $shop->getadopt($mysidia->input->get("adopttype"));
   
$adopt->assign($mysidia->user->username);
   
   if(
$shop->purchase($adopt)){
      
// The adoptable is purchased successfully, now let'ss process the request
      
$mysidia->page->addcontent("<center>{$lang->purchase_adopt}{$adopt->getcost($shop->salestax)} {$mysidia->settings->cost} <p><a href='http://felkyocreatures.com/mycreatures.php'>Click here to go to your creatures</a> <p><FORM><INPUT Type='button' VALUE='Back' onClick='history.go(-1);return true;'></FORM></center>");
   }
   else{
      
$mysidia->page->settitle($lang->global_error);
      
$mysidia->page->addcontent($lang->money);
   }
}
else{
   
// Invalid action specified, show generic error message
   
$mysidia->displayerror("action");
}

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

$mysidia->output();

?>
__________________
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 3 07-29-2020 11:27 PM
Shops voni Questions and Supports 3 04-22-2015 02:01 PM
Help with shops. Nieth Questions and Supports 5 11-26-2013 05:15 AM
Error with usergroup changing Infernette Questions and Supports 3 02-11-2013 09:58 PM
Again Shops RoconzaArt Questions and Supports 10 01-17-2011 04:32 PM


All times are GMT -5. The time now is 12:27 AM.

Currently Active Users: 630 (0 members and 630 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


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