tellafriend mod problem

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   tellafriend mod problem
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
hi all i recently installed tellafriend mod for phpbbnuke and im getting the error "Sorry, such file doesn't exist..." everytime i clicked the tellafriend link.

i reviewed my installation and i followed it correctly.

heres the code to the tellafriend.php. Thanks!


<?php
if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
require("modules/".$module_name."/nukebb.php");
define('IN_PHPBB', true);
//$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include('includes/functions_post.'.$phpEx);

$topic = (isset($HTTP_POST_VARS['topic'])) ? $HTTP_POST_VARS['topic'] : $HTTP_GET_VARS['topic'];
$friendname =  $HTTP_POST_VARS['friendname'];
$message = $HTTP_POST_VARS['message'];
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
{
   $topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
}
else if ( isset($HTTP_GET_VARS['topic']) )
{
   $topic_id = intval($HTTP_GET_VARS['topic']);
}

if ( isset($HTTP_GET_VARS[POST_POST_URL]))
{
   $post_id = intval($HTTP_GET_VARS[POST_POST_URL]);
}
$link = "http://".$HTTP_SERVER_VARS['HTTP_HOST'].$HTTP_SERVER_VARS['PHP_SELF']."?name=Forums&file=viewtopic&t=$topic_id";

$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

$userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);
init_userprefs($userdata);

if( !$userdata['session_logged_in'] )
    {
        header("Location: " . append_sid("login.$phpEx?redirect=$PHP_SELF&topic=$topic&link=$link", true));
          exit;
    }

include('includes/page_header.'.$phpEx);

$mail_body = str_replace("{TOPIC}", trim(stripslashes($topic)), $lang['Tell_Friend_Body']);
$mail_body = str_replace("{LINK}", $link, $mail_body);
$mail_body = str_replace("{SITENAME}", $board_config['sitename'], $mail_body);

$template->assign_vars(array(
'L_TELL_FRIEND_TITLE' => $lang['Tell_Friend_Title'],
'L_TELL_FRIEND_EMAIL_MESSAGE' => $lang['Tell_Friend_Email_Message'],
'L_TELL_FRIEND_SENDER_USER' => $lang['Tell_Friend'],
'L_TELL_FRIEND_SENDER_USER' => $lang['Tell_Friend_Sender_User'],
'L_TELL_FRIEND_SENDER_EMAIL' => $lang['Tell_Friend_Sender_Email'],
'L_TELL_FRIEND_RECIEVER_USER' => $lang['Tell_Friend_Reciever_User'],
'L_TELL_FRIEND_RECIEVER_EMAIL' => $lang['Tell_Friend_Reciever_Email'],
'L_TELL_FRIEND_MSG' => $lang['Tell_Friend_Msg'],
'L_TELL_FRIEND_BODY' => $mail_body,

"SUBMIT_ACTION" => "modules.php?name=Forums&file=tellafriend", true,
"L_SUBMIT" => $lang['Send_email'],
"SITENAME" => $board_config['sitename'],
"TOPIC" => trim(stripslashes($topic)),
"LINK" => $link,
"SENDER_NAME" => $userdata['username'],
"SENDER_MAIL" => $userdata['user_email'],
));

/**************/
      if ( isset($HTTP_POST_VARS['submit']) )
      {
         $error = FALSE;

         if ( !empty($HTTP_POST_VARS['friendemail']) && (strpos($HTTP_POST_VARS['friendemail'],"@")>0) )
         {
            $friendemail = trim(stripslashes($HTTP_POST_VARS['friendemail']));
            if (!$HTTP_POST_VARS['friendname']) { $friendname=substr($friendemail,0,strpos($HTTP_POST_VARS['friendemail'],"@")); };
         }
         else
         {
            $error = TRUE;
            $error_msg = "You have not entered a (valid) email address";
         }

         if ( !$error )
         {
               include( 'includes/emailer.'.$phpEx);
               $emailer = new emailer($board_config['smtp_delivery']);

               $email_headers = 'Return-Path: ' . $userdata['user_email '] . "\nFrom: ". $userdata['username'] .'<'. $userdata['user_email '] .'>' . "\n";
               // The above line did not work for some people, so we use the simpler below line
               $email_headers = 'Return-Path: ' . $userdata['user_email '] . "\nFrom: ". $userdata['user_email '] ."\n";
               //$email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
               $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
               $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
               $email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";

               $emailer->use_template('tellafriend_email', $user_lang);
               $emailer->email_address($friendname .'<'. $friendemail .'>');
               //$emailer->set_subject($friendname.', du wurdest eingeladen nach '. $board_config[sitename]);
               $emailer->set_subject(trim(stripslashes($topic)));
               $emailer->extra_headers($email_headers);

               $emailer->assign_vars(array(
                  'SITENAME' => $board_config['sitename'],
                  'BOARD_EMAIL' => $board_config['board_email'],
                  'FROM_USERNAME' => $userdata['username'],
                  'TO_USERNAME' => $friendname,
                  'MESSAGE' => $message)
               );
               $emailer->send();
               $emailer->reset();

               $template->assign_vars(array(
                  'META' => '<meta http-equiv="refresh" content="5;url=' . "../modules.php?name=Forums&file=index.$phpEx" . '">')
               );

               $message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

               message_die(GENERAL_MESSAGE, $message);
         }

         if ( $error )
         {
            $template->set_filenames(array(
               'reg_header' => 'error_body.tpl')
            );
            $template->assign_vars(array(
               'ERROR_MESSAGE' => $error_msg)
            );
            $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
         }

      }


$template->set_filenames(array("body" => "tellafriend_body.tpl"));
$template->pparse("body");

include('includes/page_tail.'.$phpEx);
?>



Back to top Reply with quote
#2   re: tellafriend mod problem
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
hey everyone , any chance of a fix yet?

check out the problem first hand here: [ Register or login to view links on this board.]



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum