Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2003
    Messaggi
    52

    Modificare questo script

    Ho questo script ke mi crea una tabella in un file html:

    codice:
    <?
    /***************************************************************************
     *
     *   This program is free software; you can redistribute it and/or modify
     *   it under the terms available from CloudMods.
     *   Written by Olympus_Hermes and FOPT_Cloudberry
     *
     ***************************************************************************/
    // ~~ Array Initializations ~~
    $sockets = Array();
    $ret_done = Array();
    $ret_data = Array();
    $parsed_data = Array();
    
    // ~~ Include necessary files ~~
    include('functions.php');
    include('template_engine.php');
    $template = new Template;
    
    // ~~ Obtain the list of players which have to be on the ratings list ~~
    $player_file = 'players.txt';
    $fp = fopen($player_file, 'r');
    $player_list = fread($fp, filesize($player_file));
    $players = explode("\n", $player_list);
    $num_players = count($players);
    
    // ~~ Open the sockets and prepare them for non-blocking! ~~
    $host = 'classic.zone.msn.com';
    for( $i = 0; $i < $num_players; $i++ )
    {
    	$sockets[$i] = fsockopen($host, 80, $errno, $errstr, 30);
    	stream_set_blocking($sockets[$i], FALSE);
    	$path = '/Profile/RatingsPlayer.asp?Players=2&Teams=&PlayerID=' . trim($players[$i]) . '&TeamID=&pguest=1';
    	fputs($sockets[$i],"GET $path HTTP/1.0\r\nHost: $host\r\n\r\n");
    }
    
    // ~~ Grab the data from each profile simeltaneous, using the prepared sockets! ~~
    $done = false;
    while( !$done )
    {
    	for( $i = 0; $i < $num_players; $i++ ) 
    	{
       		if( !feof($sockets[$i]) ) 
    		{
        		if( $ret_data[$i] )
    			{
         			$ret_data[$i] .= fgets($sockets[$i], 8192);
        		}
    			else
    			{
         			$ret_data[$i] = fgets($sockets[$i], 8192);
    			}
       		}
    		else
    		{
    			$ret_done[$i] = 1;
    		}
      	}
     	$done = (array_sum($ret_done) == $num_players);
    }
    
    // ~~ Parse the obtained data ~~
    $total_rat=0; 
    $unrated=0; 
    for( $i = 0; $i < count($ret_data); $i++ ) 
    { 
       $ret_data[$i]= substr($ret_data[$i], 8000); 
       $parsed_data[$i] = parse_profile(&$ret_data[$i]); 
       $total_rat+=$parsed_data[$i]['rating']; 
       if ($parsed_data[$i]['rating']=='-') $unrated+=1; 
    }
    
    // ~~ Sort the player attributes on rating ~~
    usort( $parsed_data, "sorter" ); 
    
    // ~~ Assign the template file ~~
    $template->set_filenames(array(
    	'template' => 'template.htm' )
    );
    
    // ~~ Put the data in the template blocks ~~
    for( $i = 0; $i < count($parsed_data); $i++ )
    {
    	if( !empty($parsed_data[$i]['nick']) )
    	{
    		$template->assign_block_vars('row', array(
    			'NICK' => '' . $parsed_data[$i]['nick'] . '',
    			'RATING' => $parsed_data[$i]['rating'],
    			'GAMES' => $parsed_data[$i]['games'],
    			'WINS' => $parsed_data[$i]['wins'],
    			'LOSSES' => $parsed_data[$i]['losses'],
    			'TIES' => $parsed_data[$i]['ties'],
    			'INCOMP' => $parsed_data[$i]['incomp'],
    			'STREAK' => $parsed_data[$i]['streak'],
    			'CLASS' => give_class(),
    			'WINPERCENT' => $parsed_data[$i]['winpercent'] )
    		);
    	}
    }
    $template->assign_vars(array( 
       'AVERAGE' => round($total_rat/($num_players-$unrated))) 
    );
    // ~~ Output the data to the template ~~
    $template->pparse('template');
    ?>
    .....continua

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2003
    Messaggi
    52
    ....
    e questo è il CSS:
    codice:
    <style>
    body {
            background-color: #EAEDF4;
            scrollbar-face-color: #EAEDF4;
            scrollbar-highlight-color: #EAEDF4;
            scrollbar-shadow-color: #EAEDF4;
            scrollbar-3dlight-color: #EAEDF4;
            scrollbar-arrow-color:  #EAEDF4;
            scrollbar-track-color: #EAEDF4;
            scrollbar-darkshadow-color: #EAEDF4;
    		padding: 5px;
    }
    
    a, a:visited { text-decoration: none; color: #005784; }
    a:hover { text-decoration: underline; color: #0066CC; }
    
    th { color: #FFFFFF; font-size: 14px;
            background-color: #EAEDF4; height: 25px; text-decoration: none; }
    td { font-face: Verdana; font-size: 11px; font-color: black; }
    
    td.row1        { background-color: #F4F6FA; }
    td.row2        { background-color: #EAEDF4; }
    
    td.heading { 	
    				background-color: #47505C; height: 28px;
    				font-size: 12px;
    				letter-spacing: 1px;
    				color : #000000;
    }
    
    table.maintable { background-color: #A9B8C2; border: 1px solid #005784; }
    
    td.copyright { background-color: #EAEDF4; }
    
    </style>
    dovrei fare in modo ke la fabella venisse fuori con questa piccola modifica:
    codice:
    onMouseover="this.bgColor='#C7CFD7'" onMouseout="this.bgColor='#D2D9E1'"
    Devo fare in modo ke le riche della tabella al passaggio del mouse cambino colore

  3. #3
    Utente di HTML.it L'avatar di *Ray*
    Registrato dal
    Oct 2000
    Messaggi
    495
    Probabilmente devi solo andare ad editare il template:

    $template->set_filenames(array(
    'template' => 'template.htm' )

    Ovunque sia questo template.htm

  4. #4
    Utente di HTML.it
    Registrato dal
    Mar 2003
    Messaggi
    52
    e il template.htm ke contiene il CSS, ma ho provato a modificarlo, ma non succede niente.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.