Tiffu Beschreibung
Aus XT Knowledge Base
Tiffu.com
...
API
Beispiel:
<? include( "../cfg.php" ); include( "../mysqldb.php" ); include( "tiffuapi.php" ); $tiffu_user = 'tiffu'; $tiffu_password = '*****'; // API-Key für die zu beschreibende Variable define( 'REG_USER', 'ba7c61f9099a19234b2c5db969fddd02' ); $db = new MySQLDB( $_CFG['DB_HOST'], $_CFG['DB_NAME'], $_CFG['DB_USER'], $_CFG['DB_PASS'] ); $request = new TiffuAPI( $tiffu_user, $tiffu_password ); function getCount( $sqlcmd ) { global $db; $query = $db->query( $sqlcmd ); return $query->getFirstField(); } function updateVar( $key, $value ) { global $request; if( !$request->setVar( $key, $value ) ) echo $request->getError()."<br>\n"; else echo "success<br>\n"; } $reg_user = getCount( "select count(*) from state_user" ); echo "reg_user: $reg_user<br>\n"; updateVar( REG_USER, $reg_user ); ?>