Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/02/2008, 06:18
Avatar de destor77
destor77
 
Fecha de Ingreso: noviembre-2004
Ubicación: Gálvez, Santa Fe, Argentina
Mensajes: 2.654
Antigüedad: 20 años, 4 meses
Puntos: 43
como llamar a esta funcion...

hola tengo una clase que tiene estas funciones:
Código PHP:
require_once 'http.inc';
...
define('HT_CHPP_MATCHES''/Common/chpp/chppxml.axd?file=matches');
define('HT_CHPP_MATCHESARCHIVE''/Common/chpp/chppxml.axd?file=matchesarchive');
define('HT_CHPP_MATCHLINEUP''/Common/chpp/chppxml.axd?file=matchlineup');
define('HT_CHPP_MATCHDETAILS''/Common/chpp/chppxml.axd?file=matchdetails');
define('HT_CHPP_LIVE','/Common/chpp/chppxml.axd?file=live');
...
class 
HTClient
{....
/**
 * Matches archive information
 * @var array
 */
var $matchesArchive;

/**
 * Retrieve matches archive for team $id, or for user's own team.
 *
 * @param    string   teamID
 * @access   public
 */
function getMatchesArchiveXML($id false$first false$last false$isYouth false$season false) {

    
$form = array();
    if (
$id)
        
$form['teamID'] = $id;
    if (
$first)
        
$form['FirstMatchDate'] = $first;
    if (
$last)
        
$form['LastMatchDate'] = $last;
    if (
$isYouth)
        
$form['isYouth'] = $isYouth;
    if (
$season)
        
$form['Season'] = $season;

    
$params "";
    foreach(
$form as $key => $value)
    {
        
$params .= "&" $key "=" $value;
    }

    
$code $this->http->get(HT_CHPP_MATCHESARCHIVE $params'http://'.$this->http->host.HT_HOME);

    if (
$code != 200)
        return 
false;
    return 
$this->http->get_response_body();
}

/**
 * Retrieve matches archive for team $id, or for user's own team.
 *
 * @param    string   teamID
 * @access   public
 */
function getMatchesArchive($id false$first false$last false$isYouth false$season false) {
    if ((! 
$id) && ($this->matchesArchive))
        return 
$this->matchesArchive;
    
$xml $this->getMatchesArchiveXML($id$first$last$isYouth$season);

    if (
$xml) {
        
$parser xml_parser_create();
        
xml_parse_into_struct($parser$xml$vals$index);
        
xml_parser_free($parser);
        if (! 
$vals[$index['FILENAME'][0]]['value'])
            return 
$xml;
        for (
$i 0$i count($index['MATCHID']); $i++) {
            
$match[$i] = array(
                
'MATCHID' => $vals[$index['MATCHID'][$i]]['value'],
                
'HOMETEAMID' => $vals[$index['HOMETEAMID'][$i]]['value'],
                
'HOMETEAMNAME' => $vals[$index['HOMETEAMNAME'][$i]]['value'],
                
'AWAYTEAMID' => $vals[$index['AWAYTEAMID'][$i]]['value'],
                
'AWAYTEAMNAME' => $vals[$index['AWAYTEAMNAME'][$i]]['value'],
                
'MATCHDATE' => $vals[$index['MATCHDATE'][$i]]['value'],
                
'MATCHTYPE' => $vals[$index['MATCHTYPE'][$i]]['value'],
                
'HOMEGOALS' => $vals[$index['HOMEGOALS'][$i]]['value'],
                
'AWAYGOALS' => $vals[$index['AWAYGOALS'][$i]]['value']
            );
        }
        
$this->matchesArchive = array(
            
'FILENAME' => $vals[$index['FILENAME'][0]]['value'],
            
'VERSION' => $vals[$index['VERSION'][0]]['value'],
            
'USERID' => $vals[$index['USERID'][0]]['value'],
            
'FETCHEDDATE' => $vals[$index['FETCHEDDATE'][0]]['value'],
            
'TEAMID' => $vals[$index['TEAMID'][0]]['value'],
            
'TEAMNAME' => $vals[$index['TEAMNAME'][0]]['value'],
            
'FIRSTMATCHDATE' => $vals[$index['FIRSTMATCHDATE'][0]]['value'],
            
'LASTMATCHDATE' => $vals[$index['LASTMATCHDATE'][0]]['value'],
            
'MATCH' => $match
        
);
        return 
$this->matchesArchive;
    }
    else return 
false;
}
..... 
yo la estoy llamando asi:
Código PHP:
$partido $htclient->getLiveMatch($_GET['id'],'view','false'); 
pero no me devuelve nada no se si estoy haciendo bien la llamada.