[Paulscriptsmods-checkin] ajax_shout/root ajax.php, 1.21.2.31, 1.21.2.32
Status: Beta
Brought to you by:
paulsohier
From: Paul S. <pau...@us...> - 2007-09-23 20:43:44
|
Update of /cvsroot/paulscriptsmods/ajax_shout/root In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9091 Modified Files: Tag: phpbb3_ver ajax.php Log Message: First part of some changes. Index: ajax.php =================================================================== RCS file: /cvsroot/paulscriptsmods/ajax_shout/root/ajax.php,v retrieving revision 1.21.2.31 retrieving revision 1.21.2.32 diff -C2 -d -r1.21.2.31 -r1.21.2.32 *** ajax.php 19 Sep 2007 08:19:11 -0000 1.21.2.31 --- ajax.php 23 Sep 2007 20:43:44 -0000 1.21.2.32 *************** *** 15,19 **** define('AJAX_DEBUG', false); ! $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); --- 15,19 ---- define('AJAX_DEBUG', false); ! $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); *************** *** 31,45 **** $mode = request_var('m', 'index'); ! $ajax_m = array('add','del','view','check', 'smilie', 'delete', 'nr'); $err = false; ! if (in_array($mode,$ajax_m)) { @ob_end_clean(); ! header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); ! header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); ! header("Cache-Control: no-cache, must-revalidate" ); ! header("Pragma: no-cache" ); ! header("Content-type: text/xml; charset=UTF-8"); ! print '<'.'?xml version="1.0" encoding="UTF-8" ?'.'> <xml>'; } --- 31,45 ---- $mode = request_var('m', 'index'); ! $ajax_mode = array('add', 'del', 'view', 'check', 'smilies', 'delete', 'number'); $err = false; ! if (in_array($mode, $ajax_mode)) { @ob_end_clean(); ! header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); ! header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); ! header('Cache-Control: no-cache, must-revalidate'); ! header('Pragma: no-cache'); ! header('Content-type: text/xml; charset=UTF-8'); ! echo '<' . '?xml version="1.0" encoding="UTF-8" ?' . '> <xml>'; } *************** *** 48,61 **** //JS :D @ob_end_clean(); ! header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); ! header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); ! header("Cache-Control: no-cache, must-revalidate" ); ! header("Pragma: no-cache" ); ! header("Content-type: text/javascript; charset=UTF-8"); } // Define the number of printed shouts. // This is difference in IE as in other browsers ;) ! if (strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), 'msie') === false || strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), 'opera') !== false) { $shout_number = 20; --- 48,61 ---- //JS :D @ob_end_clean(); ! header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); ! header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); ! header('Cache-Control: no-cache, must-revalidate'); ! header('Pragma: no-cache'); ! header('Content-type: text/javascript; charset=UTF-8'); } // Define the number of printed shouts. // This is difference in IE as in other browsers ;) ! if (strpos(strtolower($user->browser), 'msie') === false || strpos(strtolower($user->browser), 'opera') !== false) { $shout_number = 20; *************** *** 99,107 **** if (AJAX_DEBUG) { ! print 'alert(e.message);'; } else { ! print 'message(e.message, true);'; } ?> --- 99,107 ---- if (AJAX_DEBUG) { ! echo 'alert(e.message);'; } else { ! echo 'message(e.message, true);'; } ?> *************** *** 126,134 **** <?php if (AJAX_DEBUG) { ! print 'alert(tmp);'; } else { ! print 'message(tmp, true);'; } ?> --- 126,134 ---- <?php if (AJAX_DEBUG) { ! echo 'alert(tmp);'; } else { ! echo 'message(tmp, true);'; } ?> *************** *** 152,156 **** var ev = err_msg('<?php echo $user->lang['MISSING_DIV']; ?>'); ! ev.name = "E_CORE_ERROR"; throw ev; return; --- 152,156 ---- var ev = err_msg('<?php echo $user->lang['MISSING_DIV']; ?>'); ! ev.name = 'E_CORE_ERROR'; throw ev; return; *************** *** 300,306 **** { xml = huit.responseXML; ! if (xml.getElementsByTagName("error") && xml.getElementsByTagName("error").length != 0) { ! err = xml.getElementsByTagName("error")[0].childNodes[0].nodeValue; document.getElementById('msg_txt').innerHTML = ''; document.getElementById('post_message').style.display = 'block'; --- 300,306 ---- { xml = huit.responseXML; ! if (xml.getElementsByTagName('error') && xml.getElementsByTagName('error').length != 0) { ! err = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; document.getElementById('msg_txt').innerHTML = ''; document.getElementById('post_message').style.display = 'block'; *************** *** 386,390 **** // Lets got some nice things :D ! hsmilies.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=smilie', false)?>&rand='+Math.floor(Math.random() * 1000000),true); hsmilies.onreadystatechange = function() --- 386,390 ---- // Lets got some nice things :D ! hsmilies.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=smilies', false)?>&rand='+Math.floor(Math.random() * 1000000),true); hsmilies.onreadystatechange = function() *************** *** 395,401 **** { xml = hsmilies.responseXML; ! if (xml.getElementsByTagName("error") && xml.getElementsByTagName("error").length != 0) { ! err = xml.getElementsByTagName("error")[0].childNodes[0].nodeValue; document.getElementById('smilies').innerHTML = ''; message(err, true); --- 395,401 ---- { xml = hsmilies.responseXML; ! if (xml.getElementsByTagName('error') && xml.getElementsByTagName('error').length != 0) { ! err = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; document.getElementById('smilies').innerHTML = ''; message(err, true); *************** *** 404,408 **** { document.getElementById('smilies').innerHTML = ''; ! var tmp = xml.getElementsByTagName('smilie'); for (var i = (tmp.length - 1); i >= 0 ; i--) { --- 404,408 ---- { document.getElementById('smilies').innerHTML = ''; ! var tmp = xml.getElementsByTagName('smilies'); for (var i = (tmp.length - 1); i >= 0 ; i--) { *************** *** 534,541 **** // inh.appendChild(ce('br')); ! var smilie = ce('div'); ! smilie.style.display = 'none'; ! smilie.name = smilie.id = 'smilies'; ! inh.appendChild(smilie); dl.appendChild(inh); --- 534,541 ---- // inh.appendChild(ce('br')); ! var smilies = ce('div'); ! smilies.style.display = 'none'; ! smilies.name = smilies.id = 'smilies'; ! inh.appendChild(smilies); dl.appendChild(inh); *************** *** 560,567 **** <?php ! if (strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE') === false) { ! echo "post.style.height = '160px'; ! post.style.overflow = 'auto';"; } ?> --- 560,567 ---- <?php ! if (strpos($user->browser, 'MSIE') === false) { ! echo 'post.style.height = \'160px\'; ! post.style.overflow = \'auto\';''; } ?> *************** *** 594,598 **** if (xml.childNodes.length == 0) { ! return tn(""); } else if (xml.childNodes.length == 1 && xml.childNodes[0].nodeValue != null) --- 594,598 ---- if (xml.childNodes.length == 0) { ! return tn(''); } else if (xml.childNodes.length == 1 && xml.childNodes[0].nodeValue != null) *************** *** 604,608 **** else { ! var div = ce("span"); loop: --- 604,608 ---- else { ! var div = ce('span'); loop: *************** *** 632,642 **** switch (xml.childNodes[i].nodeName) { ! case "br": ! div.appendChild(ce("br")); break; ! case "blockquote": ! var q = ce("blockquote"); ! q.className = "quote"; q.appendChild(validate_overige(xml.childNodes[i])); add_style(xml.childNodes[i], q); --- 632,642 ---- switch (xml.childNodes[i].nodeName) { ! case 'br': ! div.appendChild(ce('br')); break; ! case 'blockquote': ! var q = ce('blockquote'); ! q.className = 'quote'; q.appendChild(validate_overige(xml.childNodes[i])); add_style(xml.childNodes[i], q); *************** *** 644,651 **** break; ! case "a": ! var a = ce("a"); ! a.href = xml.childNodes[i].getAttribute("href"); a.appendChild(validate_overige(xml.childNodes[i])); --- 644,651 ---- break; ! case 'a': ! var a = ce('a'); ! a.href = xml.childNodes[i].getAttribute('href'); a.appendChild(validate_overige(xml.childNodes[i])); *************** *** 655,663 **** break; ! case "img": ! var img = ce("img"); ! img.alt = xml.childNodes[i].getAttribute("alt"); ! img.src = xml.childNodes[i].getAttribute("src"); img.border = 0; add_style(xml.childNodes[i], img); --- 655,663 ---- break; ! case 'img': ! var img = ce('img'); ! img.alt = xml.childNodes[i].getAttribute('alt'); ! img.src = xml.childNodes[i].getAttribute('src'); img.border = 0; add_style(xml.childNodes[i], img); *************** *** 666,672 **** break; ! case "strong": ! case "b": ! var b = ce("strong"); b.appendChild(validate_overige(xml.childNodes[i])); --- 666,672 ---- break; ! case 'strong': ! case 'b': ! var b = ce('strong'); b.appendChild(validate_overige(xml.childNodes[i])); *************** *** 675,690 **** break; ! case "hr": ! var hr = ce("hr"); div.appendChild(hr); break; ! case "h1": ! case "h2": ! case "h3": ! case "h4": ! case "h5": ! case "h6": var h = ce(xml.childNodes[i].nodeName); h.appendChild(validate_overige(xml.childNodes[i])); --- 675,690 ---- break; ! case 'hr': ! var hr = ce('hr'); div.appendChild(hr); break; ! case 'h1': ! case 'h2': ! case 'h3': ! case 'h4': ! case 'h5': ! case 'h6': var h = ce(xml.childNodes[i].nodeName); h.appendChild(validate_overige(xml.childNodes[i])); *************** *** 703,707 **** default: { ! throw err_msg("<?php echo $user->lang['INVALID_EL']; ?>"+xml.childNodes[i].nodeName); } } --- 703,707 ---- default: { ! throw err_msg('<?php echo $user->lang['INVALID_EL']; ?>' + xml.childNodes[i].nodeName); } } *************** *** 727,731 **** } ! f = el.getAttribute("style"); if (f == null) --- 727,731 ---- } ! f = el.getAttribute('style'); if (f == null) *************** *** 733,744 **** return; } ! if (f.indexOf(";") == -1) { ! f += ";"; } ! f = f.split(";"); for (var j = 0; j < f.length; j++) { ! f2 = f[j].split(":"); if (f2[0]) --- 733,744 ---- return; } ! if (f.indexOf(';') == -1) { ! f += ';'; } ! f = f.split(';'); for (var j = 0; j < f.length; j++) { ! f2 = f[j].split(':'); if (f2[0]) *************** *** 798,802 **** // Lets got some nice things :D ! hnr.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=nr', false)?>&rand='+Math.floor(Math.random() * 1000000),true); hnr.onreadystatechange = function() --- 798,802 ---- // Lets got some nice things :D ! hnr.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=number', false)?>&rand='+Math.floor(Math.random() * 1000000),true); hnr.onreadystatechange = function() *************** *** 807,821 **** { xml = hnr.responseXML; ! if (xml.getElementsByTagName("error") && xml.getElementsByTagName("error").length != 0) { ! err = xml.getElementsByTagName("error")[0].childNodes[0].nodeValue; message(err, true); clearTimeout(timer_in); ! setTimeout("reload_post();",500); } else { ! var nr = xml.getElementsByTagName("nr")[0].childNodes[0].nodeValue; var f = document.getElementById('nr'); f.innerHTML = ''; --- 807,821 ---- { xml = hnr.responseXML; ! if (xml.getElementsByTagName('error') && xml.getElementsByTagName('error').length != 0) { ! err = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; message(err, true); clearTimeout(timer_in); ! setTimeout('reload_post();',500); } else { ! var nr = xml.getElementsByTagName('nr')[0].childNodes[0].nodeValue; var f = document.getElementById('nr'); f.innerHTML = ''; *************** *** 851,855 **** { a.c = ((on_page - 2) * per_page); ! a.href = "javascript:;"; a.onclick = function() { --- 851,855 ---- { a.c = ((on_page - 2) * per_page); ! a.href = 'javascript:;'; a.onclick = function() { *************** *** 870,874 **** a.c = 0; ! a.href = "javascript:;"; a.onclick = function() { --- 870,874 ---- a.c = 0; ! a.href = 'javascript:;'; a.onclick = function() { *************** *** 904,908 **** { a.c = (i - 1) * per_page; ! a.href = "javascript:;"; a.onclick = function() { --- 904,908 ---- { a.c = (i - 1) * per_page; ! a.href = 'javascript:;'; a.onclick = function() { *************** *** 941,945 **** { a.c = (i - 1) * per_page; ! a.href = "javascript:;"; a.onclick = function() { --- 941,945 ---- { a.c = (i - 1) * per_page; ! a.href = 'javascript:;'; a.onclick = function() { *************** *** 975,979 **** a.c = ((total_pages - 1) * per_page); ! a.href = "javascript:;"; a.onclick = function() { --- 975,979 ---- a.c = ((total_pages - 1) * per_page); ! a.href = 'javascript:;'; a.onclick = function() { *************** *** 991,995 **** a.c = ((on_page) * per_page); ! a.href = "javascript:;"; a.onclick = function() { --- 991,995 ---- a.c = ((on_page) * per_page); ! a.href = 'javascript:;'; a.onclick = function() { *************** *** 1041,1045 **** } var xml = hin2.responseXML; ! if (xml.getElementsByTagName("error") && xml.getElementsByTagName("error").length != 0) { err = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; --- 1041,1045 ---- } var xml = hin2.responseXML; ! if (xml.getElementsByTagName('error') && xml.getElementsByTagName('error').length != 0) { err = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; *************** *** 1049,1053 **** var t = xml.getElementsByTagName('tijd')[0].childNodes[0].nodeValue; ! if (t == "0") { // If start is true, we let notice that there are no messages --- 1049,1053 ---- var t = xml.getElementsByTagName('tijd')[0].childNodes[0].nodeValue; ! if (t == '0') { // If start is true, we let notice that there are no messages *************** *** 1091,1095 **** } var xml = hin.responseXML; ! if (xml.getElementsByTagName("error") && xml.getElementsByTagName("error").length != 0) { var msg = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; --- 1091,1095 ---- } var xml = hin.responseXML; ! if (xml.getElementsByTagName('error') && xml.getElementsByTagName('error').length != 0) { var msg = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; *************** *** 1183,1189 **** xml = hdelete.responseXML; ! if (xml.getElementsByTagName("error") && xml.getElementsByTagName("error").length != 0) { ! err = xml.getElementsByTagName("error")[0].childNodes[0].nodeValue; message(err, true); return; --- 1183,1189 ---- xml = hdelete.responseXML; ! if (xml.getElementsByTagName('error') && xml.getElementsByTagName('error').length != 0) { ! err = xml.getElementsByTagName('error')[0].childNodes[0].nodeValue; message(err, true); return; *************** *** 1304,1308 **** try { ! http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) --- 1304,1308 ---- try { ! http_request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) *************** *** 1310,1314 **** try { ! http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) --- 1310,1314 ---- try { ! http_request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) *************** *** 1384,1388 **** switch ($mode) { ! case 'smilie': $sql = 'SELECT * --- 1384,1388 ---- switch ($mode) { ! case 'smilies': $sql = 'SELECT * *************** *** 1399,1411 **** if ($row['smiley_url'] !== $last_url) { ! print "<smilie>\n <code>" . xml($row['code']) . "</code>\n <img>" . xml($phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url']) . "</img>\n <alt>" . xml($row['emotion']) . "</alt>\n ! </smilie>"; } $last_url = $row['smiley_url']; } ! print "</xml>"; die; } --- 1399,1411 ---- if ($row['smiley_url'] !== $last_url) { ! echo "<smilies>\n <code>" . xml($row['code']) . "</code>\n <img>" . xml($phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url']) . "</img>\n <alt>" . xml($row['emotion']) . "</alt>\n ! </smilies>"; } $last_url = $row['smiley_url']; } ! echo '</xml>'; die; } *************** *** 1416,1424 **** break; ! case "delete": $id = request_var('id', 0); if (!$id) { ! print "<error>" . $user->lang['NO_SHOUT_ID'] . "</error></xml>"; die; } --- 1416,1424 ---- break; ! case 'delete': $id = request_var('id', 0); if (!$id) { ! echo '<error>' . $user->lang['NO_SHOUT_ID'] . '</error></xml>'; die; } *************** *** 1426,1430 **** { // Lets delete this post :D ! $sql = "DELETE FROM " . SHOUTBOX_TABLE . " WHERE shout_id = " . $id; if (!$db->sql_query($sql)) { --- 1426,1430 ---- { // Lets delete this post :D ! $sql = 'DELETE FROM ' . SHOUTBOX_TABLE . ' WHERE shout_id = ' . $id; if (!$db->sql_query($sql)) { *************** *** 1433,1437 **** else { ! print "<msg></msg></xml>"; die; } --- 1433,1437 ---- else { ! echo '<msg></msg></xml>'; die; } *************** *** 1439,1443 **** break; ! case "add": if ($user->data['user_type'] == USER_IGNORE ) { --- 1439,1443 ---- break; ! case 'add': if ($user->data['user_type'] == USER_IGNORE ) { *************** *** 1450,1454 **** $time = time() - (3600 * 24 * 14);//3600 seconds in 1 hour, 24 hours in a day, 14 days in 2 weeks. ! $sql = "DELETE FROM " . SHOUTBOX_TABLE . " WHERE shout_time < $time"; if (!$db->sql_query($sql)) { --- 1450,1454 ---- $time = time() - (3600 * 24 * 14);//3600 seconds in 1 hour, 24 hours in a day, 14 days in 2 weeks. ! $sql = 'DELETE FROM ' . SHOUTBOX_TABLE . " WHERE shout_time < $time"; if (!$db->sql_query($sql)) { *************** *** 1462,1468 **** if (!($auth->acl_get('a_') || $auth->acl_getf_global('m_'))) { ! $sql = "SELECT MAX(shout_time) AS last_post_time ! FROM " . SHOUTBOX_TABLE . " ! WHERE shout_user_id = " . $user->data['user_id']; if ($result = $db->sql_query($sql)) { --- 1462,1468 ---- if (!($auth->acl_get('a_') || $auth->acl_getf_global('m_'))) { ! $sql = 'SELECT MAX(shout_time) AS last_post_time ! FROM ' . SHOUTBOX_TABLE . ' ! WHERE shout_user_id = ' . $user->data['user_id']; if ($result = $db->sql_query($sql)) { *************** *** 1472,1476 **** if ($row['last_post_time'] > 0 && ( $current_time - $row['last_post_time'] ) < $config['flood_interval']) { ! print "<error>" . $user->lang['FLOOD_ERROR'] . "</error></xml>"; die; } --- 1472,1476 ---- if ($row['last_post_time'] > 0 && ( $current_time - $row['last_post_time'] ) < $config['flood_interval']) { ! echo '<error>' . $user->lang['FLOOD_ERROR'] . '</error></xml>'; die; } *************** *** 1486,1495 **** if (empty($message)) { ! print "<error>" . $user->lang['MESSAGE_EMPTY'] . "</error></xml>"; die; } ! else if (strpos($message, "[quote") !== false || strpos($message, "[code") !== false || strpos($message, "[list") !== false) { ! print "<error>" . $user->lang['NO_QUOTE'] . "</error></xml>"; die; } --- 1486,1495 ---- if (empty($message)) { ! echo '<error>' . $user->lang['MESSAGE_EMPTY'] . '</error></xml>'; die; } ! else if (strpos($message, '[quote') !== false || strpos($message, '[code') !== false || strpos($message, '[list') !== false) { ! echo '<error>' . $user->lang['NO_QUOTE'] . '</error></xml>'; die; } *************** *** 1516,1520 **** sql_error($sql, __LINE__, __FILE__); } ! print "<msg>" . $user->lang['POSTED'] . "</msg></xml>"; die; } --- 1516,1520 ---- sql_error($sql, __LINE__, __FILE__); } ! echo '<msg>' . $user->lang['POSTED'] . '</msg></xml>'; die; } *************** *** 1522,1530 **** break; ! case "check": $last = request_var('last', 1); ! $sql = "SELECT shout_time AS s FROM " . SHOUTBOX_TABLE . " ! ORDER BY shout_time DESC LIMIT 1"; ! $result = $db->sql_query($sql); if (!$result) { --- 1522,1530 ---- break; ! case 'check': $last = request_var('last', 1); ! $sql = 'SELECT shout_time AS s FROM ' . SHOUTBOX_TABLE . ' ! ORDER BY shout_time DESC'; ! $result = $db->sql_query_limit($sql, 1); if (!$result) { *************** *** 1535,1545 **** $row = $db->sql_fetchrow($result); $s = $row['s']; ! print "<last>$s</last><tijd>" . (int)($s != $last) . "</tijd></xml>"; die; } break; ! case 'nr': ! $sql = "SELECT COUNT(shout_id) as nr FROM " . SHOUTBOX_TABLE; $result = $db->sql_query($sql); if (!$result) --- 1535,1545 ---- $row = $db->sql_fetchrow($result); $s = $row['s']; ! echo "<last>$s</last><tijd>" . (int)($s != $last) . '</tijd></xml>'; die; } break; ! case 'number': ! $sql = 'SELECT COUNT(shout_id) as nr FROM ' . SHOUTBOX_TABLE; $result = $db->sql_query($sql); if (!$result) *************** *** 1549,1553 **** $row = $db->sql_fetchrow($result); $row = (int)$row['nr']; ! print "<nr>$row</nr></xml>"; die; break; --- 1549,1553 ---- $row = $db->sql_fetchrow($result); $row = (int)$row['nr']; ! echo "<nr>$row</nr></xml>"; die; break; *************** *** 1557,1564 **** $start = ($start < 0) ? 0 : $start; ! $sql = "SELECT s.*, u.user_colour, u.username, u.user_id FROM " . SHOUTBOX_TABLE . " s, ".USERS_TABLE." u WHERE s.shout_user_id = u.user_id ! ORDER BY s.shout_time DESC"; $result = $db->sql_query_limit($sql, $shout_number, $start); if (!$result) --- 1557,1564 ---- $start = ($start < 0) ? 0 : $start; ! $sql = 'SELECT s.*, u.user_colour, u.username, u.user_id FROM ' . SHOUTBOX_TABLE . ' s, ' . USERS_TABLE . ' u WHERE s.shout_user_id = u.user_id ! ORDER BY s.shout_time DESC'; $result = $db->sql_query_limit($sql, $shout_number, $start); if (!$result) *************** *** 1571,1575 **** if (!sizeof($data)) { ! print "<error>" . $user->lang['NO_MESSAGE'] . "</error></xml>"; die; } --- 1571,1575 ---- if (!sizeof($data)) { ! echo '<error>' . $user->lang['NO_MESSAGE'] . '</error></xml>'; die; } *************** *** 1578,1582 **** { $row = $data[$i]; ! print "<posts>\n"; $row['username'] = get_username_string('full', $row['user_id'], xml(htmlspecialchars_decode($row['username'])), $row['user_colour']); --- 1578,1582 ---- { $row = $data[$i]; ! echo "<posts>\n"; $row['username'] = get_username_string('full', $row['user_id'], xml(htmlspecialchars_decode($row['username'])), $row['user_colour']); *************** *** 1598,1621 **** unset($row['shout_userip']); } ! foreach ($row as $el => $wa) { ! if (is_numeric($el)) { continue; } ! print "\t<$el>$wa</$el>\n"; } ! print "</posts>\n"; } ! print "</xml>"; die; } break; } ! if (in_array($mode, $ajax_m)) { ! print "<error></error>"; ! ! print '</xml>'; } --- 1598,1619 ---- unset($row['shout_userip']); } ! foreach ($row as $key => $value) { ! if (is_numeric($key)) { continue; } ! echo "\t<$key>$value</$key>\n"; } ! echo "</posts>\n"; } ! echo '</xml>'; die; } break; } ! if (in_array($mode, $ajax_mode)) { ! echo '<error></error></xml>'; } *************** *** 1669,1673 **** $err = $db->sql_error(); $err = xml($err['message']); ! print "<error>$err</error>\n<sql>$sql</sql>\n</xml>"; die; } --- 1667,1671 ---- $err = $db->sql_error(); $err = xml($err['message']); ! echo "<error>$err</error>\n<sql>$sql</sql>\n</xml>"; die; } |