[ Index ]
 

Code source de PHP NUKE 7.9

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Recommend_Us/ -> index.php (source)

   1  <?php
   2  
   3  /************************************************************************/

   4  /* PHP-NUKE: Web Portal System                                          */

   5  /* ===========================                                          */

   6  /*                                                                      */

   7  /* Copyright (c) 2005 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  
  15  if (!defined('MODULE_FILE')) {
  16      die ("You can't access this file directly...");
  17  }
  18  require_once ("mainfile.php");
  19  $module_name = basename(dirname(__FILE__));
  20  get_lang($module_name);
  21  $pagetitle = "- "._RECOMMEND."";
  22  
  23  function RecommendSite($mess="0") {
  24      global $user, $cookie, $prefix, $db, $user_prefix, $module_name, $gfx_chk;
  25      include  ("header.php");
  26      title(""._RECOMMEND."");
  27      OpenTable();
  28      $mess = intval($mess);
  29      if ($mess == 1) {
  30          $mess = "<center>"._SECURITYCODEERROR."</center><br><br>";
  31      } else {
  32          $mess = "";
  33      }
  34      echo "<center><font class=\"content\"><b>"._RECOMMEND."</b></font></center><br><br>$mess"
  35      ."<table align=\"left\" border=\"0\" cellpadding=\"5\" cellspacing=\"5\"><tr><td>"
  36      ."<form action=\"modules.php?name=$module_name\" method=\"post\">"
  37      ."<input type=\"hidden\" name=\"op\" value=\"SendSite\">";
  38      if (is_user($user)) {
  39          $row = $db->sql_fetchrow($db->sql_query("SELECT username, user_email from ".$user_prefix."_users where user_id = '".intval($cookie[0])."'"));
  40          $yn = filter($row['username'], "nohtml");
  41          $ye = filter($row['user_email'], "nohtml");
  42      }
  43      else {
  44          $yn = "";
  45          $ye = "";
  46      }
  47      echo "<b>"._FYOURNAME." </b></td><td><input type=\"text\" name=\"yname\" value=\"$yn\"></td></tr>\n"
  48      ."<tr><td><b>"._FYOUREMAIL." </b></td><td><input type=\"text\" name=\"ymail\" value=\"$ye\"></td></tr>\n"
  49      ."<tr><td><b>"._FFRIENDNAME." </b></td><td><input type=\"text\" name=\"fname\"></td></tr>\n"
  50      ."<tr><td><b>"._FFRIENDEMAIL." </b></td><td><input type=\"text\" name=\"fmail\"></td></tr>\n";
  51      mt_srand ((double)microtime()*1000000);
  52      $maxran = 1000000;
  53      $random_num = mt_rand(0, $maxran);
  54      if (extension_loaded("gd") AND $gfx_chk != 0 ) {
  55          echo "<tr><td><b>"._SECURITYCODE.":</b></td><td><img src='?gfx=gfx_little&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'></td></tr>\n";
  56          echo "<tr><td><b>"._TYPESECCODE.":</b></td><td><input type=\"text\" NAME=\"gfx_check\" SIZE=\"3\" MAXLENGTH=\"3\"></td></tr>\n";
  57          echo "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
  58      } else {
  59          echo "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
  60      }
  61      echo "<tr><td>&nbsp;</td><td><input type=submit value="._SEND."></form></td></tr></table>\n";
  62      CloseTable();
  63      include  ('footer.php');
  64  }
  65  
  66  function SendSite($yname, $ymail, $fname, $fmail, $random_num="0", $gfx_check) {
  67      global $sitename, $slogan, $nukeurl, $module_name, $gfx_chk, $sitekey;
  68      if ($fname == "" OR $fmail == "" OR $yname == "" OR $ymail == "") {
  69          include ("header.php");
  70          title("$sitename - "._RECOMMEND."");
  71          OpenTable();
  72          echo "<center>"._SENDSITEERROR."<br><br>"._GOBACK."";
  73          CloseTable();
  74          include ("footer.php");
  75          die();
  76      }
  77      $fname = removecrlf(filter($fname, "nohtml"));
  78      $fmail = validate_mail(removecrlf(filter($fmail, "nohtml")));
  79      $yname = removecrlf(filter($yname, "nohtml"));
  80      $ymail = validate_mail(removecrlf(filter($ymail, "nohtml")));
  81      $datekey = date("F j");
  82      $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $sitekey . $random_num . $datekey));
  83      $code = substr($rcode, 2, 3);
  84      if (extension_loaded("gd") AND $code != $gfx_check AND $gfx_chk != 0) {
  85          $mess = 1;
  86          Header("Location: modules.php?name=$module_name&op=RecommendSite&mess=$mess");
  87      } else {
  88          $subject = ""._INTSITE." $sitename";
  89          $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._OURSITE." $sitename "._INTSENT."\n\n\n"._FSITENAME." $sitename\n$slogan\n"._FSITEURL." $nukeurl\n";
  90          mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: PHP/" . phpversion());
  91          update_points(3);
  92          Header("Location: modules.php?name=$module_name&op=SiteSent&fname=$fname");
  93      }
  94  }
  95  
  96  function SiteSent($fname) {
  97      include  ('header.php');
  98      $fname = removecrlf(filter($fname, "nohtml"));
  99      OpenTable();
 100      echo "<center><font class=\"content\">"._FREFERENCE." $fname...<br><br>"._THANKSREC."</font></center>";
 101      CloseTable();
 102      include  ('footer.php');
 103  }
 104  
 105  if (!isset($mess)) { $mess = 0; }
 106  
 107  switch($op) {
 108  
 109      case "SendSite":
 110      SendSite($yname, $ymail, $fname, $fmail, $random_num, $gfx_check);
 111      break;
 112  
 113      case "SiteSent":
 114      SiteSent($fname);
 115      break;
 116  
 117      default:
 118      RecommendSite($mess);
 119      break;
 120  
 121  }
 122  
 123  ?>


Généré le : Sun Apr 1 11:11:59 2007 par Balluche grâce à PHPXref 0.7