Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.4 Alchemy Mod (http://www.mysidiaadoptables.com/forum/showthread.php?t=4368)

Nieth 11-13-2015 01:09 PM

I didn't try the original, but in the one I edited, I believe I allowed for the order. It doesn't seem to work though.

../admincp/alchemy.php @ line 85
I changed:
PHP Code:

$whereClause "(item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")}) OR (item = {$mysidia->input->post("item2")} and item2 = {$mysidia->input->post("item")})"

to
PHP Code:

$whereClause "(item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")} and item3 = {$mysidia->input->post("item3")}) OR (item = {$mysidia->input->post("item")} and item3 = {$mysidia->input->post("item3")} and item2 = {$mysidia->input->post("item2")}) OR (item2 = {$mysidia->input->post("item2")} and item = {$mysidia->input->post("item")} and item3 = {$mysidia->input->post("item3")}) OR (item2 = {$mysidia->input->post("item2")} and item3 = {$mysidia->input->post("item3")} and item = {$mysidia->input->post("item")}) OR (item3 = {$mysidia->input->post("item3")} and item2 = {$mysidia->input->post("item2")} and item = {$mysidia->input->post("item")}) OR (item3 = {$mysidia->input->post("item3")} and item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")})"

and I changed ../classes/class_alchemy.php @ line 27
from:
PHP Code:

$whereClause "(item = {$this->item->id} and item2 = {$this->item2->id}) OR (item = {$this->item2->id} and item2 = {$this->item->id})"

to
PHP Code:

$whereClause "(item = {$this->item->id} and item2 = {$this->item2->id} and item3 = {$this->item3->id}) OR (item = {$this->item->id} and item3 = {$this->item3->id} and item2 = {$this->item2->id}) OR (item2 = {$this->item2->id} and item = {$this->item->id} and item3 = {$this->item3->id}) OR (item2 = {$this->item2->id} and item3 = {$this->item3->id} and item = {$this->item->id}) OR (item3 = {$this->item3->id} and item2 = {$this->item2->id} and item = {$this->item->id}) OR (item3 = {$this->item3->id} and item = {$this->item->id} and item2 = {$this->item2->id})"

Didn't seem to work. Don't know if I did something wrong or not.

Hall of Famer 11-13-2015 01:22 PM

Of course it doesnt work, because you are just reversing the order of the WHERECLAUSE, rather than changing the actual content. In your sample code, these two are equivalent, and make no difference:

Code:

item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")} and item3 = {$mysidia->input->post("item3")}
vs

Code:

item2 = {$mysidia->input->post("item2")} and item = {$mysidia->input->post("item")} and item3 = {$mysidia->input->post("item3")}
Do you understand what I mean? Lets consider this example. To say 'you have an apple and your friend has a banana', or to say 'your friend has a banana and you have an apple', it means the same thing. You are just reversing the logical order of the statement, but doesnt change the fact that apple belongs to you and banana belong to your friend. But its different if you say 'you have a banana and your friend has an apple', since in this case banana belongs to you and apple belongs to your friend. Now you can have either apple or banana, and so are with your friend. Sorry if I aint good at explaining, but I hope you get the idea.

Nieth 11-13-2015 01:33 PM

Oh, wow. I see the difference in the first statement now, I can't believe I overlooked that the first time. Thanks a bunch. I'mma rewrite it a bit, I'm sure I'll be able to get it to work this time. xD

Man, I feel so stupid for not noticing the placements.

I just need to figure out how many different 'OR's that I need now.

EDIT: Yep, all good and functional now. Thanks for the help, still new to trying to program/edit stuff.

Hall of Famer 11-13-2015 02:37 PM

You are very welcome, I am glad I can help. You can also try SQL IN clause, so you will get rid of the OR operators. However, you will need to compare each user input, ie. $mysidia->input->post("item"), and $mysidia->input->post("item2") so that your users wont enter the same item for item1, item2, etc. Here is an example for two items SQL:

Code:

$items = "({$mysidia->input->post('item')}, {$mysidia->input->post('item2')})";
$whereClause = "(item IN {$items} and item2 IN $items)"

Read the below tutorial on w3schools, and it will help:
http://www.w3schools.com/sql/sql_in.asp

Nieth 11-13-2015 03:18 PM

Ah, alright! Thanks again, I'm learning so much by messing around with everything, realizing what means what etc. Still a complete beginner, but learning is still learning.

Would there be a simple way to change the URL for the alchemy stuff or would that be too difficult to do?

Also, where can the alchemy page be edited? I'd like to add images and specific things to that page, but I can't find where to edit it.

Hall of Famer 11-18-2015 01:44 AM

Well there are two view files you can edit to add images and other specific things to the alchemy page:
/view/inventoryview.php
/admincp/view/alchemyview.php

Note you need to understand GUI programming in order to make changes, its not the HTML a front end designer may be familiar with. The style of coding is similar to Java swing, so if you understand how swing works, it will be easy for you.

Nieth 11-18-2015 05:45 AM

Yeah, I figured out after reading some guides that I would have to edit the view pages to change what the user sees, so I went in there and tried looking around to see what made sense. Absolutely nothing! So, I've decided to leave that alone until I've reached a bit more advanced stage.

Hall of Famer 11-18-2015 12:41 PM

Its not actually that hard to understand, you just need some OOP skills and understand how the composite design pattern works. I would recommend you to read the tutorial for Java swing, and after going through it you should have no problem dealing with Mysidia's GUI API(although you will need basic Java programming knowledge to follow the tutorial):
http://www.tutorialspoint.com/swing/

SapphirePhoenix 11-30-2015 02:31 PM

Which file am I supposed to upload the file into?

Nieth 11-30-2015 03:58 PM

Using the FTP, you upload the contents of the folder to the public_html folder. All the directories should split and upload into their appropriate folders so long as you do it correctly.


All times are GMT -5. The time now is 03:15 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.