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 09-29-2009, 01:12 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,997
Seapyramid
Default 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.



PHP Code:
      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 />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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
Reply With Quote
  #12  
Old 10-06-2009, 03:23 PM
arlecchina arlecchina is offline
Member
 
Join Date: Feb 2009
Posts: 65
Credits: 3,690
arlecchina
Default 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...?
Reply With Quote
  #13  
Old 10-07-2009, 11:53 AM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 30,013
Bloodrun
Send a message via Yahoo to Bloodrun
Default 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 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' 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.
Reply With Quote
  #14  
Old 10-07-2009, 06:22 PM
arlecchina arlecchina is offline
Member
 
Join Date: Feb 2009
Posts: 65
Credits: 3,690
arlecchina
Default RE: Drop-down menu for myadopt.php

Thanks so much, bloodrun! I'll try it out tomorrow.
Reply With Quote
  #15  
Old 10-08-2009, 07:45 AM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 30,013
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: Drop-down menu for myadopt.php

Quote:
Originally Posted by arlecchina
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.
Reply With Quote
  #16  
Old 10-08-2009, 02:46 PM
arlecchina arlecchina is offline
Member
 
Join Date: Feb 2009
Posts: 65
Credits: 3,690
arlecchina
Default 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 Code:
$query "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'"
so I changed it to:
PHP Code:
$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!
Reply With Quote
  #17  
Old 10-09-2009, 08:10 AM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 30,013
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: Drop-down menu for myadopt.php

Quote:
Originally Posted by arlecchina
That worked except it only listed the adoptable in which I was on that page because of:
PHP Code:
$query "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'"
so I changed it to:
PHP Code:
$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.
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
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 03:07 AM.

Currently Active Users: 324 (0 members and 324 guests)
Threads: 4,080, Posts: 32,024, 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636