Advertisement
TwiztedInnovations

Untitled

Jul 15th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 110.64 KB | None | 0 0
  1. <?php
  2. /*=======================================================================
  3. Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
  4. =======================================================================*/
  5.  
  6. // ==========================================
  7. // PHP-NUKE: Shout Box
  8. // ==========================
  9. //
  10. // Copyright (c) 2003-2005 by Aric Bolf (SuperCat)
  11. // http://www.OurScripts.net
  12. //
  13. // Copyright (c) 2002 by Quiecom
  14. // http://www.Quiecom.com
  15. //
  16. // This program is free software. You can redistribute it and/or modify
  17. // it under the terms of the GNU General Public License as published by
  18. // the Free Software Foundation
  19. // ===========================================
  20.  
  21. /*****[CHANGES]**********************************************************
  22. -=[Base]=-
  23. Nuke Patched v3.1.0 08/10/2005
  24. -=[Mod]=-
  25. Advanced Username Color v1.0.5 10/29/2005
  26. ************************************************************************/
  27.  
  28. if (!defined('ADMIN_FILE')) {
  29. die ("Illegal File Access");
  30. }
  31.  
  32. global $prefix, $db, $cache;
  33. $module_name = basename(dirname(dirname(__FILE__)));
  34. if (!is_mod_admin($module_name)) {
  35. die("Access Denied");
  36. }
  37.  
  38. global $currentlang, $sbURL;
  39.  
  40. if ($currentlang) {
  41. include_once(NUKE_MODULES_DIR.$module_name.'/lang-admin/lang-'.$currentlang.'.php');
  42. } else {
  43. include_once(NUKE_MODULES_DIR.$module_name.'/lang-admin/lang-english.php');
  44. }
  45.  
  46. include_once(NUKE_MODULES_DIR.'Shout_Box/shout.php');
  47.  
  48. $ThemeSel = get_theme();
  49. global $rowColor;
  50. if ((($rowColor = $cache->load('theme_'.$ThemeSel, 'shoutbox')) == false) || empty($rowColor)) {
  51. $sql = "SELECT * FROM `".$prefix."_shoutbox_themes` WHERE themeName='$ThemeSel'";
  52. $result = $db->sql_query($sql);
  53. $rowColor = $db->sql_fetchrow($result);
  54. $cache->save('theme_'.$ThemeSel, 'shoutbox', $rowColor);
  55. $db->sql_freeresult($result);
  56. }
  57.  
  58. global $shout_conf;
  59. if ((($shout_conf = $cache->load('conf', 'shoutbox')) == false) || empty($shout_conf)) {
  60. $sql = "SELECT * FROM `".$prefix."_shoutbox_conf`";
  61. $result = $db->sql_query($sql);
  62. $shout_conf = $db->sql_fetchrow($result);
  63. $cache->save('conf', 'shoutbox', $shout_conf);
  64. }
  65.  
  66.  
  67. $sbURL = 'index.php?url=';
  68.  
  69. function LinkAdmin() {
  70. Global $admin_file;
  71. OpenTable();
  72. //echo "<center><a href=\"".$admin_file.".php\"><span class=\"title\">"._ADMINMENU."</span></a></center>";
  73. echo "<div align=\"center\">\n<a href=\"$admin_file.php?op=shout\">" . _SHOUT_ADMIN_HEADER . "</a></div>\n";
  74. echo "<br /><br />";
  75. echo "<div align=\"center\">\n[ <a href=\"$admin_file.php\">" . _SHOUT_RETURNMAIN . "</a> ]</div>\n";
  76. CloseTable();
  77. echo "<br />";
  78. }
  79.  
  80. // Start 'Menu' code
  81.  
  82. function ShoutBoxAdminMenu($ShoutMenuOptionActive) {
  83. global $admin_file, $rowColor;
  84. OpenTable();
  85. echo "<br /><div align=\"center\" class=\"title\">"._SHOUTADMIN."</div><br />";
  86.  
  87. echo "<center><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"background-color: ".$rowColor['border'].";\" nowrap=\"nowrap\">";
  88. echo "<table align=\"center\" cellpadding=\"0\" cellspacing=\"1\" border=\"0\"><tr><td style=\"background-color: ".$rowColor['menuColor2'].";\" nowrap=\"nowrap\">";
  89. echo "<table align=\"center\" cellpadding=\"1\" cellspacing=\"2\" border=\"0\"><tr style=\"cursor: hand; text-align: center;\">";
  90.  
  91. echo "<td style=\"background-color: $rowColor[border];\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  92. if ($ShoutMenuOptionActive == 1) {
  93. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=manageShouts'\" nowrap=\"nowrap\">";
  94. } else {
  95. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=manageShouts'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  96. }
  97. echo "<strong>"._MANAGESHOUTS."</strong></td></tr></table></td>";
  98.  
  99. echo "<td style=\"background-color: $rowColor[border];\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  100. if ($ShoutMenuOptionActive == 2) {
  101. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxLayout'\" nowrap=\"nowrap\">";
  102. } else {
  103. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxLayout'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  104. }
  105. echo "<strong>"._SB_LAYOUT."</strong></td></tr></table></td>";
  106.  
  107. echo "<td style=\"background-color: ".$rowColor['border'].";\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  108. if ($ShoutMenuOptionActive == 3) {
  109. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxThemeing'\" nowrap=\"nowrap\">";
  110. } else {
  111. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxThemeing'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  112. }
  113. echo "<strong>"._SB_THEMEING."</strong></td></tr></table></td>";
  114.  
  115. echo "<td style=\"background-color: ".$rowColor['border'].";\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  116. if ($ShoutMenuOptionActive == 4) {
  117. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxPermissions'\" nowrap=\"nowrap\">";
  118. } else {
  119. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxPermissions'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  120. }
  121. echo "<strong>"._SB_PERMISSIONS."</strong></td></tr></table></td>";
  122.  
  123. echo "<td style=\"background-color: ".$rowColor['border'].";\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  124. if ($ShoutMenuOptionActive == 5) {
  125. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=manageemoticons'\" nowrap=\"nowrap\">";
  126. } else {
  127. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=manageemoticons'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  128. }
  129. echo "<strong>"._SB_EMOTICONS."</strong></td></tr></table></td>";
  130.  
  131. echo "<td style=\"background-color: ".$rowColor['border'].";\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  132. if ($ShoutMenuOptionActive == 6) {
  133. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=managecensor'\" nowrap=\"nowrap\">";
  134. } else {
  135. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=managecensor'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  136. }
  137. echo "<strong>"._SB_CENSOR."</strong></td></tr></table></td>";
  138.  
  139. echo "<td style=\"background-color: ".$rowColor['border'].";\"><table cellpadding=\"6\" cellspacing=\"0\" border=\"0\"><tr>";
  140. if ($ShoutMenuOptionActive == 7) {
  141. echo "<td style=\"background-color: ".$rowColor['menuColor1']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxBans'\" nowrap=\"nowrap\">";
  142. } else {
  143. echo "<td style=\"background-color: ".$rowColor['menuColor2']."; line-height: .8em;\" onclick=\"top.location.href='".$admin_file.".php?op=shout&amp;Submit=ShoutBoxBans'\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\" nowrap=\"nowrap\">";
  144. }
  145. echo "<strong>"._SB_BANS."</strong></td></tr></table></td>";
  146.  
  147. echo "</tr></table>\n";
  148. echo "</td></tr></table></td></tr></table></center>";
  149.  
  150. CloseTable();
  151. echo "<br />";
  152. }
  153.  
  154. // End 'Menu' code
  155.  
  156. // Start 'Manage Shouts' code (Default page)
  157.  
  158. function manageShouts($page, $pruned) {
  159. global $prefix, $db, $admin, $admin_file, $sbURL, $module_name, $shout_conf, $rowColor, $userinfo, $board_config;
  160. include_once(NUKE_BASE_DIR.'header.php');
  161. LinkAdmin();
  162. $ShoutMenuOptionActive = 1;
  163. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  164. OpenTable();
  165.  
  166. $conf = $shout_conf;
  167.  
  168. $sql = "SELECT aCount FROM ".$prefix."_shoutbox_manage_count WHERE admin='$admin[0]'";
  169. $resultA = $db->sql_query($sql);
  170. $aCount = $db->sql_fetchrow($resultA);
  171. if (empty($aCount['aCount'])) {
  172. $sql = "INSERT INTO ".$prefix."_shoutbox_manage_count (admin, aCount) VALUES ('$admin[0]','10')";
  173. $db->sql_query($sql);
  174. $aCount['aCount'] = 10;
  175. }
  176.  
  177. echo "<form name=\"manageShouts1\" action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><div class=\"content\">";
  178. echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td style=\"background-color: ".$rowColor['border'].";\">";
  179. echo "<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\"><tr style=\"background-color: ".$rowColor['menuColor1'].";\" align=\"center\">";
  180. echo "<td width=\"10%\"><strong>"._SB_NICKNAME."</strong></td>";
  181. echo "<td><strong>"._SB_SHOUT."</strong></td>";
  182. echo "<td width=\"16%\"><strong>"._SB_DATE." &amp; "._SB_TIME."</strong></td>";
  183. echo "<td width=\"5%\"><strong>"._DELETE."</strong></td>";
  184. echo "<td width=\"5%\"><strong>"._EDIT."</strong></td>";
  185. echo "<td width=\"5%\"><strong>"._BAN."</strong></td>";
  186. echo "</tr>";
  187.  
  188. $sql = "SELECT `id` FROM `".$prefix."_shoutbox_shouts`";
  189. $result = $db->sql_query($sql);
  190. $numrows = $db->sql_numrows($result);
  191. $db->sql_freeresult($result);
  192. $numrows2 = $numrows;
  193. $shout_pages = 1;
  194. $shoutsViewed = $aCount['aCount'];
  195. while ($numrows >= $shoutsViewed) {
  196. $shout_pages++;
  197. $numrows = ($numrows - $shoutsViewed);
  198. }
  199. if ($shout_pages == 0) { $shout_pages = 1; }
  200. if (!$page) { $page = 1; }
  201. if ($page < 1) { $page = 1; }
  202. if ($page > $shout_pages) { $page = $shout_pages; }
  203. if ($page > 1) {
  204. $offset = ($page * $shoutsViewed);
  205. $offset1 = ($offset - $shoutsViewed);
  206. } else { $offset1 = 0; }
  207.  
  208. $shgroup1 = ($page*$aCount['aCount']);
  209. $shgroup1 = ($shgroup1-$aCount['aCount']);
  210. $shgroup1 = ($shgroup1+1);
  211. if ($shgroup1 < 1) { $shgroup1 = 1; }
  212. $shgroup2 = ($shgroup1-1);
  213.  
  214. $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` ORDER BY `id` DESC LIMIT ".$offset1.",".$aCount['aCount'];
  215. $nameresult = $db->sql_query($sql);
  216. $x = 1;
  217. while ($shout = $db->sql_fetchrow($nameresult)) {
  218. $comment = str_replace('src=', 'src="', $shout['comment']);
  219. $comment = str_replace('.gif>', '.gif" alt="" />', $comment);
  220. $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment);
  221. $comment = str_replace('.png>', '.png" alt="" />', $comment);
  222. $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment);
  223. /*$comment = str_replace("http:", "".$sbURL."http:", $comment);
  224. $comment = str_replace("ftp:", "".$sbURL."ftp:", $comment);*/
  225.  
  226. // BB code [b]word[/b] [i]word[/i] [u]word[/u]
  227. if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) {
  228. $comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment);
  229. $comment = str_replace("[/b]","</span>",$comment);
  230. }
  231. if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) {
  232. $comment = str_replace("[i]","<span style=\"font-style: italic\">",$comment);
  233. $comment = str_replace("[/i]","</span>",$comment);
  234. }
  235. if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count($comment,"[u]") == substr_count($comment,"[/u]"))) {
  236. $comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment);
  237. $comment = str_replace("[/u]","</span>",$comment);
  238. }
  239.  
  240. // check to see if nickname is a user in the DB
  241. $sql = "SELECT * FROM `".$prefix."_users` WHERE `username`='".$shout['name']."'";
  242. $nameresult2 = $db->sql_query($sql);
  243. $row = $db->sql_fetchrow($nameresult2);
  244. if ($row && $shout['name'] != "Anonymous" && $shout['comment'] != "Anonymous") {
  245. /*****[BEGIN]******************************************
  246. [ Mod: Advanced Username Color v1.0.5 ]
  247. ******************************************************/
  248. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td nowrap=\"nowrap\"><a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$shout[name]\">" . UsernameColor($shout['name']) . "</a></td><td>$comment</td>";
  249. } else {
  250. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td nowrap=\"nowrap\">" . UsernameColor($shout['name']) . "</td><td>$comment</td>";
  251. /*****[END]********************************************
  252. [ Mod: Advanced Username Color v1.0.5 ]
  253. ******************************************************/
  254. }
  255.  
  256. echo "<td nowrap=\"nowrap\">";
  257. if (!empty($shout['timestamp'])) {
  258. // reads unix timestamp and formats it to the viewer's timezone
  259. if (is_user()) {
  260. $unixTime = shout_create_date($userinfo['user_dateformat'], $shout['timestamp'], $userinfo['user_timezone']);
  261. echo $unixTime;
  262. } else {
  263. $unixTime = shout_create_date($board_config['default_dateformat'], $shout['timestamp'], $board_config['board_timezone']);
  264. echo "$unixTime";
  265. }
  266. } else {
  267. echo $shout['date']."&nbsp;".$shout['time'];
  268. }
  269. echo "</td>";
  270.  
  271. echo "<td align=\"center\"><input type=\"hidden\" name=\"sr$x\" value=\"".$shout['id']."\" /><input type=\"checkbox\" name=\"shr$x\" /></td><td align=\"center\"><a title=\"Edit\" href=\"".$admin_file.".php?op=shout&amp;Submit=ShoutEdit&amp;shoutID=".$shout['id']."&amp;page=$page\">"._EDIT."</a></td>";
  272.  
  273. if ($shout['ip'] != 'noip') {
  274. $sql = "SELECT * FROM `".$prefix."_shoutbox_ipblock` WHERE `name`='".$shout['ip']."' ";
  275. $nameIPresult = $db->sql_query($sql);
  276. $nameIProw = $db->sql_fetchrow($nameIPresult);
  277. $db->sql_freeresult($nameIPresult);
  278. if ($nameIProw) {
  279. echo "<td><strong>"._SB_BANNED."</strong></td></tr>";
  280. } else {
  281. echo "<td align=\"center\"><a title=\""._BAN."\" href=\"".$admin_file.".php?op=shout&amp;Submit=ban&amp;bid=".$shout['id']."&amp;page=$page\">"._BAN."</a></td></tr>";
  282. }
  283. } else {
  284. echo "<td>&nbsp;</td></tr>";
  285. }
  286. $x++;
  287. $shgroup2++;
  288. }
  289. $db->sql_freeresult($nameresult);
  290. echo "</table></td></tr></table><br />";
  291.  
  292. echo "<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr>";
  293. echo "<td width=\"1%\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"adminDropCount2\">";
  294. if ($aCount['aCount'] == '10') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  295. if ($aCount['aCount'] == '15') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  296. if ($aCount['aCount'] == '20') { $SEL3 = " selected=\"selected\""; } else { $SEL3 = ""; }
  297. if ($aCount['aCount'] == '25') { $SEL4 = " selected=\"selected\""; } else { $SEL4 = ""; }
  298. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=adminDropCount&amp;aCount=10&amp;page=$page\"$SEL1>10</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=adminDropCount&amp;aCount=15&amp;page=$page\"$SEL2>15</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=adminDropCount&amp;aCount=20&amp;page=$page\"$SEL3>20</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=adminDropCount&amp;aCount=25&amp;page=$page\"$SEL4>25</option></select></td>";
  299.  
  300. echo "<td width=\"9%\" nowrap=\"nowrap\">"._VIEWINGSHOUTS.": $shgroup1 - $shgroup2<br />"._TOTALSHOUTS.": $numrows2</td>";
  301.  
  302. echo "<td width=\"90%\" align=\"center\" nowrap=\"nowrap\">";
  303. $num1 = ($page-4);
  304. if ($num1 < 1) { $num1 = 1; }
  305. $num2 = ($num1+8);
  306. if ($num2 > $shout_pages) { $num2 = $shout_pages; }
  307. $num5 = ($num2-8);
  308. if ($num5 < $num1) {
  309. $num1 = $num5;
  310. if ($num1 < 1) { $num1 = 1; }
  311. }
  312. $num3 = ($page-1);
  313. $num4 = ($page+1);
  314. $menuLinks = "";
  315.  
  316. $count = $num1;
  317. while ($count <= $shout_pages AND $count <= $num2) {
  318. if ($count == $page) {
  319. $menuLinks .= "<strong>$count</strong>";
  320. } else {
  321. $menuLinks .= "<a href=\"".$admin_file.".php?op=shout&Submit=manageShouts&amp;page=$count\">$count</a>";
  322. }
  323. if ($count < $num2) { $menuLinks .= "&nbsp;&nbsp;"; }
  324. $count++;
  325. }
  326.  
  327. $menuLinks .= "<br /><br />";
  328. if ($page > 1) {
  329. $menuLinks .= "<a href=\"".$admin_file.".php?op=shout&Submit=manageShouts&amp;page=$num3\">"._PREVIOUS."</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
  330. }
  331. if ($page != $shout_pages) {
  332. $menuLinks .= _PAGE." $page / <a href=\"".$admin_file.".php?op=shout&Submit=manageShouts&amp;page=$shout_pages\">$shout_pages</a>\n";
  333. } else {
  334. $menuLinks .= _PAGE." $page / $shout_pages\n";
  335. }
  336. if ($page < $shout_pages) {
  337. $menuLinks .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"".$admin_file.".php?op=shout&Submit=manageShouts&amp;page=$num4\">"._NEXT."</a>\n";
  338. }
  339. echo "$menuLinks";
  340. echo "</td>";
  341.  
  342. echo "<td width=\"10%\" nowrap=\"nowrap\" align=\"right\">";
  343. echo "<input type=\"hidden\" name=\"listnum\" value=\"$aCount[aCount]\" /><input type=\"hidden\" name=\"Submit\" value=\"shremove\" /><input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"submit\" name=\"button\" value=\""._REMOVECHECKEDSHOUTS."\" /></td>";
  344. echo "</tr></table></div></form>";
  345. CloseTable();
  346. echo "<br />";
  347. OpenTable();
  348. echo "<br /><div align=\"center\" class=\"title\">"._SB_PRUNESHOUTS."</div><br />";
  349. if ($pruned > 0) {
  350. echo "<div align=\"center\" class=\"content\"><strong>$pruned</strong> "._SB_SHOUTSPRUNED."</div><br />";
  351. }
  352. echo "<center><form name=\"shoutPrune1\" action=\"\" method=\"post\" style=\"margin-bottom: 0px;\">"._SB_PRUNESHOUTSOLDERTHAN."&nbsp;&nbsp;<input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"text\" name=\"pruneDays\" value=\"\" maxlength=\"3\" size=\"5\" />&nbsp;&nbsp;"._SB_DAYS."&nbsp;&nbsp;<input type=\"hidden\" name=\"Submit\" value=\"pruneSubmit\" /><input type=\"submit\" name=\"button\" value=\""._SB_DOPRUNE."\" /></form></center>";
  353.  
  354. $sql = "SELECT `id` FROM `".$prefix."_shoutbox_shouts` WHERE `timestamp`=''";
  355. $resultTS = $db->sql_query($sql);
  356. $TSrows = $db->sql_numrows($resultTS);
  357. $db->sql_freeresult($resultTS);
  358. if ($TSrows > 0) {
  359. echo "<br /><br /><strong>NOTE:</strong> The prune feature only works on shouts that use the new unix timestamp format. You currently have <strong>$TSrows</strong> shouts that are using the old format. Please run the conversion tool that came in the Shout_Box.zip to update your shouts.";
  360. }
  361. CloseTable();
  362. echo "<br />";
  363. OpenTable();
  364. $sql = "SELECT `name`, `comment` FROM `".$prefix."_shoutbox_sticky` WHERE `stickySlot`=0";
  365. $stickyResult = $db->sql_query($sql);
  366. $stickyRow0 = $db->sql_fetchrow($stickyResult);
  367. $db->sql_freeresult($stickyResult);
  368. $sql = "SELECT `name`, `comment` FROM `".$prefix."_shoutbox_sticky` WHERE `stickySlot`=1";
  369. $stickyResult = $db->sql_query($sql);
  370. $stickyRow1 = $db->sql_fetchrow($stickyResult);
  371. $db->sql_freeresult($stickyResult);
  372.  
  373. echo "<br /><div align=\"center\" class=\"title\">"._SB_STICKYSHOUTS."</div><br />";
  374. echo "<center><table align=\"center\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\"><tr><td>".$stickyRow0['name']." </td><td nowrap=\"nowrap\"><form name=\"shoutAdmin20\" action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"text\" name=\"stickyShout\" value=\"".$stickyRow0['comment']."\" maxlength=\"150\" size=\"75\" />&nbsp;&nbsp;<input type=\"hidden\" name=\"stickyUsername\" value=\"".$admin[0]."\" /><input type=\"hidden\" name=\"Submit\" value=\"stickySubmit\" /><input type=\"hidden\" name=\"stickySlot\" value=\"0\" /><input type=\"submit\" name=\"button\" value=\""._SB_SUBMIT."\" /></form></td></tr><tr><td>".$stickyRow1['name']." </td><td nowrap=\"nowrap\"><form name=\"shoutAdmin21\" action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"text\" name=\"stickyShout\" value=\"".$stickyRow1['comment']."\" maxlength=\"150\" size=\"75\" />&nbsp;&nbsp;<input type=\"hidden\" name=\"stickyUsername\" value=\"".$admin[0]."\" /><input type=\"hidden\" name=\"Submit\" value=\"stickySubmit\" /><input type=\"hidden\" name=\"stickySlot\" value=\"1\" /><input type=\"submit\" name=\"button\" value=\""._SB_SUBMIT."\" /></form></td></tr></table></center>";
  375. CloseTable();
  376. // YOU MAY NOT REMOVE, EDIT, OR MARK OUT THE FOLLOWING PAYPAL CODE. IT IS PART OF OUR COPYRIGHT.
  377. echo "<br />";
  378. OpenTable();
  379. echo "<p align=\"center\" class=\"title\">OurScripts.net needs your support!</p>";
  380. echo "<p align=\"center\" class=\"content\">Open Source software costs money and time to develop.</p>";
  381. echo "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">
  382. <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />
  383. <input type=\"hidden\" name=\"business\" value=\"donate@ourscripts.net\" />
  384. <input type=\"hidden\" name=\"item_name\" value=\"Donation to OurScripts.net\" />
  385. <input type=\"hidden\" name=\"no_shipping\" value=\"1\" />
  386. <input type=\"hidden\" name=\"cn\" value=\"Comments\" /><p align=\"center\">
  387. <input type=\"image\" src=\"modules/$module_name/images/paypal.gif\" alt=\"Please donate. Thank you!\" name=\"submit\" title=\"Please donate. Thank you!\" /></p></form><p align=\"center\" class=\"content\">Our community appreciates your monitary support!</p><p align=\"center\" class=\"content\">Released under the <a target=\"_blank\" href=\"".$sbURL."http://www.gnu.org\">GNU/GPL license</a> and distributed by <a target=\"_blank\" href=\"".$sbURL."http://www.ourscripts.net\">OurScripts.net</a>.<br />Copyright &copy; 2002-2005 by SuiteSoft Solutions. All rights reserved.</p>";
  388. CloseTable();
  389. // END OF COPYRIGHT.
  390. include_once(NUKE_BASE_DIR.'footer.php');
  391. exit;
  392. }
  393.  
  394. function pruneSubmit($pruneDays, $page) {
  395. global $prefix, $db, $admin_file;
  396. if ($pruneDays > 0 AND is_numeric($pruneDays)) {
  397. $pruneDays = round($pruneDays);
  398. if ($pruneDays > 0) {
  399. $timestamp = time();
  400. $pruneDays = $pruneDays * 86400;
  401. $newTimestamp = $timestamp - $pruneDays;
  402.  
  403. $sql = "SELECT `id` FROM `".$prefix."_shoutbox_shouts`";
  404. $result = $db->sql_query($sql);
  405. $shoutsBefore = $db->sql_numrows($result);
  406. $db->sql_freeresult($result);
  407.  
  408. $sql = "DELETE FROM `".$prefix."_shoutbox_shouts` WHERE `timestamp` <> '' AND `timestamp` < $newTimestamp";
  409. $db->sql_query($sql);
  410.  
  411. $sql = "SELECT `id` FROM `".$prefix."_shoutbox_shouts`";
  412. $result = $db->sql_query($sql);
  413. $shoutsAfter = $db->sql_numrows($result);
  414.  
  415. $pruned = ($shoutsBefore-$shoutsAfter);
  416. }
  417. }
  418. if (empty($pruned) || $pruned < 0) { $pruned = 0; }
  419. header("Location: ".$admin_file.".php?op=shout&Submit=manageShouts&page=$page&pruned=$pruned");
  420. exit;
  421. }
  422.  
  423. function stickySubmit($stickyShout, $stickyUsername, $stickySlot, $page) {
  424. global $prefix, $db, $admin_file, $shout_conf;
  425. if ($stickyShout) {
  426. $conf = $shout_conf;
  427.  
  428. if ($conf['timeOffset'] == 0) {
  429. $timestamp = time();
  430. } elseif (strstr($conf['timeOffset'], '+')) {
  431. $sbTimeMultiplier = str_replace('+', '', $conf['timeOffset']);
  432. $sbTimeOffset = $sbTimeMultiplier * 3600;
  433. $sbTimeTemp = time();
  434. $timestamp = ($sbTimeTemp + $sbTimeOffset);
  435. } else {
  436. $sbTimeMultiplier = str_replace('-', '', $conf['timeOffset']);
  437. $sbTimeOffset = $sbTimeMultiplier * 3600;
  438. $sbTimeTemp = time();
  439. $timestamp = ($sbTimeTemp - $sbTimeOffset);
  440. }
  441.  
  442. $stickyShout = htmlspecialchars($stickyShout, ENT_QUOTES);
  443. $stickyShout = str_replace("&amp;amp;", "&amp;",$stickyShout);
  444.  
  445. $sql = "SELECT * FROM `".$prefix."_shoutbox_sticky` WHERE `stickySlot`='$stickySlot'";
  446. $stickyResult = $db->sql_query($sql);
  447. $stickyRow = $db->sql_fetchrow($stickyResult);
  448. $db->sql_freeresult($stickyResult);
  449. if ($stickyRow) {
  450. $sql = "UPDATE `".$prefix."_shoutbox_sticky set` `name`='$stickyUsername', `comment`='$stickyShout', `timestamp`='$timestamp' WHERE `stickySlot`='$stickySlot'";
  451. } else {
  452. $sql = "INSERT INTO `".$prefix."_shoutbox_sticky` (name, comment, timestamp, stickySlot) VALUES ('$stickyUsername','$stickyShout','$timestamp','$stickySlot')";
  453. }
  454. } else {
  455. $sql = "DELETE FROM `".$prefix."_shoutbox_sticky` WHERE `stickySlot`='$stickySlot'";
  456. }
  457. $db->sql_query($sql);
  458. header("Location: ".$admin_file.".php?op=shout&Submit=manageShouts&page=$page");
  459. exit;
  460. }
  461.  
  462. function ShoutEdit($shoutID, $page, $ShoutError) {
  463. global $prefix, $db, $admin_file;
  464. include_once(NUKE_BASE_DIR.'header.php');
  465. LinkAdmin();
  466. $ShoutMenuOptionActive = 1;
  467. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  468. OpenTable();
  469. $sql = "SELECT `comment` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
  470. $nameresult = $db->sql_query($sql);
  471. $row = $db->sql_fetchrow($nameresult);
  472. $db->sql_freeresult($nameresult);
  473.  
  474. // strip out link code here (added back in later if saved)
  475. $ShoutComment = $row['comment'];
  476. $ShoutComment = str_replace("&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment);
  477. $ShoutComment = str_replace("&#91;<a rel=\"nofollow\" href=\"", "",$ShoutComment);
  478. $ShoutComment = str_replace("&#91;<a target=\"_blank\" href=\"", "",$ShoutComment);
  479. $ShoutComment = str_replace("&#91;<a href=\"", "",$ShoutComment);
  480. $ShoutComment = str_replace("\">URL</a>&#93;", "",$ShoutComment);
  481. $ShoutComment = str_replace("\">FTP</a>&#93;", "",$ShoutComment);
  482. $ShoutComment = str_replace("\">IRC</a>&#93;", "",$ShoutComment);
  483. $ShoutComment = str_replace("\">TeamSpeak</a>&#93;", "",$ShoutComment);
  484. $ShoutComment = str_replace("\">AIM</a>&#93;", "",$ShoutComment);
  485. $ShoutComment = str_replace("\">Gopher</a>&#93;", "",$ShoutComment);
  486. $ShoutComment = str_replace("\">E-Mail</a>&#93;", "",$ShoutComment);
  487.  
  488. $i = 0;
  489. $ShoutNew = '';
  490. $ShoutArray = explode(" ",$ShoutComment);
  491. if (is_array($ShoutArray)) {
  492. foreach($ShoutArray as $ShoutPart) {
  493. if (preg_match("#mailto:#i", $ShoutPart)) { // find mailto:
  494. $ShoutPart = str_replace("mailto:", "",$ShoutPart); // strip out mailto:
  495. $ShoutPart = str_replace("%", " ",$ShoutPart);
  496. $ShoutPart = trim($ShoutPart);
  497. // decode address to ascii
  498. $c = 0;
  499. $AddyArray = explode(" ",$ShoutPart);
  500. if (is_array($AddyArray)) {
  501. foreach($AddyArray as $AddyPart) {
  502. $AddyNew[$c] = chr(hexdec($AddyPart));
  503. $c++;
  504. }
  505. }
  506. $ShoutPart = implode("",$AddyNew);
  507. $ShoutNew[$i] = "mailto:$ShoutPart"; // add mailto: back in
  508. } else { $ShoutNew[$i] = $ShoutPart; }
  509. $i++;
  510. }
  511. }
  512. $ShoutComment = implode(" ",$ShoutNew);
  513.  
  514. // strip smilies code here (added back in later if saved)
  515. $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`";
  516. $eresult = $db->sql_query($sql);
  517. while ($emoticons = $db->sql_fetchrow($eresult)) {
  518. $ShoutComment = str_replace($emoticons['image'],$emoticons['text'],$ShoutComment);
  519. }
  520. $db->sql_freeresult($eresult);
  521.  
  522. echo "<form name=\"adminshoutedit\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n";
  523. echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"90%\" border=\"0\" align=\"center\">\n";
  524. echo "<tr><td align=\"center\"><span class=\"title\">"._EDITSHOUT."<br /><br /></span></td></tr>\n";
  525. if (($ShoutError) && ($ShoutError != 'none')) {
  526. echo "<tr><td style=\"background: #FF3333;\"><strong>"._SB_NOTE.":</strong> $ShoutError</td></tr>";
  527. }
  528. echo "<tr><td align=\"center\"><input type=\"hidden\" name=\"shoutID\" value=\"$shoutID\" /><input type=\"text\" name=\"ShoutComment\" size=\"70\" value=\"$ShoutComment\" maxlength=\"2500\" /><input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"hidden\" name=\"Submit\" value=\"ShoutSave\" />&nbsp;&nbsp;<input type=\"submit\" name=\"button\" value=\""._UPDATE."\" /></td></tr><tr><td align=\"center\"><a href=\"".$admin_file.".php?op=shout&amp;Submit=manageShouts&page=$page\">"._CANCELEDIT."</a></td></tr></table></form>\n";
  529.  
  530. CloseTable();
  531. include_once(NUKE_BASE_DIR.'footer.php');
  532. exit;
  533. }
  534.  
  535. function ShoutSave($shoutID, $ShoutComment, $page) {
  536. global $prefix, $db, $admin_file, $shout_conf;
  537. $conf = $shout_conf;
  538.  
  539. $ShoutComment = trim($ShoutComment); // remove whitespace off ends of shout
  540. $ShoutComment = preg_replace('/\s+/', ' ', $ShoutComment); // convert double spaces in middle of shout to single space
  541. $num = strlen($ShoutComment);
  542. if ($num < 1) { $ShoutError = _SHOUTTOOSHORT; }
  543. if ($num > 2500) { $ShoutError = _SHOUTTOOLONG; }
  544. if (!$ShoutComment) { $ShoutError = _NOSHOUT; }
  545. if ($ShoutComment == _SB_MESSAGE) { $ShoutError = _NOSHOUT; }
  546. $ShoutComment = str_replace(" [.] ", ".",$ShoutComment);
  547. if (preg_match("#.xxx#i", $ShoutComment) && $conf['blockxxx'] == "yes") {
  548. $ShoutError = _XXXBLOCKED;
  549. $ShoutComment = '';
  550. }
  551. if (preg_match("#javascript:(.*)#i", $ShoutComment)) {
  552. $ShoutError =_JSINSHOUT;
  553. $ShoutComment = "";
  554. }
  555.  
  556. $ShoutComment = htmlspecialchars($ShoutComment, ENT_QUOTES);
  557. $ShoutComment = str_replace("&amp;amp;", "&amp;",$ShoutComment);
  558.  
  559. // Scan for links in the shout. If there is, replace it with [URL] or block it if disallowed
  560. $i = 0;
  561. $ShoutNew = '';
  562. $ShoutArray = explode(" ",$ShoutComment);
  563. foreach($ShoutArray as $ShoutPart) {
  564. if (is_array($ShoutPart) == TRUE) { $ShoutPart = $ShoutPart[0]; }
  565. if (preg_match("#http://#i", $ShoutPart)) {
  566. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  567. // fix for users adding text to the beginning of links: HACKhttp://www.website.com
  568. $ShoutPartL = strtolower($ShoutPart);
  569. $spot = strpos($ShoutPartL,"http://");
  570. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  571. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>&#93;";
  572. } elseif (preg_match("#ftp://#i", $ShoutPart)) {
  573. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  574. $ShoutPartL = strtolower($ShoutPart);
  575. $spot = strpos($ShoutPartL,"ftp://");
  576. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  577. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">FTP</a>&#93;";
  578. } elseif (preg_match("#irc://#i", $ShoutPart)) {
  579. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  580. $ShoutPartL = strtolower($ShoutPart);
  581. $spot = strpos($ShoutPartL,"irc://");
  582. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  583. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" href=\"$ShoutPart\">IRC</a>&#93;";
  584. } elseif (preg_match("#teamspeak://#i", $ShoutPart)) {
  585. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  586. $ShoutPartL = strtolower($ShoutPart);
  587. $spot = strpos($ShoutPartL,"teamspeak://");
  588. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  589. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" href=\"$ShoutPart\">TeamSpeak</a>&#93;";
  590. } elseif (preg_match("#aim:goim#i", $ShoutPart)) {
  591. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  592. $ShoutPartL = strtolower($ShoutPart);
  593. $spot = strpos($ShoutPartL,"aim:goim");
  594. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  595. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" href=\"$ShoutPart\">AIM</a>&#93;";
  596. } elseif (preg_match("#gopher://#i", $ShoutPart)) {
  597. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  598. $ShoutPartL = strtolower($ShoutPart);
  599. $spot = strpos($ShoutPartL,"gopher://");
  600. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  601. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" href=\"$ShoutPart\">Gopher</a>&#93;";
  602. } elseif (preg_match("#mailto:#i", $ShoutPart)) {
  603. $ShoutPartL = strtolower($ShoutPart);
  604. $spot = strpos($ShoutPartL,"mailto:");
  605. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  606. // email encoding to stop harvesters
  607. $ShoutPart = bin2hex($ShoutPart);
  608. $ShoutPart = chunk_split($ShoutPart, 2, '%');
  609. $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1);
  610. $ShoutNew[$i] = "&#91;<a href=\"$ShoutPart\">E-Mail</a>&#93;";
  611. } elseif (preg_match("#www.#i", $ShoutPart)) {
  612. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  613. $ShoutPartL = strtolower($ShoutPart);
  614. $spot = strpos($ShoutPartL,"www.");
  615. if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
  616. $ShoutPart = "http://" . $ShoutPart;
  617. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>&#93;";
  618. } elseif (preg_match('#@#i', $ShoutPart) AND preg_match('/[\.]/i', $ShoutPart)) {
  619. // \b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b
  620.  
  621. // email encoding to stop harvesters
  622. $ShoutPart = bin2hex($ShoutPart);
  623. $ShoutPart = chunk_split($ShoutPart, 2, '%');
  624. $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1);
  625. $ShoutNew[$i] = "&#91;<a href=\"mailto:$ShoutPart\">E-Mail</a>&#93;";
  626. } elseif ((preg_match("/\.(us|tv|cc|ws|ca|de|jp|ro|be|fm|ms|tc|ph|dk|st|ac|gs|vg|sh|kz|as|lt|to)/i", substr("$ShoutPart", -3,3))) OR (preg_match("/\.(com|net|org|mil|gov|biz|pro|xxx)/i", substr("$ShoutPart", -4,4))) OR (preg_match("/\.(info|name|mobi)/i", substr("$ShoutPart", -5,5))) OR (preg_match("/\.(co\.uk|co\.za|co\.nz|co\.il)/i", substr("$ShoutPart", -6,6)))) {
  627. if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; }
  628. $ShoutPart = "http://" . $ShoutPart;
  629. $ShoutNew[$i] = "&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>&#93;";
  630. } elseif (strlen(html_entity_decode($ShoutPart, ENT_QUOTES)) > 21) {
  631. $ShoutNew[$i] = htmlspecialchars(wordwrap(html_entity_decode($ShoutPart, ENT_QUOTES), 21, " ", 1), ENT_QUOTES);
  632. $ShoutNew[$i] = str_replace("[ b]", " [b]",$ShoutNew[$i]);
  633. $ShoutNew[$i] = str_replace("[b ]", " [b]",$ShoutNew[$i]);
  634. $ShoutNew[$i] = str_replace("[ /b]", "[/b] ",$ShoutNew[$i]);
  635. $ShoutNew[$i] = str_replace("[/ b]", "[/b] ",$ShoutNew[$i]);
  636. $ShoutNew[$i] = str_replace("[/b ]", "[/b] ",$ShoutNew[$i]);
  637.  
  638. $ShoutNew[$i] = str_replace("[ i]", " [i]",$ShoutNew[$i]);
  639. $ShoutNew[$i] = str_replace("[i ]", " [i]",$ShoutNew[$i]);
  640. $ShoutNew[$i] = str_replace("[ /i]", "[/i] ",$ShoutNew[$i]);
  641. $ShoutNew[$i] = str_replace("[/ i]", "[/i] ",$ShoutNew[$i]);
  642. $ShoutNew[$i] = str_replace("[/i ]", "[/i] ",$ShoutNew[$i]);
  643.  
  644. $ShoutNew[$i] = str_replace("[ u]", " [u]",$ShoutNew[$i]);
  645. $ShoutNew[$i] = str_replace("[u ]", " [u]",$ShoutNew[$i]);
  646. $ShoutNew[$i] = str_replace("[ /u]", "[/u] ",$ShoutNew[$i]);
  647. $ShoutNew[$i] = str_replace("[/ u]", "[/u] ",$ShoutNew[$i]);
  648. $ShoutNew[$i] = str_replace("[/u ]", "[/u] ",$ShoutNew[$i]);
  649. } else { $ShoutNew[$i] = $ShoutPart; }
  650. $i++;
  651. }
  652. if (empty($ShoutError)) { $ShoutComment = implode(" ",$ShoutNew); }
  653.  
  654. //Smilies from database
  655. $ShoutArrayReplace = explode(" ",$ShoutComment);
  656. $ShoutArrayScan = $ShoutArrayReplace;
  657. $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`";
  658. $eresult = $db->sql_query($sql);
  659. while ($emoticons = $db->sql_fetchrow($eresult)) {
  660. $i = 0;
  661. foreach($ShoutArrayScan as $ShoutPart) {
  662. if ($ShoutPart == $emoticons['text']) { $ShoutArrayReplace[$i] = $emoticons['image']; }
  663. $i++;
  664. }
  665. }
  666. $db->sql_freeresult($eresult);
  667. $ShoutComment = implode(" ",$ShoutArrayReplace);
  668.  
  669. //look for bad words, then censor them.
  670. if($conf['censor'] == "yes") {
  671. $ShoutArrayReplace = explode(" ",$ShoutComment);
  672. $ShoutArrayScan = $ShoutArrayReplace;
  673. $sql = "SELECT * FROM `".$prefix."_shoutbox_censor`";
  674. $cresult = $db->sql_query($sql);
  675. while ($censor = $db->sql_fetchrow($cresult)) {
  676. $i = 0;
  677. if (is_array($ShoutArray)) {
  678. foreach($ShoutArrayScan as $ShoutPart) {
  679. $ShoutPart = strtolower($ShoutPart);
  680. $censor['text'] = strtolower($censor['text']);
  681. if ($ShoutPart == $censor['text']) { $ShoutArrayReplace[$i] = $censor['replacement']; }
  682. $i++;
  683. }
  684. }
  685. }
  686. $db->sql_freeresult($cresult);
  687. $ShoutComment = implode(" ",$ShoutArrayReplace);
  688.  
  689. /*
  690. // Phrase censor - Needs work before implementing
  691. $sql = "SELECT * FROM ".$prefix."_shoutbox_emoticons";
  692. $eresult = $db->sql_query($sql);
  693. while ($emoticons = $db->sql_fetchrow($eresult)) {
  694. $ShoutComment = str_replace($emoticons[1],$emoticons[2],$ShoutComment);
  695. }
  696. */
  697. }
  698.  
  699. if (!$ShoutError) {
  700. $sql = "UPDATE `".$prefix."_shoutbox_shouts` SET `comment`='$ShoutComment' WHERE `id`='$shoutID'";
  701. $db->sql_query($sql);
  702. } else {
  703. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutEdit&shoutID=$shoutID&page=$page&ShoutError=$ShoutError");
  704. exit;
  705. }
  706. header("Location: ".$admin_file.".php?op=shout&Submit=manageShouts&page=$page");
  707. exit;
  708. }
  709.  
  710. function shremove($page, $sr, $shr,$listnum) {
  711. global $prefix, $db, $admin_file;
  712. for ($x = 1; $x <= $listnum; $x++) {
  713. if ($shr[$x] == 'on') {
  714. $sql = "DELETE FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$sr[$x]'";
  715. $db->sql_query($sql);
  716. }
  717. }
  718. header("Location: ".$admin_file.".php?op=shout&Submit=manageShouts&page=$page");
  719. exit;
  720. }
  721.  
  722. function adminDropCount($aCount, $page) {
  723. global $prefix, $db, $admin_file, $admin;
  724. $sql = "UPDATE `".$prefix."_shoutbox_manage_count` SET `aCount`='$aCount' WHERE `admin`='$admin[0]'";
  725. $db->sql_query($sql);
  726. header("Location: ".$admin_file.".php?op=shout&Submit=manageShouts&page=$page");
  727. exit;
  728. }
  729.  
  730. // End 'Manage Shouts' code
  731.  
  732. // Start 'Layout' code
  733.  
  734. function ShoutBoxLayout() {
  735. global $prefix, $db, $admin_file, $sbURL, $shout_conf, $rowColor;
  736. include_once(NUKE_BASE_DIR.'header.php');
  737. LinkAdmin();
  738. $conf = $shout_conf;
  739. $ShoutMenuOptionActive = 2;
  740. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  741. ShoutBoxAdminMonitor();
  742. OpenTable();
  743. echo "<form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table align=\"center\" width=\"95%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n";
  744.  
  745. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._DISPLAYDATEANDTIMEOFSHOUT."</td><td width=\"30%\" valign=\"middle\" nowrap=\"nowrap\"><select name=\"daten\">";
  746. if ($conf['date'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  747. if ($conf['date'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  748. echo "<option value=\"yes\"$SEL1>"._YES."</option><option value=\"no\"$SEL2>"._NO."</option></select>";
  749. echo "</td></tr>\n";
  750.  
  751. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._NUMBEROFSHOUTSINBLOCK."</td><td valign=\"middle\"><input type=\"text\" name=\"numbern\" value=\"".$conf['number']."\" /></td></tr>";
  752.  
  753. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._NUMBEROFSHOUTSINHISTORY."</td><td valign=\"middle\"><input type=\"text\" name=\"shoutsperpagehistory\" value=\"".$conf['shoutsperpage']."\" /></td></tr>";
  754.  
  755. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._TABLEHEIGHT."</td><td valign=\"middle\"><input type=\"text\" name=\"heightn\" value=\"".$conf['height']."\" /></td></tr>";
  756.  
  757. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._BLOCKINPUTBOXWIDTH."</td><td valign=\"middle\"><input type=\"text\" name=\"textboxwidth\" value=\"".$conf['textWidth']."\" /></td></tr>";
  758.  
  759. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._SMILIESPERROW."</td><td valign=\"middle\"><input type=\"text\" name=\"smiliesperrow\" value=\"".$conf['smiliesPerRow']."\" /></td></tr>";
  760.  
  761. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._SHOUTSORDER."</td><td valign=\"middle\"><select name=\"reverseshouts\">";
  762. if ($conf['reversePosts'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  763. if ($conf['reversePosts'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  764. echo "<option value=\"yes\"$SEL1>"._OLDESTFIRST."</option><option value=\"no\"$SEL2>"._NEWESTFIRST."</option></select></td></tr>";
  765.  
  766. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._POINTSPERSHOUT."</td><td valign=\"middle\"><input type=\"text\" name=\"pointspershout\" value=\"".$conf['pointspershout']."\" /></td></tr>";
  767.  
  768. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._SAVEABOVESET.":</td><td valign=\"middle\"><input type=\"hidden\" name=\"Submit\" value=\"ShoutBoxLayoutSet\" /><input type=\"submit\" name=\"button\" value=\""._SAVESETS."\" /></td></tr></table></form>";
  769.  
  770. CloseTable();
  771. echo "<br />";
  772. include_once(NUKE_BASE_DIR.'footer.php');
  773. exit;
  774. }
  775.  
  776. function ShoutBoxLayoutSet($daten, $numbern, $heightn, $textboxwidth, $smiliesperrow, $reverseshouts, $pointspershout, $shoutsperpagehistory, $serverTimezone) {
  777. global $prefix, $db, $admin_file, $cache;
  778. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET date='$daten', `number`='$numbern', `height`='$heightn', `textWidth`='$textboxwidth', `smiliesPerRow`='$smiliesperrow', `reversePosts`='$reverseshouts', `pointspershout`='$pointspershout', `shoutsperpage`='$shoutsperpagehistory', `serverTimezone`='$serverTimezone' WHERE `id`=1";
  779. $db->sql_query($sql);
  780. $cache->delete('conf', 'shoutbox');
  781. $cache->resync();
  782. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxLayout");
  783. exit;
  784. }
  785.  
  786. function ShoutBoxAdminMonitor() {
  787. global $prefix, $db, $admin_file, $module_name, $cache;
  788. OpenTable();
  789. // Warnings to admins if something isn't set right.
  790. echo "<p align=\"center\" class=\"content\"><strong>"._SETUPANDSECURITY."</strong></p>";
  791. $SBhealthCount = 0;
  792.  
  793. // Level 1 checks (Marginal)
  794. $filename = "modules/$module_name/language/index.html";
  795. if (file_exists($filename) != TRUE) { $SBhealthCount = 1; }
  796. $filename = "modules/$module_name/images/down/Black.gif";
  797. if (file_exists($filename) != TRUE) { $SBhealthCount = 1; }
  798. $filename = "modules/$module_name/images/up/Black.gif";
  799. if (file_exists($filename) != TRUE) { $SBhealthCount = 1; }
  800. $filename = "modules/$module_name/images/pause/Black.gif";
  801. if (file_exists($filename) != TRUE) { $SBhealthCount = 1; }
  802. $filename = "images/blocks/shout_box/index.html";
  803. if (file_exists($filename) != TRUE) { $SBhealthCount = 1; }
  804. $filename = "images/admin/shoutbox.png";
  805. if (file_exists($filename) != TRUE) { $SBhealthCount = 1; }
  806. // Add chmod check
  807. // $_SERVER["SERVER_SOFTWARE"]
  808.  
  809. // Level 2 checks (Critical)
  810. $filename = "modules/$module_name";
  811. if (is_dir($filename) != TRUE) { $SBhealthCount = 2; }
  812. $filename = "modules/$module_name/copyright.php";
  813. if (file_exists($filename) != TRUE) { $SBhealthCount = 2; }
  814. $filename = "includes/shoutbox.js";
  815. if (file_exists($filename) != TRUE) { $SBhealthCount = 2; }
  816. $filename = "modules/$module_name/index.php";
  817. if (file_exists($filename) != TRUE) { $SBhealthCount = 2; }
  818. $filename = "modules/$module_name/language/lang-english.php";
  819. if (file_exists($filename) != TRUE) { $SBhealthCount = 2; }
  820. $filename = "blocks/block-$module_name.php";
  821. if (file_exists($filename) != TRUE) { $SBhealthCount = 2; }
  822. $filename = "modules/$module_name/images/paypal.gif";
  823. if (file_exists($filename) != TRUE) { $SBhealthCount = 2; }
  824. $sql = "SELECT * FROM ".$prefix."_shoutbox_shouts";
  825. $result = $db->sql_query($sql);
  826. if ($result == NULL) { $SBhealthCount = 2; }
  827. $sql = "SELECT * FROM ".$prefix."_shoutbox_censor";
  828. $result = $db->sql_query($sql);
  829. if ($result == NULL) { $SBhealthCount = 2; }
  830. $sql = "SELECT * FROM ".$prefix."_shoutbox_conf";
  831. $result = $db->sql_query($sql);
  832. if ($result == NULL) { $SBhealthCount = 2; }
  833. $sql = "SELECT * FROM ".$prefix."_shoutbox_emoticons";
  834. $result = $db->sql_query($sql);
  835. if ($result == NULL) { $SBhealthCount = 2; }
  836. $sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock";
  837. $result = $db->sql_query($sql);
  838. if ($result == NULL) { $SBhealthCount = 2; }
  839. $sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock";
  840. $result = $db->sql_query($sql);
  841. if ($result == NULL) { $SBhealthCount = 2; }
  842. $sql = "SELECT * FROM ".$prefix."_shoutbox_version";
  843. $result = $db->sql_query($sql);
  844. if ($result == NULL) { $SBhealthCount = 2; }
  845. $filename = "SB_SQL_installer.php";
  846. if (file_exists($filename) == TRUE) { $SBhealthCount = 2; }
  847. $filename = "shout_box_sql_install.php";
  848. if (file_exists($filename) == TRUE) { $SBhealthCount = 2; }
  849. $filename = "shout4.6to5.0.php";
  850. if (file_exists($filename) == TRUE) { $SBhealthCount = 2; }
  851. $filename = "shout4.0to4.5.php";
  852. if (file_exists($filename) == TRUE) { $SBhealthCount = 2; }
  853. $filename = "shout3.5to4.0.php";
  854. if (file_exists($filename) == TRUE) { $SBhealthCount = 2; }
  855. $filename = "shout3.01to3.5.php";
  856. if (file_exists($filename) == TRUE) { $SBhealthCount = 2; }
  857. $sqlCheck = "SELECT * FROM ".$prefix."_blocks WHERE blockfile='block-$module_name.php'";
  858. $resultCheck = $db->sql_query($sqlCheck);
  859. $numrowsCheck = $db->sql_numrows($resultCheck);
  860. if ($numrowsCheck != 1) { $SBhealthCount = 2; }
  861. $rowCheck = $db->sql_fetchrow($resultCheck);
  862. if ($rowCheck['active'] != 1) { $SBhealthCount = 2; }
  863. if (($rowCheck['view'] != 0) AND ($rowCheck['view'] != 1)) { $SBhealthCount = 2; }
  864. $sqlCheck = "SELECT * FROM ".$prefix."_modules WHERE title='$module_name'";
  865. $resultCheck = $db->sql_query($sqlCheck);
  866. $numrowsCheck = $db->sql_numrows($resultCheck);
  867. if ($numrowsCheck != 1) { $SBhealthCount = 2; }
  868. $rowCheck = $db->sql_fetchrow($resultCheck);
  869. if ($rowCheck['active'] != 1) { $SBhealthCount = 2; }
  870. if (($rowCheck['view'] != 0) AND ($rowCheck['view'] != 1)) { $SBhealthCount = 2; }
  871. echo "<p align=\"center\" class=\"content\">"._CURRENTCOND.": ";
  872. if ($SBhealthCount == 0) { echo "<strong>"._SBEXCELLENT."</strong>/"._SBMARGINAL."/"._SBCRITICAL."</p>"; }
  873. elseif ($SBhealthCount == 1) { echo _SBEXCELLENT."/<strong>"._SBMARGINAL."</strong>/"._SBCRITICAL."</p>"; }
  874. elseif ($SBhealthCount == 2) { echo _SBEXCELLENT."/"._SBMARGINAL."/<strong>"._SBCRITICAL."</strong></p>"; }
  875. if (($SBhealthCount == 1) || ($SBhealthCount == 2)) {
  876. echo "<form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><input type=\"hidden\" name=\"SBhealthCount\" value=\"$SBhealthCount\" /><input type=\"hidden\" name=\"Submit\" value=\"shoutHealth\" /><center><input type=\"submit\" name=\"button\" value=\""._ANALYZEANDVIEW."\" /></center></form>";
  877. }
  878. CloseTable();
  879. echo "<br />";
  880. }
  881.  
  882. function shoutHealth($SBhealthCount) {
  883. global $prefix, $db, $admin_file, $module_name;
  884. include_once(NUKE_BASE_DIR.'header.php');
  885. LinkAdmin();
  886. $ShoutMenuOptionActive = 2;
  887. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  888. OpenTable();
  889. // Warnings to admins if something isn't set right or files are missing.
  890. echo "<p align=\"center\" class=\"content\"><strong>"._SETUPANDSECURITY."</strong></p>";
  891. echo "<p align=\"center\" class=\"content\">"._CURRENTCOND.": ";
  892. if ($SBhealthCount == 0) { echo "<strong>"._SBEXCELLENT."</strong>/"._SBMARGINAL."/"._SBCRITICAL."</p>"; }
  893. elseif ($SBhealthCount == 1) { echo _SBEXCELLENT."/<strong>"._SBMARGINAL."</strong>/"._SBCRITICAL."</p>"; }
  894. elseif ($SBhealthCount == 2) { echo _SBEXCELLENT."/"._SBMARGINAL."/<strong>"._SBCRITICAL."</strong></p>"; }
  895.  
  896. // Level 1 checks (Marginal)
  897. $filename = "modules/$module_name/language/index.html";
  898. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing security file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This security file is used to keep individuals from browsing the backend of your website. Its a 0 byte size file, which gives them a blank screen if they try to browse the directory it is in. You can usually find this file within another directory of your installation of PHP-Nuke and just copy it into this directory.</p>"; }
  899. $filename = "modules/$module_name/images/down/Black.gif";
  900. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing image file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This image file is used in the Shout Box block in case you don't have the themed image installed in all your themes. It is a good idea to have this uploaded, even if you are only using the themed images, because you may install another theme in the future and forget to upload the themed images. You can obtain this image from the Shout Box installation zip file.</p>"; }
  901. $filename = "modules/$module_name/images/up/Black.gif";
  902. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing image file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This image file is used in the Shout Box block in case you don't have the themed image installed in all your themes. It is a good idea to have this uploaded, even if you are only using the themed images, because you may install another theme in the future and forget to upload the themed images. You can obtain this image from the Shout Box installation zip file.</p>"; }
  903. $filename = "modules/$module_name/images/pause/Black.gif";
  904. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing image file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This image file is used in the Shout Box block in case you don't have the themed image installed in all your themes. It is a good idea to have this uploaded, even if you are only using the themed images, because you may install another theme in the future and forget to upload the themed images. You can obtain this image from the Shout Box installation zip file.</p>"; }
  905. $filename = "images/blocks/shout_box/index.html";
  906. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing security file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This security file is used to keep individuals from browsing the backend of your website. Its a 0 byte size file, which gives them a blank screen if they try to browse the directory it is in. You can usually find this file within another directory of your installation of PHP-Nuke and just copy it into this directory.</p>"; }
  907. $filename = "images/admin/shoutbox.png";
  908. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing image file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This image file is used in the PHP-Nuke admin area. It is a good idea to have this uploaded, even if you are using the admin area without images, because you may change your mind later and use admin images. You can obtain this image from the Shout Box installation zip file.</p>"; }
  909.  
  910. // Level 2 checks (Critical)
  911. $filename = "modules/$module_name";
  912. if (is_dir($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical directory:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This directory contains the Shout Box module files. Without it, half of the Shout Box is unavailable for use by the people on your website. Create this directory using cpanel, FTP, or other method.</p>"; }
  913. $filename = "includes/shoutbox.js";
  914. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This file contains the Shout Box JavaScript code. It is critical to the operation of this Shout Box. You can obtain this file from the Shout Box installation zip file. Then install it into your PHP-Nuke root folder where mainfile.php is.</p>"; }
  915. $filename = "modules/$module_name/copyright.php";
  916. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This file contains the Shout Box copyright information. It is both legally required and critical to the success of this Shout Box and OurScripts.net. You can obtain this file from the Shout Box installation zip file.</p>"; }
  917. $filename = "modules/$module_name/index.php";
  918. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This file contains the Shout Box shout history. Without it, half of the Shout Box features are unavailable for use by the people on your website. You can obtain this file from the Shout Box installation zip file.</p>"; }
  919. $filename = "modules/$module_name/language/lang-english.php";
  920. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This file contains the Shout Box shout history english language definitions. Even if you are not using them at this time, in the future, you may go multi-lingual. You can obtain this file from the Shout Box installation zip file.</p>"; }
  921. $filename = "blocks/block-$module_name.php";
  922. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical file:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This file is the core of the Shout Box. Without it, the users on your site will not be able to shout. You can obtain this file from the Shout Box installation zip file.</p>"; }
  923. $filename = "modules/$module_name/images/paypal.gif";
  924. if (file_exists($filename) != TRUE) { echo "<p class=\"content\"><strong>Missing critical image:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> This image is part of the Shout Box copyright. It is both legally required and critical to the success of this Shout Box and OurScripts.net. You can obtain this file from the Shout Box installation zip file.</p>"; }
  925. $sql = "SELECT * FROM ".$prefix."_shoutbox_shouts";
  926. $result = $db->sql_query($sql);
  927. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_shouts&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  928. $sql = "SELECT * FROM ".$prefix."_shoutbox_censor";
  929. $result = $db->sql_query($sql);
  930. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_censor&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  931. $sql = "SELECT * FROM ".$prefix."_shoutbox_conf";
  932. $result = $db->sql_query($sql);
  933. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_conf&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  934. $sql = "SELECT * FROM ".$prefix."_shoutbox_emoticons";
  935. $result = $db->sql_query($sql);
  936. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_emoticons&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  937. $sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock";
  938. $result = $db->sql_query($sql);
  939. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_ipblock&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  940. $sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock";
  941. $result = $db->sql_query($sql);
  942. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_nameblock&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  943. $filename = 'SB_SQL_installer.php';
  944. $sql = "SELECT * FROM ".$prefix."_shoutbox_version";
  945. $result = $db->sql_query($sql);
  946. if ($result == NULL) { echo "<p class=\"content\"><strong>Missing critical SQL table:</strong> ".$prefix."_shoutbox_version&nbsp;&nbsp;<strong>Recommendation:</strong> Upload the Shout Box SQL installer (SB_SQL_installer.php) and run it to repair the SQL tables. You can obtain this file from the Shout Box installation zip file in the SQL directory. For security reasons, once repaired, delete the SQL installer from your server.</p>"; }
  947. if (file_exists($filename) == TRUE) { echo "<p class=\"content\"><strong>SQL installer for Shout Box exists:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> For security reasons, once you have finished installing, upgrading, or repairing the Shout Box SQL tables, delete the SQL installer from your server.</p>"; }
  948. $filename = 'shout_box_sql_install.php';
  949. if (file_exists($filename) == TRUE) { echo "<p class=\"content\"><strong>SQL installer for Shout Box exists:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> For security reasons, delete this SQL installer from your server. It is no longer used.</p>"; }
  950. $filename = 'shout4.6to5.0.php';
  951. if (file_exists($filename) == TRUE) { echo "<p class=\"content\"><strong>SQL installer for Shout Box exists:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> For security reasons, delete this SQL installer from your server. It is no longer used.</p>"; }
  952. $filename = 'shout4.0to4.5.php';
  953. if (file_exists($filename) == TRUE) { echo "<p class=\"content\"><strong>SQL installer for Shout Box exists:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> For security reasons, delete this SQL installer from your server. It is no longer used.</p>"; }
  954. $filename = 'shout3.5to4.0.php';
  955. if (file_exists($filename) == TRUE) { echo "<p class=\"content\"><strong>SQL installer for Shout Box exists:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> For security reasons, delete this SQL installer from your server. It is no longer used.</p>"; }
  956. $filename = 'shout3.01to3.5.php';
  957. if (file_exists($filename) == TRUE) { echo "<p class=\"content\"><strong>SQL installer for Shout Box exists:</strong> $filename&nbsp;&nbsp;<strong>Recommendation:</strong> For security reasons, delete this SQL installer from your server. It is no longer used.</p>"; }
  958. $sqlCheck = "SELECT * FROM ".$prefix."_blocks WHERE blockfile='block-$module_name.php'";
  959. $resultCheck = $db->sql_query($sqlCheck);
  960. $numrowsCheck = $db->sql_numrows($resultCheck);
  961. if ($numrowsCheck != 1) {
  962. echo "<p class=\"content\"><strong>Shout Box block not added:</strong> block-$module_name.php&nbsp;&nbsp;<strong>Recommendation:</strong> You have not added the Shout Box block into PHP-Nuke. Click the Blocks icon in the admin area, scroll down the 'Add a new block' area. In the filename drop down, choose block-$module_name.php. Set 'Who can view this' as 'All Visitors', and click the 'Create Block' button.</p>";
  963. }
  964. $rowCheck = $db->sql_fetchrow($resultCheck);
  965. if ($rowCheck['active'] != '1') {
  966. echo "<p class=\"content\"><strong>Shout Box block not active:</strong> block-$module_name.php&nbsp;&nbsp;<strong>Recommendation:</strong> Click the Blocks icon in the admin area, scroll down to the 'Blocks Administration' area. In the Functions column and Shout Box row, choose 'Activate'. In the following page, choose 'Yes' to activate the block.</p>";
  967. }
  968. if (($rowCheck['view'] != 0) && ($rowCheck['view'] != 1)) {
  969. echo "<p class=\"content\"><strong>Shout Box block not publicly viewable:</strong> block-$module_name.php&nbsp;&nbsp;<strong>Recommendation:</strong> Click the Blocks icon in the admin area, scroll down to the 'Blocks Administration' area. In the Functions column and Shout Box row, choose 'Edit'. In the following page, set 'Who can view this' as 'All Visitors', and click the 'Save Block' button.</p>";
  970. }
  971. $sqlCheck = "SELECT * FROM ".$prefix."_modules WHERE title='$module_name'";
  972. $resultCheck = $db->sql_query($sqlCheck);
  973. $numrowsCheck = $db->sql_numrows($resultCheck);
  974. if ($numrowsCheck != 1) {
  975. echo "<p class=\"content\"><strong>Shout Box module not added:</strong> $module_name.php&nbsp;&nbsp;<strong>Recommendation:</strong> You have not added the Shout Box module into PHP-Nuke. Upload the files into the modules directory. You can obtain the files from the Shout Box installation zip file. Once they are uploaded, Click the Modules icon in PHP-Nuke administration. In the Functions column and Shout Box row, choose 'Activate'. In the Functions column and Shout Box row, choose 'Edit'. In the following page, set 'Who can view this' as 'All Visitors', and click the 'Save Changes' button.</p>";
  976. }
  977. $rowCheck = $db->sql_fetchrow($resultCheck);
  978. if ($rowCheck['active'] != 1) {
  979. echo "<p class=\"content\"><strong>Shout Box module not active:</strong> $module_name&nbsp;&nbsp;<strong>Recommendation:</strong> Click the Modules icon in PHP-Nuke administration. In the Functions column and Shout Box row, choose 'Activate'.</p>";
  980. }
  981. if (($rowCheck['view'] != 0) AND ($rowCheck['view'] != 1)) {
  982. echo "<p class=\"content\"><strong>Shout Box module not publicly viewable:</strong> block-$module_name.php&nbsp;&nbsp;<strong>Recommendation:</strong> Click the Modules icon in PHP-Nuke administration. In the Functions column and Shout Box row, choose 'Edit'. In the following page, set 'Who can view this' as 'All Visitors', and click the 'Save Changes' button.</p>";
  983. }
  984.  
  985. CloseTable();
  986. include_once(NUKE_BASE_DIR.'footer.php');
  987. exit;
  988. }
  989.  
  990. // End 'Layout' code
  991.  
  992. // Start Themeing code
  993.  
  994. function ShoutBoxThemeing() {
  995. global $prefix, $db, $admin_file, $sbURL, $module_name, $rowColor;
  996. include_once(NUKE_BASE_DIR.'header.php');
  997. LinkAdmin();
  998. $ShoutMenuOptionActive = 3;
  999. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  1000. OpenTable();
  1001. $themelist = '';
  1002. echo "<p align=\"center\" class=\"content\"><strong>"._SB_THEMECOLORING."</strong></p>";
  1003.  
  1004. echo "<form name=\"shoutadmin10\" action=\"\" method=\"post\" style=\"margin-bottom: 0px; margin-top: 0px;\">";
  1005. echo "<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"95%\"><tr><td style=\"background-color: $rowColor[border];\"><table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">";
  1006.  
  1007. echo "<tr style=\"background-color: ".$rowColor['menuColor1'].";\"><td align=\"center\" width=\"15%\" nowrap=\"nowrap\"><strong>"._SB_THEME."</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SHOUTBOX." 1</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SHOUTBOX." 2</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SB_BORDER."</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SB_MENU."/"._SB_ROW." 1</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SB_MENU."/"._SB_ROW." 2</strong></td></tr>";
  1008.  
  1009. $totalThemes = 0;
  1010. // Start of code from PHP-Nuke 'Your Account' module.
  1011. $handle=opendir('themes');
  1012. while ($file = readdir($handle)) {
  1013. if ( (!preg_match("/[\.]/",$file) AND file_exists(NUKE_THEMES_DIR.$file."/theme.php")) ) {
  1014. $themelist .= "$file ";
  1015. }
  1016. }
  1017. closedir($handle);
  1018. $themelist = explode(" ", $themelist);
  1019. sort($themelist);
  1020. for ($i=0; $i < sizeof($themelist); $i++) {
  1021. if(!empty($themelist[$i])) {
  1022. // End of code from PHP-Nuke 'Your Account' module.
  1023. // Insert default colors to SQL when a new theme is found
  1024. $sql = "SELECT * FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$themelist[$i]'";
  1025. $result = $db->sql_query($sql);
  1026. $themeRow = $db->sql_fetchrow($result);
  1027. $db->sql_freeresult($result);
  1028. if (empty($themeRow)) {
  1029. $sql = "INSERT INTO `".$prefix."_shoutbox_themes` (themeName, blockColor1, blockColor2, border, menuColor1, menuColor2) VALUES ('$themelist[$i]','#EBEBEB','#FFFFFF','#BBBBBB','#EBEBEB','#FFFFFF')";
  1030. $db->sql_query($sql);
  1031. }
  1032. // End default colors
  1033. $sql = "SELECT * FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$themelist[$i]'";
  1034. $result = $db->sql_query($sql);
  1035. $themeRow = $db->sql_fetchrow($result);
  1036. $db->sql_freeresult($result);
  1037. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1'].";\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td align=\"center\" nowrap=\"nowrap\">$themelist[$i]<input type=\"hidden\" name=\"themeName$i\" value=\"$themelist[$i]\" /></td><td align=\"center\"><input type=\"text\" name=\"blockColor1Theme$i\" size=\"11\" value=\"".$themeRow['blockColor1']."\" maxlength=\"15\" /></td><td align=\"center\"><input type=\"text\" name=\"blockColor2Theme$i\" size=\"11\" value=\"".$themeRow['blockColor2']."\" maxlength=\"15\" /></td><td align=\"center\"><input type=\"text\" name=\"borderTheme$i\" size=\"11\" value=\"".$themeRow['border']."\" maxlength=\"15\" /></td><td align=\"center\"><input type=\"text\" name=\"menuColor1Theme$i\" size=\"11\" value=\"".$themeRow['menuColor1']."\" maxlength=\"15\" /></td><td align=\"center\"><input type=\"text\" name=\"menuColor2Theme$i\" size=\"11\" value=\"".$themeRow['menuColor2']."\" maxlength=\"15\" /></td></tr>";
  1038. $totalThemes++;
  1039. }
  1040. }
  1041.  
  1042. echo "</table></td></tr></table>";
  1043. echo "<br /><center><input type=\"hidden\" name=\"totalThemes\" value=\"$totalThemes\" /><input type=\"hidden\" name=\"Submit\" value=\"themeSubmit\" /><input type=\"submit\" name=\"button\" value=\""._SB_SAVECOLORVALUES."\" /></center></form>";
  1044. echo "<br /><center>[ <a target=\"blank\" href=\"".$sbURL."http://www.w3schools.com/css/css_colors.asp\">"._SB_HELPWITHCOLORS."</a> ] [ <a target=\"blank\" href=\"".$sbURL."http://www.nattyware.com/pixie.html\">Pixie</a> ]</center>";
  1045. CloseTable();
  1046. echo "<br />";
  1047. OpenTable();
  1048. echo "<p align=\"center\" class=\"content\"><strong>"._SB_THEMEIMAGES."</strong></p>";
  1049.  
  1050. echo "<form name=\"shoutadmin11\" action=\"\" method=\"post\" style=\"margin-bottom: 0px; margin-top: 0px;\">";
  1051. echo "<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"95%\"><tr><td style=\"background-color: ".$rowColor['border'].";\"><table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">";
  1052.  
  1053. echo "<tr style=\"background-color: ".$rowColor['menuColor1'].";\"><td align=\"center\" width=\"15%\" nowrap=\"nowrap\"><strong>"._SB_THEME."</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SB_BOXARROWS."</strong></td><td align=\"center\" nowrap=\"nowrap\" width=\"17%\"><strong>"._SB_BOXBACKGROUND."</strong></td><td>&nbsp;</td></tr>";
  1054.  
  1055. $imagesDir = dir(NUKE_MODULES_DIR.$module_name."/images/up");
  1056. $imageList = '';
  1057. while ($image=$imagesDir->read()) {
  1058. if (!empty($image) && $image != '.' && $image != '..' && $image != 'index.html' && file_exists(NUKE_MODULES_DIR.$module_name."/images/down/$image") && file_exists(NUKE_MODULES_DIR.$module_name."/images/pause/$image")) {
  1059. $imageList .= "$image ";
  1060. }
  1061. }
  1062. closedir($imagesDir->handle);
  1063. $imageList = explode(" ", $imageList);
  1064. sort($imageList);
  1065.  
  1066. $backgroundDir = dir(NUKE_MODULES_DIR.$module_name."/images/background");
  1067. $backImageList = '';
  1068. while ($backImage=$backgroundDir->read()) {
  1069. if (!empty($backImage) && $backImage != '.' && $backImage != '..' && $backImage != 'index.html') {
  1070. $backImageList .= "$backImage ";
  1071. }
  1072. }
  1073. closedir($backgroundDir->handle);
  1074. $backImageList = explode(" ", $backImageList);
  1075. sort($backImageList);
  1076. $totalThemes = 0;
  1077. for ($i=0, $maxi = sizeof($themelist); $i < $maxi; $i++) {
  1078. if(!empty($themelist[$i])) {
  1079. // End of code from PHP-Nuke 'Your Account' module.
  1080. // Insert default image colors to SQL when a new theme is found
  1081. $sql = "SELECT * FROM `".$prefix."_shoutbox_theme_images` WHERE `themeName`='$themelist[$i]'";
  1082. $result = $db->sql_query($sql);
  1083. $themeRow = $db->sql_fetchrow($result);
  1084. $db->sql_freeresult($result);
  1085. if (empty($themeRow)) {
  1086. $sql = "INSERT INTO `".$prefix."_shoutbox_theme_images` (themeName, blockArrowColor) VALUES ('$themelist[$i]','Black.gif')";
  1087. $db->sql_query($sql);
  1088. }
  1089. // End default colors
  1090. $sql = "SELECT * FROM `".$prefix."_shoutbox_theme_images` WHERE `themeName`='$themelist[$i]'";
  1091. $result = $db->sql_query($sql);
  1092. $themeRow = $db->sql_fetchrow($result);
  1093. $db->sql_freeresult($result);
  1094. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td align=\"center\" nowrap=\"nowrap\">$themelist[$i]<input type=\"hidden\" name=\"themeName$i\" value=\"$themelist[$i]\" /></td><td align=\"center\"><select name=\"blockArrowColorTheme$i\">";
  1095. for ($k=0, $maxk = sizeof($imageList); $k < $maxk; $k++) {
  1096. if (!empty($imageList[$k])) {
  1097. if ($themeRow['blockArrowColor'] == $imageList[$k]) {
  1098. echo "<option value=\"$imageList[$k]\" selected=\"selected\">$imageList[$k]</option>";
  1099. } else {
  1100. echo "<option value=\"$imageList[$k]\">$imageList[$k]</option>";
  1101. }
  1102. }
  1103. }
  1104. echo "</select></td><td align=\"center\"><select name=\"blockBackgroundImageTheme$i\">";
  1105. if (!empty($themeRow['blockBackgroundImage'])) {
  1106. echo "<option value=\"\">- unset -</option>";
  1107. } else {
  1108. echo "<option value=\"\" selected=\"selected\">- Select -</option>";
  1109. }
  1110. for ($k=0, $maxk2 = sizeof($backImageList); $k < $maxk2; $k++) {
  1111. if (!empty($backImageList[$k])) {
  1112. if ($themeRow['blockBackgroundImage'] == $backImageList[$k]) {
  1113. echo "<option value=\"$backImageList[$k]\" selected=\"selected\">$backImageList[$k]</option>";
  1114. } else {
  1115. echo "<option value=\"$backImageList[$k]\">$backImageList[$k]</option>";
  1116. }
  1117. }
  1118. }
  1119. echo "</select></td><td>&nbsp;</td></tr>";
  1120. $totalThemes++;
  1121. }
  1122. }
  1123. echo "</table></td></tr></table>";
  1124. echo "<br /><center><input type=\"hidden\" name=\"totalThemes\" value=\"$totalThemes\" /><input type=\"hidden\" name=\"Submit\" value=\"themeImageSubmit\" /><input type=\"submit\" name=\"button\" value=\""._SB_SAVEIMAGEVALUES."\" /></center></form>";
  1125. CloseTable();
  1126. include_once(NUKE_BASE_DIR.'footer.php');
  1127. exit;
  1128. }
  1129.  
  1130. function themeSubmit($themeColorValues, $totalThemes) {
  1131. global $prefix, $db, $admin_file, $cache, $ThemeSel;
  1132. for ($x = 0; $x <= $totalThemes; $x++) {
  1133. $themeCurrent = $themeColorValues["themeName"][$x];
  1134. $blockColor1 = $themeColorValues[$themeCurrent]["block1"];
  1135. $blockColor2 = $themeColorValues[$themeCurrent]["block2"];
  1136. $border = $themeColorValues[$themeCurrent]["border"];
  1137. $menuColor1 = $themeColorValues[$themeCurrent]["menu1"];
  1138. $menuColor2 = $themeColorValues[$themeCurrent]["menu2"];
  1139. $sql = "UPDATE `".$prefix."_shoutbox_themes` SET `blockColor1`='$blockColor1', `blockColor2`='$blockColor2', `border`='$border', `menuColor1`='$menuColor1', `menuColor2`='$menuColor2' WHERE `themeName`='$themeCurrent'";
  1140. $db->sql_query($sql);
  1141. $cache->delete('theme_'.$ThemeSel, 'shoutbox');
  1142. $cache->resync();
  1143. }
  1144. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxThemeing");
  1145. exit;
  1146. }
  1147.  
  1148. function themeImageSubmit($themeImageValues, $totalThemes) {
  1149. global $prefix, $db, $admin_file;
  1150. for ($x = 0; $x <= $totalThemes; $x++) {
  1151. $themeCurrent = $themeImageValues["themeName"][$x];
  1152. $blockArrowColor = $themeImageValues[$themeCurrent]["blockArrowColor"];
  1153. $blockBackgroundImage = $themeImageValues[$themeCurrent]["blockBackgroundImage"];
  1154. $sql = "UPDATE `".$prefix."_shoutbox_theme_images` SET `blockArrowColor`='$blockArrowColor', `blockBackgroundImage`='$blockBackgroundImage' WHERE `themeName`='$themeCurrent'";
  1155. $db->sql_query($sql);
  1156. }
  1157. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxThemeing");
  1158. exit;
  1159. }
  1160. // End Themeing code
  1161.  
  1162. // Start 'Permissions' code
  1163.  
  1164. function ShoutBoxPermissions() {
  1165. global $prefix, $db, $admin_file, $shout_conf, $rowColor;
  1166. include_once(NUKE_BASE_DIR.'header.php');
  1167. LinkAdmin();
  1168. $conf = $shout_conf;
  1169. $ShoutMenuOptionActive = 4;
  1170. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  1171. OpenTable();
  1172. echo "<table align=\"center\" width=\"95%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n";
  1173.  
  1174. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._ALLOWANONURLTAGS."</td><td width=\"30%\" valign=\"middle\"><form class=\"content\" name=\"allowurloption\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"urlonoffn\">";
  1175. if ($conf['urlanononoff'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1176. if ($conf['urlanononoff'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1177. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=allowanonurloption&amp;urloption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=allowanonurloption&amp;urloption=no\"$SEL2>"._NO."</option>";
  1178. echo "</select></form></td></tr>";
  1179.  
  1180. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._ALLOWREGURLTAGS."</td><td width=\"30%\" valign=\"middle\"><form class=\"content\" name=\"allowurloption\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"urlonoffn\">";
  1181. if ($conf['urlonoff'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1182. if ($conf['urlonoff'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1183. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=allowurloption&amp;urloption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=allowurloption&amp;urloption=no\"$SEL2>"._NO."</option>";
  1184. echo "</select></form></td></tr>";
  1185.  
  1186. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._SB_BLOCKXXX."</td><td width=\"30%\" valign=\"middle\"><form class=\"content\" name=\"blockxxxoption\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"blockxxx\">";
  1187. if ($conf['blockxxx'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1188. if ($conf['blockxxx'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1189. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=blockxxxoption&amp;blockxxx=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=blockxxxoption&amp;blockxxx=no\"$SEL2>"._NO."</option>";
  1190. echo "</select></form></td></tr>";
  1191.  
  1192. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._ALLOWREGDELETE."</td><td width=\"30%\" valign=\"middle\"><form name=\"allowdeloption\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"delyourlastpostn\">";
  1193. if ($conf['delyourlastpost'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1194. if ($conf['delyourlastpost'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1195. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=allowdeloption&amp;deloption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=allowdeloption&amp;deloption=no\"$SEL2>"._NO."</option>";
  1196. echo "</select></form></td></tr>";
  1197.  
  1198. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._ALLOWANONSSHOUT."</td><td width=\"30%\" valign=\"middle\"><form name=\"allowanonoption\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"anonymouspostn\">";
  1199. if ($conf['anonymouspost'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1200. if ($conf['anonymouspost'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1201. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=allowanonoption&amp;anonoption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=allowanonoption&amp;anonoption=no\"$SEL2>"._NO."</option>";
  1202. echo "</select></form></td></tr>";
  1203.  
  1204. echo "</table>";
  1205. CloseTable();
  1206. include_once(NUKE_BASE_DIR.'footer.php');
  1207. exit;
  1208. }
  1209.  
  1210. function allowurloption($urloption) {
  1211. global $prefix, $db, $admin_file, $cache;
  1212. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET `urlonoff`='$urloption' WHERE `id`=1";
  1213. $db->sql_query($sql);
  1214. $cache->delete('conf', 'shoutbox');
  1215. $cache->resync();
  1216. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxPermissions");
  1217. exit;
  1218. }
  1219.  
  1220. function blockxxxoption($blockxxx) {
  1221. global $prefix, $db, $admin_file, $cache;
  1222. $sql = "UPDATE `".$prefix."_shoutbox_conf` set `blockxxx`='$blockxxx' WHERE `id`=1";
  1223. $db->sql_query($sql);
  1224. $cache->delete('conf', 'shoutbox');
  1225. $cache->resync();
  1226. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxPermissions");
  1227. exit;
  1228. }
  1229.  
  1230. function allowanonurloption($urloption) {
  1231. global $prefix, $db, $admin_file, $cache;
  1232. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET `urlanononoff`='$urloption' WHERE `id`=1";
  1233. $db->sql_query($sql);
  1234. $cache->delete('conf', 'shoutbox');
  1235. $cache->resync();
  1236. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxPermissions");
  1237. exit;
  1238. }
  1239.  
  1240. function allowdeloption($deloption) {
  1241. global $prefix, $db, $admin_file, $cache;
  1242. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET `delyourlastpost`='$deloption' WHERE `id`=1";
  1243. $db->sql_query($sql);
  1244. $cache->delete('conf', 'shoutbox');
  1245. $cache->resync();
  1246. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxPermissions");
  1247. exit;
  1248. }
  1249.  
  1250. function allowanonoption($anonoption) {
  1251. global $prefix, $db, $admin_file, $cache;
  1252. $sql = "UPDATE `".$prefix."_shoutbox_conf` set `anonymouspost`='$anonoption' WHERE `id`=1";
  1253. $db->sql_query($sql);
  1254. $cache->delete('conf', 'shoutbox');
  1255. $cache->resync();
  1256. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxPermissions");
  1257. exit;
  1258. }
  1259.  
  1260. // End 'Permissions' code
  1261.  
  1262. // Start 'Emoticons' code
  1263.  
  1264. function manageemoticons() {
  1265. global $prefix, $db, $admin_file;
  1266. include_once(NUKE_BASE_DIR.'header.php');
  1267. LinkAdmin();
  1268. $ShoutMenuOptionActive = 5;
  1269. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  1270. //Emoticons Here
  1271. $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`";
  1272. $nameresult = $db->sql_query($sql);
  1273. $numrows = $db->sql_numrows($nameresult);
  1274. if ($numrows > 0) {
  1275. OpenTable();
  1276. echo "<form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">";
  1277. for ($shx = 1; $emoticons = $db->sql_fetchrow($nameresult); $shx++) {
  1278. $comment = str_replace('src=', 'src="', $emoticons['image']);
  1279. $comment = str_replace('.gif>', '.gif" alt="" />', $comment);
  1280. $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment);
  1281. $comment = str_replace('.png>', '.png" alt="" />', $comment);
  1282. $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment);
  1283. echo "<tr><td valign=\"middle\">"._EMOTICON.":</td><td><input type=\"text\" name=\"textn$shx\" value=\"".$emoticons['text']."\" />
  1284. <input type=\"hidden\" name=\"idn$shx\" value=\"".$emoticons['id']."\" /><input type=\"hidden\" name=\"idnn$shx\" value=\"".$emoticons['image']."\" />
  1285. - $comment -- <a href=\"".$admin_file.".php?op=shout&amp;Submit=emoticonremove&amp;emoticonremove=".$emoticons['id']."\">"._BBAREMOVE."</a></td></tr>";
  1286. }
  1287. $shx = $shx - 1;
  1288. echo "<tr><td valign=\"middle\">"._UPDATE.":</td><td><input type=\"hidden\" name=\"listnum\" value=\"$shx\" /><input type=\"hidden\" name=\"Submit\" value=\"updateemoticon\" /><input type=\"submit\" name=\"button\" value=\""._UPDATE."\" /></td></tr></table></form>";
  1289. CloseTable();
  1290. echo "<br />";
  1291. }
  1292. $db->sql_freeresult($nameresult);
  1293. OpenTable();
  1294. echo "<form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">";
  1295. echo "<tr><td valign=\"middle\">"._ADDEMOTICON."</td><td><input type=\"text\" name=\"addemoticontext\" value=\"\" /></td>
  1296. </tr><tr><td valign=\"middle\">"._IMAGESOURCE.":</td><td><select name=\"addemoticonimage\">";
  1297. $names = array();
  1298. $handle = opendir(NUKE_IMAGES_DIR."blocks/shout_box");
  1299. while ($file = readdir($handle)) { if ($file != '.' AND $file != '..' AND $file != 'index.html') { array_push($names,$file); } }
  1300. closedir($handle);
  1301. foreach($names as $name) { echo "<option value=\"$name\">$name</option>"; }
  1302. echo "</select></td></tr><tr><td valign=\"middle\">"._UPDATE.":</td><td><input type=\"hidden\" name=\"Submit\" value=\"addemoticon\" /><input type=\"submit\" name=\"button\" value=\""._ADD."\" /></td></tr></table></form>";
  1303. CloseTable();
  1304. include_once(NUKE_BASE_DIR.'footer.php');
  1305. exit;
  1306. }
  1307.  
  1308. function addemoticon($addemoticonimage, $addemoticontext) {
  1309. global $prefix, $db, $admin_file;
  1310. $addemoticonimage = "<img src=images/blocks/shout_box/$addemoticonimage>";
  1311. $sql = "INSERT INTO `".$prefix."_shoutbox_emoticons` (text, image) VALUES ('$addemoticontext','$addemoticonimage')";
  1312. $db->sql_query($sql);
  1313. header("Location: ".$admin_file.".php?op=shout&Submit=manageemoticons");
  1314. exit;
  1315. }
  1316.  
  1317. function updateemoticon($idn, $textn, $idnn, $listnum) {
  1318. global $prefix, $db, $admin_file;
  1319. for ($x = 1; $x <= $listnum; $x++) {
  1320. $sql = "UPDATE `".$prefix."_shoutbox_emoticons` SET `id`='$idn[$x]', `text`='$textn[$x]', `image`='$idnn[$x]' WHERE `id`='$idn[$x]'";
  1321. $db->sql_query($sql);
  1322. }
  1323. header("Location: ".$admin_file.".php?op=shout&Submit=manageemoticons");
  1324. exit;
  1325. }
  1326.  
  1327. function emoticonremove($emoticonremove) {
  1328. global $prefix, $db, $admin_file;
  1329. $sql = "DELETE FROM `".$prefix."_shoutbox_emoticons` WHERE `id`='$emoticonremove'";
  1330. $db->sql_query($sql);
  1331. header("Location: ".$admin_file.".php?op=shout&Submit=manageemoticons");
  1332. exit;
  1333. }
  1334.  
  1335. // End 'Emoticons' code
  1336.  
  1337. // Start 'Censor' code
  1338.  
  1339. function managecensor() {
  1340. global $prefix, $db, $admin_file, $shout_conf, $rowColor;
  1341. include_once(NUKE_BASE_DIR.'header.php');
  1342. LinkAdmin();
  1343. $conf = $shout_conf;
  1344. $ShoutMenuOptionActive = 6;
  1345. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  1346. OpenTable();
  1347. echo "<table align=\"center\" width=\"95%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n";
  1348. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._CENSORTEXTONOFF."</td><td width=\"30%\" valign=\"middle\"><form name=\"censoractive\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"censor1\">";
  1349. if ($conf['censor'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1350. if ($conf['censor'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1351. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=censoractive&amp;censoroption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=censoractive&amp;censoroption=no\"$SEL2>"._NO."</option>";
  1352. echo "</select></form></td></tr></table>";
  1353. CloseTable();
  1354. echo "<br />";
  1355. $sql = "SELECT * FROM `".$prefix."_shoutbox_censor`";
  1356. $nameresult = $db->sql_query($sql);
  1357. $numrows = $db->sql_numrows($nameresult);
  1358. if ($numrows > 0) {
  1359. //Bad Words Here
  1360. OpenTable();
  1361. echo "<form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">";
  1362. echo "<tr><td valign=\"top\">"._CENSOR."</td><td>"._EDITCENSOR."</td></tr>";
  1363. for ($shx = 1; $censor = $db->sql_fetchrow($nameresult); $shx++) {
  1364. echo "<tr><td valign=\"top\">"._REPLACEMENT.":</td><td>
  1365. <input type=\"text\" name=\"censornw$shx\" value=\"".$censor['text']."\" /> -
  1366. <input type=\"text\" name=\"censornr$shx\" value=\"".$censor['replacement']."\" />
  1367. <input type=\"hidden\" name=\"idn$shx\" value=\"$censor[id]\" />
  1368. - <a href=\"".$admin_file.".php?op=shout&amp;Submit=censorremove&amp;censorremove=".$censor['id']."\">"._BBAREMOVE."</a></td></tr>";
  1369. }
  1370. $shx = $shx - 1;
  1371. echo "<tr><td valign=\"top\">"._UPDATE.":</td><td><input type=\"hidden\" name=\"listnum\" value=\"$shx\" /><input type=\"hidden\" name=\"Submit\" value=\"updatecensor\" /><input type=\"submit\" name=\"button\" value=\""._UPDATE."\" /></td></tr></table></form>";
  1372. CloseTable();
  1373. echo "<br />";
  1374. }
  1375. $db->sql_freeresult($nameresult);
  1376. OpenTable();
  1377. echo "<form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">";
  1378. echo "<tr><td valign=\"top\">"._WORDTOCENSOR."</td><td><input type=\"text\" name=\"addcensor\" value=\"\" /></td>
  1379. </tr><tr><td valign=\"top\">"._REPLACEWITH."</td><td><input type=\"text\" name=\"addcensorr\" value=\"\" /></td>
  1380. </tr><tr><td valign=\"top\">"._UPDATE.":</td><td><input type=\"hidden\" name=\"Submit\" value=\"addcensor\" /><input type=\"submit\" name=\"button\" value=\""._ADD."\" /></td></tr></table></form>";
  1381. CloseTable();
  1382. include_once(NUKE_BASE_DIR.'footer.php');
  1383. exit;
  1384. }
  1385.  
  1386. function censoractive($censoroption) {
  1387. global $prefix, $db, $admin_file;
  1388. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET `censor`='$censoroption' WHERE `id`=1";
  1389. $db->sql_query($sql);
  1390. header("Location: ".$admin_file.".php?op=shout&Submit=managecensor");
  1391. exit;
  1392. }
  1393.  
  1394. function addcensor($addcensor, $addcensorr) {
  1395. global $prefix, $db, $admin_file, $cache;
  1396. $sql = "INSERT INTO `".$prefix."_shoutbox_censor` (text, replacement) VALUES ('$addcensor','$addcensorr')";
  1397. $db->sql_query($sql);
  1398. $cache->delete('censor', 'shoutbox');
  1399. $cache->resync();
  1400. header("Location: ".$admin_file.".php?op=shout&Submit=managecensor");
  1401. exit;
  1402. }
  1403.  
  1404. function updatecensor($censornr, $idn, $censornw, $listnum) {
  1405. global $prefix, $db, $admin_file, $cache;
  1406. for ($x = 1; $x <= $listnum; $x++) {
  1407. $sql = "UPDATE `".$prefix."_shoutbox_censor` SET `id`='$idn[$x]', `text`='$censornw[$x]', `replacement`='$censornr[$x]' WHERE `id`='$idn[$x]'";
  1408. $db->sql_query($sql);
  1409. }
  1410. $cache->delete('censor', 'shoutbox');
  1411. $cache->resync();
  1412. header("Location: ".$admin_file.".php?op=shout&Submit=managecensor");
  1413. exit;
  1414. }
  1415.  
  1416. function censorremove($censorremove) {
  1417. global $prefix, $db, $admin_file, $cache;
  1418. $sql = "DELETE FROM `".$prefix."_shoutbox_censor` WHERE `id`='$censorremove'";
  1419. $db->sql_query($sql);
  1420. $cache->delete('censor', 'shoutbox');
  1421. $cache->resync();
  1422. header("Location: ".$admin_file.".php?op=shout&Submit=managecensor");
  1423. exit;
  1424. }
  1425.  
  1426. // End 'Censor' code
  1427.  
  1428. // Start 'Bans' code
  1429.  
  1430. function ShoutBoxBans() {
  1431. global $prefix, $db, $admin_file, $shout_conf, $rowColor;
  1432. include_once(NUKE_BASE_DIR.'header.php');
  1433. LinkAdmin();
  1434. $conf = $shout_conf;
  1435.  
  1436. $ShoutMenuOptionActive = 7;
  1437. ShoutBoxAdminMenu($ShoutMenuOptionActive);
  1438. OpenTable();
  1439. echo "<table align=\"center\" width=\"95%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n";
  1440.  
  1441. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td width=\"70%\" valign=\"middle\">"._BANIPONOFF."</td><td width=\"30%\" valign=\"middle\"><form class=\"content\" name=\"ipbanactive\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"ipban1\">";
  1442. if ($conf['ipblock'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1443. if ($conf['ipblock'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1444. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=ipbanactive&amp;banoption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=ipbanactive&amp;banoption=no\"$SEL2>"._NO."</option>";
  1445. echo "</select></form></td></tr>";
  1446.  
  1447. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\" onmouseover=\"this.style.backgroundColor='".$rowColor['menuColor1']."';\" onmouseout=\"this.style.backgroundColor='".$rowColor['menuColor2']."';\"><td valign=\"middle\">"._BANNAMEONOFF."</td><td valign=\"middle\"><form name=\"namebanactive\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\"><select onchange=\"top.location.href=this.options[this.selectedIndex].value\" name=\"nameban1\">";
  1448. if ($conf['nameblock'] == 'yes') { $SEL1 = " selected=\"selected\""; } else { $SEL1 = ''; }
  1449. if ($conf['nameblock'] == 'no') { $SEL2 = " selected=\"selected\""; } else { $SEL2 = ''; }
  1450. echo "<option value=\"".$admin_file.".php?op=shout&amp;Submit=namebanactive&amp;banoption=yes\"$SEL1>"._YES."</option><option value=\"".$admin_file.".php?op=shout&amp;Submit=namebanactive&amp;banoption=no\"$SEL2>"._NO."</option>";
  1451. echo "</select></form></td></tr>";
  1452.  
  1453. echo "</table>";
  1454. CloseTable();
  1455. echo "<br />";
  1456. // BANS
  1457. OpenTable();
  1458. echo "<table align=\"center\" width=\"95%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">";
  1459.  
  1460. // banned IPs
  1461. echo "<tr style=\"background-color: ".$rowColor['menuColor1'].";\"><td width=\"70%\" valign=\"middle\">"._ADDIPTOBAN."</td>
  1462. <td width=\"30%\" valign=\"middle\" nowrap=\"nowrap\"><form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><input type=\"text\" name=\"banip\" value=\"\" />&nbsp;<input type=\"hidden\" name=\"Submit\" value=\"banip\" /><input type=\"submit\" name=\"button\" value=\""._ADD."\" /></form></td></tr>\n";
  1463.  
  1464. $sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock";
  1465. $ipresult = $db->sql_query($sql);
  1466. $numrows = $db->sql_numrows($ipresult);
  1467. if ($numrows > 0) {
  1468. echo "<tr><td colspan=\"2\"><form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\"><tr style=\"background: ".$rowColor['menuColor2'].";\"><td width=\"70%\" valign=\"middle\">"._BANNEDIP."</td><td width=\"30%\" valign=\"middle\" nowrap=\"nowrap\">"._EDITADDRESS."</td></tr>\n";
  1469. for ($shx = 1; $badips = $db->sql_fetchrow($ipresult); $shx++) {
  1470. echo "<tr style=\"background: ".$rowColor['menuColor2'].";\"><td valign=\"middle\">"._IPBANNED.":</td><td valign=\"middle\" nowrap=\"nowrap\"><input type=\"text\" name=\"ipn$shx\" value=\"$badips[name]\" />
  1471. <input type=\"hidden\" name=\"idn$shx\" value=\"$badips[0]\" />- <a href=\"".$admin_file.".php?op=shout&amp;Submit=ipremove&amp;ipremove=".$badips['id']."\">"._BBAREMOVE."</a>
  1472. </td></tr>\n";
  1473. }
  1474. $shx = $shx - 1;
  1475. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\"><td valign=\"middle\">"._UPDATE.":</td><td valign=\"middle\"><input type=\"hidden\" name=\"listnum\" value=\"$shx\" /><input type=\"hidden\" name=\"Submit\" value=\"updateip\" /><input type=\"submit\" name=\"button\" value=\""._UPDATEIP."\" /></td></tr></table></form></td></tr>\n";
  1476. }
  1477. $db->sql_freeresult($ipresult);
  1478.  
  1479. //Banned names
  1480. if ($numrows > 0) {
  1481. echo "<tr style=\"background-color: ".$rowColor['menuColor1'].";\">";
  1482. } else {
  1483. echo "<tr style=\"background-color: ".$rowColor['menuColor2'].";\">";
  1484. }
  1485. echo "<td valign=\"middle\">"._ADDNAMETOBAN."</td>
  1486. <td valign=\"middle\" nowrap=\"nowrap\"><form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><input type=\"text\" name=\"addname\" value=\"\" />&nbsp;<input type=\"hidden\" name=\"Submit\" value=\"addname\" /><input type=\"submit\" name=\"button\" value=\""._ADD."\" /></form></td></tr>\n";
  1487.  
  1488. $sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock";
  1489. $nameresult = $db->sql_query($sql);
  1490. $numrows = $db->sql_numrows($nameresult);
  1491. if ($numrows > 0) {
  1492. echo "<tr><td colspan=\"2\"><form action=\"\" method=\"post\" style=\"margin-bottom: 0px;\"><table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\"><tr style=\"background: ".$rowColor['menuColor2'].";\"><td width=\"70%\" valign=\"middle\">"._BANNEDNAMES."</td><td width=\"30%\" valign=\"middle\">"._EDITNAME."</td></tr>\n";
  1493. for ($shx = 1; $badnames = $db->sql_fetchrow($nameresult); $shx++) {
  1494. echo "<tr style=\"background: ".$rowColor['menuColor2'].";\"><td valign=\"middle\">"._NAMEBANNED.":</td><td valign=\"middle\" nowrap=\"nowrap\"><input type=\"text\" name=\"namen$shx\" value=\"$badnames[name]\" />
  1495. <input type=\"hidden\" name=\"idn$shx\" value=\"".$badnames['id']."\" />
  1496. - <a href=\"".$admin_file.".php?op=shout&amp;Submit=nameremove&amp;nameremove=".$badnames['id']."\" class=\"content\">"._BBAREMOVE."</a></td></tr>\n";
  1497. }
  1498. $shx = $shx - 1;
  1499. echo "<tr style=\"background: ".$rowColor['menuColor2'].";\"><td valign=\"middle\">"._UPDATE.":</td><td valign=\"middle\"><input type=\"hidden\" name=\"listnum\" value=\"$shx\" /><input type=\"hidden\" name=\"Submit\" value=\"updatename\" /><input type=\"submit\" name=\"button\" value=\""._UPDATENAME."\" /></td></tr></table></form></td></tr>\n";
  1500. }
  1501. $db->sql_freeresult($nameresult);
  1502. echo "</table>";
  1503.  
  1504. CloseTable();
  1505. include_once(NUKE_BASE_DIR.'footer.php');
  1506. exit;
  1507. }
  1508.  
  1509. function namebanactive($banoption) {
  1510. global $prefix, $db, $admin_file, $cache;
  1511. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET `nameblock`='$banoption' WHERE id=1";
  1512. $db->sql_query($sql);
  1513. $cache->delete('conf', 'shoutbox');
  1514. $cache->resync();
  1515. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1516. exit;
  1517. }
  1518.  
  1519. function ipbanactive($banoption) {
  1520. global $prefix, $db, $admin_file, $cache;
  1521. $sql = "UPDATE `".$prefix."_shoutbox_conf` SET `ipblock`='$banoption' WHERE id=1";
  1522. $db->sql_query($sql);
  1523. $cache->delete('conf', 'shoutbox');
  1524. $cache->resync();
  1525. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1526. exit;
  1527. }
  1528.  
  1529. function addname($addname) {
  1530. global $prefix, $db, $admin_file, $cache;
  1531. $sql = "INSERT INTO `".$prefix."_shoutbox_nameblock` (name) VALUES ('$addname')";
  1532. $db->sql_query($sql);
  1533. $cache->delete('nameblock', 'shoutbox');
  1534. $cache->resync();
  1535. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1536. exit;
  1537. }
  1538.  
  1539. function updatename($idn, $namen, $listnum) {
  1540. global $prefix, $db, $admin_file, $cache;
  1541. for ($x = 1; $x <= $listnum; $x++) {
  1542. $sql = "UPDATE `".$prefix."_shoutbox_nameblock` SET `id`='$idn[$x]', `name`='$namen[$x]' WHERE `id`='$idn[$x]'";
  1543. $db->sql_query($sql);
  1544. }
  1545. $cache->delete('nameblock', 'shoutbox');
  1546. $cache->resync();
  1547. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1548. exit;
  1549. }
  1550.  
  1551. function nameremove($nameremove) {
  1552. global $prefix, $db, $admin_file, $cache;
  1553. $sql = "DELETE FROM `".$prefix."_shoutbox_nameblock` WHERE `id`='$nameremove'";
  1554. $db->sql_query($sql);
  1555. $cache->delete('nameblock', 'shoutbox');
  1556. $cache->resync();
  1557. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1558. exit;
  1559. }
  1560.  
  1561. function banip($banip) { // From Bans tab
  1562. global $prefix, $db, $admin_file;
  1563. $sql = "INSERT INTO `".$prefix."_shoutbox_ipblock` (name) VALUES ('$banip')";
  1564. $db->sql_query($sql);
  1565. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1566. exit;
  1567. }
  1568.  
  1569. function addip($addip, $page) { // From Manage shouts tab
  1570. global $prefix, $db, $admin_file;
  1571. $sql = "INSERT INTO `".$prefix."_shoutbox_ipblock` (name) VALUES ('$addip')";
  1572. $db->sql_query($sql);
  1573. header("Location: ".$admin_file.".php?op=shout&Submit=manageShouts&page=$page");
  1574. exit;
  1575. }
  1576.  
  1577. function updateip($ipn, $idn, $listnum) {
  1578. global $prefix, $db, $admin_file;
  1579. for ($x = 1; $x <= $listnum; $x++) {
  1580. $sql = "UPDATE `".$prefix."_shoutbox_ipblock` set `id`='$idn[$x]', `name`='$ipn[$x]' WHERE `id`='$idn[$x]'";
  1581. $db->sql_query($sql);
  1582. }
  1583. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1584. exit;
  1585. }
  1586.  
  1587. function ipremove($ipremove) {
  1588. global $prefix, $db, $admin_file;
  1589. $sql = "DELETE FROM `".$prefix."_shoutbox_ipblock` WHERE `id`='$ipremove'";
  1590. $db->sql_query($sql);
  1591. header("Location: ".$admin_file.".php?op=shout&Submit=ShoutBoxBans");
  1592. exit;
  1593. }
  1594.  
  1595. // End 'Bans' code
  1596.  
  1597. $page = (isset($_REQUEST['page'])) ? $_REQUEST['page'] : '';
  1598. $aCount = (isset($_REQUEST['aCount'])) ? $_REQUEST['aCount'] : '';
  1599. $Submit = (isset($_REQUEST['Submit'])) ? $_REQUEST['Submit'] : '';
  1600. $SBhealthCount = (isset($_REQUEST['SBhealthCount'])) ? $_REQUEST['SBhealthCount'] : '';
  1601. $addemoticonimage = (isset($_REQUEST['addemoticonimage'])) ? $_REQUEST['addemoticonimage'] : '';
  1602. $addemoticontext = (isset($_REQUEST['addemoticontext'])) ? $_REQUEST['addemoticontext'] : '';
  1603. $addemoticontext = (isset($_REQUEST['addemoticontext'])) ? $_REQUEST['addemoticontext'] : '';
  1604. $listnum = (isset($_REQUEST['listnum'])) ? (int)$_REQUEST['listnum'] : 0;
  1605. $emoticonremove = (isset($_REQUEST['emoticonremove'])) ? $_REQUEST['emoticonremove'] : '';
  1606. $addcensor = (isset($_REQUEST['addcensor'])) ? $_REQUEST['addcensor'] : '';
  1607. $addcensorr = (isset($_REQUEST['addcensorr'])) ? $_REQUEST['addcensorr'] : '';
  1608. $censorremove = (isset($_REQUEST['censorremove'])) ? $_REQUEST['censorremove'] : '';
  1609. $banoption = (isset($_REQUEST['banoption'])) ? $_REQUEST['banoption'] : '';
  1610. $censoroption = (isset($_REQUEST['censoroption'])) ? $_REQUEST['censoroption'] : '';
  1611.  
  1612. switch($Submit) {
  1613.  
  1614. case "adminDropCount":
  1615. adminDropCount($aCount, $page);
  1616. break;
  1617.  
  1618. case "ShoutBoxLayout":
  1619. ShoutBoxLayout();
  1620. break;
  1621.  
  1622. case "ShoutBoxThemeing":
  1623. ShoutBoxThemeing();
  1624. break;
  1625.  
  1626. case "ShoutBoxPermissions":
  1627. ShoutBoxPermissions();
  1628. break;
  1629.  
  1630. case "manageemoticons":
  1631. manageemoticons();
  1632. break;
  1633.  
  1634. case "shoutHealth":
  1635. shoutHealth($SBhealthCount);
  1636. break;
  1637.  
  1638. case "addemoticon":
  1639. addemoticon($addemoticonimage, $addemoticontext);
  1640. break;
  1641.  
  1642. case "updateemoticon":
  1643. for ($x = 1; $x <= $listnum; $x++) {
  1644. $idn[$x] = ${"idn$x"};
  1645. $textn[$x] = ${"textn$x"};
  1646. $idnn[$x] = ${"idnn$x"};
  1647. }
  1648. updateemoticon($idn, $textn, $idnn, $listnum);
  1649. break;
  1650.  
  1651. case "emoticonremove":
  1652. emoticonremove($emoticonremove);
  1653. break;
  1654.  
  1655. case "managecensor":
  1656. managecensor();
  1657. break;
  1658.  
  1659. case "addcensor":
  1660. addcensor($addcensor, $addcensorr);
  1661. break;
  1662.  
  1663. case "updatecensor":
  1664. for ($x = 1; $x <= $listnum; $x++) {
  1665. $censornr[$x] = ${"censornr$x"};
  1666. $idn[$x] = ${"idn$x"};
  1667. $censornw[$x] = ${"censornw$x"};
  1668. }
  1669. updatecensor($censornr, $idn, $censornw, $listnum);
  1670. break;
  1671.  
  1672. case "censorremove":
  1673. censorremove($censorremove);
  1674. break;
  1675.  
  1676. case "ShoutBoxBans":
  1677. ShoutBoxBans();
  1678. break;
  1679.  
  1680. case "namebanactive":
  1681. namebanactive($banoption);
  1682. break;
  1683.  
  1684. case "ipbanactive":
  1685. ipbanactive($banoption);
  1686. break;
  1687.  
  1688. case "censoractive":
  1689. censoractive($censoroption);
  1690. break;
  1691.  
  1692. case "allowanonurloption":
  1693. allowanonurloption($urloption);
  1694. break;
  1695.  
  1696. case "allowurloption":
  1697. allowurloption($urloption);
  1698. break;
  1699.  
  1700. case "blockxxxoption":
  1701. blockxxxoption($blockxxx);
  1702. break;
  1703.  
  1704. case "allowdeloption":
  1705. allowdeloption($deloption);
  1706. break;
  1707.  
  1708. case "allowanonoption":
  1709. allowanonoption($anonoption);
  1710. break;
  1711.  
  1712. case "addname":
  1713. addname($addname);
  1714. break;
  1715.  
  1716. case "ShoutBoxLayoutSet":
  1717. ShoutBoxLayoutSet($daten, $numbern, $heightn, $textboxwidth, $smiliesperrow, $reverseshouts, $pointspershout, $shoutsperpagehistory, $serverTimezone);
  1718. break;
  1719.  
  1720. case "themeSubmit":
  1721. for ($x = 0; $x <= $totalThemes; $x++) {
  1722. $themeColorValues["themeName"][$x] = ${"themeName$x"};
  1723. $themeColorValues["${"themeName$x"}"]["block1"] = ${"blockColor1Theme$x"};
  1724. $themeColorValues["${"themeName$x"}"]["block2"] = ${"blockColor2Theme$x"};
  1725. $themeColorValues["${"themeName$x"}"]["border"] = ${"borderTheme$x"};
  1726. $themeColorValues["${"themeName$x"}"]["menu1"] = ${"menuColor1Theme$x"};
  1727. $themeColorValues["${"themeName$x"}"]["menu2"] = ${"menuColor2Theme$x"};
  1728. }
  1729. themeSubmit($themeColorValues, $totalThemes);
  1730. break;
  1731.  
  1732. case "themeImageSubmit":
  1733. for ($x = 0; $x <= $totalThemes; $x++) {
  1734. $themeImageValues["themeName"][$x] = ${"themeName$x"};
  1735. $themeImageValues["${"themeName$x"}"]["blockArrowColor"] = ${"blockArrowColorTheme$x"};
  1736. $themeImageValues["${"themeName$x"}"]["blockBackgroundImage"] = ${"blockBackgroundImageTheme$x"};
  1737. }
  1738. themeImageSubmit($themeImageValues, $totalThemes);
  1739. break;
  1740.  
  1741. case "updatename":
  1742. for ($x = 1; $x <= $listnum; $x++) {
  1743. $idn[$x] = ${"idn$x"};
  1744. $namen[$x] = ${"namen$x"};
  1745. }
  1746. updatename($idn, $namen, $listnum);
  1747. break;
  1748.  
  1749. case "nameremove":
  1750. nameremove($nameremove);
  1751. break;
  1752.  
  1753. case "banip":
  1754. banip($banip);
  1755. break;
  1756.  
  1757. case "ban":
  1758. $sql = "SELECT ip FROM ".$prefix."_shoutbox_shouts WHERE id='$bid'";
  1759. $idresult = $db->sql_query($sql);
  1760. $banip = $db->sql_fetchrow($idresult);
  1761. $addip = $banip['ip'];
  1762. addip($addip, $page);
  1763. break;
  1764.  
  1765. case "updateip":
  1766. for ($x = 1; $x <= $listnum; $x++) {
  1767. $idn[$x] = ${"idn$x"};
  1768. $ipn[$x] = ${"ipn$x"};
  1769. }
  1770. updateip($ipn, $idn, $listnum);
  1771. break;
  1772.  
  1773. case "ipremove":
  1774. ipremove($ipremove);
  1775. break;
  1776.  
  1777. case "shremove":
  1778. for ($x = 1; $x <= $listnum; $x++) {
  1779. $shr[$x] = ${"shr$x"};
  1780. $sr[$x] = ${"sr$x"};
  1781. }
  1782. shremove($page, $sr, $shr, $listnum);
  1783. break;
  1784.  
  1785. case "ShoutEdit":
  1786. if (empty($ShoutError)) { $ShoutError = 'none'; }
  1787. ShoutEdit($shoutID, $page, $ShoutError);
  1788. break;
  1789.  
  1790. case "ShoutSave":
  1791. ShoutSave($shoutID, $ShoutComment, $page);
  1792. break;
  1793.  
  1794. case "manageShouts":
  1795. if (empty($page)) { $page = "1"; }
  1796. if (empty($pruned)) { $pruned = "0"; }
  1797. manageShouts($page, $pruned);
  1798. break;
  1799.  
  1800. case "stickySubmit":
  1801. stickySubmit($stickyShout, $stickyUsername, $stickySlot, $page);
  1802. break;
  1803.  
  1804. case "pruneSubmit":
  1805. pruneSubmit($pruneDays, $page);
  1806. break;
  1807.  
  1808. default:
  1809. if (empty($page)) { $page = "1"; }
  1810. if (empty($pruned)) { $pruned = "0"; }
  1811. manageShouts($page, $pruned);
  1812. break;
  1813. }
  1814.  
  1815. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement