50) { $count = 10; } $res = mysql_query("SELECT * FROM post WHERE user=$userid ORDER BY timestamp DESC LIMIT $count"); if ($res) { $count = mysql_num_rows($res); echo "\n"; echo "$count\n"; echo "\n"; while ($row = mysql_fetch_object($res)) { echo "\n"; echo " $row->id\n"; echo " $row->thread\n"; echo " $row->timestamp\n"; echo " content, 0, 100)."]]>\n"; echo "\n"; } echo "\n"; echo "\n"; } else { xml_error(-1, "Database error"); } } elseif ($method == "user_threads") { $userid = get_int("userid", true); $user = lookup_user_id($userid); if (!$user) { xml_error(-136); } $count = get_int("count", true); if (!$count || $count <= 0 || $count > 50) { $count = 10; } $res = mysql_query("SELECT * FROM thread WHERE owner=$userid ORDER BY timestamp DESC LIMIT $count"); if ($res) { $count = mysql_num_rows($res); echo "\n"; echo "$count\n"; echo "\n"; while ($row = mysql_fetch_object($res)) { echo "\n"; echo " $row->id\n"; echo " $row->forum\n"; echo " $row->replies\n"; echo " $row->views\n"; echo " $row->timestamp\n"; echo " <![CDATA[$row->title]]>\n"; echo "\n"; } echo "\n"; echo "\n"; } else { xml_error(-1, "Database error"); } } ?>