Announcement

Collapse
No announcement yet.

TWD Scores on a diff site with PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TWD Scores on a diff site with PHP

    Not sure if this goes here, but here I go.

    I recently was making a script edit off another script that posted the TWD Squad Roster on another site. I was trying to edit it to post the scores. I got it to print out this:

    BnG Squad Scores

    This is what the php code looks like

    PHP Code:
    <html>
    <head>
    </head>
    <body>
    <?php
    //FireOut's TWD Roster Script
    //Last Updated: Oct 5th 2003

    //use your squad's score URL here:
    $twdsite=fopen("http://www.twdivisions.org/body.php?action=ViewSquad&R_fnTeamID=1878&tab=2"'r');

    //Go to beginning of TWD server generated lists (line 43)
    for($i=0$i<43$i++)
    $buffer fgets($twdsite5096);


    //fgetss strips HTML tags from the file input stream
    $text="";
    while(!
    feof($twdsite)){
    $buffer fgetss($twdsite5096);
    $text=$text.$buffer."\n";
    }


    /*
    //Removes the numbers before the names
    $n=substr_count($text,"&nbsp")-4;
    for($i=1;$i<=$n;$i++){
    $pos=strpos($text,"&nbsp;")+10;
    $subtext=substr($text,0,$pos);
    $haystack="&nbsp;".$i;
    $text=str_replace($haystack,"<br>\n",$subtext).substr($text,$pos);
    }
    */

    //Jump to beginning of scores list
    $text=substr($text,strpos($text,"TWD Dueling"),20000);


    /*
    //Strip the additional crap from the TWD site
    $text=substr($text,19,strpos($text,"&nbsp")-19);
                   */
    //$text=substr_replace("Oct","<br>Oct",strpos($text,"TWD Dueling"),$endoffile);
    echo $text;


    fclose ($twdsite);

    ?>
    </body>
    </html>
    Script originally by FireOut. I just edited it with his permission.

    I want it to bold the TWD Deuling,Javalin,Basing headers and space everything out.

    Help please.
    Member of BnG squad. And no, you can't join.

  • #2
    Do you mean something like this?

    PHP Code:
    <html>
    <head>
    </head>
    <body>
    <table border=0>
    <?php
    $twdsite
    =fopen("http://www.twdivisions.org/body.php?action=ViewSquad&R_fnTeamID=1878&tab=2"'r');

    for(
    $i=0$i<43$i++)
    $buffer fgets($twdsite5096);

    $text="";
    while(!
    feof($twdsite)){
    $buffer fgets($twdsite5096);
    $text=$text.$buffer."\n";
    }

    $text=substr($text,strpos($text,"<b>TWD Dueling"),20000);
    $text=substr($text,0,strpos($text,"\n</td>"));

    $text preg_replace("/<a class=\"n\" href=\"(.*?)\">(.*?)<\\/a>/""<a href=\"http://www.twdivisions.org/\\\\1\" target=_blank>\\\\2</u></a>"$text);
    $text preg_replace("/<\\/tr>/""</tr>\n"$text);
    $text preg_replace("/<\\/b>(.*?)<\\/u>/e""'</b>'.htmlspecialchars('\\\\1').''"$text);
    echo 
    $text;

    fclose ($twdsite);

    ?>
    </body>
    </html>
    Or do you also want those links stripped out?
    Last edited by AnZu; 10-30-2003, 01:41 PM.

    Comment


    • #3
      Here's the code we used when Alcoholism were in TWD :

      PHP Code:
      <html>
      <head>
      </head>
      <body>
      <table border=0>
      <?

      $gameresult="lost"

      echo "Last game : We ".$gameresult.".<br>";
      echo "Recap of last 10 games : We ".$gameresult." all these ones too.<br>";
      echo "Next game : Who cares? It'll just be ".$gameresult." again.";


      ?>
      </body>
      </html>
      Last edited by GuruMeditation; 10-31-2003, 09:06 AM.
      gravy_: They should do great gran tourismo
      gravy_: Electric granny chariots
      gravy_: round the nurburgring

      XBL: VodkaSurprise

      Comment


      • #4
        Lies! When Lou and I were javving with the alcoholics we won a few! :]
        jasonofabitch loves!!!!

        Comment


        • #5
          AnZu: Yes, thank you very much. Thats exactly what we need. You will be credited on the site.

          GuruMeditation: LOL!!!
          Member of BnG squad. And no, you can't join.

          Comment

          Working...
          X