Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Adding live links to my website to Edome Stats

 
Post new topic   Reply to topic Printable version
 View previous topic  I figured, "Meh, Why not?" Post :: Post Starforce CEO> The stocks(sky)'s fa...  View next topic  
Author Message
Mitey
Guest


Offline

PostPosted: Wed Apr 12, 2006 8:42 am   Post maybe stupid    Post subject: Adding live links to my website to Edome Stats Reply to topic Reply with quote

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
Back to top
Cerium
Server Help Squatter


Age:42
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Wed Apr 12, 2006 1:00 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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.
_________________
There are 7 user(s) ignoring me right now.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mitey
Guest


Offline

PostPosted: Thu Apr 13, 2006 5:24 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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!
Back to top
Mitey
Guest


Offline

PostPosted: Thu Apr 13, 2006 6:00 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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?
Back to top
Cerium
Server Help Squatter


Age:42
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Thu Apr 13, 2006 6:06 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mitey
Guest


Offline

PostPosted: Thu Apr 13, 2006 6:21 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
Back to top
Cerium
Server Help Squatter


Age:42
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Thu Apr 13, 2006 10:16 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mitey
Guest


Offline

PostPosted: Thu Apr 13, 2006 11:56 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can 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
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 150 page(s) served in previous 5 minutes.

phpBB Created this page in 0.595708 seconds : 32 queries executed (85.8%): GZIP compression disabled