示例#1
0
             if ($row_count == 1) {
                 @mysql_query("UPDATE " . $db_settings['userdata_cache_table'] . " SET cache_signature='" . mysql_real_escape_string($data['signature']) . "' WHERE cache_id=" . intval($data['user_id']), $connid);
             } else {
                 @mysql_query("DELETE FROM " . $db_settings['userdata_cache_table'] . " WHERE cache_id=" . intval($data['user_id']), $connid);
                 @mysql_query("INSERT INTO " . $db_settings['userdata_cache_table'] . " (cache_id, cache_signature, cache_profile) VALUES (" . intval($data['user_id']) . ",'" . mysql_real_escape_string($data['signature']) . "','')", $connid);
             }
         }
     }
 } else {
     unset($data['signature']);
 }
 if (empty($data["email_contact"])) {
     $data["email_contact"] = 0;
 }
 if ($data['hp'] != '') {
     $data['hp'] = add_http_if_no_protocol($data['hp']);
 }
 if ($data['email'] != '' && $data['email_contact'] == 1) {
     $data['email'] = true;
 } else {
     $data['email'] = false;
 }
 if ($data['location'] != '') {
     $data['location'] = htmlspecialchars(stripslashes($data['location']));
 }
 if (isset($_SESSION[$settings['session_prefix'] . 'user_type']) && $_SESSION[$settings['session_prefix'] . 'user_type'] > 0) {
     $data['move_posting_link'] = true;
 }
 if (isset($_SESSION[$settings['session_prefix'] . 'user_type']) && $_SESSION[$settings['session_prefix'] . 'user_type'] > 0 && $settings['akismet_key'] != '' && $settings['akismet_entry_check'] == 1 && $data['spam'] == 0 && $data['spam_check_status'] > 0) {
     $data['report_spam_link'] = true;
 }
示例#2
0
 $smarty->assign('user_name', $user_name);
 $smarty->assign('user_type', $row['user_type']);
 $smarty->assign('user_real_name', htmlspecialchars(stripslashes($row['user_real_name'])));
 $smarty->assign('gender', $row['gender']);
 if ($day != 0 && $month != 0 && $year != 0) {
     $birthdate['day'] = $day;
     $birthdate['month'] = $month;
     $birthdate['year'] = $year;
     $smarty->assign('birthdate', $birthdate);
     $smarty->assign('years', $years);
 }
 if ($row['email_contact'] == 1) {
     $smarty->assign('user_email', TRUE);
 }
 if (trim($row['user_hp']) != '') {
     $row['user_hp'] = add_http_if_no_protocol($row['user_hp']);
 }
 $smarty->assign('user_hp', htmlspecialchars(stripslashes($row['user_hp'])));
 $smarty->assign('user_location', htmlspecialchars(stripslashes($row['user_location'])));
 $smarty->assign('user_registered', format_time($lang['time_format'], $row['user_registered']));
 if ($row['user_registered'] != $row['user_last_login']) {
     $smarty->assign('user_last_login', format_time($lang['time_format'], $row['user_last_login']));
 }
 $smarty->assign('postings', $postings);
 if ($postings > 0) {
     $smarty->assign('postings_percent', number_format($postings / $total_postings * 100, 1));
 } else {
     $smarty->assign('postings_percent', 0);
 }
 $smarty->assign('logins', $row['logins']);
 $days_registered = (time() - $row['registered']) / 86400;
示例#3
0
     }
     if (trim($pr_data['user_location']) != '') {
         $smarty->assign('preview_location', htmlspecialchars(stripslashes($pr_data['user_location'])));
     }
     if (trim($pr_data['signature']) != '') {
         $smarty->assign('preview_signature', signature_format(stripslashes($pr_data['signature'])));
     }
     if ($pr_data['signature'] != '') {
         $smarty->assign('signature', true);
         $smarty->assign('show_signature', $show_signature);
     }
     $smarty->assign('provide_email_notification', true);
 } else {
     $smarty->assign('email', htmlspecialchars(stripslashes($email)));
     if (trim($hp) != '') {
         $smarty->assign('preview_hp', htmlspecialchars(stripslashes(add_http_if_no_protocol($hp))));
     }
     $smarty->assign('hp', htmlspecialchars(stripslashes($hp)));
     $smarty->assign('location', htmlspecialchars(stripslashes($location)));
     $smarty->assign('preview_location', htmlspecialchars(stripslashes($location)));
     if ($settings['email_notification_unregistered']) {
         $smarty->assign('provide_email_notification', true);
     }
 }
 if (isset($_SESSION[$settings['session_prefix'] . 'user_type']) && $_SESSION[$settings['session_prefix'] . 'user_type'] > 0 && (empty($id) || $posting_mode == 1 && $pid == 0)) {
     $smarty->assign('provide_sticky', true);
 }
 // actual time:
 list($preview_time) = mysql_fetch_row(mysql_query("SELECT UNIX_TIMESTAMP(NOW() + INTERVAL " . $time_difference . " MINUTE)"));
 $smarty->assign('preview_timestamp', $preview_time);
 $preview_formated_time = format_time($lang['time_format_full'], $preview_time);
示例#4
0
     $dbr->bindParam(':type', $type, PDO::PARAM_INT);
     $dbr->bindParam(':comment_id', $comment_id, PDO::PARAM_INT);
     $dbr->execute();
 }
 $i = 0;
 while ($data = $dbr->fetch()) {
     #$item_ids[] = $data['comment_id'];
     $comments[$i]['id'] = $data['id'];
     $comments[$i]['comment_id'] = $data['comment_id'];
     $comments[$i]['time'] = $data['time'];
     $comments[$i]['name'] = htmlspecialchars($data['name']);
     if ($data['email_hp']) {
         if (preg_match("/^[^@]+@.+\\.\\D{2,5}\$/", $data['email_hp'])) {
             $comments[$i]['email_hp'] = 'mailto:' . htmlspecialchars($data['email_hp']);
         } else {
             $comments[$i]['email_hp'] = add_http_if_no_protocol(htmlspecialchars($data['email_hp']));
         }
     }
     $comments[$i]['comment'] = htmlspecialchars($data['comment']);
     if ($settings['comment_remove_blank_lines'] == 1) {
         $entry_array = explode("\n", $comments[$i]['comment']);
         $comment = '';
         foreach ($entry_array as $entry_line) {
             $entry_line = trim($entry_line);
             if ($entry_line != '') {
                 $comment .= $entry_line . "\n";
             }
         }
         $comments[$i]['comment'] = $comment;
     }
     $comments[$i]['comment'] = nl2br($comments[$i]['comment']);
示例#5
0
 public function preview()
 {
     $data['comment_text'] = isset($_POST['comment_text']) ? trim($_POST['comment_text']) : '';
     $data['name'] = isset($_POST['name']) ? trim($_POST['name']) : '';
     $data['email_hp'] = isset($_POST['email_hp']) ? trim($_POST['email_hp']) : '';
     // check posted data:
     $this->check_data($data);
     $preview['name'] = htmlspecialchars($data['name']);
     $preview['timestamp'] = time();
     $preview['time'] = time();
     #$preview['formated_time'] = format_time(TIME_FORMAT_FULL,time());
     $preview['comment_text'] = $this->format_comment($data['comment_text']);
     $email_hp = htmlspecialchars($data['email_hp']);
     if (preg_match("/^[^@]+@.+\\.\\D{2,5}\$/", $email_hp)) {
         if ($this->admin_mode) {
             $preview['email'] = $email_hp;
         }
     } elseif ($email_hp != '') {
         $preview['hp'] = add_http_if_no_protocol($email_hp);
     }
     $this->_localization->bindId('comment_time', 'preview');
     $this->_localization->replacePlaceholderBound('time', $preview['time'], 'comment_time', 'preview', Localization::FORMAT_TIME);
     $_SESSION[$this->_form_session] = time();
     $this->form_session = $_SESSION[$this->_form_session];
     if (isset($preview)) {
         return $preview;
     }
     return false;
 }