Mysidia Adoptables Support Forum  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-14-2014, 02:13 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 128,897
Kyttias is on a distinguished road
Default

Hmm... Well... I modified my default shop pages. Specifically, classes/class_itemshop.php. Outside of that, I really can't help. Shops are tied to three or four other files and having to clone all of them would just be tedious. Save backups of the original classes/class_itemshop.php, and bear with me. (And I assume the class for adoptshop would be similar, but I actually haven't modified mine yet.) Because you add items to shops through the AdminCP, these additional files I'm talking about all work together to display the items that belong in a particular shop, pull up item information, and construct the functionality needed for the buttons. To recreate it all, you'd need exactly the same files already in place -- so you really have no choice but to work with them, else work entirely from scratch with little help from the community.

Inside public function display is where all the important magic is happening for this. So examine everything going on in this function in its default state and try to wrap your head around it.

If you could draw or create a visual mockup/representation of what you want the finished product to look like, I can try to help from there? I will also need to know the name of at least two item shops to start my example, but the more the merrier. I designed my shops to use tooltips, but any arrangement of information is possible.

You want two things - to render an NPC image based on the shop, and, I assume to change the entire way items are listed.

As a start, in public function display:
PHP Code:
# Choose the NPC image based on the name of the shop
    
switch ($this->shopname) {
        case 
"Crossed Roads":                     
            
$npc_img "http://fc00.deviantart.net/fs71/f/2014/262/a/2/base_npc_60_by_kyttias-d7zqrnf.png";
            break;
        case 
"Spectrum"
            
$npc_img "http://fc00.deviantart.net/fs70/f/2014/313/a/c/base_npc_2_60_by_kyttias-d85ww5k.png";    
            break;
        default; 
            
$npc_img "http://placekitten.com/g/200/500";
            break;
    }
            
# Now let's render the NPC, use css to position the div with the class name of .shop_npc
    
$document->add(new Comment("<div class='shop_npc'><img src='{$npc_img}'/></div>"FALSE)); 
I have two shops, Crossed Roads and Spectrum. If I make a shop and forget to list it here, it will use the default.

The switch statement I've constructed above is using $this->shopname. The word "this" means, literally, defined inside this class. This page. Up at the top you'll find public $shopname;. If you were some other page, you'd need to pull up that information with a function yourself. Why create a page for each shop if each shop is going to need to pull all the same data from the database to construct itself? This is the entire basis of object oriented PHP - to avoid repeating yourself.

So this is why I encourage you to modify the default shop rendering.

If you'll show me how you want items to display, if you don't want the default table that is, I can get to the next step. ^^

-

But, then again, upon reading closer, I think you may also be wanting an entirely new kind of shop? One that uses items, rather than currency? (Possibly multiple items? And currency in addition? How complex.)

If you like the default shops as they are, you can ignore everything I've said. But an entirely new kind of shop that uses items as a currency would need work beyond what I can do in a single night.

I mean, I like the concept, so I can try to tinker over winter break. How many shops of this kind were you wanting? Just one, or many?
__________________
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; 12-14-2014 at 02:26 PM.
Reply With Quote
 

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
visitors do not write messages in the shoutbox? kratosvr Questions and Supports 1 10-29-2011 07:45 PM
Not show shop adopts on adopt page SilverDragonTears Questions and Supports 0 08-16-2011 06:57 PM
Ad code "unable to write" LilPixie Questions and Supports 4 03-26-2009 01:07 PM
Re-Write suggestions rosepose Suggestions and Feature Requests 4 03-22-2009 07:13 PM
Suggestions For The Possible Re Write gjac1 Suggestions and Feature Requests 2 03-19-2009 05:15 AM


All times are GMT -5. The time now is 09:43 PM.

Currently Active Users: 3319 (0 members and 3319 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636