if (mysql_num_rows($q) > 0) { while ($r = mysql_fetch_row($q)) { $m['sender'] = $r[0]; $m['body'] = htmlspecialchars($r[1]); $m['timestamp'] = $r[2]; $messages[$r[3]] = $m; } } return $messages; } function send_solution($solution, $self) { require "inc/db.inc"; $sql = "select gameid from games natural join opponents natural join users_opponents natural join users where username = '******'"; $q = mysql_query($sql, $mysql_access); if (mysql_num_rows($q) > 0) { $gameid = mysql_result($q, 0); $sql = "insert into games_log (gameid, uid, solution) " . "values ({$gameid}, (select uid from users where username = '******'), '{$solution}') " . "on duplicate key update solution = '{$solution}'"; mysql_query($sql, $mysql_access); } } header('Content-Type: text/xml'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // disable IE caching header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); require 'utils/assoc_array2xml.php'; $converter = new assoc_array2xml(); $response_xml = $converter->array2xml($response); print $response_xml;
function seoauto_export() { if (isset($_GET['seoexport']) && current_user_can('activate_plugins')) { include 'libs/assoc_array2xml.php'; header('Content-type: text/xml'); header('Content-disposition: attachment; filename=seo-settings.xml'); $array = get_option('autoseo_options'); unset($array['paypal']['require']); // This could cause conflicts with people who do not have the paypal plugin if we left it set. array_walk_recursive($array, 'seoauto_prepare_export'); $converter = new assoc_array2xml(); $xml = $converter->array2xml($array); echo $xml; die; } }