View Single Post
  #2  
Old 04-17-2015, 03:01 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 87,064
Kyttias is on a distinguished road
Default

Well I can give you this, to simplify the database stuff at the start, but read the entire post first:
Database
Create the adopts_pets_group table in the database. You can use the following SQL:
Code:
CREATE TABLE IF NOT EXISTS `adopts_pet_groups` (
  `name` varchar(15) NOT NULL,
  `user` varchar(20) NOT NULL,
  `id` int(11) NOT NULL,
  `group` varchar(15) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Note that if your prefix is not adopts_, which it would be by default, then you need to change it in the code above to match what you set your prefix to be during installation.
HOWEVER, after this point there's not much I can say on the matter without understanding what the code did better.

I CAN say that doadopt.php does not exist anymore, but, similar lines in similar locations do exist -- however, even though they do, it is not a line that actually needs modifying. When a pet is created, the database is automatically going to already give it a group column, and, it is going to be set the default value of zero. So no worries here, moving on--

As for myadopts.php, obviously things have changed a lot, so you cannot simply replace your entire file. I don't know what in there belonged to the original myadopts.php for v1.3.1 and what was newly added by the mod, and I'd have to compare the two to find out. Further, as of v1.3.4, pages are now controlled in a model-view-controller fashion, meaning, there are "two" files for every one page. This is mostly useful in being able to bounce form data back and forth on the "same" page.

Since a form is definitely being used in this mod to create new pet groups and to manage what group you want to belong to, I'd have to study what's going and catch the data, then update the database for these form submissions.

I don't have time right now, but perhaps others can take a crack at it. For the best (simple) example of how form data is being sent and collected, I'd observe how donate.php and view/donateview.php are working together to submit forms. And for further general reading on working with the framework in v1.3.4, I recommend reading this vague guide I made while helping someone once.

Good luck!
__________________
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; 04-19-2015 at 11:34 PM.
Reply With Quote