Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #11  
Old 07-04-2014, 03:50 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 67,477
Hwona is on a distinguished road
Default

^I want the code to display some radio buttons that will allow a user to actually choose to spot to put a trinket in instead of having the trinket go to the only slot the trinket type was set to go to.(Hope that made sense) The user would then click a radio button to select the slot, and then the rest of the code would put the trinket there and show this message: The trinket has been added. :3 Would adding a "comment" instead work?
__________________
Reply With Quote
  #12  
Old 07-04-2014, 06:52 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 67,477
Hwona is on a distinguished road
Default

Hmmm... would this code work?:
PHP Code:
function items_trinket($item$adopt){
  
$mysidia Registry::get("mysidia");
$slot1 $this->adopt->getAdoptSlot1();
$slot2 $this->adopt->getAdoptSlot2();
$slot3 $this->adopt->getAdoptSlot3();
$slot4 $this->adopt->getAdoptSlot4();
$slot5 $this->adopt->getAdoptSlot5();
$message = &#8220;<input type=’radio’ name=’slot[ ]’ value=’slot1’ /><span class=’slot’><img src='{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot1}.png'></span><br>
<input type=&#8217;radio’ name=’slot[ ]’ value=’slot2’ /><span class=’slot’><span class=’slot’><img src='{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot2}.png'></span><br>
<input type=&#8217;radio’ name=’slot[ ]’ value=’slot3’ /><span class=’slot’><img src='{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot3}.png'></span><br>
<input type=&#8217;radio’ name=’slot[ ]’ value=’slot4’ /><span class=’slot’><img src='{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot4}.png'></span><br>
<input type=&#8217;radio’ name=’slot[ ]’ value=’slot5’ /><span class=’slot’><img src='{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot5}.png'></span><br>
<input type=&#8217;submit’ name=’choose’ value=’Give Trinket to Adoptable’ />”;
$document->add(new Comment($message));
if (!isset(
$_POST[&#8216;slot’])) {
$noslot = &#8220;You have not selected a slot to place this trinket in.”
return $noslot;
}
else {
$slot $_POST[&#8216;slot’];
$image $item->itemname;
$note "The trinket has been given to this adoptable!";
  
$mysidia->db->update("owned_adoptables", array("lastbred" => 0), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$delitem $item->remove(); 
  return 
$note;

*crosses fingers*
__________________
Reply With Quote
  #13  
Old 07-10-2014, 05:48 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 67,477
Hwona is on a distinguished road
Default

Ok, I tested out this code:
PHP Code:
function items_trinket($item$adopt){
  
$mysidia Registry::get("mysidia");
$slot1 $this->adopt->getAdoptSlot1();
$slot2 $this->adopt->getAdoptSlot2();
$slot3 $this->adopt->getAdoptSlot3();
$slot4 $this->adopt->getAdoptSlot4();
$slot5 $this->adopt->getAdoptSlot5();
$message ="<input type=’radio’ name=’slot[]’ value=’slot1’ /><span class=’slot’><img src='{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot1}.png'></span><br>
<input type='radio’ name=’slot[]’ value=’slot2’ /><span class=’slot’><span class=’slot’><img src='
{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot2}.png'></span><br>
<input type='radio’ name=’slot[]’ value=’slot3’ /><span class=’slot’><img src='
{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot3}.png'></span><br>
<input type='radio’ name=’slot[]’ value=’slot4’ /><span class=’slot’><img src='
{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot4}.png'></span><br>
<input type='radio’ name=’slot[]’ value=’slot5’ /><span class=’slot’><img src='
{$mysidia->path->getAbsolute()}picuploads/trinkets/{$slot5}.png'></span><br>
<input type='submit’ name=’choose’ value=’Give Trinket to Adoptable’ />"
;
$document->add(new Comment($message));
if (!isset(
$_POST['slot'])) {
$noslot "You have not selected a slot to place this trinket in.";
return 
$noslot;
}
else {
$slot $_POST['slot'];
$image $item->itemname;
$note "The trinket has been given to this adoptable!";
  
$mysidia->db->update("owned_adoptables", array('{$slot}' => '{$image}'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$delitem $item->remove(); 
  return 
$note;

and got this error on a blank page when I tried to use the item:
Parse error: syntax error, unexpected end of file in /home/wallie12/public_html/functions/functions_items.php on line 391
I'm pretty certain the code above is the issue, but I don't know what's wrong. :L
__________________
Reply With Quote
  #14  
Old 07-10-2014, 05:55 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 129,183
Kyttias is on a distinguished road
Default

You need a closing bracket, I think. You closed the else, but not the function itself.
__________________
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.
Reply With Quote
  #15  
Old 07-10-2014, 06:11 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 67,477
Hwona is on a distinguished road
Default

Thanks! The page is no longer broken, but now this message pops up:
The item function is invalid. I already modified the privateitem.php file...
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trinket Images Hwona Art Gallery 3 07-03-2014 10:44 PM
Are there ani guides for making a theme here? Rovick Questions and Supports 13 11-22-2013 04:47 PM
Making IDs be codes? Empress_Swanbottom Questions and Supports 6 02-16-2013 01:24 PM
Making an RSS Feed! PTGigi Tutorials and Tips 1 06-01-2012 03:31 AM
Making a map... help! dulop Questions and Supports 5 05-23-2012 08:14 PM


All times are GMT -5. The time now is 09:00 AM.

Currently Active Users: 3028 (0 members and 3028 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