Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
Adoptable Shops With Conditions
**Works perfectly with Kyttias' Know-Gender-Before-Naming Mod!
Here's a rough example of viewing the new shop page, adopting a pet, and then showing that it subtracts currency. This also allows users to name pets they are purchasing, which is a small thing but pleasant. Why this exists: For those who do employ adoptable shops on their sites, they'll find that the adoptable conditions (for example, the number limiting condition) do not work with adoptables purchased from shops. This can be a major head ache if your adoptables are supposed to have certain rarities, and for other reasons. What this mod does: This mod simply is a copy of the Adopt page, which allows for you to customize each shop page with a custom description, images, and even a custom table for the adoptables for each shop, if you like. The big part, of course, is that conditions now work so, say you have a pet that you only want users to be able to buy 3 of, once they've purchased 3 that pet no longer shows. Who contributed to this mod: I'd really like thank Kyttias for assisting me in getting it so that users actually do pay for the adoptables that they purchase. Couldn't have done it without her help! How to set up this mod: OK, so I have attached the BASE files for this mod, but they MUST be edited or they will not work with your website. ---------------------- Step One: Download the zip file below and unzip it however you like. There should be a folder called Shop Mod, and within that a file called NAME.php, and a view and lang file. Inside of the view and lang files should be NAMEview.php and lang_NAME.php Once you're sure you have all of this, we're ready to edit. Step Two: Create a Shop If you don't have one already, you're going to want to create an adoptable shop. Set the status of it to "Hidden" and everything else is up to you. Keep the name handy, since you'll need it. Step Three: NAME.php Now, open up NAME.php in your favorite file editor (mine is notepadd++). The first thing we'll edit is right at the top; PHP Code:
PHP Code:
PHP Code:
Save the file, replacing NAME with whatever you put in place of SHOP. (ex: mine is mao.php) Make sure the filename is lowercase (mao.php instead of Mao.php). Step Four: NAMEview.php Now open up the file NAMEview.php, within the view folder. We have to change a couple of things in here. The first part is this; PHP Code:
Now find this line; PHP Code:
Now scroll down until you find this line; PHP Code:
Now scroll down to find this; PHP Code:
Now save this so that it matches the file name of the previous file, but with view tacked on (ex: for me it's maoview.php). Make sure the filename is lowercase (maoview.php instead of Maoview.php). ***Goodies*** $adoptTable = new Table("table", "", FALSE); This line is fun because you can use it to actually customize a specific shop's table! If you create a new section in your CSS file like so, and replace "table" with your own words (for example; "maotable") and then changed TABLENAME to match that, then you can customize this specific table. HTML Code:
#TABLENAME {stuff here} Now, open up lang_NAME.php...you'll want to edit a good deal of this. The lang file displays most of the text users actually see. The first line to edit is the title; PHP Code:
PHP Code:
You can edit most of this text to your liking, honestly. But the only other thing I'll specifically point out is this line; PHP Code:
Now save this file, and replace NAME with the same thing you replaced it with for the past two files (mine is lang_mao.php). Step Six: Well, you're just about all done! Just upload the files to your site in the appropriate folders (NAME.php goes in the home directory, NAMEview.php goes in the view folder, and lang_NAME.php goes in the lang folder). Go check it out on your site by visiting the url .../NAME (name obviously changed to whatever you changed it to). To create more adoptable shops like this, just repeat the process but replace all of the edits to reflect the new shop. If you have any questions or run into any errors, let me know!
__________________
My Mods Site (1.3.4, 2020 Mods) Last edited by Abronsyth; 02-17-2016 at 09:31 PM. |
#2
|
|||
|
|||
Did everything, but I seem to get this when I try to visit it:
Fatal error: Uncaught exception 'Exception' with message 'Fatal Error: Class AdoptsView either does not exist, or has its include path misconfigured!' in /home/felidaef/public_html/classes/class_loader.php:83 Stack trace: #0 [internal function]: Loader->load('AdoptsView') #1 /home/felidaef/public_html/classes/class_controller.php(135): spl_autoload_call('AdoptsView') #2 /home/felidaef/public_html/classes/class_appcontroller.php(115): Controller->loadView(Object(Resource\Native\String)) #3 /home/felidaef/public_html/classes/class_frontcontroller.php(71): AppController->getView() #4 /home/felidaef/public_html/index.php(73): FrontController->getView() #5 /home/felidaef/public_html/index.php(78): IndexController::main() #6 {main} thrown in /home/felidaef/public_html/classes/class_loader.php on line 83 edit; I also get this when I try to visit any user profiles; Fatal error: Uncaught exception 'MemberNotfoundException' with message 'The specified user 3 does not exist...' in /home/felidaef/public_html/classes/class_member.php:30 Stack trace: #0 /home/felidaef/public_html/classes/class_friendlist.php(51): Member->__construct('3') #1 /home/felidaef/public_html/classes/class_userprofile.php(161): Friendlist->display() #2 /home/felidaef/public_html/classes/class_userprofile.php(82): UserProfile->getfriends(Object(Member)) #3 /home/felidaef/public_html/view/profileview.php(83): UserProfile->display('friends', Object(Member)) #4 /home/felidaef/public_html/classes/class_frontcontroller.php(100): ProfileView->view() #5 /home/felidaef/public_html/index.php(74): FrontController->render() #6 /home/felidaef/public_html/index.php(78): IndexController::main() #7 {main} thrown in /home/felidaef/public_html/classes/class_member.php on line 30 Last edited by gunpowdercat; 02-16-2016 at 04:44 PM. |
#3
|
||||
|
||||
Other than the view page having two "?>" closing brackets at the end (one renders as plain text to the page, it works perfectly for me! Awesome~!! I'd love to see something like this done for the item shops, too... I managed a lot with my mod but it was kind of complicated in comparison. This opens up a lot of freedom for the adopt shops~~
(Unrelated: I wish it was easier to retroactively add pets to shops...? Am I missing something? I created a new one to test it, so whatever, but..... =T) Also, this should be fairly easy to integrate with this mod, right, since it's just based on on the original adopts page? -- gunpowdercat - Be sure everything is named properly and saved in the proper locations. The second error is unrelated since this mod does touch user profiles.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-16-2016 at 05:28 PM. |
#4
|
|||
|
|||
One of your animated gifs to show what these actually do before installing would be awesome, Kyttias ;)
|
#5
|
||||
|
||||
If you don't understand what this mod is for, then the default shop mod is probably good enough for your site's needs. This mod will allow further customization for those who know how to program and have ideas for custom pages. This is basically just allowing a custom page to access shop information and sell pets on behalf of a hidden shop. See my signature for information on custom pages.
I'm happy for this mod because it'll allow me to uniquely decorate each shop individually, rather than using the default adopt shop page. By default, this mod's visual appearance is 100% identical to the freely available adoption page, the only difference is that pets are not free. If you know how add your own html (again, see the custom page guide), you can easily modify the appearance of the page, add in a shop keeper, etc.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-16-2016 at 08:16 PM. |
#6
|
||||
|
||||
gunpowdercat, as Kyttias said one of your files is misnamed, or you did not change these lines properly;
PHP Code:
PHP Code:
Kyttias, actually I was planning on testing how your Know-Gender mod can work with this! It definitely should work, in fact the differences are very minor so you'd only have to change the wording bits in yours to customize it more. So yep, should work perfectly! Edit: Tested and yesiree it does work! You just need to go through and do the modifications for all of the view files :)
__________________
My Mods Site (1.3.4, 2020 Mods) Last edited by Abronsyth; 02-17-2016 at 11:51 AM. |
#7
|
|||
|
|||
I have gone through and checked, multiple times-- There is no error in my editing, at all..
I keep getting this now; Fatal error: Uncaught exception 'Exception' with message 'Fatal Error: Class LeopardView either does not exist, or has its include path misconfigured!' in /home/felidaef/public_html/classes/class_loader.php:83 Stack trace: #0 [internal function]: Loader->load('LeopardView') #1 /home/felidaef/public_html/classes/class_controller.php(135): spl_autoload_call('LeopardView') #2 /home/felidaef/public_html/classes/class_appcontroller.php(115): Controller->loadView(Object(Resource\Native\String)) #3 /home/felidaef/public_html/classes/class_frontcontroller.php(71): AppController->getView() #4 /home/felidaef/public_html/index.php(73): FrontController->getView() #5 /home/felidaef/public_html/index.php(78): IndexController::main() #6 {main} thrown in /home/felidaef/public_html/classes/class_loader.php on line 83 Last edited by gunpowdercat; 02-17-2016 at 12:21 PM. |
#8
|
||||
|
||||
Does a file named leopardsview.php exist in your view folder? All the error says is that it doesn't exist. Make sure you named the files before placing them!
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#9
|
|||
|
|||
Yes, it does. and it is titled "leopardview" (I deleted and tried again, this time naming them all leopard and putting leopard in instead of leopards because I decided I did not want that name.)
http://prntscr.com/a4jb7p |
#10
|
||||
|
||||
Have you tried it lowercase like all the other files?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
|
|
What's New? |
What's Hot? |
What's Popular? |