G-Shout PHP


SUBMITTED BY: Guest

DATE: July 22, 2014, 10:17 p.m.

FORMAT: Text only

SIZE: 9.4 kB

HITS: 708

  1. <?php
  2. /************************************************************************/
  3. /* G-Shout : Gravitasi Shoutbox */
  4. /* ============================================ */
  5. /* */
  6. /* Copyright (c) 2005 by Yohanes Pradono */
  7. /* http://gravitasi.com */
  8. /* */
  9. /* This program is free software. You can redistribute it and/or modify */
  10. /* it under the terms of the GNU General Public License as published by */
  11. /* the Free Software Foundation; either version 2 of the License. */
  12. /* */
  13. /************************************************************************/
  14. header("Expires: Sun, 10 Jan 1982 05:00:00 GMT"); // donie's birthday
  15. header("Last-Modified: ".gmdate("D, d M Y H:i:s"). " GMT"); // always modified
  16. if($SERVER_PROTOCOL == "HTTP/1.0"){
  17. header("Pragma: no-cache"); // HTTP/1.0
  18. }else{
  19. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  20. }
  21. include("config.php");
  22. include("./includes/functions.inc.php");
  23. include ("./languages/lang-".$language.".php");
  24. /* this is useful if the form becomes one with shoutbox.
  25. if($usecookie && $formsubmitted) {
  26. SetCookie ("gnamec", $gname, time()+2592000);
  27. SetCookie ("guric", $guri, time()+2592000);
  28. SetCookie ("gsexc", $gsex, time()+2592000);
  29. $gnamec = $gname;
  30. $guric = $guri;
  31. $gsexc = $gsex;
  32. } else if (!$usecookie && $formsubmitted) {
  33. SetCookie ("gnamec", $gname, time()-2592000);
  34. SetCookie ("guric", $guri, time()-2592000);
  35. SetCookie ("gsexc", $gsex, time()-2592000);
  36. SetCookie ("gname", $gname, time());
  37. SetCookie ("guri", $guri, time());
  38. SetCookie ("gsex", $gsex, time());
  39. }
  40. */
  41. // antiflood system, started from version 1.1
  42. if($formsubmitted && !isset($blockflooder) && getTimestampByIP($_SERVER["REMOTE_ADDR"]) >= time()-ceil($floodwait*60)) {
  43. $blockflood = TRUE;
  44. } else {
  45. $blockflood = FALSE;
  46. }
  47. // DELETION IS SUCCESS OR NOT
  48. if ($action == "deleteshout"){
  49. if ($_SERVER["REMOTE_ADDR"] == getIP($id)) {
  50. deleteShout($id);
  51. $message = _PROCESS_DELETED;
  52. } else {
  53. $error = _PROCESS_DELETEFAILED;
  54. }
  55. }
  56. ?>
  57. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  58. <html>
  59. <head>
  60. <title>G-Shout</title>
  61. <meta http-equiv="Content-Type" content="text/html; charset=<?=_CHARSET?>" />
  62. <?
  63. // to check the HTTP version
  64. if($SERVER_PROTOCOL == "HTTP/1.0"){
  65. echo("<meta http-equiv=\"pragma\" content=\"no-cache\" />\n");
  66. }else{
  67. echo("<meta http-equiv=\"Cache-Control\" content=\"no-cache, must-revalidate\" />\n");
  68. }
  69. ?>
  70. <meta name="Generator" content="G-Shout <?=$version?>" />
  71. <?
  72. // if you want your shoutbox depends on skins when you update skins from admin cpanel, uncomment this out
  73. /*
  74. <link rel="stylesheet" type="text/css" href="<?echo "skins/".$skin.".css";$hr = "no";?>"/>
  75. */
  76. ?>
  77. <style type="text/css">
  78. <!--
  79. .textfield, input, textarea {
  80. font-family: verdana, arial, helvetica, sans-serif;
  81. font-size: 9px;
  82. color: #333333;
  83. background-color: #ffffff;
  84. border: #333333;
  85. border-style: solid;
  86. border-top-width: 1px;
  87. border-right-width: 1px;
  88. border-bottom-width: 1px;
  89. border-left-width: 1px;
  90. width: 130;
  91. }
  92. html, body, p, td {
  93. scrollbar-face-color: #ffffff;
  94. scrollbar-shadow-color: #ffffff;
  95. scrollbar-highlight-color: #ffffff;
  96. scrollbar-3dlight-color: #ffffff;
  97. scrollbar-darkshadow-color: #838b8b;
  98. scrollbar-track-color: #ededed;
  99. scrollbar-arrow-color: #4169aa;
  100. font-family: verdana, arial, helvetica, sans-serif;
  101. font-size: 9px;
  102. color: #333333;
  103. background: #fff;
  104. }
  105. a {
  106. text-decoration: none;
  107. color: #FF8800;
  108. }
  109. a:link {
  110. color: #f30;
  111. text-decoration: none;
  112. }
  113. a:vlink {
  114. color: #f30;
  115. }
  116. a:alink {
  117. color: #f30;
  118. }
  119. a:visited {
  120. color: #f30;
  121. }
  122. a:hover {
  123. color: #fff;
  124. background-color:#f30;
  125. }
  126. hr {
  127. color: #999999;
  128. width: 100%;
  129. height: 1px;
  130. }
  131. #yahoo a, #yahoo a:link, #yahoo a:active, #yahoo a:visited, #yahoo a:hover {
  132. color: #ff0000;
  133. font-family: "Courier New", Courier, mono;
  134. font-weight: bold;
  135. font-size: small;
  136. background: none;
  137. }
  138. div.smileys a.icon, div.smileys a:link.icon, div.smileys a:active.icon, div.smileys a:visited.icon, div.smileys a:hover.icon {
  139. background: none;
  140. }
  141. .success {
  142. background: #f0f8ff;
  143. border: 1px solid #69c;
  144. padding: 0.2em 1em 0.2em 1em;
  145. }
  146. .alert {
  147. background: #fff0f8;
  148. border: 1px solid #cc666f;
  149. padding: 0.2em 1em 0.2em 1em;
  150. }
  151. a.delete:link, a.delete:visited {
  152. background: none;
  153. color: red;
  154. font-weight: bold;
  155. }
  156. a.delete:hover {
  157. background: #c00;
  158. color: #fff;
  159. font-weight: bold;
  160. }
  161. a.edit, a.delete, a.edit:hover, a.delete:hover {
  162. border-bottom: none;
  163. display: block;
  164. padding: 5px 0;
  165. text-align: center;
  166. width: 100%;
  167. }
  168. label {
  169. cursor: pointer;
  170. }
  171. -->
  172. </style>
  173. <script type="text/javascript">
  174. <!--
  175. function add_smiley(smiley)
  176. {
  177. // if help page opened in new window, use this
  178. opener.document.newguest.gcomment.value += " " + smiley + " ";
  179. opener.window.document.newguest.gcomment.focus();
  180. window.close();
  181. // if help page opened inside the IFRAME, use this
  182. //parent.document.newguest.gcomment.value += " " + smiley + " ";
  183. //parent.window.document.newguest.gcomment.focus();
  184. }
  185. //-->
  186. </script>
  187. </head>
  188. <body>
  189. <?
  190. // just checking if there is a datafile or not
  191. if (is_writable($datafile) AND filesize($datafile) <= 35) {
  192. if($file = fopen($datafile, "w+")) {
  193. fwrite($file, "".$id."#%Hi :D. You can delete this shout from Control Panel. Check G-Shout Website for update. Thanx for using G-Shout.#%");
  194. fwrite($file, "donie#%m#%http://gravitasi.com#%".time()."#%#%#%#%\n");
  195. fclose($file);
  196. }
  197. } else if (!is_writable($datafile)) {
  198. $error = _DATA_UNWRITABLE;
  199. } else {}
  200. if($formsubmitted && $blockflood && ($floodwait > 0)) {
  201. $error = _PLEASE_WAIT;
  202. } else if($formsubmitted) {
  203. $gname = strip_tags($gname);
  204. // if ok, then write the shout to datafile
  205. writeTag($gname, $gsex, $guri, $gcomment);
  206. } else {}
  207. // to show success/error message
  208. if(isset($message)){
  209. echo "<div class='success'>";
  210. echo $message;
  211. echo "</div><br /><br />";
  212. } else if(isset($error)) {
  213. echo "<div class='alert'>".$error."</div><br /><br />";
  214. } else {}
  215. // this function used to show ShoutBox
  216. viewShoutBox();
  217. include ("./languages/lang-$language.php");
  218. if($help == TRUE){
  219. //echo("<a href=\"javascript:history.go(-1)\">BACK</a><br /><br />\n\n");
  220. echo("<a href=\"javascript:window.close()\">"._CLOSE_WINDOW."</a><br /><br />\n\n");
  221. echo ("<div class=\"smileys\">");
  222. showHelp();
  223. echo ("</div>");
  224. //echo("<a href=\"javascript:history.go(-1)\">BACK</a><br /><br />\n\n");
  225. echo("<a href=\"javascript:window.close()\">"._CLOSE_WINDOW."</a><br /><br />\n\n");
  226. } else {
  227. /*******************
  228. BEGIN OF PAGINATION
  229. *******************/
  230. echo "<div align=\"center\">";
  231. $shoutcount = countShouts();
  232. if (!isset($page)||$page==0) {
  233. //$page=floor($shoutcount/20)+1;
  234. $page=1;
  235. }
  236. $entry = ($commentshown * $page)-$commentshown;
  237. $selesai = $commentshown*$page;
  238. $output = getShouts($start,20,1);
  239. if ($page != 1) {
  240. echo "<a href='".$PHP_SELF."?page=1'>[ << ]</a> <a href='".$PHP_SELF."?page=".($page-1)."&commentshown=".$commentshown."'>[ < ]</a> ";
  241. } else {
  242. echo "<font color='#666666'>[ << ] [ < ]</font> ";
  243. }
  244. for ($count=0;$count<$shoutcount;$count=$count+$commentshown) {
  245. $newpage = floor($count/$commentshown) + 1;
  246. if ($page == $newpage) {
  247. echo $newpage." ";
  248. } else {
  249. echo "<a href='".$PHP_SELF."?page=".$newpage."&commentshown=".$commentshown."'>".$newpage."</a> ";
  250. }
  251. }
  252. if ($page != floor($shoutcount/$commentshown)+1) {
  253. echo "<a href='".$PHP_SELF."?page=".($page+1)."&commentshown=".$commentshown."'>[ > ]</a> <a href='".$PHP_SELF."?page=".(floor($shoutcount/$commentshown)+1)."&commentshown=".$commentshown."'>[ >> ]</a>";
  254. } else {
  255. echo "<font color='#666666'>[ > ] [ >> ]</font>";
  256. }
  257. echo "</div>";
  258. // end of pagination
  259. }
  260. ?>
  261. <br />
  262. </body>
  263. </html>

comments powered by Disqus