[Paulscriptsmods-checkin] ajax_shout/root ajax.php, 1.21.2.27, 1.21.2.28
Status: Beta
Brought to you by:
paulsohier
From: Paul S. <pau...@us...> - 2007-09-15 21:26:22
|
Update of /cvsroot/paulscriptsmods/ajax_shout/root In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2046/root Modified Files: Tag: phpbb3_ver ajax.php Log Message: You dont see this comment, didnt you? Some small changes, for next release (1.0.x, when MOD is denied, or later for 1.2.x). Not really special changes. Index: ajax.php =================================================================== RCS file: /cvsroot/paulscriptsmods/ajax_shout/root/ajax.php,v retrieving revision 1.21.2.27 retrieving revision 1.21.2.28 diff -C2 -d -r1.21.2.27 -r1.21.2.28 *** ajax.php 11 Aug 2007 10:20:36 -0000 1.21.2.27 --- ajax.php 15 Sep 2007 21:25:49 -0000 1.21.2.28 *************** *** 17,22 **** $phpEx = substr(strrchr(__FILE__, '.'), 1); - define('CORTEX_PATH', $phpbb_root_path); // To lazy to change cortex <3 - include ($phpbb_root_path . 'common.' . $phpEx); --- 17,20 ---- *************** *** 58,62 **** // Define the number of printed shouts. // This is difference in IE as in other browsers ;) ! if (strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE') === false) { $shout_number = 20; --- 56,60 ---- // 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; *************** *** 64,68 **** else { ! $shout_number = 10; } --- 62,66 ---- else { ! $shout_number = 5; } *************** *** 292,296 **** // Lets got some nice things :D ! huit.open('POST','<?php echo append_sid('ajax.' . $phpEx , 'm=add', false)?>&rand='+Math.floor(Math.random() * 1000000),true); huit.onreadystatechange = function() --- 290,294 ---- // Lets got some nice things :D ! huit.open('POST','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=add', false)?>&rand='+Math.floor(Math.random() * 1000000),true); huit.onreadystatechange = function() *************** *** 387,391 **** // Lets got some nice things :D ! hsmilies.open('GET','<?php echo append_sid('ajax.' . $phpEx , 'm=smilie', false)?>&rand='+Math.floor(Math.random() * 1000000),true); hsmilies.onreadystatechange = function() --- 385,389 ---- // 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() *************** *** 799,803 **** // Lets got some nice things :D ! hnr.open('GET','<?php echo append_sid('ajax.' . $phpEx , 'm=nr', false)?>&rand='+Math.floor(Math.random() * 1000000),true); hnr.onreadystatechange = function() --- 797,801 ---- // 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() *************** *** 1030,1034 **** if (hin2.readyState == 4 || hin2.readyState == 0) { ! hin2.open('GET','<?php echo append_sid('ajax.' . $phpEx , 'm=check', false)?>&last=' + last + '&rand='+Math.floor(Math.random() * 1000000),true); hin2.onreadystatechange = function() { --- 1028,1032 ---- if (hin2.readyState == 4 || hin2.readyState == 0) { ! hin2.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=check', false)?>&last=' + last + '&rand='+Math.floor(Math.random() * 1000000),true); hin2.onreadystatechange = function() { *************** *** 1079,1083 **** last = xml.getElementsByTagName('last')[0].childNodes[0].nodeValue; // Lets got some nice things :D ! hin.open('GET','<?php echo append_sid('ajax.' . $phpEx , 'm=view', false)?>&start=' + count + '&rand='+Math.floor(Math.random() * 1000000),true); hin.onreadystatechange = function() { --- 1077,1081 ---- last = xml.getElementsByTagName('last')[0].childNodes[0].nodeValue; // Lets got some nice things :D ! hin.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=view', false)?>&start=' + count + '&rand='+Math.floor(Math.random() * 1000000),true); hin.onreadystatechange = function() { *************** *** 1174,1178 **** { // Lets got some nice things :D ! hdelete.open('GET','<?php echo append_sid('ajax.' . $phpEx , 'm=delete', false)?>&id=' + this.post_id + '&rand='+Math.floor(Math.random() * 1000000),true); hdelete.onreadystatechange = function() --- 1172,1176 ---- { // Lets got some nice things :D ! hdelete.open('GET','<?php echo append_sid("{$phpbb_root_path}ajax." . $phpEx , 'm=delete', false)?>&id=' + this.post_id + '&rand='+Math.floor(Math.random() * 1000000),true); hdelete.onreadystatechange = function() *************** *** 1614,1618 **** break; } ! if (in_array($mode,$ajax_m)) { print "<error></error>"; --- 1612,1616 ---- break; } ! if (in_array($mode, $ajax_m)) { print "<error></error>"; *************** *** 1627,1633 **** * @return string */ ! function xml($txt) { ! return "<![CDATA[$txt]]>"; } --- 1625,1653 ---- * @return string */ ! function xml($content) { ! $contents = utf8_encode(trim($contents)); ! ! if ( preg_match('/\<(.*?)\>/xsi', $contents) ) ! { ! $contents = preg_replace('/\<script[\s]+(.*)\>(.*)\<\/script\>/xsi', '', $contents); ! } ! ! if (!(strpos($contents, '>') === false) || !(strpos($contents, '<') === false) || !(strpos($contents, '&') === false)) ! { ! // CDATA doesn't let you use ']]>' so fall back to WriteString ! if (!(strpos($contents, ']]>') === false)) ! { ! return htmlspecialchars($contents); ! } ! else ! { ! return '<![CDATA[' . $contents . ']]>'; ! } ! } ! else ! { ! return htmlspecialchars($contents); ! } } |