mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
r115
исправлено отображение возраста и добавление опроса git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@115 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
618efa7548
commit
9c6983a586
4 changed files with 6 additions and 11 deletions
|
@ -2066,7 +2066,7 @@ function realdate($date, $format = "Ymd")
|
|||
function birthday_age($date)
|
||||
{
|
||||
if(!$date) return;
|
||||
return delta_time(mktime(0, 0, 0, 0, 0, realdate($date, 'Y')));
|
||||
return delta_time(mktime(0, 0, 0, 6, 0, realdate($date, 'Y')));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -52,7 +52,7 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
|
|||
// Check subject
|
||||
if (!empty($subject))
|
||||
{
|
||||
$subject = preg_replace('#&#', '&', htmlspecialchars(trim($subject)));
|
||||
$subject = str_replace('&', '&', $subject);
|
||||
}
|
||||
else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
|
||||
{
|
||||
|
@ -76,11 +76,6 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
|
|||
{
|
||||
$poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0;
|
||||
|
||||
if (!empty($poll_title))
|
||||
{
|
||||
$poll_title = htmlspecialchars(trim($poll_title));
|
||||
}
|
||||
|
||||
if(!empty($poll_options))
|
||||
{
|
||||
$temp_option_text = array();
|
||||
|
@ -89,7 +84,7 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
|
|||
$option_text = trim($option_text);
|
||||
if (!empty($option_text))
|
||||
{
|
||||
$temp_option_text[$option_id] = htmlspecialchars($option_text);
|
||||
$temp_option_text[$option_id] = clean_title($option_text);
|
||||
}
|
||||
}
|
||||
$option_text = $temp_option_text;
|
||||
|
@ -296,7 +291,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
|
|||
{
|
||||
if (!empty($option_text))
|
||||
{
|
||||
$option_text = DB()->escape(htmlspecialchars($option_text));
|
||||
$option_text = DB()->escape(clean_title($option_text));
|
||||
$poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;
|
||||
|
||||
$sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . BB_VOTE_RESULTS . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . BB_VOTE_RESULTS . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
|
||||
|
|
|
@ -493,7 +493,7 @@ else if ( ($submit || $confirm) && !$topic_has_new_posts )
|
|||
$subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : '';
|
||||
$message = ( !empty($_POST['message']) ) ? prepare_message($_POST['message']) : '';
|
||||
$poll_title = ( isset($_POST['poll_title']) && $is_auth['auth_pollcreate'] ) ? clean_title($_POST['poll_title']) : '';
|
||||
$poll_options = ( isset($_POST['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? clean_title($_POST['poll_option_text']) : '';
|
||||
$poll_options = ( isset($_POST['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $_POST['poll_option_text'] : '';
|
||||
$poll_length = ( isset($_POST['poll_length']) && $is_auth['auth_pollcreate'] ) ? $_POST['poll_length'] : '';
|
||||
|
||||
prepare_post($mode, $post_data, $error_msg, $username, $subject, $message, $poll_title, $poll_options, $poll_length);
|
||||
|
|
|
@ -272,7 +272,7 @@ ajax.callback.view_message = function(data){
|
|||
</tr>
|
||||
<!-- END switch_avatar_local_gallery -->
|
||||
<!-- END switch_avatar_block -->
|
||||
<!-- IF IS_ADMIN -->
|
||||
<!-- IF IS_ADMIN && ADM_EDIT -->
|
||||
<tr>
|
||||
<th colspan="2">{L_MANAGE_USER}</th>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue