Hi
I have a very strange issue... after user enters name and password and logs in the page appears by has this error at the top
+++++++++++++++++++++++++++
Warning: file(/var/www/html/templates/account/menumap_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_seller_profitshare_profitshare_profitshare_profitshare.html): failed to open stream: No such file or directory in /var/www/html/includes/functions.inc.php on line 33
+++++++++++++++++++++++++++
The correct file name is
menumap_buyer_seller_profitshare.html
and it does have this name and is in the correct folder... so why is it being called with a much longer name ?
Here is about half of the functions.inc.php file
+++++++++++++++++++++++
<?php
// Functions include file
// Set variable so PHPBB functions work
define('IN_PHPBB', true);
// Includes
$phpbb_root_path = '/var/www/html/';
include_once('/var/www/html/extension.inc');
include_once('/var/www/html/common.php');
require_once('/var/www/html/includes/classes.inc.php');
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1',
trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/profile.'.$phpEx :
'profile.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' :
'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' .
trim($board_config['server_port']) . '/' : '/';
$server_url = $server_protocol . $server_name . $server_port . $script_name;
//
// End session management
//
// Set $User variable with the User object for the logged in user.
$User = new User($userdata['user_id']);
// Generate location drop down used on several pages
$output_array['location_dropdown'] = '<SELECT NAME="user_location">';
$query = $db->sql_query("SELECT * FROM locations WHERE location_active =
1");
while ($result = $db->sql_fetchrow($query))
{
$output_array['location_dropdown'] .= '<OPTION
VALUE="'.$result['location_id'].'">'.$result['location_name'].'</OPTION>';
}
$output_array['location_dropdown'] .= "</SELECT>";
// Do member box login routine used on all pages
if ($User->logged_in())
{
$output_array['login'] = make_output("login_in", get_object_vars($User));
} else {
$output_array['login'] = make_output("login_out");
}
/*=================================
|| Function Name: display_output
|| Description: Runs through the given template and builds HTML output
using the sent replacements
|| Parameters: 1) Filename of the template to use
|| 2) Associative array with replacement keys and values
|| Returns: Returns the processed HTML in String format
=================================*/
function make_output ($template, $replacements = Array())
{
global $db, $User, $phpbb_root_path;
// Set to "on" to see template names in HTML source
$debug = "off";
$buffer = file($phpbb_root_path . "templates/".$template.".html");
$i = 0;
$j = 0;
$staff_line = 0;
while($i < count($buffer))
{
if(!ereg("^#(.)*$",$buffer[$i]))
{
$current_line = trim($buffer[$i]);
// Set if current line is only for staff members
if ($current_line == "<!--BEGIN STAFF-->")
{
$staff_line = 1;
$i++;
continue;
}
if ($current_line == "<!--END STAFF-->")
{
$staff_line = 0;
$i++;
continue;
}
// Set if current line is for Admins
if ($current_line == "<!--BEGIN ADMIN-->")
{
$admin_line = 1;
$i++;
continue;
}
if ($current_line == "<!--END ADMIN-->")
{
$admin_line = 0;
$i++;
continue;
}
// Check if user is staff or admin and display line if true
if ($staff_line == 1 || $admin_line == 1)
{
if ($User)
{
if ($User->is_staff())
{
if ($admin_line == 1)
{
if ($User->is_admin())
{
$skipped_buffer[$j] = $buffer[$i];
$j++;
} else {
$i++;
continue;
}
} else {
$skipped_buffer[$j] = $buffer[$i];
$j++;
}
} else {
$i++;
continue;
}
}
} else {
$skipped_buffer[$j] = $buffer[$i];
$j++;
}
}
$i++;
}
//--Retrieve message
$output = implode("", $skipped_buffer);
//--Change TAGS with variables content
if (is_array($replacements))
{
foreach ($replacements as $replaced => $replacer)
{
$output = ereg_replace("<!--".$replaced."-->", $replacer,
$output);
}
}
// Display debug info if set on
if ($debug == "on")
{
$output = "<!--".$template."
START-->\n\n".$output."\n\n<!--".$template." END-->\n\n";
}
return $output;
}
/*=================================
|| Function Name: arrayKeyExists
|| Description: Older version PHP replacement function. Looks in the sent
array for the sent key.
|| Parameters: 1) Key searching for
|| 2) Array searching in
|| Returns: True if the key exists in the array, false if not
=================================*/
function arrayKeyExists($key, $search) {
if (in_array($key, array_keys($search))) {
return true;
} else {
return false;
}
}
/*=================================
|| Function Name: email_user
|| Description: Emails a Quoticom user building the email from the given
template and replacement variables.
|| Parameters: 1) User ID of User that email is being sent to
|| 2) Template to use when building the email
|| 3) Send to temporary email? (1=yes, 2-no) Used for changing
email
|| 4) Array of replacement variables to used when building the
email
|| Returns: 1 after email is sent
=================================*/
function email_user($user_id, $template, $temp=0, $content=Array())
{
// Gather user details
$user = new User($user_id);
// Figure out which address to use
if ($temp != 0)
{
$email = $user->user_tempemail;
} else {
$email = $user->user_email;
}
// As per doteasy, if sending to a quoticom email address, need to change
the TO address
if (substr($email, -12) == "quoticom.com")
{
$pieces = explode('@', $email);
$email = $pieces[0]."%".$pieces[1]."@dpmail17.doteasy.com";
}
// Set replacement values
$user_values = get_object_vars($user);
$values = $content;
$values["site_url"] = 'http://www.quoticom.com';
// Determine subject from template
$message = make_output($template, $user_values+$values);
$message_array = explode("|||", $message);
if (count($message_array) > 1)
{
// template has a subject
$subject = trim(str_replace("Subject=", "", $message_array[0]));
$message_text = $message_array[1];
} else {
$subject = "Important Quoticom Information";
$message_text = $message_array[0];
}
// MIME HTML EMAIL
require_once('/var/www/html/includes/mail/htmlMimeMail.php');
$mail = new htmlMimeMail();
$text = strip_tags($message_text);
$html = make_output("emails/email_html_shell", Array("message" =>
nl2br($message_text)));
$mail->setHtml($html, $text);
$mail->setFrom('Quoticom <info@quoticom.com>');
$mail->setSubject($subject);
// Send the email
$result = $mail->send(array($email));
return 1;
}
/*=================================
|| Function Name: email_admins
|| Description: Wraps the email_user function to send email to all admins
(usergroup 2)
|| Parameters: 1) Filename of the template to use
|| 2) Associative array with replacement keys and values
|| Returns: True when email is sent
=================================*/
function email_admins($template, $content)
{
global $db;
// gather admin accounts from db
$sql = "SELECT user_id FROM user_group WHERE group_id = '2'";
$query = $db->sql_query($sql);
while ($result = $db->sql_fetchrow($query))
{
// email admins using email function
email_user($result['user_id'], $template, 0, $content);
}
return;
}
/*=================================
|| Function Name: EmailCheck
|| Description: Verifies that the sent email is in the valid format for an
email address
|| Parameters: 1) Email address to check
|| Returns: True if the email passes, false if not
=================================*/
function EmailCheck($Email)
{
$Result = ereg ("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $Email );
?>
++++++++++++++++++++++++++++
Can anybody help PLEASE...or suggest a fix... I have never seen anything like this before... also the correct file name seems too long too... but I did not make this file... it was a previous developer... I cannot download the file as the name
menumap_buyer_seller_profitshare.html
is too long... hope somebody can offer a suggestion
Thanks
Jolacphp