View Single Post
  #11  
Old 09-29-2009, 01:12 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 21,145
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