home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phpnuke / PHP-Nuke-7.5.exe / html / modules / Journal / comment.php < prev    next >
PHP Script  |  2004-01-29  |  4KB  |  87 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* Journal § ZX                                                     */
  5. /* ================                                                     */
  6. /*                                                                      */
  7. /* Original work done by Joseph Howard known as Member's Journal, which */
  8. /* was based on Trevor Scott's vision of Atomic Journal.                */
  9. /*                                                                      */
  10. /* Modified on 25 May 2002 by Paul Laudanski (paul@computercops.biz)    */
  11. /* Copyright (c) 2002 Modifications by Computer Cops.                   */
  12. /* http://computercops.biz                                              */
  13. /*                                                                      */
  14. /* Required: PHPNuke 5.5 ( http://www.phpnuke.org/ ) and phpbb2         */
  15. /* ( http://bbtonuke.sourceforge.net/ ) forums port.                    */
  16. /*                                                                      */
  17. /* Member's Journal did not work on a PHPNuke 5.5 portal which had      */
  18. /* phpbb2 port integrated.  Thus was Journal § ZX created with the  */
  19. /* Member's Journal author's blessings.                                 */
  20. /*                                                                      */
  21. /* To install, backup everything first and then FTP the Journal package */
  22. /* files into your site's module directory.  Also run the tables.sql    */
  23. /* script so the proper tables and fields can be created and used.  The */
  24. /* default table prefix is "nuke" which is hard-coded throughout the    */
  25. /* entire system as a left-over from Member's Journal.  If a demand     */
  26. /* exists, that can be changed for a future release.                    */
  27. /*                                                                      */
  28. /* This program is free software. You can redistribute it and/or modify */
  29. /* it under the terms of the GNU General Public License as published by */
  30. /* the Free Software Foundation; either version 2 of the License.       */
  31. /************************************************************************/
  32.  
  33. if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
  34.     die ("You can't access this file directly...");
  35. }
  36.  
  37. require_once("mainfile.php");
  38. $module_name = basename(dirname(__FILE__));
  39. get_lang($module_name);
  40.  
  41. $pagetitle = "- "._USERSJOURNAL."";
  42. include("header.php");
  43. include("modules/$module_name/functions.php");
  44.  
  45. cookiedecode($user);
  46. $username = $cookie[1];
  47. $htime = date(h);
  48. $mtime = date(i);
  49. $ntime = date(a);
  50. $mtime = "$htime:$mtime $ntime";
  51. $mdate = date(m);
  52. $ddate = date(d);
  53. $ydate = date(Y);
  54. $ndate = "$mdate-$ddate-$ydate";
  55.  
  56. if ($debug == "true") :
  57.     echo ("UserName:$username<br>SiteName: $sitename");
  58. endif;
  59.  
  60. startjournal($sitename,$user);
  61.  
  62. function dropcomment($username,$onwhat,$mtime,$ndate) {
  63.     global $module_name;
  64.     echo "<br>";
  65.     OpenTable();
  66.     echo ("<div align=center class=title>"._LEAVECOMMENT."</div><br><br>");
  67.     echo ("<form action='modules.php?name=$module_name&file=commentsave' method='post'><input type='hidden' name='rid' value='$onwhat'>");
  68.     echo ("<div align=center>"._COMMENTBOX.":<br><textarea name=\"comment\" wrap=virtual cols=55 rows=10></textarea><br><br><input type='submit' name='submit' value='"._POSTCOMMENT."'></div>");
  69.     echo ("</form><br>");
  70.     echo ("<center>"._COMMENTSNOTE."</center>");
  71.     CloseTable();
  72. }
  73.  
  74. if (!is_user($user)) :
  75.     echo ("<br>");
  76.     openTable();
  77.     echo ("<div align=center>"._YOUMUSTBEMEMBER."<br></div>");
  78.     closeTable();
  79.     journalfoot();
  80.     die();
  81. else:
  82.     dropcomment($username,$onwhat,$mtime,$ndate);
  83. endif;
  84.  
  85. journalfoot();
  86.  
  87. ?>