/***************************************************************************
* ExBB v.1.1 *
* Copyright (c) 2002-20ġġ by Alexander Subhankulov aka Warlock *
* *
* http://www.exbb.net *
* email: admin@exbb.net *
* *
***************************************************************************/
/***************************************************************************
* *
* 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, or *
* (at your option) any later version. *
* *
***************************************************************************/
define('ATTACH',true);
include('common.php');
$vars = parsed_vars();
switch ($vars['action']) {
case 'smiles' : showsmiles(); break;
case 'attach' : attachment(); break;
default: massmail(); break;
}
function massmail() {
global $exbb,$vars,$lang;
include('./language/' . $exbb['default_lang'] . '/lang_admin.php');
if (!$exbb['reged']) error($lang['Info'],$lang['Guest_mail'],'',0);
$filetoopen = $exbb['home_path'].'data/users.php';
if (isset($vars['mode'])) {
$users = get_file($filetoopen);
if (isset($vars['mid'])) {
if ( array_key_exists($vars['mid'],$users) ) {
if (!defined('IS_ADMIN') ) {
$lastpost = $_SESSION['lastposttime'] + $exbb['flood_limit'];
if ( $lastpost > time() ) error($lang['Email_error'],$lang['Flood_limit'].$exbb['flood_limit'].$lang['Flood_mail']);
$_SESSION['lastposttime'] = time();
}
$member = getmember($vars['mid']);
$message = $lang['Hello'].', '.$member['name']."\n".$exbb['member'].$lang['Email_from'].$exbb['boardname'].' ('.$exbb['boardurl'].")\n\n";
$message .= stripslashes(trim($_POST['message']));
sendmail($exbb['member'],$users[$exbb['mem_id']]['m'],$message,$vars['subject'],$users[$vars['mid']]['m']);
} else {
error($lang['Info'],$lang['Email_error'],'',0);
}
error($lang['Info'],$lang['Message_sent'],'',0);
}
error($lang['Info'],$lang['Message_sent'],'',0);
}
else {
$title_page = $exbb['boardname'];
include('./templates/'.$exbb['default_style'].'all_header.tpl');
if (isset($vars['mid'])) {
$member = getmember($vars['mid']);
$add = '
'.$lang['Email_to'].$member['name'].'
';
$hidden = '';
include('./templates/'.$exbb['default_style'].'logos.tpl');
}
$script = 'tools.php';
include('./templates/'.$exbb['default_style'].'admin/mass_mail.tpl');
include('./templates/'.$exbb['default_style'].'footer.tpl');
include('page_tail.php');
}
}
function showsmiles() {
global $exbb,$vars,$lang;
$filetoopen = $exbb['home_path'].'data/smiles.php';
if (file_exists($filetoopen)) {$smiles_list = get_file($filetoopen); uasort($smiles_list,'sort_by_id');} else {$smiles_list = array();}
if (count($smiles_list)) {
foreach ($smiles_list as $code=>$data) include('./templates/'.$exbb['default_style'].'smiles_data.tpl');
}
else {$datashow = '