mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Перенос файлов движка в корень
This commit is contained in:
parent
584f692288
commit
f94c0dd2ee
585 changed files with 14 additions and 14 deletions
2
library/includes/ucp/.htaccess
Normal file
2
library/includes/ucp/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
order allow,deny
|
||||
deny from all
|
47
library/includes/ucp/activate.php
Normal file
47
library/includes/ucp/activate.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
if (!defined('IN_FORUM')) die('Hacking attempt');
|
||||
|
||||
if (empty($_GET['u']) || empty($_GET['act_key']))
|
||||
{
|
||||
bb_die('Bad request');
|
||||
}
|
||||
|
||||
$sql = "SELECT user_active, user_id, username, user_email, user_newpasswd, user_lang, user_actkey
|
||||
FROM " . BB_USERS . "
|
||||
WHERE user_id = " . intval($_GET[POST_USERS_URL]);
|
||||
if (!($result = DB()->sql_query($sql)))
|
||||
{
|
||||
bb_die('Could not obtain user information');
|
||||
}
|
||||
|
||||
if ($row = DB()->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['user_active'] && trim($row['user_actkey']) == '')
|
||||
{
|
||||
bb_die($lang['ALREADY_ACTIVATED']);
|
||||
}
|
||||
else if ((trim($row['user_actkey']) == trim($_GET['act_key'])) && (trim($row['user_actkey']) != ''))
|
||||
{
|
||||
$sql_update_pass = ( $row['user_newpasswd'] != '' ) ? ", user_password = '" . md5(md5($row['user_newpasswd'])) . "', user_newpasswd = ''" : '';
|
||||
|
||||
$sql = "UPDATE " . BB_USERS . "
|
||||
SET user_active = 1, user_actkey = ''" . $sql_update_pass . "
|
||||
WHERE user_id = " . $row['user_id'];
|
||||
if (!($result = DB()->sql_query($sql)))
|
||||
{
|
||||
bb_die('Could not update users table');
|
||||
}
|
||||
|
||||
$message = ( $sql_update_pass == '' ) ? $lang['ACCOUNT_ACTIVE'] : $lang['PASSWORD_ACTIVATED'];
|
||||
bb_die($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['WRONG_ACTIVATION']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['NO_SUCH_USER']);
|
||||
}
|
80
library/includes/ucp/bonus.php
Normal file
80
library/includes/ucp/bonus.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
if (!defined('BB_ROOT')) die(basename(__FILE__));
|
||||
|
||||
$user_id = $userdata['user_id'];
|
||||
$user_points = $userdata['user_points'];
|
||||
|
||||
if($bb_cfg['seed_bonus_enabled'] && $bb_cfg['bonus_upload'] && $bb_cfg['bonus_upload_price'])
|
||||
{
|
||||
$upload_row = unserialize($bb_cfg['bonus_upload']);
|
||||
$price_row = unserialize($bb_cfg['bonus_upload_price']);
|
||||
}
|
||||
else bb_die($lang['EXCHANGE_NOT']);
|
||||
|
||||
if (isset($_POST['bonus_id']))
|
||||
{
|
||||
$id = (int) $_POST['bonus_id'];
|
||||
|
||||
$btu = get_bt_userdata($user_id);
|
||||
|
||||
if (empty($btu))
|
||||
{
|
||||
require(INC_DIR .'functions_torrent.php');
|
||||
generate_passkey($user_id, true);
|
||||
$btu = get_bt_userdata($user_id);
|
||||
}
|
||||
|
||||
$upload = $upload_row[$id]*1024*1024*1024;
|
||||
$points = $price_row[$id];
|
||||
|
||||
if ($userdata['user_points'] < $points)
|
||||
{
|
||||
meta_refresh('index.php', 5);
|
||||
|
||||
$message = $lang['BONUS_NOT_SUCCES'] .'<br /><br /><a href="'. BONUS_URL .'">'. $lang['BONUS_RETURN'] .'</a><br /><br /><a href="'. PROFILE_URL . $userdata['user_id'] .'">'. $lang['RETURN_PROFILE'] .'</a><br /><br />'. sprintf($lang['CLICK_RETURN_INDEX'], '<a href="index.php">', '</a>');
|
||||
|
||||
bb_die($message);
|
||||
}
|
||||
|
||||
DB()->query("UPDATE ". BB_BT_USERS ." bu, ". BB_USERS ." u
|
||||
SET
|
||||
bu.u_up_total = u_up_total + $upload,
|
||||
u.user_points = u.user_points - $points
|
||||
WHERE
|
||||
bu.user_id = $user_id
|
||||
AND u.user_id = bu.user_id
|
||||
");
|
||||
|
||||
cache_rm_user_sessions($user_id);
|
||||
meta_refresh(BONUS_URL, 5);
|
||||
|
||||
$message = sprintf($lang['BONUS_SUCCES'], humn_size($upload_row[$id]*1024*1024*1024));
|
||||
$message .= '<br /><br /><a href="'. BONUS_URL .'">'. $lang['BONUS_RETURN'] .'</a><br /><br /><a href="'. PROFILE_URL . $userdata['user_id'] .'">'. $lang['RETURN_PROFILE'] .'</a><br /><br />'. sprintf($lang['CLICK_RETURN_INDEX'], '<a href="index.php">', '</a>');
|
||||
|
||||
bb_die($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'U_USER_PROFILE' => PROFILE_URL . $user_id,
|
||||
'S_MODE_ACTION' => 'profile.php?mode=bonus',
|
||||
'PAGE_TITLE' => $lang['EXCHANGE_BONUS'],
|
||||
'MY_BONUS' => sprintf($lang['MY_BONUS'], $user_points),
|
||||
));
|
||||
|
||||
foreach($price_row as $i => $price)
|
||||
{
|
||||
if(!$price || !$upload_row[$i]) continue;
|
||||
$class = ($user_points >= $price) ? 'seed' : 'leech';
|
||||
|
||||
$template->assign_block_vars('bonus_upload', array(
|
||||
'ROW_CLASS' => !($i % 2) ? 'row2' : 'row1',
|
||||
'ID' => $i,
|
||||
'DESC' => sprintf($lang['BONUS_UPLOAD_DESC'], humn_size($upload_row[$i]*1024*1024*1024)),
|
||||
'PRICE' => sprintf($lang['BONUS_UPLOAD_PRICE'], $class, sprintf('%.2f', $price)),
|
||||
));
|
||||
}
|
||||
|
||||
print_page('usercp_bonus.tpl');
|
||||
}
|
91
library/includes/ucp/email.php
Normal file
91
library/includes/ucp/email.php
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
|
||||
if (!defined('IN_FORUM')) die("Hacking attempt");
|
||||
|
||||
// Is send through board enabled? No, return to index
|
||||
if (!$bb_cfg['board_email_form'])
|
||||
{
|
||||
redirect("index.php");
|
||||
}
|
||||
|
||||
set_die_append_msg();
|
||||
|
||||
if ( !empty($_GET[POST_USERS_URL]) || !empty($_POST[POST_USERS_URL]) )
|
||||
{
|
||||
$user_id = ( !empty($_GET[POST_USERS_URL]) ) ? intval($_GET[POST_USERS_URL]) : intval($_POST[POST_USERS_URL]);
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['NO_USER_SPECIFIED']);
|
||||
}
|
||||
|
||||
if ( !$userdata['session_logged_in'] )
|
||||
{
|
||||
redirect(LOGIN_URL . "?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id");
|
||||
}
|
||||
|
||||
$errors = array();
|
||||
|
||||
$sql = "SELECT username, user_id, user_rank, user_email, user_lang
|
||||
FROM " . BB_USERS . "
|
||||
WHERE user_id = $user_id
|
||||
";
|
||||
|
||||
if ($row = DB()->fetch_row($sql))
|
||||
{
|
||||
$username = $row['username'];
|
||||
$user_email = $row['user_email'];
|
||||
$user_lang = $row['user_lang'];
|
||||
|
||||
if ( true || IS_ADMIN ) // TRUE instead of missing user_opt "prevent_email"
|
||||
{
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
$subject = trim(html_entity_decode($_POST['subject']));
|
||||
$message = trim(html_entity_decode($_POST['message']));
|
||||
|
||||
if (!$subject) $errors[] = $lang['EMPTY_SUBJECT_EMAIL'];
|
||||
if (!$message) $errors[] = $lang['EMPTY_MESSAGE_EMAIL'];
|
||||
|
||||
if (!$errors)
|
||||
{
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($userdata['username'] ." <{$userdata['user_email']}>");
|
||||
$emailer->email_address($username ." <$user_email>");
|
||||
|
||||
$emailer->use_template('profile_send_email', $user_lang);
|
||||
$emailer->set_subject($subject);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $bb_cfg['sitename'],
|
||||
'FROM_USERNAME' => $userdata['username'],
|
||||
'TO_USERNAME' => $username,
|
||||
'MESSAGE' => $message,
|
||||
));
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
bb_die($lang['EMAIL_SENT']);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'USERNAME' => profile_url($row),
|
||||
'S_HIDDEN_FIELDS' => '',
|
||||
'S_POST_ACTION' => "profile.php?mode=email&" . POST_USERS_URL . "=$user_id",
|
||||
'ERROR_MESSAGE' => ($errors) ? join('<br />', array_unique($errors)) : '',
|
||||
));
|
||||
|
||||
print_page('usercp_email.tpl');
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['USER_PREVENT_EMAIL']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['USER_NOT_EXIST']);
|
||||
}
|
779
library/includes/ucp/register.php
Normal file
779
library/includes/ucp/register.php
Normal file
|
@ -0,0 +1,779 @@
|
|||
<?php
|
||||
|
||||
if (!defined('BB_ROOT')) die(basename(__FILE__));
|
||||
|
||||
array_deep($_POST, 'trim');
|
||||
|
||||
set_die_append_msg();
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
$bb_cfg['reg_email_activation'] = false;
|
||||
|
||||
$new_user = (int) request_var('admin', '');
|
||||
if ($new_user) $gen_simple_header = true;
|
||||
|
||||
$template->assign_vars(array(
|
||||
'NEW_USER' => $new_user,
|
||||
));
|
||||
}
|
||||
|
||||
$can_register = (IS_GUEST || IS_ADMIN);
|
||||
|
||||
$submit = !empty($_POST['submit']);
|
||||
$errors = array();
|
||||
$adm_edit = false; // редактирование админом чужого профиля
|
||||
|
||||
require(INC_DIR .'bbcode.php');
|
||||
require(INC_DIR .'functions_validate.php');
|
||||
require(INC_DIR .'functions_selects.php');
|
||||
|
||||
$pr_data = array(); // данные редактируемого либо регистрационного профиля
|
||||
$db_data = array(); // данные для базы: регистрационные либо измененные данные юзера
|
||||
$tp_data = array(); // данные для tpl
|
||||
|
||||
// Данные профиля
|
||||
switch ($mode)
|
||||
{
|
||||
/**
|
||||
* Регистрация
|
||||
*/
|
||||
case 'register':
|
||||
if (!$can_register) redirect('index.php');
|
||||
|
||||
if (!IS_ADMIN)
|
||||
{
|
||||
// Ограничение по ip
|
||||
if($bb_cfg['unique_ip'])
|
||||
{
|
||||
if($users = DB()->fetch_row("SELECT user_id, username FROM ". BB_USERS ." WHERE user_reg_ip = '". USER_IP ."' LIMIT 1"))
|
||||
{
|
||||
bb_die(sprintf($lang['ALREADY_REG_IP'], '<a href="'. PROFILE_URL . $users['user_id'] .'"><b>'. $users['username'] .'</b></a>', $bb_cfg['tech_admin_email']));
|
||||
}
|
||||
}
|
||||
// Отключение регистрации
|
||||
if ($bb_cfg['new_user_reg_disabled'] || ($bb_cfg['reg_email_activation'] && $bb_cfg['emailer_disabled']))
|
||||
{
|
||||
bb_die($lang['NEW_USER_REG_DISABLED']);
|
||||
}
|
||||
// Ограничение по времени
|
||||
else if ($bb_cfg['new_user_reg_restricted'])
|
||||
{
|
||||
if (in_array(date('G'), array(0,/*1,2,3,4,5,6,7,8,11,12,13,14,15,16,*/17,18,19,20,21,22,23)))
|
||||
{
|
||||
bb_die($lang['REGISTERED_IN_TIME']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// field => can_edit
|
||||
$profile_fields = array(
|
||||
'username' => true,
|
||||
'user_password' => true,
|
||||
'user_email' => true,
|
||||
'user_timezone' => true,
|
||||
'user_lang' => true,
|
||||
'user_opt' => true,
|
||||
);
|
||||
|
||||
$pr_data = array(
|
||||
'user_id' => GUEST_UID,
|
||||
'username' => '',
|
||||
'user_password' => '',
|
||||
'user_email' => '',
|
||||
'user_timezone' => $bb_cfg['board_timezone'],
|
||||
'user_lang' => $bb_cfg['default_lang'],
|
||||
'user_opt' => 0,
|
||||
'avatar_ext_id' => 0,
|
||||
);
|
||||
break;
|
||||
|
||||
/**
|
||||
* Редактирование профиля
|
||||
*/
|
||||
case 'editprofile':
|
||||
if (IS_GUEST) login_redirect();
|
||||
|
||||
// field => can_edit
|
||||
$profile_fields = array(
|
||||
'user_active' => IS_ADMIN,
|
||||
'username' => (IS_ADMIN || $bb_cfg['allow_namechange']),
|
||||
'user_password' => true,
|
||||
'user_email' => true, // должен быть после user_password
|
||||
'user_lang' => true,
|
||||
'user_gender' => true,
|
||||
'user_birthday' => true,
|
||||
'user_timezone' => true,
|
||||
'user_opt' => true,
|
||||
'avatar_ext_id' => true,
|
||||
'user_icq' => true,
|
||||
'user_skype' => true,
|
||||
'user_twitter' => true,
|
||||
'user_website' => true,
|
||||
'user_from' => true,
|
||||
'user_sig' => true,
|
||||
'user_occ' => true,
|
||||
'user_interests' => true,
|
||||
'tpl_name' => true,
|
||||
);
|
||||
|
||||
// Выбор профиля: для юзера свой, для админа любой
|
||||
if (IS_ADMIN && !empty($_REQUEST['u']))
|
||||
{
|
||||
$pr_user_id = (int) $_REQUEST['u'];
|
||||
$adm_edit = ($pr_user_id != $userdata['user_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pr_user_id = $userdata['user_id'];
|
||||
}
|
||||
$profile_fields_sql = join(', ', array_keys($profile_fields));
|
||||
$sql = "
|
||||
SELECT
|
||||
user_id,
|
||||
user_rank,
|
||||
user_level,
|
||||
$profile_fields_sql
|
||||
FROM ". BB_USERS ."
|
||||
WHERE user_id = $pr_user_id
|
||||
LIMIT 1
|
||||
";
|
||||
if (!$pr_data = DB()->fetch_row($sql))
|
||||
{
|
||||
bb_die($lang['PROFILE_NOT_FOUND']);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error("invalid mode: $mode", E_USER_ERROR);
|
||||
}
|
||||
|
||||
// CAPTCHA
|
||||
$need_captcha = ($mode == 'register' && !IS_ADMIN);
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
if ($need_captcha && !CAPTCHA()->verify_code())
|
||||
{
|
||||
$errors[] = $lang['CONFIRM_CODE_WRONG'];
|
||||
}
|
||||
}
|
||||
|
||||
// Валидация данных
|
||||
$cur_pass_valid = $adm_edit;
|
||||
|
||||
foreach ($profile_fields as $field => $can_edit)
|
||||
{
|
||||
switch ($field)
|
||||
{
|
||||
/**
|
||||
* Активация (edit, reg)
|
||||
*/
|
||||
case 'user_active':
|
||||
$active = isset($_POST['user_active']) ? (int) $_POST['user_active'] : $pr_data['user_active'];
|
||||
if ($submit && $adm_edit)
|
||||
{
|
||||
$pr_data['user_active'] = $active;
|
||||
$db_data['user_active'] = $active;
|
||||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* Имя (edit, reg)
|
||||
*/
|
||||
case 'username':
|
||||
$username = !empty($_POST['username']) ? clean_username($_POST['username']) : $pr_data['username'];
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$err = validate_username($username);
|
||||
if (!$errors AND $err && $mode == 'register')
|
||||
{
|
||||
$errors[] = $err;
|
||||
}
|
||||
if ($can_edit && $username != $pr_data['username'] || $mode == 'register')
|
||||
{
|
||||
$pr_data['username'] = $username;
|
||||
$db_data['username'] = $username;
|
||||
}
|
||||
}
|
||||
$tp_data['CAN_EDIT_USERNAME'] = $can_edit;
|
||||
$tp_data['USERNAME'] = $pr_data['username'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Пароль (edit, reg)
|
||||
*/
|
||||
case 'user_password':
|
||||
if ($submit)
|
||||
{
|
||||
$cur_pass = (string) @$_POST['cur_pass'];
|
||||
$new_pass = (string) @$_POST['new_pass'];
|
||||
$cfm_pass = (string) @$_POST['cfm_pass'];
|
||||
|
||||
// пароль для гостя и при смене пароля юзером
|
||||
if (!empty($new_pass))
|
||||
{
|
||||
if (mb_strlen($new_pass, 'UTF-8') > 20)
|
||||
{
|
||||
$errors[] = sprintf($lang['CHOOSE_PASS_ERR_MAX'], 20);
|
||||
}
|
||||
elseif (mb_strlen($new_pass, 'UTF-8') < 4)
|
||||
{
|
||||
$errors[] = sprintf($lang['CHOOSE_PASS_ERR_MIN'], 4);
|
||||
}
|
||||
elseif ($new_pass != $cfm_pass)
|
||||
{
|
||||
$errors[] = $lang['CHOOSE_PASS_ERR'];
|
||||
}
|
||||
$db_data['user_password'] = md5(md5($new_pass));
|
||||
}
|
||||
|
||||
if ($mode == 'register')
|
||||
{
|
||||
if (empty($new_pass))
|
||||
{
|
||||
$errors[] = $lang['CHOOSE_PASS'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!empty($cur_pass))
|
||||
{
|
||||
$cur_pass_valid = ($pr_data['user_password'] === md5(md5($cur_pass)));
|
||||
}
|
||||
if (!empty($new_pass) && !$cur_pass_valid)
|
||||
{
|
||||
$errors[] = $lang['CHOOSE_PASS_FAILED'];
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* E-mail (edit, reg)
|
||||
*/
|
||||
case 'user_email':
|
||||
$email = !empty($_POST['user_email']) ? (string) $_POST['user_email'] : $pr_data['user_email'];
|
||||
if ($submit)
|
||||
{
|
||||
if ($mode == 'register')
|
||||
{
|
||||
if (empty($email))
|
||||
{
|
||||
$errors[] = $lang['CHOOSE_E_MAIL'];
|
||||
}
|
||||
if (!$errors AND $err = validate_email($email))
|
||||
{
|
||||
$errors[] = $err;
|
||||
}
|
||||
$db_data['user_email'] = $email;
|
||||
}
|
||||
else if ($email != $pr_data['user_email']) // если смена мейла юзером
|
||||
{
|
||||
if (!$cur_pass_valid)
|
||||
{
|
||||
$errors[] = $lang['CONFIRM_PASSWORD_EXPLAIN'];
|
||||
}
|
||||
if (!$errors AND $err = validate_email($email))
|
||||
{
|
||||
$errors[] = $err;
|
||||
}
|
||||
if ($bb_cfg['reg_email_activation'])
|
||||
{
|
||||
$pr_data['user_active'] = 0;
|
||||
$db_data['user_active'] = 0;
|
||||
}
|
||||
$db_data['user_email'] = $email;
|
||||
}
|
||||
}
|
||||
$tp_data['USER_EMAIL'] = htmlCHR($email);
|
||||
break;
|
||||
|
||||
/**
|
||||
* Язык (edit, reg)
|
||||
*/
|
||||
case 'user_lang':
|
||||
$user_lang = isset($_POST['user_lang']) ? (string) $_POST['user_lang'] : $pr_data['user_lang'];
|
||||
if ($submit && ($user_lang != $pr_data['user_lang'] || $mode == 'register'))
|
||||
{
|
||||
$pr_data['user_lang'] = $user_lang;
|
||||
$db_data['user_lang'] = $user_lang;
|
||||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* Часовой пояс (edit, reg)
|
||||
*/
|
||||
case 'user_timezone':
|
||||
$user_timezone = isset($_POST['user_timezone']) ? (int) $_POST['user_timezone'] : $pr_data['user_timezone'];
|
||||
if ($submit && ($user_timezone != $pr_data['user_timezone'] || $mode == 'register'))
|
||||
{
|
||||
if (isset($lang['TZ'][$user_timezone]))
|
||||
{
|
||||
$pr_data['user_timezone'] = $user_timezone;
|
||||
$db_data['user_timezone'] = $user_timezone;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* Пол (edit, reg)
|
||||
*/
|
||||
case 'user_gender':
|
||||
$user_gender = isset($_POST['user_gender']) ? (int) $_POST['user_gender'] : $pr_data['user_gender'];
|
||||
if ($submit && $user_gender != $pr_data['user_gender'])
|
||||
{
|
||||
$pr_data['user_gender'] = $user_gender;
|
||||
$db_data['user_gender'] = $user_gender;
|
||||
}
|
||||
$tp_data['USER_GENDER'] = build_select('user_gender', array_flip($lang['GENDER_SELECT']), $pr_data['user_gender']);
|
||||
break;
|
||||
|
||||
/**
|
||||
* Возраст (edit)
|
||||
*/
|
||||
case 'user_birthday':
|
||||
$user_birthday = isset($_POST['user_birthday']) ? (string) $_POST['user_birthday'] : $pr_data['user_birthday'];
|
||||
|
||||
if ($submit && $user_birthday != $pr_data['user_birthday'])
|
||||
{
|
||||
$birthday_date = date_parse($user_birthday);
|
||||
|
||||
if (!empty($birthday_date['year']))
|
||||
{
|
||||
if (strtotime($user_birthday) >= TIMENOW)
|
||||
{
|
||||
$errors[] = $lang['WRONG_BIRTHDAY_FORMAT'];
|
||||
}
|
||||
elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] > $bb_cfg['birthday_max_age'])
|
||||
{
|
||||
$errors[] = sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age']);
|
||||
}
|
||||
elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] < $bb_cfg['birthday_min_age'])
|
||||
{
|
||||
$errors[] = sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age']);
|
||||
}
|
||||
}
|
||||
|
||||
$pr_data['user_birthday'] = $user_birthday;
|
||||
$db_data['user_birthday'] = $user_birthday;
|
||||
}
|
||||
$tp_data['USER_BIRTHDAY'] = $pr_data['user_birthday'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* opt (edit)
|
||||
*/
|
||||
case 'user_opt':
|
||||
$user_opt = $pr_data['user_opt'];
|
||||
$reg_mode = ($mode == 'register');
|
||||
|
||||
$update_user_opt = array(
|
||||
# 'user_opt_name' => ($reg_mode) ? #reg_value : #in_login_change
|
||||
'user_viewemail' => ($reg_mode) ? false : true,
|
||||
'user_viewonline' => ($reg_mode) ? false : true,
|
||||
'user_notify' => ($reg_mode) ? true : true,
|
||||
'user_notify_pm' => ($reg_mode) ? true : true,
|
||||
'user_porn_forums' => ($reg_mode) ? false : true,
|
||||
'user_dls' => ($reg_mode) ? false : true,
|
||||
'user_callseed' => ($reg_mode) ? true : true,
|
||||
'user_retracker' => ($reg_mode) ? true : true,
|
||||
);
|
||||
|
||||
foreach ($update_user_opt as $opt => $can_change_opt)
|
||||
{
|
||||
if ($submit && (isset($_POST[$opt]) && $can_change_opt || $reg_mode))
|
||||
{
|
||||
$change_opt = ($reg_mode) ? $can_change_opt : !empty($_POST[$opt]);
|
||||
setbit($user_opt, $bf['user_opt'][$opt], $change_opt);
|
||||
}
|
||||
$tp_data[strtoupper($opt)] = bf($user_opt, 'user_opt', $opt);
|
||||
}
|
||||
if ($submit && ($user_opt != $pr_data['user_opt'] || $reg_mode))
|
||||
{
|
||||
$pr_data['user_opt'] = $user_opt;
|
||||
$db_data['user_opt'] = (int) $user_opt;
|
||||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* Avatar (edit)
|
||||
*/
|
||||
case 'avatar_ext_id':
|
||||
if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'))
|
||||
{
|
||||
if (isset($_POST['delete_avatar']))
|
||||
{
|
||||
delete_avatar($pr_data['user_id'], $pr_data['avatar_ext_id']);
|
||||
$pr_data['avatar_ext_id'] = 0;
|
||||
$db_data['avatar_ext_id'] = 0;
|
||||
}
|
||||
else if (!empty($_FILES['avatar']['name']) && $bb_cfg['avatars']['up_allowed'])
|
||||
{
|
||||
require(INC_DIR .'functions_upload.php');
|
||||
$upload = new upload_common();
|
||||
|
||||
if ($upload->init($bb_cfg['avatars'], $_FILES['avatar']) AND $upload->store('avatar', $pr_data))
|
||||
{
|
||||
$pr_data['avatar_ext_id'] = $upload->file_ext_id;
|
||||
$db_data['avatar_ext_id'] = (int) $upload->file_ext_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors = array_merge($errors, $upload->errors);
|
||||
}
|
||||
}
|
||||
}
|
||||
$tp_data['AVATARS_MAX_SIZE'] = humn_size($bb_cfg['avatars']['max_size']);
|
||||
break;
|
||||
|
||||
/**
|
||||
* ICQ (edit)
|
||||
*/
|
||||
case 'user_icq':
|
||||
$icq = isset($_POST['user_icq']) ? (string) $_POST['user_icq'] : $pr_data['user_icq'];
|
||||
if ($submit && $icq != $pr_data['user_icq'])
|
||||
{
|
||||
if ($icq == '' || preg_match('#^\d{6,15}$#', $icq))
|
||||
{
|
||||
$pr_data['user_icq'] = $icq;
|
||||
$db_data['user_icq'] = (string) $icq;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pr_data['user_icq'] = '';
|
||||
$errors[] = htmlCHR($lang['ICQ_ERROR']);
|
||||
}
|
||||
}
|
||||
$tp_data['USER_ICQ'] = $pr_data['user_icq'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Сайт (edit)
|
||||
*/
|
||||
case 'user_website':
|
||||
$website = isset($_POST['user_website']) ? (string) $_POST['user_website'] : $pr_data['user_website'];
|
||||
$website = htmlCHR($website);
|
||||
if ($submit && $website != $pr_data['user_website'])
|
||||
{
|
||||
if ($website == '' || preg_match('#^https?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+$#iu', $website))
|
||||
{
|
||||
$pr_data['user_website'] = $website;
|
||||
$db_data['user_website'] = (string) $website;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pr_data['user_website'] = '';
|
||||
$errors[] = htmlCHR($lang['WEBSITE_ERROR']);
|
||||
}
|
||||
}
|
||||
$tp_data['USER_WEBSITE'] = $pr_data['user_website'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Откуда (edit)
|
||||
*/
|
||||
case 'user_from':
|
||||
$from = isset($_POST['user_from']) ? (string) $_POST['user_from'] : $pr_data['user_from'];
|
||||
$from = htmlCHR($from);
|
||||
if ($submit && $from != $pr_data['user_from'])
|
||||
{
|
||||
$pr_data['user_from'] = $from;
|
||||
$db_data['user_from'] = (string) $from;
|
||||
}
|
||||
$tp_data['USER_FROM'] = $pr_data['user_from'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Подпись (edit)
|
||||
*/
|
||||
case 'user_sig':
|
||||
$sig = isset($_POST['user_sig']) ? (string) $_POST['user_sig'] : $pr_data['user_sig'];
|
||||
if ($submit && $sig != $pr_data['user_sig'])
|
||||
{
|
||||
$sig = prepare_message($sig);
|
||||
|
||||
if (mb_strlen($sig, 'UTF-8') > $bb_cfg['max_sig_chars'])
|
||||
{
|
||||
$errors[] = $lang['SIGNATURE_TOO_LONG'];
|
||||
}
|
||||
else if (preg_match('#<(a|b|i|u|table|tr|td|img) #i', $sig) || preg_match('#(href|src|target|title)=#i', $sig))
|
||||
{
|
||||
$errors[] = $lang['SIGNATURE_ERROR_HTML'];
|
||||
}
|
||||
|
||||
$pr_data['user_sig'] = $sig;
|
||||
$db_data['user_sig'] = (string) $sig;
|
||||
}
|
||||
$tp_data['USER_SIG'] = $pr_data['user_sig'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Род занятий (edit)
|
||||
*/
|
||||
case 'user_occ':
|
||||
$occ = isset($_POST['user_occ']) ? (string) $_POST['user_occ'] : $pr_data['user_occ'];
|
||||
$occ = htmlCHR($occ);
|
||||
if ($submit && $occ != $pr_data['user_occ'])
|
||||
{
|
||||
$pr_data['user_occ'] = $occ;
|
||||
$db_data['user_occ'] = (string) $occ;
|
||||
}
|
||||
$tp_data['USER_OCC'] = $pr_data['user_occ'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Интересы
|
||||
*/
|
||||
case 'user_interests':
|
||||
$interests = isset($_POST['user_interests']) ? (string) $_POST['user_interests'] : $pr_data['user_interests'];
|
||||
$interests = htmlCHR($interests);
|
||||
if ($submit && $interests != $pr_data['user_interests'])
|
||||
{
|
||||
$pr_data['user_interests'] = $interests;
|
||||
$db_data['user_interests'] = (string) $interests;
|
||||
}
|
||||
$tp_data['USER_INTERESTS'] = $pr_data['user_interests'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Skype
|
||||
*/
|
||||
case 'user_skype':
|
||||
$skype = isset($_POST['user_skype']) ? (string) $_POST['user_skype'] : $pr_data['user_skype'];
|
||||
if ($submit && $skype != $pr_data['user_skype'])
|
||||
{
|
||||
if ($skype != '' && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $skype))
|
||||
{
|
||||
$errors[] = $lang['SKYPE_ERROR'];
|
||||
}
|
||||
$pr_data['user_skype'] = $skype;
|
||||
$db_data['user_skype'] = (string) $skype;
|
||||
}
|
||||
$tp_data['USER_SKYPE'] = $pr_data['user_skype'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Twitter
|
||||
*/
|
||||
case 'user_twitter':
|
||||
$twitter = isset($_POST['user_twitter']) ? (string) $_POST['user_twitter'] : $pr_data['user_twitter'];
|
||||
if ($submit && $twitter != $pr_data['user_twitter'])
|
||||
{
|
||||
if ($twitter != '' && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $twitter))
|
||||
{
|
||||
$errors[] = $lang['TWITTER_ERROR'];
|
||||
}
|
||||
$pr_data['user_twitter'] = $twitter;
|
||||
$db_data['user_twitter'] = (string) $twitter;
|
||||
}
|
||||
$tp_data['USER_TWITTER'] = $pr_data['user_twitter'];
|
||||
break;
|
||||
|
||||
/**
|
||||
* Выбор шаблона (edit)
|
||||
*/
|
||||
case 'tpl_name':
|
||||
$templates = isset($_POST['tpl_name']) ? (string) $_POST['tpl_name'] : $pr_data['tpl_name'];
|
||||
$templates = htmlCHR($templates);
|
||||
if ($submit && $templates != $pr_data['tpl_name'])
|
||||
{
|
||||
$pr_data['tpl_name'] = $bb_cfg['tpl_name'];
|
||||
$db_data['tpl_name'] = (string) $bb_cfg['tpl_name'];
|
||||
foreach ($bb_cfg['templates'] as $folder => $name)
|
||||
{
|
||||
if ($templates == $folder)
|
||||
{
|
||||
$pr_data['tpl_name'] = $templates;
|
||||
$db_data['tpl_name'] = (string) $templates;
|
||||
}
|
||||
}
|
||||
}
|
||||
$tp_data['TEMPLATES_SELECT'] = templates_select($pr_data['tpl_name'], 'tpl_name');
|
||||
break;
|
||||
|
||||
/**
|
||||
* default
|
||||
*/
|
||||
default:
|
||||
trigger_error("invalid profile field: $field", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
// submit
|
||||
if ($submit && !$errors)
|
||||
{
|
||||
/**
|
||||
* Создание нового профиля
|
||||
*/
|
||||
if ($mode == 'register')
|
||||
{
|
||||
if ($bb_cfg['reg_email_activation'])
|
||||
{
|
||||
$user_actkey = make_rand_str(12);
|
||||
$db_data['user_active'] = 0;
|
||||
$db_data['user_actkey'] = $user_actkey;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db_data['user_active'] = 1;
|
||||
$db_data['user_actkey'] = '';
|
||||
}
|
||||
$db_data['user_regdate'] = TIMENOW;
|
||||
|
||||
if (!IS_ADMIN) $db_data['user_reg_ip'] = USER_IP;
|
||||
|
||||
if (!isset($db_data['tpl_name'])) $db_data['tpl_name'] = (string) $bb_cfg['tpl_name'];
|
||||
|
||||
$sql_args = DB()->build_array('INSERT', $db_data);
|
||||
|
||||
DB()->query("INSERT INTO ". BB_USERS . $sql_args);
|
||||
$new_user_id = DB()->sql_nextid();
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
set_pr_die_append_msg($new_user_id);
|
||||
$message = $lang['ACCOUNT_ADDED'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($bb_cfg['reg_email_activation'])
|
||||
{
|
||||
$message = $lang['ACCOUNT_INACTIVE'];
|
||||
$email_template = 'user_welcome_inactive';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = $lang['ACCOUNT_ADDED'];
|
||||
$email_template = 'user_welcome';
|
||||
}
|
||||
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>");
|
||||
$emailer->email_address("$username <$email>");
|
||||
|
||||
$emailer->use_template($email_template, $user_lang);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $bb_cfg['sitename'],
|
||||
'WELCOME_MSG' => sprintf($lang['WELCOME_SUBJECT'], $bb_cfg['sitename']),
|
||||
'USERNAME' => html_entity_decode($username),
|
||||
'PASSWORD' => $new_pass,
|
||||
|
||||
'U_ACTIVATE' => make_url('profile.php?mode=activate&' . POST_USERS_URL . '=' . $new_user_id . '&act_key=' . $db_data['user_actkey'])
|
||||
));
|
||||
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
}
|
||||
|
||||
bb_die($message);
|
||||
}
|
||||
/**
|
||||
* Редактирование
|
||||
*/
|
||||
else
|
||||
{
|
||||
set_pr_die_append_msg($pr_data['user_id']);
|
||||
|
||||
// если что-то было изменено
|
||||
if ($db_data)
|
||||
{
|
||||
if (!$pr_data['user_active'])
|
||||
{
|
||||
$user_actkey = make_rand_str(12);
|
||||
$pr_data['user_actkey'] = $user_actkey;
|
||||
$db_data['user_actkey'] = $user_actkey;
|
||||
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>");
|
||||
$emailer->use_template('user_activate', $pr_data['user_lang']);
|
||||
$emailer->email_address("$username <$email>");
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $bb_cfg['sitename'],
|
||||
'USERNAME' => html_entity_decode($username),
|
||||
'U_ACTIVATE' => make_url("profile.php?mode=activate&u={$pr_data['user_id']}&act_key=$user_actkey"),
|
||||
));
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
$message = $lang['PROFILE_UPDATED_INACTIVE'];
|
||||
$user->session_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh('index.php' , 10);
|
||||
$message = $lang['PROFILE_UPDATED'];
|
||||
}
|
||||
|
||||
$sql_args = DB()->build_array('UPDATE', $db_data);
|
||||
|
||||
DB()->query("UPDATE ". BB_USERS ." SET $sql_args WHERE user_id = {$pr_data['user_id']} LIMIT 1");
|
||||
|
||||
if ($pr_data['user_id'] != $userdata['user_id'])
|
||||
{
|
||||
if ($pr_data['user_level'] == MOD && !empty($db_data['username']))
|
||||
{
|
||||
$datastore->update('moderators');
|
||||
}
|
||||
}
|
||||
|
||||
cache_rm_user_sessions ($pr_data['user_id']);
|
||||
|
||||
if($adm_edit)
|
||||
{
|
||||
bb_die($lang['PROFILE_USER'] . ' <b>'. profile_url($pr_data) .'</b> '. $lang['GOOD_UPDATE']);
|
||||
}
|
||||
elseif(!$pr_data['user_active'])
|
||||
{
|
||||
bb_die($lang['PROFILE_UPDATED_INACTIVE']);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh('index.php' , 10);
|
||||
bb_die($lang['PROFILE_UPDATED']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['NOTHING_HAS_CHANGED']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars($tp_data);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_TITLE' => ($mode == 'editprofile') ? $lang['EDIT_PROFILE'] . ($adm_edit ? " :: {$pr_data['username']}" : '') : $lang['REGISTER'],
|
||||
'SHOW_REG_AGREEMENT' => ($mode == 'register' && !IS_ADMIN),
|
||||
'ERROR_MESSAGE' => ($errors) ? join('<br />', array_unique($errors)) : '',
|
||||
'MODE' => $mode,
|
||||
'EDIT_PROFILE' => ($mode == 'editprofile'),
|
||||
'ADM_EDIT' => $adm_edit,
|
||||
'SHOW_PASS' => ($adm_edit || ($mode == 'register' && IS_ADMIN)),
|
||||
'CAPTCHA_HTML' => ($need_captcha) ? CAPTCHA()->get_html() : '',
|
||||
|
||||
'LANGUAGE_SELECT' => language_select($pr_data['user_lang'], 'user_lang'),
|
||||
'TIMEZONE_SELECT' => tz_select($pr_data['user_timezone'], 'user_timezone'),
|
||||
'USER_TIMEZONE' => $pr_data['user_timezone'],
|
||||
|
||||
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['avatars']['max_width'], $bb_cfg['avatars']['max_height'], (round($bb_cfg['avatars']['max_size'] / 1024))),
|
||||
'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'),
|
||||
'AVATAR_DIS_EXPLAIN' => sprintf($lang['AVATAR_DISABLE'], $bb_cfg['terms_and_conditions_url']),
|
||||
|
||||
'SIGNATURE_EXPLAIN' => sprintf($lang['SIGNATURE_EXPLAIN'], $bb_cfg['max_sig_chars']),
|
||||
'SIG_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_sig'),
|
||||
|
||||
'PR_USER_ID' => $pr_data['user_id'],
|
||||
'U_RESET_AUTOLOGIN' => LOGIN_URL . "?logout=1&reset_autologin=1&sid={$userdata['session_id']}",
|
||||
|
||||
'AVATAR_URL_PATH' => ($pr_data['avatar_ext_id']) ? get_avatar_path($pr_data['user_id'], $pr_data['avatar_ext_id']) : '',
|
||||
));
|
||||
|
||||
print_page('usercp_register.tpl');
|
87
library/includes/ucp/sendpasswd.php
Normal file
87
library/includes/ucp/sendpasswd.php
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
if (!defined('IN_FORUM')) die("Hacking attempt");
|
||||
|
||||
set_die_append_msg();
|
||||
|
||||
if ($bb_cfg['emailer_disabled']) bb_die($lang['EMAILER_DISABLED']);
|
||||
|
||||
$need_captcha = ($_GET['mode'] == 'sendpassword' && !IS_ADMIN);
|
||||
|
||||
if ( isset($_POST['submit']) )
|
||||
{
|
||||
if ($need_captcha && !CAPTCHA()->verify_code()) bb_die($lang['CONFIRM_CODE_WRONG']);
|
||||
$email = ( !empty($_POST['email']) ) ? trim(strip_tags(htmlspecialchars($_POST['email']))) : '';
|
||||
$sql = "SELECT *
|
||||
FROM " . BB_USERS . "
|
||||
WHERE user_email = '" . DB()->escape($email)."'";
|
||||
if ( $result = DB()->sql_query($sql) )
|
||||
{
|
||||
if ( $row = DB()->sql_fetchrow($result) )
|
||||
{
|
||||
if (!$row['user_active'])
|
||||
{
|
||||
bb_die($lang['NO_SEND_ACCOUNT_INACTIVE']);
|
||||
}
|
||||
if (in_array($row['user_level'], array(MOD, ADMIN)))
|
||||
{
|
||||
bb_die($lang['NO_SEND_ACCOUNT']);
|
||||
}
|
||||
|
||||
$username = $row['username'];
|
||||
$user_id = $row['user_id'];
|
||||
|
||||
$user_actkey = make_rand_str(12);
|
||||
$user_password = make_rand_str(8);
|
||||
|
||||
$sql = "UPDATE " . BB_USERS . "
|
||||
SET user_newpasswd = '$user_password', user_actkey = '$user_actkey'
|
||||
WHERE user_id = " . $row['user_id'];
|
||||
if (!DB()->sql_query($sql))
|
||||
{
|
||||
bb_die('Could not update new password information');
|
||||
}
|
||||
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>");
|
||||
$emailer->email_address("$username <{$row['user_email']}>");
|
||||
|
||||
$emailer->use_template('user_activate_passwd', $row['user_lang']);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $bb_cfg['sitename'],
|
||||
'USERNAME' => $username,
|
||||
'PASSWORD' => $user_password,
|
||||
'U_ACTIVATE' => make_url('profile.php?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
|
||||
));
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
bb_die($lang['PASSWORD_UPDATED']);
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die($lang['NO_EMAIL_MATCH']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bb_die('Could not obtain user information for sendpassword');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$email = $username = '';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'USERNAME' => $username,
|
||||
'EMAIL' => $email,
|
||||
'CAPTCHA_HTML' => ($need_captcha) ? CAPTCHA()->get_html() : '',
|
||||
'S_HIDDEN_FIELDS' => '',
|
||||
'S_PROFILE_ACTION' => "profile.php?mode=sendpassword",
|
||||
));
|
||||
|
||||
print_page('usercp_sendpasswd.tpl');
|
100
library/includes/ucp/topic_watch.php
Normal file
100
library/includes/ucp/topic_watch.php
Normal file
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
if (empty($bb_cfg['topic_notify_enabled']))
|
||||
{
|
||||
bb_die($lang['DISABLED']);
|
||||
}
|
||||
|
||||
$page_cfg['use_tablesorter'] = true;
|
||||
$page_cfg['include_bbcode_js'] = true;
|
||||
$tracking_topics = get_tracks('topic');
|
||||
|
||||
$user_id = $userdata['user_id'];
|
||||
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
|
||||
$per_page = $bb_cfg['topics_per_page'];
|
||||
|
||||
if (isset($_POST['topic_id_list']))
|
||||
{
|
||||
$topic_ids = implode(",", $_POST['topic_id_list']);
|
||||
$sql = "DELETE FROM ". BB_TOPICS_WATCH ." WHERE topic_id IN(". $topic_ids .") AND user_id = $user_id";
|
||||
if (!($result = DB() ->sql_query($sql)))
|
||||
{
|
||||
bb_die('Could not delete topic watch information #1');
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_TITLE' => $lang['WATCHED_TOPICS'],
|
||||
'S_FORM_ACTION' => BB_ROOT .'profile.php?mode=watch',
|
||||
));
|
||||
|
||||
$sql = "SELECT COUNT(topic_id) as watch_count FROM ". BB_TOPICS_WATCH ." WHERE user_id = $user_id";
|
||||
if ( !($result = DB() ->sql_query($sql)) )
|
||||
{
|
||||
bb_die('Could not obtain watch topic information #2');
|
||||
}
|
||||
$row = DB() ->sql_fetchrow($result);
|
||||
$watch_count = ( $row['watch_count'] ) ? $row['watch_count'] : 0;
|
||||
DB() ->sql_freeresult($result);
|
||||
|
||||
if ($watch_count > 0)
|
||||
{
|
||||
$sql = "SELECT w.*, t.*, f.*, u.*, u2.username as last_username, u2.user_id as last_user_id,
|
||||
u2.user_level as last_user_level, u2.user_rank as last_user_rank
|
||||
FROM ". BB_TOPICS_WATCH ." w, ". BB_TOPICS ." t, ". BB_USERS ." u, ". BB_FORUMS ." f, ". BB_POSTS ." p, " . BB_USERS . " u2
|
||||
WHERE w.topic_id = t.topic_id
|
||||
AND t.forum_id = f.forum_id
|
||||
AND p.post_id = t.topic_last_post_id
|
||||
AND p.poster_id = u2.user_id
|
||||
AND t.topic_poster = u.user_id
|
||||
AND w.user_id = $user_id
|
||||
GROUP BY t.topic_last_post_time DESC
|
||||
LIMIT $start, $per_page";
|
||||
if (!($result = DB() ->sql_query($sql)))
|
||||
{
|
||||
bb_die('Could not obtain watch topic information #3');
|
||||
}
|
||||
$watch = DB() ->sql_fetchrowset($result);
|
||||
|
||||
if ($watch)
|
||||
{
|
||||
for ( $i = 0; $i < count($watch); $i++ )
|
||||
{
|
||||
$is_unread = is_unread($watch[$i]['topic_last_post_time'], $watch[$i]['topic_id'], $watch[$i]['forum_id']);
|
||||
|
||||
$template->assign_block_vars('watch', array(
|
||||
'ROW_CLASS' => ( !($i % 2) ) ? 'row1' : 'row2',
|
||||
'POST_ID' => $watch[$i]['topic_first_post_id'],
|
||||
'TOPIC_ID' => $watch[$i]['topic_id'],
|
||||
'TOPIC_TITLE' => wbr(str_short($watch[$i]['topic_title'], 70)),
|
||||
'FULL_TOPIC_TITLE' => wbr($watch[$i]['topic_title']),
|
||||
'U_TOPIC' => TOPIC_URL . $watch[$i]['topic_id'],
|
||||
'FORUM_TITLE' => wbr($watch[$i]['forum_name']),
|
||||
'U_FORUM' => FORUM_URL . $watch[$i]['forum_id'],
|
||||
'REPLIES' => $watch[$i]['topic_replies'],
|
||||
'AUTHOR' => profile_url($watch[$i]),
|
||||
'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) .'<br />'. profile_url(array('user_id' => $watch[$i]['last_user_id'], 'username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank'])),
|
||||
'LAST_POST_ID' => $watch[$i]['topic_last_post_id'],
|
||||
'IS_UNREAD' => $is_unread,
|
||||
'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread),
|
||||
'PAGINATION' => ($watch[$i]['topic_status'] == TOPIC_MOVED) ? '' : build_topic_pagination(TOPIC_URL . $watch[$i]['topic_id'], $watch[$i]['topic_replies'], $bb_cfg['posts_per_page']),
|
||||
));
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MATCHES' => (count($watch) == 1) ? sprintf($lang['FOUND_SEARCH_MATCH'], count($watch)) : sprintf($lang['FOUND_SEARCH_MATCHES'], count($watch)),
|
||||
'PAGINATION' => generate_pagination(BB_ROOT .'profile.php?mode=watch', $watch_count, $per_page, $start),
|
||||
'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], ( floor( $start / $per_page ) + 1 ), ceil( $watch_count / $per_page )),
|
||||
'U_PER_PAGE' => BB_ROOT .'profile.php?mode=watch',
|
||||
'PER_PAGE' => $per_page,
|
||||
));
|
||||
}
|
||||
DB() ->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(BB_ROOT, '3');
|
||||
bb_die($lang['NO_WATCHED_TOPICS']);
|
||||
}
|
||||
|
||||
print_page('usercp_topic_watch.tpl');
|
223
library/includes/ucp/viewprofile.php
Normal file
223
library/includes/ucp/viewprofile.php
Normal file
|
@ -0,0 +1,223 @@
|
|||
<?php
|
||||
|
||||
if (!defined('BB_ROOT')) die(basename(__FILE__));
|
||||
|
||||
require(INC_DIR .'bbcode.php');
|
||||
|
||||
$datastore->enqueue(array(
|
||||
'ranks',
|
||||
));
|
||||
|
||||
if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == GUEST_UID)
|
||||
{
|
||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
}
|
||||
if (!$profiledata = get_userdata($_GET[POST_USERS_URL]))
|
||||
{
|
||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
}
|
||||
|
||||
if (!$userdata['session_logged_in'])
|
||||
{
|
||||
redirect(LOGIN_URL . "?redirect={$_SERVER['REQUEST_URI']}");
|
||||
}
|
||||
|
||||
if (!$ranks = $datastore->get('ranks'))
|
||||
{
|
||||
$datastore->update('ranks');
|
||||
$ranks = $datastore->get('ranks');
|
||||
}
|
||||
|
||||
$poster_rank = $rank_image= $rank_style = $rank_select = '';
|
||||
if ($user_rank = $profiledata['user_rank'] AND isset($ranks[$user_rank]))
|
||||
{
|
||||
$rank_image = ($ranks[$user_rank]['rank_image']) ? '<img src="'. $ranks[$user_rank]['rank_image'] .'" alt="" title="" border="0" />' : '';
|
||||
$poster_rank = $ranks[$user_rank]['rank_title'];
|
||||
$rank_style = $ranks[$user_rank]['rank_style'];
|
||||
}
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
$rank_select = array($lang['NONE'] => 0);
|
||||
foreach ($ranks as $row)
|
||||
{
|
||||
$rank_select[$row['rank_title']] = $row['rank_id'];
|
||||
}
|
||||
$rank_select = build_select('rank-sel', $rank_select, $user_rank);
|
||||
}
|
||||
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'user_viewemail') || $profiledata['user_id'] == $userdata['user_id'] || IS_AM)
|
||||
{
|
||||
$email_uri = ($bb_cfg['board_email_form']) ? 'profile.php?mode=email&'. POST_USERS_URL .'='. $profiledata['user_id'] : 'mailto:'. $profiledata['user_email'];
|
||||
$email = '<a class="editable" href="'. $email_uri .'">'. $profiledata['user_email'] .'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$email = '';
|
||||
}
|
||||
|
||||
//
|
||||
// Generate page
|
||||
//
|
||||
|
||||
$profile_user_id = ($profiledata['user_id'] == $userdata['user_id']);
|
||||
|
||||
$signature = ($bb_cfg['allow_sig'] && $profiledata['user_sig']) ? $profiledata['user_sig'] : '';
|
||||
|
||||
if(bf($profiledata['user_opt'], 'user_opt', 'dis_sig'))
|
||||
{
|
||||
if($profile_user_id)
|
||||
{
|
||||
$signature = $lang['SIGNATURE_DISABLE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$signature = '';
|
||||
}
|
||||
}
|
||||
else if ($signature)
|
||||
{
|
||||
$signature = bbcode2html($signature);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
|
||||
'USERNAME' => $profiledata['username'],
|
||||
'PROFILE_USER_ID' => $profiledata['user_id'],
|
||||
'PROFILE_USER' => $profile_user_id,
|
||||
'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', false),
|
||||
'POSTER_RANK' => ($poster_rank) ? "<span class=\"$rank_style\">". $poster_rank ."</span>" : $lang['USER'],
|
||||
'RANK_IMAGE' => $rank_image,
|
||||
'RANK_SELECT' => $rank_select,
|
||||
'POSTS' => $profiledata['user_posts'],
|
||||
'PM' => '<a href="' . PM_URL . '?mode=post&'. POST_USERS_URL .'='. $profiledata['user_id'] .'">'. $lang['SEND_PRIVATE_MESSAGE'] .'</a>',
|
||||
'EMAIL' => $email,
|
||||
'WWW' => $profiledata['user_website'],
|
||||
'ICQ' => $profiledata['user_icq'],
|
||||
'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', false) : $lang['NEVER'],
|
||||
'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', false) : $lang['NEVER'],
|
||||
|
||||
'USER_ACTIVE' => $profiledata['user_active'],
|
||||
'LOCATION' => $profiledata['user_from'],
|
||||
'OCCUPATION' => $profiledata['user_occ'],
|
||||
'INTERESTS' => $profiledata['user_interests'],
|
||||
'SKYPE' => $profiledata['user_skype'],
|
||||
'TWITTER' => $profiledata['user_twitter'],
|
||||
'USER_POINTS' => $profiledata['user_points'],
|
||||
'GENDER' => ($bb_cfg['gender']) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '',
|
||||
'BIRTHDAY' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? $profiledata['user_birthday'] : '',
|
||||
'AGE' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? birthday_age($profiledata['user_birthday']) : '',
|
||||
|
||||
'L_VIEWING_PROFILE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
|
||||
'L_MY_PROFILE' => sprintf($lang['VIEWING_MY_PROFILE'], 'profile.php?mode=editprofile'),
|
||||
|
||||
'U_SEARCH_USER' => "search.php?search_author=1&uid={$profiledata['user_id']}",
|
||||
'U_SEARCH_TOPICS' => "search.php?uid={$profiledata['user_id']}&myt=1",
|
||||
'U_SEARCH_RELEASES' => "tracker.php?rid={$profiledata['user_id']}#results",
|
||||
|
||||
'AVATAR_IMG' => get_avatar($profiledata['user_id'], $profiledata['avatar_ext_id'], !bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')),
|
||||
|
||||
'SIGNATURE' => $signature,
|
||||
'SHOW_PASSKEY' => (IS_ADMIN || $profile_user_id),
|
||||
'SHOW_ROLE' => (IS_AM || $profile_user_id || $profiledata['user_active']),
|
||||
'GROUP_MEMBERSHIP' => false,
|
||||
'TRAF_STATS' => !(IS_AM || $profile_user_id),
|
||||
));
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
$group_membership = array();
|
||||
$sql = "
|
||||
SELECT COUNT(g.group_id) AS groups_cnt, g.group_single_user, ug.user_pending
|
||||
FROM ". BB_USER_GROUP ." ug
|
||||
LEFT JOIN ". BB_GROUPS ." g USING(group_id)
|
||||
WHERE ug.user_id = {$profiledata['user_id']}
|
||||
GROUP BY ug.user_id, g.group_single_user, ug.user_pending
|
||||
ORDER BY NULL
|
||||
";
|
||||
if ($rowset = DB()->fetch_rowset($sql))
|
||||
{
|
||||
$member = $pending = $single = 0;
|
||||
foreach ($rowset as $row)
|
||||
{
|
||||
if (!$row['group_single_user'] && !$row['user_pending'])
|
||||
{
|
||||
$member = $row['groups_cnt'];
|
||||
}
|
||||
else if (!$row['group_single_user'] && $row['user_pending'])
|
||||
{
|
||||
$pending = $row['groups_cnt'];
|
||||
}
|
||||
else if ($row['group_single_user'])
|
||||
{
|
||||
$single = $row['groups_cnt'];
|
||||
}
|
||||
}
|
||||
if ($member) $group_membership[] = $lang['PARTY'] ." <b>$member</b>";
|
||||
if ($pending) $group_membership[] = $lang['CANDIDATE'] ." <b>$pending</b>";
|
||||
if ($single) $group_membership[] = $lang['INDIVIDUAL'];
|
||||
$group_membership = join(', ', $group_membership);
|
||||
}
|
||||
$template->assign_vars(array(
|
||||
'GROUP_MEMBERSHIP' => (bool) $group_membership,
|
||||
'GROUP_MEMBERSHIP_TXT' => $group_membership,
|
||||
));
|
||||
}
|
||||
else if (IS_MOD)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'SHOW_GROUP_MEMBERSHIP' => ($profiledata['user_level'] != USER),
|
||||
));
|
||||
}
|
||||
|
||||
// Show users torrent-profile
|
||||
if (IS_AM || $profile_user_id || !bf($profiledata['user_opt'], 'user_opt', 'user_dls'))
|
||||
{
|
||||
require(UCP_DIR .'viewtorrent.php');
|
||||
}
|
||||
|
||||
// Ajax bt_userdata
|
||||
if (IS_AM || $profile_user_id)
|
||||
{
|
||||
show_bt_userdata($profiledata['user_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'DOWN_TOTAL_BYTES' => false,
|
||||
'MIN_DL_BYTES' => false,
|
||||
));
|
||||
}
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
$ajax_user_opt = bb_json_encode(array(
|
||||
'dis_avatar' => bf($profiledata['user_opt'], 'user_opt', 'dis_avatar'),
|
||||
'dis_sig' => bf($profiledata['user_opt'], 'user_opt', 'dis_sig'),
|
||||
'dis_passkey' => bf($profiledata['user_opt'], 'user_opt', 'dis_passkey'),
|
||||
'dis_pm' => bf($profiledata['user_opt'], 'user_opt', 'dis_pm'),
|
||||
'dis_post' => bf($profiledata['user_opt'], 'user_opt', 'dis_post'),
|
||||
'dis_post_edit' => bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit'),
|
||||
'dis_topic' => bf($profiledata['user_opt'], 'user_opt', 'dis_topic'),
|
||||
));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'EDITABLE_TPLS' => true,
|
||||
'AJAX_USER_OPT' => $ajax_user_opt,
|
||||
'U_MANAGE' => "profile.php?mode=editprofile&u={$profiledata['user_id']}",
|
||||
'U_PERMISSIONS' => "admin/admin_ug_auth.php?mode=user&u={$profiledata['user_id']}",
|
||||
));
|
||||
}
|
||||
|
||||
$user_restrictions = array();
|
||||
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')) $user_restrictions[] = $lang['HIDE_AVATARS'];
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) $user_restrictions[] = $lang['SHOW_CAPTION'];
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_passkey')) $user_restrictions[] = $lang['DOWNLOAD_TORRENT'];
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_pm')) $user_restrictions[] = $lang['SEND_PM'];
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_post')) $user_restrictions[] = $lang['SEND_MESSAGE'];
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit')) $user_restrictions[] = $lang['EDIT_POST'];
|
||||
if (bf($profiledata['user_opt'], 'user_opt', 'dis_topic')) $user_restrictions[] = $lang['NEW_THREADS'];
|
||||
|
||||
$template->assign_var('USER_RESTRICTIONS', join('</li><li>', $user_restrictions));
|
||||
|
||||
print_page('usercp_viewprofile.tpl');
|
123
library/includes/ucp/viewtorrent.php
Normal file
123
library/includes/ucp/viewtorrent.php
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
|
||||
if (!defined('IN_PROFILE')) die(basename(__FILE__));
|
||||
|
||||
$releasing = $seeding = $leeching = array();
|
||||
$releasing_count = $seeding_count = $leeching_count = 0;
|
||||
|
||||
// Auth
|
||||
$excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW);
|
||||
$not_auth_forums_sql = ($excluded_forums_csv) ? "
|
||||
AND f.forum_id NOT IN($excluded_forums_csv)
|
||||
AND f.forum_parent NOT IN($excluded_forums_csv)
|
||||
" : '';
|
||||
|
||||
$sql = DB()->fetch_rowset("
|
||||
SELECT
|
||||
f.forum_id, f.forum_name, t.topic_title,
|
||||
tor.tor_type, tor.size,
|
||||
sn.seeders, sn.leechers, tr.*
|
||||
FROM ". BB_FORUMS ." f, ". BB_TOPICS ." t, ". BB_BT_TRACKER ." tr, ". BB_BT_TORRENTS ." tor, ". BB_BT_TRACKER_SNAP ." sn
|
||||
WHERE tr.user_id = {$profiledata['user_id']}
|
||||
AND tr.topic_id = tor.topic_id
|
||||
AND sn.topic_id = tor.topic_id
|
||||
AND tor.topic_id = t.topic_id
|
||||
AND t.forum_id = f.forum_id
|
||||
$not_auth_forums_sql
|
||||
GROUP BY tr.topic_id
|
||||
ORDER BY f.forum_name, t.topic_title
|
||||
");
|
||||
|
||||
foreach ($sql as $rowset)
|
||||
{
|
||||
if ($rowset['releaser'])
|
||||
{
|
||||
$releasing[] = $rowset;
|
||||
}
|
||||
elseif ($rowset['seeder'])
|
||||
{
|
||||
$seeding[] = $rowset;
|
||||
}
|
||||
else
|
||||
{
|
||||
$leeching[] = $rowset;
|
||||
}
|
||||
}
|
||||
|
||||
if ($releasing)
|
||||
{
|
||||
foreach ($releasing as $i => $row)
|
||||
{
|
||||
$topic_title = wbr($row['topic_title']);
|
||||
|
||||
$template->assign_block_vars('released', array(
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
'FORUM_NAME' => htmlCHR($row['forum_name']),
|
||||
'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "<s>$topic_title</s>",
|
||||
'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
|
||||
'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
|
||||
'TOR_TYPE' => is_gold($row['tor_type']),
|
||||
'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
|
||||
'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
|
||||
'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') .'/s' : '-',
|
||||
));
|
||||
|
||||
$releasing_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($seeding)
|
||||
{
|
||||
foreach ($seeding as $i => $row)
|
||||
{
|
||||
$topic_title = wbr($row['topic_title']);
|
||||
|
||||
$template->assign_block_vars('seed', array(
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
'FORUM_NAME' => htmlCHR($row['forum_name']),
|
||||
'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "<s>$topic_title</s>",
|
||||
'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
|
||||
'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
|
||||
'TOR_TYPE' => is_gold($row['tor_type']),
|
||||
'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
|
||||
'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
|
||||
'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') .'/s' : '-',
|
||||
));
|
||||
|
||||
$seeding_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($leeching)
|
||||
{
|
||||
foreach ($leeching as $i => $row)
|
||||
{
|
||||
$compl_size = ($row['remain'] && $row['size'] && $row['size'] > $row['remain']) ? ($row['size'] - $row['remain']) : 0;
|
||||
$compl_perc = ($compl_size) ? floor($compl_size * 100 / $row['size']) : 0;
|
||||
$topic_title = wbr($row['topic_title']);
|
||||
|
||||
$template->assign_block_vars('leech', array(
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
'FORUM_NAME' => htmlCHR($row['forum_name']),
|
||||
'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "<s>$topic_title</s>",
|
||||
'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
|
||||
'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
|
||||
'COMPL_PERC' => $compl_perc,
|
||||
'TOR_TYPE' => is_gold($row['tor_type']),
|
||||
'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
|
||||
'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
|
||||
'SPEED_DOWN' => ($row['speed_down']) ? humn_size($row['speed_down'], 0, 'KB') .'/s' : '-',
|
||||
));
|
||||
|
||||
$leeching_count++;
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'SHOW_SEARCH_DL' => IS_AM || $profile_user_id,
|
||||
'USERNAME' => $profiledata['username'],
|
||||
'L_RELEASINGS' => "{$lang['RELEASING']}: ". (($releasing_count) ? "<b>$releasing_count</b>" : '0'),
|
||||
'L_SEEDINGS' => "{$lang['SEEDING']}: ". (($seeding_count) ? "<b>$seeding_count</b>" : '0'),
|
||||
'L_LEECHINGS' => "{$lang['LEECHING']}: ". (($leeching_count) ? "<b>$leeching_count</b>" : '0'),
|
||||
'USER_DLS' => $releasing_count || $seeding_count || $leeching_count,
|
||||
));
|
Loading…
Add table
Add a link
Reference in a new issue