Drop-down menu for myadopt.php [SOLVED]

Forum
Last Post
Threads / Messages

arlecchina

Member
Member
Joined
Feb 11, 2009
Messages
65
Points
0
Mysidian Dollar
0
The solution (thanks to Bloodrun) is below.

PHP:
<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:
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:
$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.
 
RE: Drop-down menu for myadopt.php

Um, you will need to do one of two things.

Either implement ajax this with this function. This is the hardest of the two options.

Or simple make it so that the drop down menu of the adoptable names will lead the person to another page.
 
RE: Drop-down menu for myadopt.php

Bloodrun said:
Um, you will need to do one of two things.

Either implement ajax this with this function. This is the hardest of the two options.

Or simple make it so that the drop down menu of the adoptable names will lead the person to another page.
I am planning on making it so the drop-down menu will lead the person to another page. However, currently the drop-down menu doesn't show up at all.

I believe it is conflicting with this in the original code but I'm not sure:
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'";

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.
 
RE: Drop-down menu for myadopt.php

arlecchina said:
Bloodrun said:
Um, you will need to do one of two things.

Either implement ajax this with this function. This is the hardest of the two options.

Or simple make it so that the drop down menu of the adoptable names will lead the person to another page.
I am planning on making it so the drop-down menu will lead the person to another page. However, currently the drop-down menu doesn't show up at all.

I believe it is conflicting with this in the original code but I'm not sure:
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'";

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.

Yeah I figured that much, I was trying to stall so I could find how I did it. But I currently don't have access to that information quite yet, so I have to try and remember.

But I know you wrote the code wrong for the drop-down menu.

I would have to see this Name Change page your talking about, (the coding that is) before I could give you an honest answer on where to put your drop-down menu code.
 
RE: Drop-down menu for myadopt.php

Here is the code for the rename action without the drop-down menu code I wrote (Because I don't know where to put it to make it work).

I've made several changes to Brandon's original code but none of these changes should conflict with the drop-down menu I think.

Sorry for the horizontal scrolling.

PHP:
else if($act == "rename"){

// We are renaming an adoptable

if(is_numeric($id)){

// Now we see if the adoptable actually exists...

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

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

$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");
$totalclicks=@mysql_result($result,$i,"totalclicks");
$usealternates=@mysql_result($result,$i,"usealternates");
$isfrozen=@mysql_result($result,$i,"isfrozen");
$royalbio=@mysql_result($result,$i,"royalbio");
$royaloccupation=@mysql_result($result,$i,"royaloccupation");

$i++;
}

if($aid == $id){

$image = getcurrentimage($id);

	if($currentlevel == "0"){
		$royalnametitle = "";
		$lang_caremenu_biobutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_bio_t."</span>";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton1."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton1."</a>";
		}
	}
	else if($currentlevel == "1"){
		$royalnametitle = "";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton2."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton2."</a>";
		}
	}
	else if($currentlevel == "2"){
		$royalnametitle = "";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton2."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton2."</a>";
		}
	}
	else if($currentlevel == "3"){
		$royalnametitle = "";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton2."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton2."</a>";
		}
	}
	else if($currentlevel == "4"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage4mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage4ftitle;
		}
	}
	else if($currentlevel == "5"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage5mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage5ftitle;
		}
	}
	else if($currentlevel == "6"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage6mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage6ftitle;
		}
	}
	else if($currentlevel == "7"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage7mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage7ftitle;
		}
	}
	else if($currentlevel == "8"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage8mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage8ftitle;
		}
	}

	//Frozen or Unfroozen?
	if($isfrozen == "yes"){
		$status2 = $lang_unfreeze_button;
		$renamebutton = "<div class='buttongrey buttoncarefor center'>".$lang_caremenu_rename_t."</div>";
	}
	else{
		$status2 = $lang_freeze_button;
		$renamebutton = "<a href='myadopts.php?act=rename&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_rename_t."</a>";
	}

if($isfrozen != "yes"){

if($more == ""){

$article_title = $lang_rename_title." ".$royalnametitle." ".$name;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$lang_rename." <span class='bold'>".$royalnametitle." ".$name."</span> ".$lang_rename2." <span class='bold'>".$royalnametitle." ".$name."".$lang_rename3."</p></div>

<div id='pwrapper'>
<div id='p'>
	<div id='p_up_left'></div>
	<div id='p_up'></div>
	<div id='p_up_right'></div>
	<div id='p_middle_left'></div>
	<div id='p_middle'>
		<div class='inside2'>

<div id='pwrapper2'>
	<div id='ptitle'><div class='sub-title'>".$royalnametitle." ".$name."</div></div>
	<div id='p4'>
			<div id='p5'><a href='levelup.php?id=".$aid."'><img src='".$image."' alt='".$royalnametitle." ".$name."' id='p5image' /></a></div>
			<div id='p5'>
			<div id='p1'><a href='myadopts.php?act=manage&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats2_t."</a></div>
			<div id='p1'>".$levelupbutton."</div>
			<div id='p2'>".$lang_caremenu_biobutton."</div>
			<div id='p3'>".$lang_caremenu_occupationbutton."</div>
			<div id='p1'><a href='myadopts.php?act=stats&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats_t."</a></div>
			<div id='p2'><a href='myadopts.php?act=bbcode&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_codes_t."</a></div>
			<div id='p3'>".$renamebutton."</div>
			<div id='p1'><a href='myadopts.php?act=freeze&id=".$aid."' class='button buttoncarefor center'>".$status2."</a></div>
			<div id='p1'><a href='myadopts.php?act=kill&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_setfree_t."</a></div>
			</div>
	</div>
</div>

<form name='form1' method='get' action='myadopts.php'>
<label>".$lang_adoptrename_old_label."</label> ".$name."<br />
<div class='npc_p'><p class='titania2_p'>".$lang_rename4."</p></div>
<label for='more'>".$lang_adoptrename_new_label."</label> <input name='more' type='text' id='more' class='p_middletextarea' />
<input name='id' type='hidden' id='id' value='".$id."' />
<input name='act' type='hidden' id='act' value='rename' />
<input type='submit' name='Submit' class='button' value='".$lang_adoptrename_button."' />
</form>
		</div>
	</div>
	<div id='p_middle_right'></div>
	<div id='p_down_left'></div>
	<div id='p_down'></div>
	<div id='p_down_right'></div>
</div>
</div>
<!-- google_ad_section_end -->";

}
else{

// We are renaming the adoptable

$query = "UPDATE ".$prefix."owned_adoptables SET name='".$more."' WHERE aid='".$id."' and owner='".$loggedinname."'";
mysql_query($query);

$article_title = $lang_rename_success_title;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$lang_rename_success."</p></div>
<div id='pwrapper'>
<div id='p'>
	<div id='p_up_left'></div>
	<div id='p_up'></div>
	<div id='p_up_right'></div>
	<div id='p_middle_left'></div>
	<div id='p_middle'>
		<div class='inside2'>

<div id='pwrapper2'>
	<div id='ptitle'><div class='sub-title'>".$royalnametitle." ".$name."</div></div>
	<div id='p4'>
			<div id='p5'><a href='levelup.php?id=".$aid."'><img src='".$image."' alt='".$royalnametitle." ".$name."' id='p5image' /></a></div>
			<div id='p5'>
			<div id='p1'><a href='myadopts.php?act=manage&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats2_t."</a></div>
			<div id='p1'>".$levelupbutton."</div>
			<div id='p2'>".$lang_caremenu_biobutton."</div>
			<div id='p3'>".$lang_caremenu_occupationbutton."</div>
			<div id='p1'><a href='myadopts.php?act=stats&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats_t."</a></div>
			<div id='p2'><a href='myadopts.php?act=bbcode&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_codes_t."</a></div>
			<div id='p3'>".$renamebutton."</div>
			<div id='p1'><a href='myadopts.php?act=freeze&id=".$aid."' class='button buttoncarefor center'>".$status2."</a></div>
			<div id='p1'><a href='myadopts.php?act=kill&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_setfree_t."</a></div>
			</div>
	</div>
</div>

		</div>
	</div>
	<div id='p_middle_right'></div>
	<div id='p_down_left'></div>
	<div id='p_down'></div>
	<div id='p_down_right'></div>
</div>
</div>
<!-- google_ad_section_end -->";

}
}
else{

// We cannot rename a frozen adoptable...

$article_title = $lang_frozen_title;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$lang_frozen1." <span class='bold'>".$royalnametitle." ".$name."</span>".$lang_fronze2." <a href='myadopts.php?act=freeze&id=".$id."&more=unfreeze'>".$lang_adoptremane_unfreeze_link."</a> <span class='bold'>".$royalnametitle." ".$name."".$lang_frozen3."</p></div>
<div id='pwrapper'>
<div id='p'>
	<div id='p_up_left'></div>
	<div id='p_up'></div>
	<div id='p_up_right'></div>
	<div id='p_middle_left'></div>
	<div id='p_middle'>
		<div class='inside2'>

<div id='pwrapper2'>
	<div id='ptitle'><div class='sub-title'>".$royalnametitle." ".$name."</div></div>
	<div id='p4'>
			<div id='p5'><a href='levelup.php?id=".$aid."'><img src='".$image."' alt='".$royalnametitle." ".$name."' id='p5image' /></a></div>
			<div id='p5'>
			<div id='p1'><a href='myadopts.php?act=manage&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats2_t."</a></div>
			<div id='p1'>".$levelupbutton."</div>
			<div id='p2'>".$lang_caremenu_biobutton."</div>
			<div id='p3'>".$lang_caremenu_occupationbutton."</div>
			<div id='p1'><a href='myadopts.php?act=stats&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats_t."</a></div>
			<div id='p2'><a href='myadopts.php?act=bbcode&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_codes_t."</a></div>
			<div id='p3'>".$renamebutton."</div>
			<div id='p1'><a href='myadopts.php?act=freeze&id=".$aid."' class='button buttoncarefor center'>".$status2."</a></div>
			<div id='p1'><a href='myadopts.php?act=kill&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_setfree_t."</a></div>
			</div>
	</div>
</div>

		</div>
	</div>
	<div id='p_middle_right'></div>
	<div id='p_down_left'></div>
	<div id='p_down'></div>
	<div id='p_down_right'></div>
</div>
</div>
<!-- google_ad_section_end -->";

}


}
else{

$article_title = $err_idnoexist;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$err_idnoexist_text."</p></div>
<!-- google_ad_section_end -->";

}
}
else{

$article_title = $err_idnoexist;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$err_idnoexist_text."</p></div>
<!-- google_ad_section_end -->";

}

}
 
RE: Drop-down menu for myadopt.php

arlecchina said:
Here is the code for the rename action without the drop-down menu code I wrote (Because I don't know where to put it to make it work).

I've made several changes to Brandon's original code but none of these changes should conflict with the drop-down menu I think.

Sorry for the horizontal scrolling.

PHP:
else if($act == "rename"){

// We are renaming an adoptable

if(is_numeric($id)){

// Now we see if the adoptable actually exists...

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

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

$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");
$totalclicks=@mysql_result($result,$i,"totalclicks");
$usealternates=@mysql_result($result,$i,"usealternates");
$isfrozen=@mysql_result($result,$i,"isfrozen");
$royalbio=@mysql_result($result,$i,"royalbio");
$royaloccupation=@mysql_result($result,$i,"royaloccupation");

$i++;
}

if($aid == $id){

$image = getcurrentimage($id);

	if($currentlevel == "0"){
		$royalnametitle = "";
		$lang_caremenu_biobutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_bio_t."</span>";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton1."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton1."</a>";
		}
	}
	else if($currentlevel == "1"){
		$royalnametitle = "";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton2."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton2."</a>";
		}
	}
	else if($currentlevel == "2"){
		$royalnametitle = "";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton2."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton2."</a>";
		}
	}
	else if($currentlevel == "3"){
		$royalnametitle = "";
		$lang_caremenu_occupationbutton = "<span class='buttongrey buttoncarefor center'>".$lang_caremenu_occupation_t."</span>";
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton2."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton2."</a>";
		}
	}
	else if($currentlevel == "4"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage4mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage4ftitle;
		}
	}
	else if($currentlevel == "5"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage5mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage5ftitle;
		}
	}
	else if($currentlevel == "6"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage6mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage6ftitle;
		}
	}
	else if($currentlevel == "7"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage7mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage7ftitle;
		}
	}
	else if($currentlevel == "8"){
		$lang_caremenu_biobutton = "<a href='myadopts.php?act=bio&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_bio_t."</a>";
		$lang_caremenu_occupationbutton = "<a href='myadopts.php?act=occupation&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_occupation_t."</a>";
		if($isfrozen == "yes"){
			$levelupbutton = "<span class='buttongrey buttoncarefor center'>".$levelupbutton3."</span>";
		}
		else{
			$levelupbutton = "<a href='levelup.php?id=".$aid."' class='button buttoncarefor center'>".$levelupbutton3."</a>";
		}
		if($usealternates == "yes"){
			$royalnametitle = $royalstage8mtitle;
		}
		else if($usealternates == "no" ){
			$royalnametitle = $royalstage8ftitle;
		}
	}

	//Frozen or Unfroozen?
	if($isfrozen == "yes"){
		$status2 = $lang_unfreeze_button;
		$renamebutton = "<div class='buttongrey buttoncarefor center'>".$lang_caremenu_rename_t."</div>";
	}
	else{
		$status2 = $lang_freeze_button;
		$renamebutton = "<a href='myadopts.php?act=rename&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_rename_t."</a>";
	}

if($isfrozen != "yes"){

if($more == ""){

$article_title = $lang_rename_title." ".$royalnametitle." ".$name;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$lang_rename." <span class='bold'>".$royalnametitle." ".$name."</span> ".$lang_rename2." <span class='bold'>".$royalnametitle." ".$name."".$lang_rename3."</p></div>

<div id='pwrapper'>
<div id='p'>
	<div id='p_up_left'></div>
	<div id='p_up'></div>
	<div id='p_up_right'></div>
	<div id='p_middle_left'></div>
	<div id='p_middle'>
		<div class='inside2'>

<div id='pwrapper2'>
	<div id='ptitle'><div class='sub-title'>".$royalnametitle." ".$name."</div></div>
	<div id='p4'>
			<div id='p5'><a href='levelup.php?id=".$aid."'><img src='".$image."' alt='".$royalnametitle." ".$name."' id='p5image' /></a></div>
			<div id='p5'>
			<div id='p1'><a href='myadopts.php?act=manage&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats2_t."</a></div>
			<div id='p1'>".$levelupbutton."</div>
			<div id='p2'>".$lang_caremenu_biobutton."</div>
			<div id='p3'>".$lang_caremenu_occupationbutton."</div>
			<div id='p1'><a href='myadopts.php?act=stats&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats_t."</a></div>
			<div id='p2'><a href='myadopts.php?act=bbcode&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_codes_t."</a></div>
			<div id='p3'>".$renamebutton."</div>
			<div id='p1'><a href='myadopts.php?act=freeze&id=".$aid."' class='button buttoncarefor center'>".$status2."</a></div>
			<div id='p1'><a href='myadopts.php?act=kill&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_setfree_t."</a></div>
			</div>
	</div>
</div>

<form name='form1' method='get' action='myadopts.php'>
<label>".$lang_adoptrename_old_label."</label> ".$name."<br />
<div class='npc_p'><p class='titania2_p'>".$lang_rename4."</p></div>
<label for='more'>".$lang_adoptrename_new_label."</label> <input name='more' type='text' id='more' class='p_middletextarea' />
<input name='id' type='hidden' id='id' value='".$id."' />
<input name='act' type='hidden' id='act' value='rename' />
<input type='submit' name='Submit' class='button' value='".$lang_adoptrename_button."' />
</form>
		</div>
	</div>
	<div id='p_middle_right'></div>
	<div id='p_down_left'></div>
	<div id='p_down'></div>
	<div id='p_down_right'></div>
</div>
</div>
<!-- google_ad_section_end -->";

}
else{

// We are renaming the adoptable

$query = "UPDATE ".$prefix."owned_adoptables SET name='".$more."' WHERE aid='".$id."' and owner='".$loggedinname."'";
mysql_query($query);

$article_title = $lang_rename_success_title;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$lang_rename_success."</p></div>
<div id='pwrapper'>
<div id='p'>
	<div id='p_up_left'></div>
	<div id='p_up'></div>
	<div id='p_up_right'></div>
	<div id='p_middle_left'></div>
	<div id='p_middle'>
		<div class='inside2'>

<div id='pwrapper2'>
	<div id='ptitle'><div class='sub-title'>".$royalnametitle." ".$name."</div></div>
	<div id='p4'>
			<div id='p5'><a href='levelup.php?id=".$aid."'><img src='".$image."' alt='".$royalnametitle." ".$name."' id='p5image' /></a></div>
			<div id='p5'>
			<div id='p1'><a href='myadopts.php?act=manage&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats2_t."</a></div>
			<div id='p1'>".$levelupbutton."</div>
			<div id='p2'>".$lang_caremenu_biobutton."</div>
			<div id='p3'>".$lang_caremenu_occupationbutton."</div>
			<div id='p1'><a href='myadopts.php?act=stats&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats_t."</a></div>
			<div id='p2'><a href='myadopts.php?act=bbcode&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_codes_t."</a></div>
			<div id='p3'>".$renamebutton."</div>
			<div id='p1'><a href='myadopts.php?act=freeze&id=".$aid."' class='button buttoncarefor center'>".$status2."</a></div>
			<div id='p1'><a href='myadopts.php?act=kill&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_setfree_t."</a></div>
			</div>
	</div>
</div>

		</div>
	</div>
	<div id='p_middle_right'></div>
	<div id='p_down_left'></div>
	<div id='p_down'></div>
	<div id='p_down_right'></div>
</div>
</div>
<!-- google_ad_section_end -->";

}
}
else{

// We cannot rename a frozen adoptable...

$article_title = $lang_frozen_title;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$lang_frozen1." <span class='bold'>".$royalnametitle." ".$name."</span>".$lang_fronze2." <a href='myadopts.php?act=freeze&id=".$id."&more=unfreeze'>".$lang_adoptremane_unfreeze_link."</a> <span class='bold'>".$royalnametitle." ".$name."".$lang_frozen3."</p></div>
<div id='pwrapper'>
<div id='p'>
	<div id='p_up_left'></div>
	<div id='p_up'></div>
	<div id='p_up_right'></div>
	<div id='p_middle_left'></div>
	<div id='p_middle'>
		<div class='inside2'>

<div id='pwrapper2'>
	<div id='ptitle'><div class='sub-title'>".$royalnametitle." ".$name."</div></div>
	<div id='p4'>
			<div id='p5'><a href='levelup.php?id=".$aid."'><img src='".$image."' alt='".$royalnametitle." ".$name."' id='p5image' /></a></div>
			<div id='p5'>
			<div id='p1'><a href='myadopts.php?act=manage&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats2_t."</a></div>
			<div id='p1'>".$levelupbutton."</div>
			<div id='p2'>".$lang_caremenu_biobutton."</div>
			<div id='p3'>".$lang_caremenu_occupationbutton."</div>
			<div id='p1'><a href='myadopts.php?act=stats&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_stats_t."</a></div>
			<div id='p2'><a href='myadopts.php?act=bbcode&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_codes_t."</a></div>
			<div id='p3'>".$renamebutton."</div>
			<div id='p1'><a href='myadopts.php?act=freeze&id=".$aid."' class='button buttoncarefor center'>".$status2."</a></div>
			<div id='p1'><a href='myadopts.php?act=kill&id=".$aid."' class='button buttoncarefor center'>".$lang_caremenu_setfree_t."</a></div>
			</div>
	</div>
</div>

		</div>
	</div>
	<div id='p_middle_right'></div>
	<div id='p_down_left'></div>
	<div id='p_down'></div>
	<div id='p_down_right'></div>
</div>
</div>
<!-- google_ad_section_end -->";

}


}
else{

$article_title = $err_idnoexist;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$err_idnoexist_text."</p></div>
<!-- google_ad_section_end -->";

}
}
else{

$article_title = $err_idnoexist;
$article_content = "<!-- google_ad_section_start(weight=ignore) -->
<div class='npc3'><p class='titania2'><img src='templates/default/images/npc_1_s.png' width='70' height='70' border='0' alt='Titania' />".$err_idnoexist_text."</p></div>
<!-- google_ad_section_end -->";

}

}

Oh jeese, okay now why do you want the drop down menu for this page?

What purpose would it be for?

You need to explain this to me, because there is more then one function on this page.
 
RE: Drop-down menu for myadopt.php

I want users to easily be able to navigate from one adoptable to another when managing, viewing stats, getting codes, renaming, freezing, unfreezing and killing adoptables (which are all existing actions in brandon's original myadopt.php file).

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), after they rename adoptable 1, they can then choose adoptable 2 from the drop-down menu allowing them to navigate to the adoptable 2's rename page (myadopts.php?act=rename&id=2).

This is more convenient for the user and reduces the number of steps they need to do in order to manage multiple adoptables.
 
RE: Drop-down menu for myadopt.php

arlecchina said:
I want users to easily be able to navigate from one adoptable to another when managing, viewing stats, getting codes, renaming, freezing, unfreezing and killing adoptables (which are all existing actions in brandon's original myadopt.php file).

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), after they rename adoptable 1, they can then choose adoptable 2 from the drop-down menu allowing them to navigate to the adoptable 2's rename page (myadopts.php?act=rename&id=2).

This is more convenient for the user and reduces the number of steps they need to do in order to manage multiple adoptables.

Well to be quite honest I don't know where to put it in the Rename page, because of the fact that the rename page gets the ID from the previous page, therefore you wouldn't be able to do the whole drop down menu on the rename page without instituting Ajax, because adding a drop down menu would mean you would have to move the person to another page. But you want them to stay on the rename page obviously so they could change each pet.

So im trying to think of what you should do...

I think the easiest thing to do, would be to not incorporate the drop down menu with the actual coding on the rename page, but to have it on the page, so that when you rename one pet the drop down menu will show on the success page. Then your users can choose another pet from the success screen, then just make the "Click Here to Submit" Button, or whatever your going to call it, lead back to the Rename page.

Please tell me you followed that, because it will be a little bit before I can work up an example for you.
 
RE: Drop-down menu for myadopt.php

Bloodrun said:
Well to be quite honest I don't know where to put it in the Rename page, because of the fact that the rename page gets the ID from the previous page, therefore you wouldn't be able to do the whole drop down menu on the rename page without instituting Ajax, because adding a drop down menu would mean you would have to move the person to another page. But you want them to stay on the rename page obviously so they could change each pet.

So im trying to think of what you should do...

I think the easiest thing to do, would be to not incorporate the drop down menu with the actual coding on the rename page, but to have it on the page, so that when you rename one pet the drop down menu will show on the success page. Then your users can choose another pet from the success screen, then just make the "Click Here to Submit" Button, or whatever your going to call it, lead back to the Rename page.

Please tell me you followed that, because it will be a little bit before I can work up an example for you.

Actually I don't want them to stay on the rename page to rename each pet. I understand that each pet has their own rename url (example: myadopts.php?act=rename&id=2). I just want the user to be able to easily navigate from one adoptable rename url to another pet's rename url without having to return to the manage adoptables page (myadopts.php) to choose the pet.

I think adding the drop down menu to the success page would be a good idea. The only problem I am really having is listing the existing adoptables the user owns on the rename page and other myadopts pages including the success page. If we could list them on the success page, I think that would solve my problem.

Please note that I will be away 09/26-10/3 so feel free to postpone working on any of this until I return. I really appreciate all your help. Thank you.
 
RE: Drop-down menu for myadopt.php

arlecchina said:
Bloodrun said:
Well to be quite honest I don't know where to put it in the Rename page, because of the fact that the rename page gets the ID from the previous page, therefore you wouldn't be able to do the whole drop down menu on the rename page without instituting Ajax, because adding a drop down menu would mean you would have to move the person to another page. But you want them to stay on the rename page obviously so they could change each pet.

So im trying to think of what you should do...

I think the easiest thing to do, would be to not incorporate the drop down menu with the actual coding on the rename page, but to have it on the page, so that when you rename one pet the drop down menu will show on the success page. Then your users can choose another pet from the success screen, then just make the "Click Here to Submit" Button, or whatever your going to call it, lead back to the Rename page.

Please tell me you followed that, because it will be a little bit before I can work up an example for you.

Actually I don't want them to stay on the rename page to rename each pet. I understand that each pet has their own rename url (example: myadopts.php?act=rename&id=2). I just want the user to be able to easily navigate from one adoptable rename url to another pet's rename url without having to return to the manage adoptables page (myadopts.php) to choose the pet.

I think adding the drop down menu to the success page would be a good idea. The only problem I am really having is listing the existing adoptables the user owns on the rename page and other myadopts pages including the success page. If we could list them on the success page, I think that would solve my problem.

Please note that I will be away 09/26-10/3 so feel free to postpone working on any of this until I return. I really appreciate all your help. Thank you.

Alright very well, I know how to write, because I've written it several times, I just can't get to my copy right now, in fact I can't get to any of my codes right now, and its really bugging me so lol I will try my hardest to get it.
 
RE: Drop-down menu for myadopt.php

Just a thought. What I have done to the "Manage" page for the new War Effort update to be released this week is a complete overhaul of the page so that it gives a lot of info in a neat formation. This way users don't have to click through a ton of links to look at the stats, bbc codes or whatever.

ss_manage.jpg


PHP:
      elseif ($act == "manage") {
          // We are managing a specific adoptable
          
          if ($id == "" or !is_numeric($id)) {
              $article_title = $err_idnoexist . "<br /><br />";
              $article_content = $err_idnoexist_text;
          } else {
              // See if the adoptable actually exists...
              
              $query = "SELECT * FROM " . $prefix . "owned_adoptables WHERE owner='$loggedinname' and aid='$id'";
              $result = mysql_query($query);
              $num = mysql_numrows($result);
              
              //Loop out code
              $i = 0;
              while ($i < 1) {
                  //The adoptable's ID
                  $aid = @mysql_result($result, $i, "aid");
                  $currentlevel = @mysql_result($result, $i, "currentlevel");
                  $type = @mysql_result($result, $i, "type");
                  $name = @mysql_result($result, $i, "name");
                  $totalclicks = @mysql_result($result, $i, "totalclicks");
                  $race = @mysql_result($result, $i, "race");
                  $primclass = @mysql_result($result, $i, "primclass");
                  $secdclass = @mysql_result($result, $i, "secdclass");
				  $valor = @mysql_result($result, $i, "valor");
				  $valortimes = @mysql_result($result, $i, "valortimes");
				  $health = @mysql_result($result, $i, "health");
				  $isfrozen = @mysql_result($result, $i, "isfrozen");
                  
                  $i++;
              }
              
              // Check that the adoptable exists for real, or show an error...
              
              if ($aid == $id) {
                  // The adoptable does exist, so we show the image and junk to the user...              
				  
				  if ($isfrozen == "yes") {
                  $status = "<img src='templates/icons/freeze.gif' border=0 /> Forever Young";
              } else {
                  $status = "<img src='templates/icons/unfreeze.gif' border=0 /> Growing Strong";
              }
              
              		if ($valor >= "20") {
                  $vstatus1 = "<img src='templates/icons/medal_silver.gif' border=0 /> ";
              } else {
                  $vstatus1 = " ";
              }
              
              		if ($valor >= "50") {
                  $vstatus2 = "<img src='templates/icons/medal_gold.gif' border=0 /> ";
              } else {
                  $vstatus2 = " ";
              }
                  
                  $image = getcurrentimage($id);
                  
                  $article_title = "Managing " . $name . "<br /><br />";
                  $article_content = $found . "<br />
				  <center><b><a href='myadopts.php'>Tree of Life</a></></center><br />
		          <table width='99%' align='center' border='0'><tr><td>
		          <center>" . $vstatus1 . " " . $status . " " . $vstatus2 . "</center>
				  <br /><img src='" . $image . "'></td>
					<td><b>Current Level: " . $currentlevel . "<br />
					Total Clicks: " . $totalclicks . "<br />
					Race: " . $race . "<br />
					Primary Class: " . $primclass . "<br />
					Secondary Class: " . $secdclass . "<br />
					Tours of Duty: " . $valortimes . "<br />
					Valor: " . $valor . "/100<br />
					Health: " . $health . "
					</b></td></tr>
					<tr><td>
					
					<b><a href='levelup.php?id=" . $id . "'>Train</a><br />
					<a href='myadopts.php?act=rename&id=" . $id . "'>Rename</a><br />
					<a href='myadopts.php?act=aband&id=" . $id . "'>Abandon</a><br />
					<a href='myadopts.php?act=gift&id=" . $id . "'>Gift to another Caretaker</a><br />
					</td><td>
					<a href='myadopts.php?act=dorm&id=" . $id . "'>Send to the Dormantory</a><br />
					<a href='myadopts.php?act=fame&id=" . $id . "'>Send to the Hall of Fame</a><br />
					<a href='myadopts.php?act=trade&id=" . $id . "'>Send to the Trading Post</a></td></tr></table><br />";
					
					              // The adoptable exists, so we show the stats for it...
              
              
              $image = getcurrentimage($id);
              $nextlevelexists = getnextlevelexists($type, $currentlevel);
              
              $nextlevel = "";
              
              // If a higher level exists, get that level's information...
              
              if ($nextlevelexists == "true") {
                  $nextlevel = $currentlevel + 1;
                  
                  $query = "SELECT * FROM " . $prefix . "levels WHERE adoptiename='$type' and thisislevel='$nextlevel'";
                  $result = mysql_query($query);
                  $num = mysql_numrows($result);
                  
                  $i = 0;
                  while ($i < 1) {
                      //The adoptable's ID
                      $requiredclicks = @mysql_result($result, $i, "requiredclicks");
                      
                      
                      $i++;
                  }
              }
              // End grab next level info...
              
              // Determine what to show for next level:
              
              if ($nextlevelexists == "true" and $nextlevel != "") {
                  // See how many more clicks to go
                  
                  $ctg = $requiredclicks - totalclicks;
                  
                  $nloutput = "Training needed for next level: " . $ctg;
              } else {
                  $nloutput = "This Companion is fully trained!";
              }
              
              // Voters Information...
              
              $article_content = $article_content . "<h3>" . $name . "'s Trainers:</h3><br /><center>" . $nloutput . "</center><br />     Last 10 people who trained your Companion. <br /><br />
			  <table width='450' align='center' border='1'>
				<tr><td width='129'><strong>Caretaker</strong></td><td width='156'><strong>Date Trained</strong></td><td width='82'><strong>Tree of Life</strong></td><td width='55'><strong>Messenger Bird</strong></td></tr>";
              
              // Select the voters from the DB
              
              $query = "SELECT * FROM " . $prefix . "vote_voters WHERE adoptableid='$id' ORDER BY date DESC LIMIT 10";
              $result = mysql_query($query);
              $num = mysql_numrows($result);
              
              $i = 0;
              while ($i < $num) {
                  $date = @mysql_result($result, $i, "date");
                  $username = @mysql_result($result, $i, "username");
                  
                  if ($username == "") {
                      $username = "Guest";
                  }
                  
                  if ($username == "Guest") {
                      $article_content = $article_content . "<tr>
    					<td><div align='left'>Guest</div></td>
    					<td><div align='left'>" . $date . "</div></td>
    					<td><div align='center'></div></td>
    					<td><div align='center'></div></td>
  						</tr>";
                  } else {
                      $article_content = $article_content . "<tr>
    					<td><div align='left'>" . $username . "</div></td>
    					<td><div align='left'>" . $date . "</div></td>
    					<td><div align='center'><a href='profile.php?user=" . $username . "' target='_blank'><img src='templates/buttons/profile.gif' border=0></a></div></td>
    					<td><div align='center'><a href='messages.php?act=newpm&user=" . $username . "' target='_blank'><img src='templates/buttons/pm.gif' border=0></a></div></td>
  						</tr>";
                  }
                  
                  
                  
                  $i++;
              }
              
              $article_content = $article_content . "</table><br />
				<p><u>Forum Codes / BBCode: </u></p>
				<p>
  				<textarea name='textarea' cols='50' rows='4'>[url=http://" . $domain . "" . $scriptpath . "/levelup.php?id=" . $aid . "][img]http://" . $domain . "" . $scriptpath . "/siggy.php?id=" . $aid . "[/img][/url]
				</textarea>
				</p>";
              
              if ($altbb == "yes") {
                  // Use the seo friendly alternate bbcodes...
                  
                  $article_content = $article_content . "<p><u>Alternate BBCodes (Use if the above do not work on a forum): </u><br /><br /></p>
					<p>
  					<textarea name='textarea' cols='50' rows='4'>[url=http://" . $domain . "" . $scriptpath . "/levelup.php?id=" . $aid . "][img]http://" . $domain . "" . $scriptpath . "/get/" . $aid . ".gif\[/img][/url]
					</textarea>
					</p>";
              }
              
              
              
              	$article_content = $article_content . "<p><u>HTML Code</u>:<br /><br /></p>
					<p>
					<textarea name='textarea' cols='50' rows='4'><a href=\"http://" . $domain . "" . $scriptpath . "/levelup.php?id=" . $aid . "\" target=\"_blank\"><img src=\"http://" . $domain . "" . $scriptpath . "/siggy.php?id=" . $aid . "\" border=0></a>
  					</textarea>
					</p>";		
					
					
              } else {
                  $article_title = $err_idnoexist . "<br /><br />";
                  $article_content = $err_idnoexist_text . "<br /><br />";
              }
          }
      }
      // End the MANAGE action code

A lot of that wouldn't be needed of course because it is very specific to Mystic Grove. But it can be implemented with relative ease.

Sea
 
RE: Drop-down menu for myadopt.php

Thanks so much to both of you,[/align] Bloodrun and Sea.

@Bloodrun - If you do find your code, I'd really appreciate looking at it.

@Sea - I will look into this too. Putting everything on one page may be preferable but I still want people to be able to choose another pet from the success page. I'm not sure if I'd still have the same issue if I use and edit your code...?
 
RE: Drop-down menu for myadopt.php

Alright this is how I would do it if I were you, it isn't anything Fancy but it get's the job done:


PHP:
<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' and aid='$id'";
	$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>

If have any questions about just ask and I'll try my best to answer them.
 
RE: Drop-down menu for myadopt.php

Thanks so much, bloodrun! I'll try it out tomorrow.
 
RE: Drop-down menu for myadopt.php

arlecchina said:
Thanks so much, bloodrun! I'll try it out tomorrow.

Your welcome, just post your questions and errors if you have any, and be able to make sure that you can tell exactly what you did, so I can fix any errors that you made have made along the way.
 
RE: Drop-down menu for myadopt.php

That worked except it only listed the adoptable in which I was on that page because of:
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'";

so I changed it to:
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname'";

and then it listed all the adoptables the owner had.

Thanks so much for your help!

Now I can code it to actually navigate to those pages. Thanks!
 
RE: Drop-down menu for myadopt.php

arlecchina said:
That worked except it only listed the adoptable in which I was on that page because of:
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'";

so I changed it to:
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname'";

and then it listed all the adoptables the owner had.

Thanks so much for your help!

Now I can code it to actually navigate to those pages. Thanks!

Your welcome =D
Glad I could help.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top