Server Help

Trash Talk - Adding live links to my website to Edome Stats

Anonymous - Wed Apr 12, 2006 8:42 am
Post subject: Adding live links to my website to Edome Stats
I'm not sure if this is the proper place to post, but I was wondering if anyone knew how to link from a website to Edome stats for every pilot that is on their squad.

Help would be MUCH appreciated! Sorry if this is the wrong place to post! icon_confused.gif

Mitey

www.pwnedsquad.bravehost.com
Cerium - Wed Apr 12, 2006 1:00 pm
Post subject:
You cant link directly to the stats, since the cgi script only accepts form data via post. However, you can use some javascript to simulate it:

Code: Show/Hide
<html>

   <head>
      <title></title>
   </head>

   <script language="javascript">

       function getStats(strPlayer)
       {
           var objForm = document.getElementById("statform");
           var objName = document.getElementById("statname");

           if(objForm != null && objName != null)
           {
               objName.value = strPlayer;
               objForm.submit();
           } else {
               alert("Unable to locate form and/or name objects!!");
           }
       }


   </script>

   <body>

       <form id="statform" method="post" action="http://edome.fi.soneraplaza.net/subspace/cgi-bin/search.cgi">
           <input id="statname" type="hidden" name="string" value=""/>
           <input type="hidden" name="zone" value="3800"/>
       </form>

       <a href="#" onclick="javascript:getStats('Cerium');">Cerium</a><br/>
       <a href="#" onclick="javascript:getStats('Cerium+');">Cerium+</a><br/>
       <a href="#" onclick="javascript:getStats('Dr Cerium');">Dr Cerium</a><br/>
       <a href="#" onclick="javascript:getStats('The Cheat');">The Cheat</a><br/>
       <a href="#" onclick="javascript:getStats('Kid Flash');">Kid Flash</a><br/>

       <!--

       <option value="3700"> SSCB RedStar
       <option value="5900"> SSCU 17th Parallel
       <option value="36000"> SSCU Death Star Battle
       <option value="5400"> SSCU Trench Wars
       <option value="7501"> SSCE Hockey Zone
       <option value="3800"> SSCX Chaos/League Zone SVS
       <option value="8625"> SSCX Alpha West SVS
       <option value="5200"> SSCX Extreme Games
       <option value="7500"> SSCX PowerBall
       <option value="7100"> SSCX Star Warzone
       <option value="4966"> SSCX Warzone CTF
       <option value="14500"> SSCB Devastation
       <option value="10600"> SSCB Mystic Kingdom
       <option value="14600"> SSCB Paintball Reloaded
       <option value="3750"> SSCB RS Development
       <option value="1200"> SSCC Desert Storm
       <option value="14000"> SSCC Metal Gear CTF
       <option value="0"> SSCC MetalgearDEV
       <option value="10200"> SSCC Omega Fire
       <option value="17100"> SSCE Hyperspace
       <option value="7600"> SSCI Battlefield
       <option value="10300"> SSCI Dragonball Z
       <option value="14200"> SSCI Halo
       <option value="25100"> SSCI MERC Ground Warfare
       <option value="14100"> SSCI Vexillum
       <option value="17500"> SSCU Super Ships
       <option value="5450"> SSCU Trench Wars (DEV)
       <option value="16000"> T3 The Gauntlet! (SSC)
       <option value="16001"> T3 The Gauntlet! asss test zone (SSC)

       -->

   </body>

</html>



Just change the zone value to the value of the select options value of the zone you want (got that?). And then youll need to update the links with the actual names of the pilots.
Anonymous - Thu Apr 13, 2006 5:24 pm
Post subject:
Wow, you are an absolute lifesaver. Thank you so much!!! biggrin.gif


I will have to work with it I'm sure. I don't completely understand it (probably never will "completely") but if I have any questions I will get back to you....if thats ok biggrin.gif

Woo hoo! Thanks!
Anonymous - Thu Apr 13, 2006 6:00 pm
Post subject:
Ok, I am a complete newbie at this, so please bear with me... icon_sad.gif

Is this what the code should look like since the zone I am going to play in is SSCX Extreme Games? Also, is there a way to go even further and to display a pilots total points for that zone on the actual webpage, and for them to be somehow updating by refreshing, or running a query of some sort?

Code: Show/Hide

<html>

   <head>
      <title></title>
   </head>

   <script language="javascript">

       function getStats(strPlayer)
       {
           var objForm = document.getElementById("statform");
           var objName = document.getElementById("statname");

           if(objForm != null && objName != null)
           {
               objName.value = strPlayer;
               objForm.submit();
           } else {
               alert("Unable to locate form and/or name objects!!");
           }
       }


   </script>

   <body>

       <form id="statform" method="post" action="http://edome.fi.soneraplaza.net/subspace/cgi-bin/search.cgi">
           <input id="statname" type="hidden" name="string" value=""/>
           <input type="hidden" name="zone" value="5200"/>
       </form>

       <a href="#" onclick="javascript:getStats('Mitey');">Mitey</a><br/>

       <!--

       <option value="5200"> SSCX Extreme Games

       -->

   </body>

</html>


Did I completely butcher this?
Cerium - Thu Apr 13, 2006 6:06 pm
Post subject:
At a glance, it looks correct. The part starting with the <!-- and ending with --> is an HTML comment, and can be removed. I only included it so you had a list of zone names and their script values.

The easiest way to check if youre edits are ok is to save it to text file, change the extension to .html, then open it in any browser.


For the other stuff, youll want to employ something similar, perhaps in an auto-refreshing iframe, or you could go even more browser specific/hackish and use ajax, but I really wouldnt recommend it.
Anonymous - Thu Apr 13, 2006 6:21 pm
Post subject:
Thank you very much.

As far as the other stuff I mentioned above (total pts, and autorefresh) you are talking to a complete newbie here. This is the first time I have ever used any HTML script. I basically just followed what you said to the T.

I did check this since I last posted, and it worked btw! Excellent!

But if there is a way you can provide some code for what I mentioned above, that would be even sweeter!

If you aren't able to help on that, I just want to say I really appreciate what you have done. This is great. I never would have been able to do this otherwise biggrin.gif
Cerium - Thu Apr 13, 2006 10:16 pm
Post subject:
I could, but its generally against my 'rules', for lack of a better word. I hate giving out code to people who dont understand it -- mostly because if it doesnt work exactly as the person wants, they cant modify it accordingly. And that means more work for me. Nothing personal, Im just lazy when it comes to compensationless work.

If you want to learn some html (xhtml) or javascript, a good place to start would be @ www.w3schools.com.
Anonymous - Thu Apr 13, 2006 11:56 pm
Post subject:
Thank you very much for your time. I appreciate it, and completely understand your rule.

The time you do spend not being compensated is already very gracious. Again, thank you!
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group