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 / friend.php < prev    next >
PHP Script  |  2004-01-31  |  4KB  |  97 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14. /* Additional security checking code 2003 by chatserv                   */
  15. /* http://www.nukefixes.com -- http://www.nukeresources.com             */
  16. /************************************************************************/
  17.  
  18. if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
  19.     die ("You can't access this file directly...");
  20. }
  21.  
  22. require_once("mainfile.php");
  23. $module_name = basename(dirname(__FILE__));
  24. get_lang($module_name);
  25.  
  26. $pagetitle = "- "._USERSJOURNAL."";
  27. include("header.php");
  28. include("modules/$module_name/functions.php");
  29.  
  30. cookiedecode($user);
  31. $username = $cookie[1];
  32.  
  33. if ($debug == "true") :
  34.     echo ("UserName:$username<br>SiteName: $sitename");
  35. endif;
  36.  
  37. startjournal($sitename,$user);
  38. $jid = intval($jid);
  39. $sql = "select title from ".$prefix."_journal where jid='$jid'";
  40. $result = $db->sql_query($sql);
  41. $row = $db->sql_fetchrow($result);
  42. $jtitle = $row[title];
  43.  
  44. if ($send == 1) {
  45.     $fname= removecrlf($fname);
  46.     $fmail= removecrlf($fmail);
  47.     $yname= removecrlf($yname);
  48.     $ymail= removecrlf($ymail);
  49.     $subject = ""._INTERESTING." $sitename";
  50.     $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._CONSIDERED."\n\n\n$jtitle\n"._URL.": $nukeurl/modules.php?name=$module_name&file=display&jid=$jid\n\n\n"._AREMORE."\n\n---\n$sitename\n$nukeurl";
  51.     mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: PHP/" . phpversion());
  52.     $title = urlencode($title);
  53.     $fname = urlencode($fname);
  54.     $sent = 1;
  55. }
  56.  
  57. if ($sent == 1) {
  58.     echo "<br>";
  59.     title(""._SENDJFRIEND."");
  60.     OpenTable();
  61.     echo "<center>"._FSENT."<br><br>[ <a href=\"modules.php?name=$module_name&file=display&jid=$jid\">"._RETURNJOURNAL2."</a> ]</center>";
  62.     CloseTable();
  63.     journalfoot();
  64.     die();
  65. }
  66.  
  67. echo "<br>";
  68. title(""._SENDJFRIEND."");
  69. OpenTable();
  70. echo "<table align=center border=0><tr><td>"
  71.     ."<center><b>$jtitle</b><br>"._YOUSENDJOURNAL."</center><br><br>"
  72.     ."<form action=\"modules.php?name=$module_name&file=friend\" method=\"post\">"
  73.     ."<input type=\"hidden\" name=\"send\" value=\"1\">"
  74.     ."<input type=\"hidden\" name=\"jid\" value=\"$jid\">";
  75. if (is_user($user)) {
  76.     $sql = "select name, username, user_email from ".$user_prefix."_users where username='$cookie[1]'";
  77.     $result = $db->sql_query($sql);
  78.     $row = $db->sql_fetchrow($result);
  79.     $yn = $row[name];
  80.     $yun = $row[username];
  81.     $ye = $row[user_email];
  82. }
  83. if ($yn == "") {
  84.     $yn = $yun;
  85. }
  86. echo "<b>"._FYOURNAME." </b> <input type=\"text\" name=\"yname\" value=\"$yn\"><br><br>\n"
  87.     ."<b>"._FYOUREMAIL." </b> <input type=\"text\" name=\"ymail\" value=\"$ye\"><br><br><br>\n"
  88.     ."<b>"._FFRIENDNAME." </b> <input type=\"text\" name=\"fname\"><br><br>\n"
  89.     ."<b>"._FFRIENDEMAIL." </b> <input type=\"text\" name=\"fmail\"><br><br>\n"
  90.     ."<input type=\"hidden\" name=\"op\" value=\"SendStory\">\n"
  91.     ."<input type=\"submit\" value="._SEND.">\n"
  92.     ."</form></td></tr></table>\n";
  93. CloseTable();
  94.  
  95. journalfoot();
  96.  
  97. ?>