Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-28-2017, 03:11 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,985
Dinocanid is on a distinguished road
Default User Shops

Requirements: Database math | Original Owner | Secondary Currency
Description: This addon allows users to create their own shops that they can use to sell their pets and items to other users. The shop styling is the same from Kyttias's Item Shop mods, but you don't need that mod for this one to work.
(At the moment, this tutorial only covers pets)
  Spoiler: Changelog 
12/30/17: Fixed a bug where you couldn't edit your own shop

-Step 1-
Create a new table in the database called (prefix)_adopt_stock with these settings:


Next, create another table called (prefix)_user_shops with these settings:



-Step 2-
Download and unzip the file in the attachments, then place them where they need to go.

-Step 3-
You want a way for users to put their pets up for sale. This is how I set it up on my site in myadoptsview.php: Pastebin link
Now I can use {$sale_manage} to display all the information I need.
That should be it! Let me know if there are any bugs in it, since I'm not always good at spotting them all.

-Q&A-
Q: Why don't you use mysidia's form builder?
A: Honestly, I just don't like using it. To me, using an html form allows for more customization and flexability

Q: The styling looks a weird!
A: I use Bootstrap 4 on my site, so the styling might look weird if you don't have it installed. Luckily, the tables and forms can easily be re-styled.

Q: What is "tax" for?
A: That was meant to be a feature where users could apply a tax to their shops, but I ended up not including it.
Attached Files
File Type: zip usershops mod_dinocanid.zip (5.9 KB, 24 views)
__________________

Last edited by Dinocanid; 12-30-2017 at 08:48 AM.
Reply With Quote
  #2  
Old 12-28-2017, 10:40 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,176
Abronsyth is on a distinguished road
Default

Ooh! Nice!! Absolutely going to play with this tomorrow, thank you so much for sharing!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #3  
Old 12-29-2017, 11:34 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,176
Abronsyth is on a distinguished road
Default

I'm about to go to bed so I am keeping this short- I'm having an issue when trying to edit my shop where it is not recognizing that my uid is the shop_manager id, so it's telling me I don't own the shop.
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #4  
Old 12-30-2017, 08:43 AM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,985
Dinocanid is on a distinguished road
Default

Quote:
Originally Posted by Abronsyth View Post
I'm about to go to bed so I am keeping this short- I'm having an issue when trying to edit my shop where it is not recognizing that my uid is the shop_manager id, so it's telling me I don't own the shop.
I think it's because I forgot to add these variables to the "else" statement in public function edit() of shopcpview.php:
PHP Code:
$manager_id $shop->manager_id;
            
$uid $mysidia->user->uid
I re-uploaded the script in case that wasn't what was missing, but I think that's what I did.

EDIT: There's also a bug where premium currency would still subtract and proceed with giving you the pet, even if you don't have enough. Add this alongside the existing "money check" to fix it:
PHP Code:
$adopt_premium_price $_REQUEST["adopt_premium_price"];
$premium_money_check $mysidia->db->select("users", array("premiumcurrency"), "uid = '{$mysidia->user->uid}'")->fetchColumn();
elseif(
$premium_money_check $adopt_premium_price){
                    
$document->add(new Comment("<p>Whoops! You don't have enough premium currency to buy this pet!</p> <a href='/usershop/browse/{$shop_id}'>Continue shopping?</a>"));
                    return;
                } 
__________________

Last edited by Dinocanid; 12-30-2017 at 09:23 AM.
Reply With Quote
  #5  
Old 12-30-2017, 12:50 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,176
Abronsyth is on a distinguished road
Default

Awesome, that was it! Thank you :D
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #6  
Old 03-28-2018, 10:27 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 21,771
NobodysHero is on a distinguished road
Default I made a problem. -.-

Code:
[28-Mar-2018 22:24:23 America/New_York] PHP Fatal error:  Uncaught exception 'LanguageException' with message 'Language var add does not exist.' in /home/mystfell/public_html/classes/class_language.php:68
Stack trace:
#0 /home/mystfell/public_html/view/shopcpview.php(70): Language->__get('add')
#1 /home/mystfell/public_html/classes/class_frontcontroller.php(100): ShopcpView->add()
#2 /home/mystfell/public_html/index.php(74): FrontController->render()
#3 /home/mystfell/public_html/index.php(78): IndexController::main()
#4 {main}
  thrown in /home/mystfell/public_html/classes/class_language.php on line 68
Halp?

Also, I removed the premium_price... So, if that's a problem, would be wonderful to know the right way to sell their pets for regular currency.

Thanks!
__________________

Venture Into The Mist
Reply With Quote
  #7  
Old 03-29-2018, 01:41 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,985
Dinocanid is on a distinguished road
Default

Looks like it was a mistake on my end, I forgot to include the lang file ^^;
I included it as an attachment for you.

Selling pets for regular currency is already included in the mod (in the pastebin link). All you would have to do is remove all of the parts that involve premium currency from the pastebin code and the usershop/usershopview code if you don't want to give that option to users. It shouldn't break anything afaik.
Attached Files
File Type: php lang_shopcp.php (2.2 KB, 11 views)
__________________
Reply With Quote
  #8  
Old 03-29-2018, 10:04 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 21,771
NobodysHero is on a distinguished road
Default

Thanks! That's actually exactly what I did. YAY! Thanks for the mod, it's exciting to be able to offer shops to my users!

Edit: Actually, three more things. >.< For some reason, it's showing my header image as the background for the URL input?

2nd thing: I can't figure out how to stock my shop?

3rd thing: It doesn't allow the selection of item shop. The radio is stuck on adopts?

Sorry! -hides.-
__________________

Venture Into The Mist

Last edited by NobodysHero; 03-29-2018 at 11:04 PM. Reason: Additional questions
Reply With Quote
  #9  
Old 03-29-2018, 11:37 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,985
Dinocanid is on a distinguished road
Default

With the way it is now, you can only stock your shop from the myadopts page (I plan to add it to the shopCP at some point, but it is possible to make an alternate way in the meantime with the example code if you know how). The pastebin code gives an example of a section on a pet's manage page where you can add/remove them from your shop and for what price.
  Spoiler: what it looks like 

Item shops aren't available/made yet, so adopts is the only selectable option for now.

For the header image, can I see a screenshot? The image is appearing inside the url box?
__________________

Last edited by Dinocanid; 03-29-2018 at 11:42 PM.
Reply With Quote
  #10  
Old 03-30-2018, 10:25 AM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 21,771
NobodysHero is on a distinguished road
Default

Yeah, I included that, but when I go to my pet's profile, it doesn't show anything?

I've attached my code, if you wouldn't mind looking through it? Maybe I missed something. x.x

Here's the image of the creation page:

Attached Files
File Type: php myadoptsview.php (12.0 KB, 5 views)
__________________

Venture Into The Mist
Reply With Quote
Reply


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


All times are GMT -5. The time now is 10:13 PM.

Currently Active Users: 635 (0 members and 635 guests)
Threads: 4,081, Posts: 32,031, 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