Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
Andrzej
Hangin' Around


Joined: Jan 22, 2004
Posts: 31

PostPosted: Sun Nov 14, 2004 2:10 pm Reply with quote

Hello!
I have changed a Send to Friend function a little. Adding a new field for some recommendation (fpole). It works quite well
Code:
<?php




/************************************************************************/

/* PHP-NUKE: Web Portal System                                          */

/* ===========================                                          */

/*                                                                      */

/* Copyright (c) 2002 by Francisco Burzi                                */

/* http://phpnuke.org                                                   */

/*                                                                      */

/* This program is free software. You can redistribute it and/or modify */

/* it under the terms of the GNU General Public License as published by */

/* the Free Software Foundation; either version 2 of the License.       */

/************************************************************************/

/*         Additional security & Abstraction layer conversion           */

/*                           2003 chatserv                              */

/*      http://www.nukefixes.com -- http://www.nukeresources.com        */

/************************************************************************/



if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {

   die ("You can't access this file directly...");

}

if (stristr($_SERVER["QUERY_STRING"],'%25')) header("Location: index.php");

require_once("mainfile.php");

$module_name = basename(dirname(__FILE__));

get_lang($module_name);

$pagetitle = "- "._RECOMMEND."";



function FriendSend($sid) {

    global $user, $cookie, $prefix, $db, $user_prefix, $module_name;

    $sid = intval($sid);

    if(!isset($sid)) { exit(); }

    include ("header.php");

    $row = $db->sql_fetchrow($db->sql_query("SELECT title FROM ".$prefix."_stories WHERE sid='$sid'"));

    $title = stripslashes(check_html($row['title'], "nohtml"));

    title(""._FRIEND."");

    OpenTable();

    echo "<center> "._YOUSENDSTORY." <br><br><b>$title</b><br><br> "._TOAFRIEND."</font></center><br>"

   ."<form action=\"modules.php?name=$module_name&amp;file=friend\" method=\"post\">"

   ."<input type=\"hidden\" name=\"sid\" value=\"$sid\">";

    if (is_user($user)) {

   $row2 = $db->sql_fetchrow($db->sql_query("SELECT name, user_email FROM ".$user_prefix."_users WHERE username='$cookie[1]'"));

   $yn = stripslashes($row2['name']);

   $ye = stripslashes($row2['user_email']);

    }

    echo "<b>"._FYOURNAME." </b> <input type=\"text\" name=\"yname\" value=\"$yn\"><br>\n"

   ."<b>"._FYOUREMAIL." </b> <input type=\"text\" name=\"ymail\" value=\"$ye\"><br><br>\n"

   ."<b>"._FFRIENDNAME." </b> <input type=\"text\" name=\"fname\"><br>\n"

   ."<b>"._FFRIENDEMAIL." </b> <input type=\"text\" name=\"fmail\"><br><br>\n"

   .""._FFRIENDPOLECA." <br> <input type=\"text\" size=\"80\" maxwidth=\"250\" name=\"fpole\"><br><br>\n"


   ."<input type=\"hidden\" name=\"op\" value=\"SendStory\">\n"

   ."<input type=\"submit\" value="._SEND.">\n"

   ."</form>\n"

   .""._YOUSENDSTORY2."<br><br>";

    CloseTable();

    include ('footer.php');

}



function SendStory($sid, $yname, $ymail, $fname, $fmail, $fpole) {

    global $sitename, $nukeurl, $prefix, $db, $module_name;



    $fname = stripslashes(removecrlf($fname));

    $fmail = stripslashes(removecrlf($fmail));

    $yname = stripslashes(removecrlf($yname));

    $ymail = stripslashes(removecrlf($ymail));   
    $fpole = stripslashes(removecrlf($fpole));   


    $sid = intval($sid);

    $row = $db->sql_fetchrow($db->sql_query("SELECT title, time, topic FROM ".$prefix."_stories WHERE sid='$sid'"));

    $title = stripslashes(check_html($row['title'], "nohtml"));

    $time = $row['time'];

    $topic = intval($row['topic']);

    $row2 = $db->sql_fetchrow($db->sql_query("SELECT topictext FROM ".$prefix."_topics WHERE topicid='$topic'"));

    $topictext = stripslashes(check_html($row2['topictext'], "nohtml"));

    $subject = ""._INTERESTING." $sitename";

    $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._CONSIDERED."\n\n$title\n\n"._URL2POLECA."$fpole\n\n"._URL2.": \n$nukeurl/modules.php?name=$module_name&file=article&sid=$sid\n\n"._YOUCANREAD." ";

    mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: PHP/" . phpversion());

    $title = urlencode($title);

    $fname = urlencode($fname);

    Header("Location: modules.php?name=$module_name&file=friend&op=StorySent&title=$title&fname=$fname");

}



function StorySent($title, $fname) {

    include ("header.php");

    $title = urldecode(check_html($title, "nohtml"));

    $fname = urldecode($fname);

    OpenTable();

    echo "<center><font class=\"content\">"._FSTORY." <br><br><b>$title</b> <br><br>"._HASSENT." <b>$fname</b>... <br><br>"._THANKS."</font>"

   ."<br><br><a href=\"javascript:history.go(-1)\"><b><font color=navy>"._NO2."</b></font></a></center><br><br>";

    CloseTable();

    include ("footer.php");

}



switch($op) {



    case "SendStory":

    SendStory($sid, $yname, $ymail, $fname, $fmail, $fpole);

    break;

   

    case "StorySent":

    StorySent($title, $fname);

    break;


    case "FriendSend":

    FriendSend($sid);

    break;
}
?>


I am not a coder. I have 2 problems:
1. How to make the field of recomandation to textarea field - to let the reader better write a recommandation. I tried - but nothig helped.
2. How to implement other lang than english. Have a lot of trouble with polish letters;-)

Thanks in advance for your help

Andrzej
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©