gate PHP

Post new topic   Reply to topic Site Building View previous topic :: View next topic  
Author Message
Scotsman
Site Admin


Joined: 03 Aug 2004
Posts: 705
Location: MadWolf Software

PostPosted: Sun Apr 10, 2005 5:57 pm    Post subject: gate PHP Reply with quote

Ok, here's the php to add to a gate RMD to display the top 5 most populated manors. It creates spots 16-20. You will probably need to make some adjustments for your needs. Don't forget to change the extension from RMD to PHP and don't use the room editor on the room or you will loose the php code.
Code:

   <?php
      $db = mysql_connect('madwolfsw.com', 'carlm_external', 'WeBsTeR');
      if ($db)
      {
         if (mysql_select_db('carlm_servers'))
         {
            $result = mysql_query("select sites.ID, sites.sitename,
               UNIX_TIMESTAMP(now()) as servTime, UNIX_TIMESTAMP(lastUpdate) as lastUpdate, sites.population,
               sites.imgURL, sites.URL, sites.revURL, sites.description, sites.profileURL, sites.isPlat
               from carlm_servers.sites as sites
               where date_add(sites.lastUpdate, interval 20 minute) >= now()
               order by sites.population desc limit 5");
               
            for ($site = 0; $site < mysql_num_rows($result); $site++)
            {
               $siteRow = mysql_fetch_object($result);
               $rectTop = 100 + $site * 20;
               $rectBottom = 120 + $site * 20;
               $spotID = $site + 16;
               echo "<spot id=".$spotID;
               echo " poly=614,".$rectTop;
               echo ":749,".$rectTop.":749,".$rectBottom.":614,".$rectBottom;
               echo " pasg=\"".$siteRow->URL."\" title=\"".$siteRow->sitename." (".$siteRow->population." people)\"></spot>\n";
            }
         }
      }
   ?>
Back to top
View user's profile Send private message Visit poster's website
Bri



Joined: 06 Aug 2004
Posts: 237
Location: Palm Springs, CA

PostPosted: Mon Apr 11, 2005 8:52 am    Post subject: PHP script Reply with quote

Blended into the directory room at TmT manor.
Will tune it later.
TY
_________________
RL..now with 100% less lag!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic All times are GMT - 6 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum