Jump to content

dodgeitorelse

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Posts posted by dodgeitorelse

  1. no it doesn't but this should work

    div.Content {
    background-color:#837a7a;
    width:90%;
    height:600px;
    margin: 0 auto;
    }
    

     

    and change

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    

     

    to

     

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    

  2. all I have is aao://76.73.3.42:1716

     

    aao is a registered protocol on my pc.

     

    if I create a shortcut for aa and put it in my desktop, then in the properties for the shortcut I can edit the target which is "C:\Program Files\America's Army\System\ArmyOps.exe"

    by adding a space then 76.73.3.42:1716 at the end of the target and the shortcut works.

  3. Hi, not sure where to post this.

     

    I want to make a custom hyperlink that when clicked will open a game and then will activate the tilde key to open the console.

     

    aao:// is the protocol and link will start the game however no matter what I put following does no good. any suggestions?

  4. I think The Little Guy is saying to make a table named "History" with the 3 fields of id, user_id and page. Then when a user go to a page it logs that user with new id so it would be similar to:

     

    id            user_id            page

    ------------------------------------------

    1                123                  6.php

    2                123                  3.php

    3                123                  1.php

    4                123                  2.php

    5                234                  2.php

    6                345                  12.html

    7                123                  15.php

    8                123                  11.php

  5. Hi I have jquery table sorter for one of my pages. It works fine..... until I start using some variables that are in session. Why does this stop the sort function from working?

     

    code for sorter that works ....

    <head>
      <title><?php echo "$server_name"; ?> Top Ten Scores</title>
    
    <style type="text/css">
    A:link {text-decoration: none; color: lime;}
    A:visited {text-decoration: none; color: blue;}
    A:active {text-decoration: none; color: white;}
    A:hover {text-decoration: underline; color: lightgreen;}
    </style>
      
      <script src="js/jquery.js" type="text/javascript"></script>
      <script src="js/jquery.dataTables.min.js" type="text/javascript"></script>
      
      <link href="css/table.css" rel="stylesheet" type="text/css" media="print, projection, screen" />
      <script type="text/javascript">
        $(document).ready(function ()
        {
          $("#tablesorter").dataTable({
            "bPaginate": false,
            "bAutoWidth": true,
    	"aaSorting": [[ 0, "Asc" ]],
            "aoColumns": 
              [
    	  
                { "bSortable": true }, // disable sorting of first column in table
                	null,
                    null				
              ]
          })
        });
      </script>
    </head>
    

     

     

    with sessions (this stops table from sorting feature)....

     

    <?php
    
    session_start();
    
    // Retrieve the URL variables (using PHP).
    	$name = $_GET['name'];
    	$name2 = $_GET['name2'];
    	$name3 = $_GET['name3'];
    
    
    $_SESSION['name'] = $_GET['name'];
    $_SESSION['name2'] = $_GET['name2'];		
    $_SESSION['name3'] = $_GET['name3'];	
    
    
    //rest of code that displays data and table
    
    ?>

  6. I have an included file that has my table defined as

    $db_table_name = "19";

     

    and when I put it into my query like

    $sql = 'select name, score from $db_table_name           
    	ORDER BY score desc limit 10';

    it doesn't work. How do I put the variable into my query?

  7. Hi guys,

    I have a php file that will go to a site and scrape the data I need. However this site is setup to use pagination so when I try to scrape all the players names I have to do separate queries to search each page. Is there a way to find out by using code how many pages there are and query all the pages at same time?

     

    I use  this code

    <?php	//first page
    
    //turn error reporting on	
    libxml_use_internal_errors(true);
    
    //get data from this page
    $dom = new DOMDocument;
    $dom->loadHTMLFile('http://www.gametracker.com/server_info/76.73.3.42:1716/top_players/?searchipp=50#search');
    $xpath = new DOMXPath($dom);
    
    // Get the total player count
    $rows2 = $xpath->query('//div[@class="block774"]/div');
    
    // Get the rows from the search list
    $rows = $xpath->query('//table[@class="table_lst table_lst_spn"]/tr');
    
    
    for ($i=1; $i<$rows->length-1; $i++) {
        $row = $rows->item($i);
    
        // Get the columns for a row
        $cols = $row->getElementsByTagName('td');
    
    // Get the player rank (1st column)
        echo 'Rank:'.trim($cols->item(0)->textContent).PHP_EOL;
    
        // Get the player name (2nd column)
        echo 'Name:'.trim($cols->item(1)->textContent).PHP_EOL;
    
    // Get the player score (3rd column, actually 4th but number 3 is hidden)
        echo 'Score:'.trim($cols->item(3)->textContent).PHP_EOL;
    
    echo "<br />";
    }
    ?>
    
    
    
    
    
    <?php	//secondpage
    
    //turn error reporting on
    libxml_use_internal_errors(true);
    
    //get data from this page
    $dom = new DOMDocument;
    $dom->loadHTMLFile('http://www.gametracker.com/server_info/76.73.3.42:1716/top_players/?searchipp=50&searchpge=2#search');
    $xpath = new DOMXPath($dom);
    
    // Get the rows from the search list
    $rows = $xpath->query('//table[@class="table_lst table_lst_spn"]/tr');
    
    
    for ($i=1; $i<$rows->length-1; $i++) {
        $row = $rows->item($i);
    
        // Get the columns for a row
        $cols = $row->getElementsByTagName('td');
    
    // Get the player rank (1st column)
        echo 'Rank:'.trim($cols->item(0)->textContent).PHP_EOL;
    
        // Get the player name (2nd column)
        echo 'Name:'.trim($cols->item(1)->textContent).PHP_EOL;
    
    // Get the player score (3rd column)
        echo 'Score:'.trim($cols->item(3)->textContent).PHP_EOL;
    echo "<br />";
    }
    
    ?>

     

    I also have to go to that website first to see how many pages there are so I can have enough queries.

     

     

     

     

  8. wrap each table in its own div and use float is an option.

    <div style="float: left;">
    <table width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center" >
    <tr>
       <td>Popular Features
       </td>
    </tr>
    
    <tr height="25">
      <td height="25" bgcolor="#f5f5f5"><font color="#ce0000"> » </font><a href="www.test.com" target="_blank">Title 1</a>
      </td>
    </tr>
    
    <tr height="25">
       <td height="25"><font color="#ce0000"> » </font><a href="www.test.com" target="_blank">Title 2</a>
       </td>
    </tr>
    
    <tr height="25">
       <td height="25" bgcolor="#f5f5f5"><font color="#ce0000">» </font><a href="www.test.com" target="_blank">Title 3</a>
       </td>
    </tr>
    
    <tr height="25">
       <td height="25"><font color="#ce0000">» </font><a href="www.test.com" target="_blank">Title 4</a>
       </td>
    </tr>
    
    <tr height="25">
       <td height="25" bgcolor="#f5f5f5"><font color="#ce0000">» </font><a href="www.test.com" target="_blank">Title 5 </a>
       </td>
    </tr>
    
    <tr height="25">
       <td height="25"><font color="#ce0000">» </font><a href="www.test.com" target="_blank">Title 6</a>
       </td>
    </tr>
    </table>
    </div>
    
    <div style="float: right;">
    <table  width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center">
       <td width="300"><a href="http://blast.verticalscope.com/oi3-vs/scripts/script.php?id=12536&uid=2381352&messageId=1690&mid=2639" target="_blank"><img width="300" height="250" border="0" align="middle" alt="" src="http://img.verticalscope.com/atv.com/newsletters/images/09072011/Kawasaki-300x250.jpg"></a>
       </td>
    </table>
    
    
    <table  width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center">
    
    
    
       <tr>
          <td>Reviews</tr>
       </td>
       </tr>
    
       <tr>
          <td>
          <a  href="http://t0.gstatic.com/images?q=tbn:ANd9GcSgfnlqd9YfSAZ73KbO6p4jzScBCwFCBTWvLjyepmfTF-jYVokI" target="_blank"><img border="0" align="left" alt="" src="http://t0.gstatic.com/images?q=tbn:ANd9GcSgfnlqd9YfSAZ73KbO6p4jzScBCwFCBTWvLjyepmfTF-jYVokI">F1 
          </a>
       </td>
       </tr>
    
       <tr>
         <td>
         <a href="http://t0.gstatic.com/images?q=tbn:ANd9GcSgfnlqd9YfSAZ73KbO6p4jzScBCwFCBTWvLjyepmfTF-jYVokI" target="_blank"><img border="0" align="left" alt="" src="http://t0.gstatic.com/images?q=tbn:ANd9GcSgfnlqd9YfSAZ73KbO6p4jzScBCwFCBTWvLjyepmfTF-jYVokI">F2 
         </a>
         </td>
       </tr>
    </table>
    
    <table  width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center">
    <tr>
       <td>Registry</tr></td>
    </tr>
    
    <tr>
       <td>
       <a  href="http://t1.gstatic.com/images?q=tbn:ANd9GcQiYqLEBA3H4giuf4HbigPqpOiAMMivFF-Xy838nGacOBjntovCHQ" target="_blank"><img  border="0" align="left" alt="" src="http://t1.gstatic.com/images?q=tbn:ANd9GcQiYqLEBA3H4giuf4HbigPqpOiAMMivFF-Xy838nGacOBjntovCHQ">L1
       </a>
       </td>
    </tr>
    
    <tr>
       
       <td>
       <a href="http://t1.gstatic.com/images?q=tbn:ANd9GcQiYqLEBA3H4giuf4HbigPqpOiAMMivFF-Xy838nGacOBjntovCHQ" target="_blank"><img border="0" align="left" alt="" src="http://t1.gstatic.com/images?q=tbn:ANd9GcQiYqLEBA3H4giuf4HbigPqpOiAMMivFF-Xy838nGacOBjntovCHQ">L2
       </a>
       </td>
       
    </tr>
    </table>
    </div>
    
    
    
    

  9. I figured it out .......

     

    $mysql_query  = "INSERT INTO `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`disabled`,`comment`,`cache`,`cache_time`,`site`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$disabled}','{$comment}','','','<a href=\"$yoursite\" target=\"blank\">$comment</a>')";

  10. Hi guys, I tried to search for ths but get error for search daemon.

    I am trying to insert into my database a url as a link. The url comes from a form.

     

    the following code is what I have but it gives me "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'http://www.xxxxxxxxx.net.au/site1/'>-=[xxxxxxxxx]=- User Created Maps Server'' at line 1"

     

    $mysql_query  = "INSERT INTO websites (`clan`,`ip`,`port`,`site`) VALUES ('{$comment}','{$ip}','{$c_port}','<a href='$yoursite'>$comment</a>'";
        $mysql_result = mysql_query($mysql_query) or die(mysql_error());

     

    if I change code to

    $mysql_query  = "INSERT INTO websites (`clan`,`ip`,`port`) VALUES ('{$comment}','{$ip}','{$c_port}')";
        $mysql_result = mysql_query($mysql_query) or die(mysql_error());

    it works.

     

    any idea what I am doing wrong?

  11. <li><a href='http://your.address.here' target='_blank' title='Facebook'><img alt='RSS Feeds' src='http://3.bp.blogspot.com/-j7VhgbrLDLI/Tf5fVMLLeBI/AAAAAAAADDs/18Yon6Bt5tE/s1600/facebook.png'/></a></li>

     

    change your.address.here to the address you want to go to

  12. and no I am not a programmer. I am currently learning to code. I have learned some basics. For example I can query databases, I can find my way through modifying a lot of code but I do not know enough yet to be able to help myself in this situation. Or perhaps I do and am just making it more complicated than it really is, I don't know.

  13. I have some code that is supposed to get data from a site and then insert the gathered data into a database. The code does start adding data to database but it isn't adding data that it is getting from site that has starting data. What I mean is this. This code gets current player scores and such from gametracker and adds that to the database. then it will get player scores from my own tracker and add new scores to the ones that weere adde3d from game tracker. We did this so that our game servers continue tracking the scores for our new server trackers and not start out at zero initially. How ever when we run the code it says data was not written to database probably because server does not exists in database when in fact it really does. SO if someone could explain the code to me as to what it is doing then maybe I can figure out why it isn't working.

     

    function InitializeServer( $sid, $ip, $name, &$totalplayers )
    {
        !mysql_query( "DROP TABLE ".SERVER_TABLE_NAME.$sid.";" );    // we don't care if this fails if table didn't exist before
        if( !mysql_query( "CREATE TABLE ".SERVER_TABLE_NAME.$sid." ("
            ." `name` varchar(32), `score` int, `goal` int default 0, `leader` int default 0, `enemy` int default 0, `kia` int default 0, `roe` int default 0,"
            ." PRIMARY KEY(`name`) );" ) ) {
            die( "Error creating table: ".mysql_error() );
        }
    
        $id = 1;
        $page = 1;
        $done = FALSE;
        while( !$done ) {
            $data = http_request( "www.gametracker.com", "/server_info/".$ip."/top_players/?searchipp=50&searchpge=$page" );
            $pos = 0;
            $out = "";
            while( !$done ) {
                $num = GetStringInMiddle( $data, $pos, '<td class="c01">', '</td>' ); if( $num == NULL && $id > 1 ) break;
                if( $num != $id || $num == NULL ) { $done = TRUE; break; }
                $name = GetStringInMiddle( $data, $pos, '/">', '</a>' ); if( $name  === NULL ) break;
                $score = GetStringInMiddle( $data, $pos, '<td class="c04">', '</td>' );
                //$timePlayed  = GetStringInMiddle( $data, $pos, '<td class="c05">', '</td>' );
                //$scorePerMinute = GetStringInMiddle( $data, $pos, '<td class="c06">', '</td>' );
                
                if( $out != "" ) $out .= ",\n";
                $out .= "('$name', '$score')";
                $id ++;
                $totalplayers ++;
            }
    
            // Write data to database, if any                
            if( $out != "" ) 
            {
                $cmd = "INSERT INTO ".SERVER_TABLE_NAME.$sid." (`name`, `score`) VALUES ".$out.";";            
                if( !mysql_query( $cmd ) ) {
                    echo "Error with insert: ".mysql_error()."\n[$cmd]";
                }
            }
            echo ($id-1)." "; flush(); ob_flush();
            $page++;
        }
    
        if( $id > 1 ) echo "\nInitalized server #$sid: ".$ip." - ".$name." - ".($id-1)." players added<br />";
        else echo "\nServer #$sid: ".$ip." - ".$name." - no players added (server probably not in database)<br />";
    
        flush(); ob_flush();
    }
    

     

    $sid, $ip and such are defined in other files that are included in the same file as this code is included in.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.