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
  #1  
Old 09-23-2009, 03:19 PM
arlecchina arlecchina is offline
Member
 
Join Date: Feb 2009
Posts: 65
Credits: 4,898
arlecchina
Default Drop-down menu for myadopt.php [SOLVED]

The solution (thanks to Bloodrun) is below.

PHP Code:
<p>
    <
select name='owned_adoptables' id='owned_adoptables'>";
      
// We need to stop here and fetch their adoptables...

    
$query = "SELECT FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname'";
    
$result = mysql_query($query);
    
$num = mysql_numrows($result);

    //Loop out code
    
$i=0;
    while (
$i < $num) {

        
$aid=@mysql_result($result,$i,"aid");
        
$currentlevel=@mysql_result($result,$i,"currentlevel");
        
$name=@mysql_result($result,$i,"name");
    
    
$article_content = $article_content."<option value='".$aid."'>".$name." :: ".$currentlevel."</option>";    

    
$i++;
    }

$article_content = $article_content."</select>
</
p><br /> 
The Original Post:
Quote:
I want users to easily be able to jump from one adoptable to another when managing, viewing stats, getting codes, renaming, freezing, unfreezing and killing adoptables.

So on each of the myadopt.php action pages I would like to have a drop-down menu that lists all of the user's existing adoptables. For example, if the user is on the rename page for their first adoptable (myadopts.php?act=rename&id=1), then they could rename adoptable 1, and then choose adoptable 2 from the drop-down menu allowing them to jump to the adoptable 2's rename page (myadopts.php?act=rename&id=2).

I understand that the code below doesn't currently allow navigation. I am just trying to get the pages to list the adoptables the user owns first. It doesn't seem to be showing up and I believe it may be conflicting with some of the other code on the myadopt.php action pages.

This is what I wanted to use:

PHP Code:
$article_title "Example Title";
$article_content "Example Text";

//Get Member's adoptables from the database and display them
$query "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

//Member has 1 or more adoptable
if($num 0){
    
$dropdownstart "<select>";
    
$dropdownend "</select>";
}
//Member has 0 adoptables
else{
    
$dropdownstart "";
    
$dropdownend "";
}

$article_content $article_content."".$dropdownstart;

//Loop out code
$i=0;
while (
$i $num) {

$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$owner=@mysql_result($result,$i,"owner");

$article_content $article_content."<option value='".$aid."'>".$name."</option>";

$i++;

}

$article_content $article_content."".$dropdownend
Where would I put this so it will show up, for example, on the rename page and not conflict with the rename action code? Once I know how it will work for one of the action pages I can figure out the other ones.
Reply With Quote
 


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
Drop Down List to Use Item Messed Up Abronsyth Questions and Supports 4 12-30-2014 10:37 AM
Creating a drop down list within FORM to SHOW FounderSim Questions and Supports 6 09-27-2014 04:39 PM
Too many drop down bars? Infernette Questions and Supports 4 01-29-2013 04:01 PM
dropdown menu? AlexC Questions and Supports 35 12-27-2011 05:50 PM
HTML Drop-down Menu Knyfe Tutorials and Tips 2 02-17-2011 04:03 PM


All times are GMT -5. The time now is 01:38 PM.

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