mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r57
мелкие фиксы редактирование данных пользователя на ajax фикс при отключении системы нарушений git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@57 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
d4afc2caf1
commit
aa3a824c58
22 changed files with 118 additions and 217 deletions
|
@ -104,8 +104,6 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
|
|||
$user_lang = ( $_POST['language'] != $bb_cfg['board_lang'] ) ? $_POST['language'] : '';
|
||||
$user_timezone = ( isset($_POST['timezone']) ) ? str_replace(',', '.', doubleval($_POST['timezone'])) : $bb_cfg['board_timezone'];
|
||||
|
||||
$user_flag = (@$_POST['user_flag'] && $_POST['user_flag'] != 'blank.gif') ? $_POST['user_flag'] : '';
|
||||
|
||||
$user_template = ( @$_POST['template'] ) ? $_POST['template'] : @$bb_cfg['board_template'];
|
||||
$user_dateformat = (!empty($_POST['dateformat']) && $_POST['dateformat'] != $bb_cfg['board_dateformat']) ? $_POST['dateformat'] : '';
|
||||
|
||||
|
@ -514,7 +512,6 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
|
|||
user_website = '" . str_replace("\'", "''", $website) . "',
|
||||
user_occ = '" . str_replace("\'", "''", $occupation) . "',
|
||||
user_from = '" . str_replace("\'", "''", $location) . "',
|
||||
user_from_flag = '$user_flag',
|
||||
user_interests = '" . str_replace("\'", "''", $interests) . "',
|
||||
user_sig = '" . str_replace("\'", "''", $signature) . "',
|
||||
user_opt = $user_opt,
|
||||
|
@ -619,7 +616,6 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
|
|||
|
||||
$website = htmlspecialchars($this_userdata['user_website']);
|
||||
$location = htmlspecialchars($this_userdata['user_from']);
|
||||
$user_flag = htmlspecialchars($this_userdata['user_from_flag']);
|
||||
|
||||
$occupation = htmlspecialchars($this_userdata['user_occ']);
|
||||
$interests = htmlspecialchars($this_userdata['user_interests']);
|
||||
|
@ -732,10 +728,6 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
|
|||
$s_hidden_fields .= '<input type="hidden" name="website" value="' . str_replace("\"", """, $website) . '" />';
|
||||
$s_hidden_fields .= '<input type="hidden" name="location" value="' . str_replace("\"", """, $location) . '" />';
|
||||
|
||||
// FLAGHACK-start
|
||||
$s_hidden_fields .= '<input type="hidden" name="user_flag" value="' . $user_flag . '" />';
|
||||
// FLAGHACK-end
|
||||
|
||||
$s_hidden_fields .= '<input type="hidden" name="occupation" value="' . str_replace("\"", """, $occupation) . '" />';
|
||||
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", """, $interests) . '" />';
|
||||
$s_hidden_fields .= '<input type="hidden" name="signature" value="' . str_replace("\"", """, $signature) . '" />';
|
||||
|
@ -820,42 +812,6 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
|
|||
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
|
||||
$form_enctype = ( !@$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$bb_cfg['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
|
||||
|
||||
// query to get the list of flags
|
||||
$sql = "SELECT *
|
||||
FROM " . BB_COUNTRIES . "
|
||||
ORDER BY country_id";
|
||||
if(!$flags_result = DB()->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$flag_row = DB()->sql_fetchrowset($flags_result);
|
||||
$num_flags = DB()->num_rows($flags_result);
|
||||
|
||||
// build the html select statement
|
||||
if(!defined('COUNTRIES_LANG'))
|
||||
{
|
||||
include(LANG_DIR . "lang_countries.php");
|
||||
}
|
||||
|
||||
$flag_start_image = 'blank.gif' ;
|
||||
$selected = ( isset($user_flag) ) ? '' : HTML_SELECTED;
|
||||
$flag_select = "<select name=\"user_flag\" onChange=\"document.images['user_flag'].src = '../images/flags/' + this.value + '.png';\" >";
|
||||
$flag_select .= "<option value=\"blank.gif\"$selected>" . $lang['SELECT_COUNTRY'] . "</option>";
|
||||
|
||||
for ($i = 0; $i < $num_flags; $i++)
|
||||
{
|
||||
$country_code = $flag_row[$i]['country_code'];
|
||||
$country_name = $lang['COUNTRIES'][$country_code];
|
||||
$flag_image = $country_code . '.png';
|
||||
$selected = ( isset( $user_flag) ) ? (($user_flag == $country_code) ? HTML_SELECTED : '' ) : '' ;
|
||||
$flag_select .= "\t<option value=\"$country_code\"$selected>$country_name</option>";
|
||||
if ( isset( $user_flag) && ($user_flag == $country_code))
|
||||
{
|
||||
$flag_start_image = $flag_image ;
|
||||
}
|
||||
}
|
||||
$flag_select .= '</select>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TPL_ADMIN_USER_EDIT' => true,
|
||||
|
||||
|
@ -865,9 +821,6 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
|
|||
'OCCUPATION' => $occupation,
|
||||
'INTERESTS' => $interests,
|
||||
'LOCATION' => $location,
|
||||
'L_FLAG' => $lang['COUNTRY_FLAG'],
|
||||
'FLAG_SELECT' => $flag_select,
|
||||
'FLAG_START' => $flag_start_image,
|
||||
|
||||
'WEBSITE' => $website,
|
||||
'SIGNATURE' => str_replace('<br />', "\n", $signature),
|
||||
|
|
|
@ -174,6 +174,11 @@ $template->assign_vars(array(
|
|||
|
||||
if(!defined('NO_XS_HEADER'))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'xs_header' => XS_TPL_PATH . 'xs_header.tpl',
|
||||
'xs_footer' => XS_TPL_PATH . 'xs_footer.tpl',
|
||||
));
|
||||
|
||||
$template->preparse = 'xs_header';
|
||||
$template->postparse = 'xs_footer';
|
||||
$template->assign_block_vars('nav_left',array('ITEM' => '<a href="' . append_sid('xs_index.php') . '">' . $lang['XS_MENU'] . '</a>'));
|
||||
|
|
|
@ -55,6 +55,7 @@ class ajax_common
|
|||
var $valid_actions = array(
|
||||
// ACTION NAME AJAX_AUTH
|
||||
'edit_user_profile' => array('admin'),
|
||||
'change_user_rank' => array('admin'),
|
||||
|
||||
'change_torrent' => array('mod'),
|
||||
'change_tor_status' => array('mod'),
|
||||
|
@ -279,6 +280,27 @@ class ajax_common
|
|||
require(AJAX_DIR .'edit_user_profile.php');
|
||||
}
|
||||
|
||||
function change_user_rank ()
|
||||
{
|
||||
global $datastore;
|
||||
|
||||
$ranks = $datastore->get('ranks');
|
||||
$rank_id = intval($this->request['rank_id']);
|
||||
|
||||
if (!$user_id = intval($this->request['user_id']) OR !$profiledata = get_userdata($user_id))
|
||||
{
|
||||
$this->ajax_die("invalid user_id: $user_id");
|
||||
}
|
||||
if ($rank_id != 0 && !isset($ranks[$rank_id]))
|
||||
{
|
||||
$this->ajax_die("invalid rank_id: $rank_id");
|
||||
}
|
||||
|
||||
DB()->query("UPDATE ". BB_USERS ." SET user_rank = $rank_id WHERE user_id = $user_id LIMIT 1");
|
||||
|
||||
$this->response['html'] = ($rank_id != 0) ? 'Присвоено звание <b>'. $ranks[$rank_id]['rank_title'] .'</b>' : 'Звание снято';
|
||||
}
|
||||
|
||||
function gen_passkey ()
|
||||
{
|
||||
global $userdata, $lang;
|
||||
|
@ -287,15 +309,20 @@ class ajax_common
|
|||
|
||||
if ($req_uid == $userdata['user_id'] || IS_ADMIN)
|
||||
{
|
||||
$force_generate = (IS_ADMIN);
|
||||
if (empty($this->request['confirmed']))
|
||||
{
|
||||
$msg = "Вы уверены, что хотите создать новый passkey?";
|
||||
$this->prompt_for_confirm($msg);
|
||||
}
|
||||
|
||||
if (!$passkey = generate_passkey($req_uid, $force_generate))
|
||||
if (!$passkey = generate_passkey($req_uid, IS_ADMIN))
|
||||
{
|
||||
$this->ajax_die('Could not insert passkey');
|
||||
}
|
||||
tracker_rm_user($req_uid);
|
||||
$this->response['passkey'] = $passkey;
|
||||
}
|
||||
else $this->ajax_die($lang['NOT_AUTHORISED']);
|
||||
}
|
||||
|
||||
function view_post ()
|
||||
|
|
|
@ -18,6 +18,34 @@ $value = (string) $this->request['value'];
|
|||
|
||||
switch ($field)
|
||||
{
|
||||
case 'username':
|
||||
require_once(INC_DIR .'functions_validate.php');
|
||||
$value = clean_username($value);
|
||||
if ($err = validate_username($value))
|
||||
{
|
||||
$this->ajax_die(strip_tags($err));
|
||||
}
|
||||
$this->response['new_value'] = $this->request['value'];
|
||||
break;
|
||||
|
||||
case 'user_email':
|
||||
require_once(INC_DIR .'functions_validate.php');
|
||||
$value = htmlCHR($value);
|
||||
if ($err = validate_email($value))
|
||||
{
|
||||
$this->ajax_die($err);
|
||||
}
|
||||
$this->response['new_value'] = $this->request['value'];
|
||||
break;
|
||||
|
||||
case 'user_website':
|
||||
if ($value == '' || preg_match('#^https?://[a-z0-9_:;?&=/.%~\-]+$#i', $value))
|
||||
{
|
||||
$this->response['new_value'] = htmlCHR($value);
|
||||
}
|
||||
else $this->ajax_die('Ïîëå "Ñàéò" ìîæåò ñîäåðæàòü òîëüêî http:// ññûëêó');
|
||||
break;
|
||||
|
||||
case 'user_regdate':
|
||||
case 'user_lastvisit':
|
||||
$tz = TIMENOW + (3600 * $bb_cfg['board_timezone']);
|
||||
|
|
|
@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1;
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.0.2';
|
||||
$bb_cfg['tp_release_state'] = 'TP II r56';
|
||||
$bb_cfg['tp_release_state'] = 'TP II r57';
|
||||
$bb_cfg['tp_release_date'] = '02-07-2011';
|
||||
|
||||
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
||||
|
@ -428,7 +428,6 @@ $bb_cfg['show_rank_image'] = true;
|
|||
$bb_cfg['show_poster_joined'] = true;
|
||||
$bb_cfg['show_poster_posts'] = true;
|
||||
$bb_cfg['show_poster_from'] = true;
|
||||
$bb_cfg['show_poster_flag'] = true;
|
||||
$bb_cfg['show_bot_nick'] = false;
|
||||
$bb_cfg['text_buttons'] = true; // replace EDIT, QUOTE... images with text links
|
||||
$bb_cfg['parse_ed2k_links'] = true; // make ed2k links clickable
|
||||
|
|
|
@ -448,18 +448,18 @@ function extract_search_words ($text)
|
|||
$min_word_len = max(2, $bb_cfg['search_min_word_len'] - 1);
|
||||
$max_word_len = $bb_cfg['search_max_word_len'];
|
||||
|
||||
$text = ' ' . str_compact(strip_tags(strtolower($text))) . ' ';
|
||||
$text = ' ' . str_compact(strip_tags(mb_strtolower($text))) . ' ';
|
||||
$text = str_replace(array('[', ']'), array('[', ']'), $text);
|
||||
|
||||
// HTML entities like
|
||||
$text = preg_replace('/(\w*?)&#?[0-9a-z]+;(\w*?)/i', '', $text);
|
||||
// Remove URL's
|
||||
$text = preg_replace('#\b[a-z0-9]+://[0-9a-z\.\-]+(/[0-9a-z\?\.%_\-\+=&/]+)?#', ' ', $text);
|
||||
$text = preg_replace('/(\w*?)&#?[0-9a-z]+;(\w*?)/iu', '', $text);
|
||||
// Remove URL's ((www|ftp)\.[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]*?)
|
||||
$text = preg_replace('#\b[a-z0-9]+://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+(/[0-9a-z\?\.%_\-\+=&/]+)?#u', ' ', $text);
|
||||
|
||||
$text = strip_bbcode($text);
|
||||
|
||||
// Filter out characters like ^, $, &, change "it's" to "its"
|
||||
$text = preg_replace('#\W#', ' ', $text);
|
||||
$text = preg_replace('#[.,:;]#u', ' ', $text);
|
||||
|
||||
// short & long words
|
||||
$text = preg_replace('#(?<=^|\s)(\S{1,'.$min_word_len.'}|\S{'.$max_word_len.',}|\W*)(?=$|\s)#', ' ', $text);
|
||||
|
|
|
@ -1759,19 +1759,6 @@ function make_jumpbox ($selected = 0)
|
|||
));
|
||||
}
|
||||
|
||||
function make_user_flag($country_code)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if(!defined('COUNTRIES_LANG'))
|
||||
{
|
||||
include(LANG_DIR . "lang_countries.php");
|
||||
}
|
||||
|
||||
$title = $lang['COUNTRIES'][$country_code];
|
||||
return "<img src=\"images/flags/{$country_code}.png\" alt=\"{$title}\" title=\"{$title}\" border=\"0\" /><br />";
|
||||
}
|
||||
|
||||
// $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode'
|
||||
function get_forum_select ($mode = 'guest', $name = POST_FORUM_URL, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '', $all_forums_option = null)
|
||||
{
|
||||
|
|
|
@ -106,6 +106,8 @@ function report_modules($mode = 'all', $module = null)
|
|||
static $modules;
|
||||
static $module_names;
|
||||
|
||||
if(!$bb_cfg['reports_enabled']) return false;
|
||||
|
||||
if (!isset($modules))
|
||||
{
|
||||
include(INC_DIR . "report_module.php");
|
||||
|
|
|
@ -365,7 +365,6 @@ define('BB_BT_TORSTAT', 'bb_bt_torstat');
|
|||
define('BB_CATEGORIES', 'bb_categories');
|
||||
define('BB_CAPTCHA', 'bb_captcha');
|
||||
define('BB_CONFIG', 'bb_config');
|
||||
define('BB_COUNTRIES', 'bb_countries');
|
||||
define('BB_CRON', 'bb_cron');
|
||||
define('BB_DATASTORE', 'bb_datastore');
|
||||
define('BB_DISALLOW', 'bb_disallow');
|
||||
|
|
|
@ -20,7 +20,6 @@ class user_common
|
|||
*/
|
||||
var $opt_js = array(
|
||||
'only_new' => 0, // show ony new posts or topics
|
||||
'h_flag' => 0, // hide flags
|
||||
'h_av' => 0, // hide avatar
|
||||
'h_rnk_i' => 0, // hide rank images
|
||||
'h_post_i' => 0, // hide post images
|
||||
|
@ -231,7 +230,7 @@ class user_common
|
|||
$login = (int) ($this->data['user_id'] != ANONYMOUS);
|
||||
$is_user = ($this->data['user_level'] == USER);
|
||||
$user_id = (int) $this->data['user_id'];
|
||||
$mod_admin_session = ($login && !$auto_created && !$is_user) ? $this->data['user_level'] : 0;
|
||||
$mod_admin_session = ($this->data['user_level'] == ADMIN);
|
||||
|
||||
if (($bb_cfg['max_srv_load'] || $bb_cfg['max_reg_users_online']) && $login && $is_user && !$this->data['ignore_srv_load'])
|
||||
{
|
||||
|
|
|
@ -296,97 +296,3 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
|
|||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function display_avatar_gallery($mode, $category, $user_id, $email, $current_email, $username, $email, $new_password, $cur_password, $password_confirm, $icq, $website, $location, $user_flag, $occupation, $interests, $signature, $viewemail, $notifypm, $notifyreply, $attachsig, $hideonline, $style, $language, $timezone, $dateformat, &$session_id)
|
||||
{
|
||||
global $bb_cfg, $template, $lang, $images, $theme;
|
||||
|
||||
$dir = @opendir($bb_cfg['avatar_gallery_path']);
|
||||
|
||||
$avatar_images = array();
|
||||
while( $file = @readdir($dir) )
|
||||
{
|
||||
if( $file != '.' && $file != '..' && !is_file($bb_cfg['avatar_gallery_path'] . '/' . $file) && !is_link($bb_cfg['avatar_gallery_path'] . '/' . $file) )
|
||||
{
|
||||
$sub_dir = @opendir($bb_cfg['avatar_gallery_path'] . '/' . $file);
|
||||
|
||||
$avatar_row_count = 0;
|
||||
$avatar_col_count = 0;
|
||||
while( $sub_file = @readdir($sub_dir) )
|
||||
{
|
||||
if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) )
|
||||
{
|
||||
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $sub_file;
|
||||
$avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));
|
||||
|
||||
$avatar_col_count++;
|
||||
if( $avatar_col_count == 5 )
|
||||
{
|
||||
$avatar_row_count++;
|
||||
$avatar_col_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@closedir($dir);
|
||||
|
||||
@ksort($avatar_images);
|
||||
@reset($avatar_images);
|
||||
|
||||
if( empty($category) )
|
||||
{
|
||||
list($category, ) = each($avatar_images);
|
||||
}
|
||||
@reset($avatar_images);
|
||||
|
||||
$s_categories = '<select name="avatarcategory">';
|
||||
while( list($key) = each($avatar_images) )
|
||||
{
|
||||
$selected = ( $key == $category ) ? ' selected="selected"' : '';
|
||||
if( count($avatar_images[$key]) )
|
||||
{
|
||||
$s_categories .= '<option value="' . $key . '"' . $selected . '>' . ucfirst($key) . '</option>';
|
||||
}
|
||||
}
|
||||
$s_categories .= '</select>';
|
||||
|
||||
$s_colspan = 0;
|
||||
for($i = 0; $i < count($avatar_images[$category]); $i++)
|
||||
{
|
||||
$template->assign_block_vars("avatar_row", array());
|
||||
|
||||
$s_colspan = max($s_colspan, count($avatar_images[$category][$i]));
|
||||
|
||||
for($j = 0; $j < count($avatar_images[$category][$i]); $j++)
|
||||
{
|
||||
$template->assign_block_vars('avatar_row.avatar_column', array(
|
||||
"AVATAR_IMAGE" => $bb_cfg['avatar_gallery_path'] . '/' . $category . '/' . $avatar_images[$category][$i][$j],
|
||||
"AVATAR_NAME" => $avatar_name[$category][$i][$j])
|
||||
);
|
||||
|
||||
$template->assign_block_vars('avatar_row.avatar_option_column', array(
|
||||
"S_OPTIONS_AVATAR" => $avatar_images[$category][$i][$j])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$params = array('user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'website', 'location', 'user_flag', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'notifyreply', 'attachsig', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
|
||||
|
||||
$s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="avatarcatname" value="' . $category . '" />';
|
||||
|
||||
for($i = 0; $i < count($params); $i++)
|
||||
{
|
||||
$s_hidden_vars .= '<input type="hidden" name="' . $params[$i] . '" value="' . str_replace('"', '"', $$params[$i]) . '" />';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_CATEGORY_SELECT' => $s_categories,
|
||||
'S_COLSPAN' => $s_colspan,
|
||||
'S_PROFILE_ACTION' => append_sid("profile.php?mode=$mode"),
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_vars)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
|
@ -51,7 +51,7 @@ if (!$ranks = $datastore->get('ranks'))
|
|||
$datastore->update('ranks');
|
||||
$ranks = $datastore->get('ranks');
|
||||
}
|
||||
$poster_rank = $rank_image = '';
|
||||
$poster_rank = $rank_image = $rank_select = '';
|
||||
|
||||
if ($user_rank = $profiledata['user_rank'] AND isset($ranks[$user_rank]))
|
||||
{
|
||||
|
@ -59,6 +59,16 @@ if ($user_rank = $profiledata['user_rank'] AND isset($ranks[$user_rank]))
|
|||
$poster_rank = $ranks[$user_rank]['rank_title'];
|
||||
}
|
||||
|
||||
if (IS_ADMIN)
|
||||
{
|
||||
$rank_select = array($lang['NO'] => 0);
|
||||
foreach ($ranks as $row)
|
||||
{
|
||||
$rank_select[$row['rank_title']] = $row['rank_id'];
|
||||
}
|
||||
$rank_select = build_select('rank-sel', $rank_select, $user_rank);
|
||||
}
|
||||
|
||||
$temp_url = append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
|
||||
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['SEND_PRIVATE_MESSAGE'] . '" title="' . $lang['SEND_PRIVATE_MESSAGE'] . '" border="0" /></a>';
|
||||
|
||||
|
@ -145,6 +155,7 @@ $template->assign_vars(array(
|
|||
'USER_REGDATE' => bb_date($profiledata['user_regdate']),
|
||||
'POSTER_RANK' => $poster_rank,
|
||||
'RANK_IMAGE' => $rank_image,
|
||||
'RANK_SELECT' => $rank_select,
|
||||
'POSTS_PER_DAY' => $posts_per_day,
|
||||
'POSTS' => $profiledata['user_posts'],
|
||||
'PERCENTAGE' => $percentage . '%',
|
||||
|
|
|
@ -1437,6 +1437,7 @@ $lang['TORHELP_TITLE'] = 'Please help seeding these torrents!';
|
|||
// Reports (need to translate it!)
|
||||
//
|
||||
$lang['REPORTS'] = 'Reports';
|
||||
$lang['REPORTS_DISABLE'] = 'Reports disabled';
|
||||
$lang['NEW_REPORT'] = ' (one open)';
|
||||
$lang['NO_NEW_REPORTS'] = ': no new Reports';
|
||||
$lang['NEW_REPORTS'] = ' (%d open)';
|
||||
|
|
|
@ -1443,6 +1443,7 @@ $lang['TORHELP_TITLE'] = 'Этим раздачам необходима ваш
|
|||
// Reports
|
||||
//
|
||||
$lang['REPORTS'] = 'Нарушения';
|
||||
$lang['REPORTS_DISABLE'] = 'Система нарушений отключена';
|
||||
$lang['NEW_REPORT'] = ': одно открыто';
|
||||
$lang['NEW_REPORTS'] = ': %d открыто';
|
||||
$lang['NO_NEW_REPORTS'] = ': нет открытых';
|
||||
|
|
|
@ -152,7 +152,7 @@ $template->assign_vars(array(
|
|||
));
|
||||
|
||||
// per-letter selection end
|
||||
$sql = "SELECT username, user_id, user_opt, user_posts, user_regdate, user_from, user_from_flag, user_website, user_email, user_icq, user_avatar, user_avatar_type, user_allowavatar
|
||||
$sql = "SELECT username, user_id, user_opt, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_avatar, user_avatar_type, user_allowavatar
|
||||
FROM ". BB_USERS ."
|
||||
WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")";
|
||||
if ( $username )
|
||||
|
@ -173,9 +173,6 @@ if ( $row = DB()->sql_fetchrow($result) )
|
|||
$username = $row['username'];
|
||||
$user_id = $row['user_id'];
|
||||
$from = $row['user_from'];
|
||||
// FLAGHACK-start
|
||||
$flag = ($row['user_from_flag'] && $row['user_from_flag'] != 'blank.gif') ? make_user_flag($row['user_from_flag']) : '';
|
||||
// FLAGHACK-end
|
||||
|
||||
$joined = bb_date($row['user_regdate'], $lang['DATE_FORMAT']);
|
||||
$posts = $row['user_posts'];
|
||||
|
@ -212,7 +209,6 @@ if ( $row = DB()->sql_fetchrow($result) )
|
|||
'ROW_CLASS' => $row_class,
|
||||
'USERNAME' => $username,
|
||||
'FROM' => $from,
|
||||
'FLAG' => $flag,
|
||||
'JOINED_RAW' => $row['user_regdate'],
|
||||
'JOINED' => $joined,
|
||||
'POSTS' => $posts,
|
||||
|
|
|
@ -10,6 +10,8 @@ require(INC_DIR ."functions_report.php");
|
|||
// Init userdata
|
||||
$user->session_start(array('req_login' => true));
|
||||
|
||||
if(!$bb_cfg['reports_enabled']) bb_die($lang['REPORTS_DISABLE']);
|
||||
|
||||
$return_links = array(
|
||||
'index' => '<br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="' . append_sid("index.php") . '">', '</a>'),
|
||||
'list' => '<br /><br />' . sprintf($lang['CLICK_RETURN_REPORT_LIST'], '<a href="' . append_sid("report.php") . '">', '</a>')
|
||||
|
|
|
@ -104,18 +104,6 @@
|
|||
<input class="post" type="text" name="location" size="35" maxlength="100" value="{LOCATION}" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- FLAGHACK-start -->
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_FLAG}:</span></td>
|
||||
<td class="row2"><span class="small">
|
||||
<table>
|
||||
<tr>
|
||||
<td>{FLAG_SELECT} </td>
|
||||
<td><img src="../images/flags/{FLAG_START}" name="user_flag" /></td>
|
||||
</tr></table>
|
||||
</span></td>
|
||||
</tr>
|
||||
<!-- FLAGHACK-end -->
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_OCCUPATION}</span></td>
|
||||
<td class="row2">
|
||||
|
|
|
@ -753,7 +753,6 @@ table.topic { width: 100%; }
|
|||
.poster_info .nick { margin: 0 0 4px; color: #333333; line-height: 110%; }
|
||||
.poster_info .avatar { margin: 5px 0 4px; max-width: 100px; max-height: 100px; overflow: hidden; }
|
||||
.avatar imgreflect { display: block; }
|
||||
.poster_info .flag { margin: 4px 0; }
|
||||
.poster_info em { font-style: normal; color: #000000; }
|
||||
|
||||
table.topic, .topic .td1, .topic .td2, .topic .td3, .post_head, .post_btn_2 {
|
||||
|
|
|
@ -7,21 +7,13 @@
|
|||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
{META}
|
||||
<link rel="stylesheet" href="{STYLESHEET}?v={$bb_cfg['css_ver']}" type="text/css">
|
||||
<!-- IF DEBUG --><link rel="stylesheet" href="{DBG_CSS}" type="text/css"><!-- ENDIF -->
|
||||
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="opensearch_desc.xml" title="{SITENAME} (Forum)" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="opensearch_desc_bt.xml" title="{SITENAME} (Tracker)" />
|
||||
<!-- IF DEBUG -->
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/source/jquery.js"></script>
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/source/jquery_plugins/dimensions.js"></script>
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/source/jquery_plugins/json.js"></script>
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/source/jquery_plugins/metadata.js"></script>
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/source/jquery_plugins/jquery.media.js"></script>
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/firebug/firebug.js"></script>
|
||||
<!-- ELSE -->
|
||||
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/jquery.pack.js?v={$bb_cfg['js_ver']}"></script>
|
||||
<!-- ENDIF -->
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/main.js?v={$bb_cfg['js_ver']}"></script>
|
||||
|
||||
<!-- IF INCLUDE_BBCODE_JS -->
|
||||
<script type="text/javascript" src="{#BB_ROOT}misc/js/bbcode.js?v={$bb_cfg['js_ver']}"></script>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -18,8 +18,22 @@ ajax.init.edit_user_profile = function(params){
|
|||
ajax.callback.edit_user_profile = function(data){
|
||||
ajax.restoreEditable(data.edit_id, data.new_value);
|
||||
};
|
||||
|
||||
// change_user_rank
|
||||
ajax.change_user_rank = function(uid, rank_id) {
|
||||
$('#rank-msg').html('<i class="loading-1">выполняется...</i>');
|
||||
ajax.exec({
|
||||
action : 'change_user_rank',
|
||||
user_id : uid,
|
||||
rank_id : rank_id
|
||||
});
|
||||
}
|
||||
ajax.callback.change_user_rank = function(data) {
|
||||
$('#rank-msg').html(data.html);
|
||||
}
|
||||
</script>
|
||||
|
||||
<var class="ajax-params">{action: "edit_user_profile", id: "username"}</var>
|
||||
<var class="ajax-params">{action: "edit_user_profile", id: "user_regdate"}</var>
|
||||
<var class="ajax-params">{action: "edit_user_profile", id: "user_lastvisit"}</var>
|
||||
<!-- IF IGNORE_SRV_LOAD_EDIT -->
|
||||
|
@ -51,10 +65,18 @@ ajax.callback.edit_user_profile = function(data){
|
|||
<td class="row1 vTop tCenter" width="30%">
|
||||
|
||||
<p class="mrg_4">{AVATAR_IMG}</p>
|
||||
<!-- IF POSTER_RANK -->
|
||||
<p class="small mrg_4">{POSTER_RANK}</p>
|
||||
<p class="small mrg_4">
|
||||
<!-- IF IS_ADMIN -->
|
||||
{RANK_SELECT}
|
||||
<script type="text/javascript">
|
||||
$('#rank-sel').bind('change', function(){ ajax.change_user_rank( {PROFILE_USER_ID}, $(this).val() ); });
|
||||
</script>
|
||||
<div id="rank-msg" class="mrg_6"></div>
|
||||
<!-- ELSE IF POSTER_RANK -->
|
||||
{POSTER_RANK}
|
||||
<!-- ENDIF -->
|
||||
<h4 class="cat border bw_TB">{L_CONTACT} {USERNAME}</h4>
|
||||
</p>
|
||||
<h4 class="cat border bw_TB" id="username">{L_CONTACT} <span class="editable bold">{USERNAME}</span></h4>
|
||||
|
||||
<table class="borderless user_contacts w100">
|
||||
<!-- IF EMAIL_IMG -->
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<!-- IF LOGGED_IN -->
|
||||
<style type="text/css">
|
||||
<!-- IF HIDE_FLAGS -->.flag img { display: none; }<!-- ENDIF -->
|
||||
<!-- IF HIDE_AVATAR -->.avatar { display: none; }<!-- ENDIF -->
|
||||
<!-- IF HIDE_RANK_IMG -->.rank_img { display: none; }<!-- ENDIF -->
|
||||
<!-- IF HIDE_POST_IMG -->img.postImg, div.postImg-wrap { display: none; }<!-- ENDIF -->
|
||||
|
@ -107,11 +106,6 @@ function set_hid_chbox (id)
|
|||
<fieldset id="show-only">
|
||||
<legend>{L_HIDE_IN_TOPIC}</legend>
|
||||
<div class="med pad_4">
|
||||
<label>
|
||||
<input type="checkbox" <!-- IF HIDE_FLAGS -->{CHECKED}<!-- ENDIF --><!-- IF HIDE_FLAGS_DIS -->{DISABLED}<!-- ENDIF -->
|
||||
onclick="user.set('h_flag', this.checked ? 1 : 0);"
|
||||
/>{L_FLAGS}
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" <!-- IF HIDE_AVATAR -->{CHECKED}<!-- ENDIF -->
|
||||
onclick="user.set('h_av', this.checked ? 1 : 0);"
|
||||
|
@ -190,10 +184,9 @@ function set_hid_chbox (id)
|
|||
<!-- IF postrow.POSTER_JOINED --><p class="joined" title="{postrow.POSTER_JOINED_DATE}"><em>{L_LONGEVITY}:</em> {postrow.POSTER_JOINED}</p><!-- ENDIF -->
|
||||
<!-- IF postrow.POSTER_POSTS --><p class="posts"><em>{L_POSTS}:</em> {postrow.POSTER_POSTS}</p><!-- ENDIF -->
|
||||
<!-- IF postrow.POSTER_FROM --><p class="from"><em>{L_LOCATION}:</em> {postrow.POSTER_FROM}</p><!-- ENDIF -->
|
||||
<!-- IF postrow.POSTER_FROM_FLAG --><p class="flag">{postrow.POSTER_FROM_FLAG}</p><!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<p><img src="{SPACER}" width="{TOPIC_LEFT_COL_SPACER_WITDH}" height="<!-- IF postrow.POSTER_AVATAR || postrow.POSTER_FROM_FLAG || postrow.RANK_IMAGE -->2<!-- ELSE -->30<!-- ENDIF -->" border="0" alt="" /></p>
|
||||
<p><img src="{SPACER}" width="{TOPIC_LEFT_COL_SPACER_WITDH}" height="<!-- IF postrow.POSTER_AVATAR || postrow.RANK_IMAGE -->2<!-- ELSE -->30<!-- ENDIF -->" border="0" alt="" /></p>
|
||||
|
||||
</td>
|
||||
<td class="message td2" rowspan="2">
|
||||
|
@ -214,7 +207,7 @@ function set_hid_chbox (id)
|
|||
<!-- IF postrow.EDIT --><a class="txtb" href="{EDIT_POST_URL}{postrow.POST_ID}">{EDIT_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF postrow.DELETE --><a class="txtb" href="{DELETE_POST_URL}{postrow.POST_ID}">{DELETE_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF postrow.IP --><a class="txtb" href="{IP_POST_URL}{postrow.POST_ID}&t={TOPIC_ID}">{IP_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
{postrow.REPORT}{POST_BTN_SPACER}
|
||||
<!-- IF postrow.REPORT -->{postrow.REPORT}{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF AUTH_MOD -->
|
||||
<!-- IF not IN_MODERATION --><a class="txtb" href="{PAGE_URL}&mod=1&start={PAGE_START}#{postrow.POST_ID}">{MOD_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
|
|
|
@ -370,7 +370,7 @@ $post_order = (isset($_POST['postorder']) && $_POST['postorder'] !== 'asc') ? 'd
|
|||
//
|
||||
$sql = "
|
||||
SELECT
|
||||
u.username, u.user_id, u.user_posts, u.user_from, u.user_from_flag,
|
||||
u.username, u.user_id, u.user_posts, u.user_from,
|
||||
u.user_regdate, u.user_rank, u.user_sig,
|
||||
u.user_avatar, u.user_avatar_type, u.user_allowavatar,
|
||||
p.*,
|
||||
|
@ -584,7 +584,6 @@ $template->assign_vars(array(
|
|||
'SHOW_BOT_NICK' => $bb_cfg['show_bot_nick'],
|
||||
'T_POST_REPLY' => $reply_alt,
|
||||
|
||||
'HIDE_FLAGS' => ($user->opt_js['h_flag'] && $bb_cfg['show_poster_flag']),
|
||||
'HIDE_AVATAR' => $user->opt_js['h_av'],
|
||||
'HIDE_RANK_IMG' => ($user->opt_js['h_rnk_i'] && $bb_cfg['show_rank_image']),
|
||||
'HIDE_POST_IMG' => $user->opt_js['h_post_i'],
|
||||
|
@ -592,7 +591,6 @@ $template->assign_vars(array(
|
|||
'HIDE_SIGNATURE' => $user->opt_js['h_sig'],
|
||||
'SPOILER_OPENED' => $user->opt_js['sp_op'],
|
||||
|
||||
'HIDE_FLAGS_DIS' => !$bb_cfg['show_poster_flag'],
|
||||
'HIDE_RANK_IMG_DIS' => !$bb_cfg['show_rank_image'],
|
||||
|
||||
'AUTH_MOD' => $is_auth['auth_mod'],
|
||||
|
@ -799,14 +797,8 @@ for($i = 0; $i < $total_posts; $i++)
|
|||
|
||||
$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_from'] : '';
|
||||
|
||||
// FLAGHACK-start
|
||||
$poster_from_flag = ( !$user->opt_js['h_flag'] && $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? make_user_flag($postrow[$i]['user_from_flag']) : "";
|
||||
// FLAGHACK-end
|
||||
|
||||
$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $lang['DATE_FORMAT']) : '';
|
||||
|
||||
|
||||
|
||||
$poster_longevity = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? delta_time($postrow[$i]['user_regdate']) : '';
|
||||
|
||||
$poster_avatar = '';
|
||||
|
@ -972,7 +964,6 @@ for($i = 0; $i < $total_posts; $i++)
|
|||
'POSTER_BOT' => ($poster_id == BOT_UID),
|
||||
'POSTER_ID' => $poster_id,
|
||||
'POSTED_AFTER' => ($prev_post_time) ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '',
|
||||
'POSTER_FROM_FLAG' => ($bb_cfg['show_poster_flag']) ? $poster_from_flag : '',
|
||||
'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id),
|
||||
'IS_FIRST_POST' => (!$start && ($postrow[$i]['post_id'] == $t_data['topic_first_post_id'])),
|
||||
'MOD_CHECKBOX' => ($moderation && ($start || defined('SPLIT_FORM_START'))),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue