本文整理汇总了PHP中SE_Language::load方法的典型用法代码示例。如果您正苦于以下问题:PHP SE_Language::load方法的具体用法?PHP SE_Language::load怎么用?PHP SE_Language::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SE_Language
的用法示例。
在下文中一共展示了SE_Language::load方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_systememail
function send_systememail($systememail, $recipient_email, $replace = array(), $bcc = FALSE)
{
global $setting, $database;
// RETRIEVE EMAIL INFO
$email = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_systememails WHERE systememail_name='{$systememail}' LIMIT 1"));
SE_Language::_preload_multi($email['systememail_subject'], $email['systememail_body']);
SE_Language::load();
// GET/DECODE SUBJECT AND MESSAGE
$subject = htmlspecialchars_decode(SE_Language::_get($email['systememail_subject']), ENT_QUOTES);
$message = htmlspecialchars_decode(SE_Language::_get($email['systememail_body']), ENT_QUOTES);
// REPLACE VARIABLES IN SUBJECT AND MESSAGE
$subject = vsprintf($subject, $replace);
$message = vsprintf($message, $replace);
// ENCODE SUBJECT FOR UTF8
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
// REPLACE CARRIAGE RETURNS WITH BREAKS
$message = str_replace("\n", "<br>", $message);
// SET HEADERS
$sender = "{$setting['setting_email_fromname']} <{$setting['setting_email_fromemail']}>";
$headers = "MIME-Version: 1.0" . "\n";
$headers .= "Content-type: text/html; charset=utf-8" . "\n";
$headers .= "Content-Transfer-Encoding: 8bit" . "\n";
$headers .= "From: {$sender}" . "\n";
$headers .= "Return-Path: {$sender}" . "\n";
$headers .= "Reply-To: {$sender}\n";
// IF BCC, SET TO AND BCC
if ($bcc) {
$headers .= "Bcc: {$recipient_email}\n";
$recipient_email = "noreply@domain.com";
}
// SEND MAIL
mail($recipient_email, $subject, $message, $headers);
return true;
}
示例2: send_systememail
function send_systememail($systememail, $recipient_email, $replace = array(), $bcc = FALSE)
{
global $setting, $database, $setting_smtp_email;
$setting_email_query = $database->database_query("SELECT * FROM se_settings_email LIMIT 1");
$setting_smtp_email = $database->database_fetch_assoc($setting_email_query);
// RETRIEVE EMAIL INFO
$email = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_systememails WHERE systememail_name='{$systememail}' LIMIT 1"));
SE_Language::_preload_multi($email['systememail_subject'], $email['systememail_body']);
SE_Language::load();
// GET/DECODE SUBJECT AND MESSAGE
$subject = htmlspecialchars_decode(SE_Language::_get($email['systememail_subject']), ENT_QUOTES);
$message = htmlspecialchars_decode(SE_Language::_get($email['systememail_body']), ENT_QUOTES);
// REPLACE VARIABLES IN SUBJECT AND MESSAGE
$subject = vsprintf($subject, $replace);
$message = vsprintf($message, $replace);
// ENCODE SUBJECT FOR UTF8
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
// REPLACE CARRIAGE RETURNS WITH BREAKS
$message = str_replace("\n", "<br>", $message);
// SET HEADERS
$sender = "{$setting['setting_email_fromname']} <{$setting['setting_email_fromemail']}>";
$headers = "MIME-Version: 1.0" . "\n";
$headers .= "Content-type: text/html; charset=utf-8" . "\n";
$headers .= "Content-Transfer-Encoding: 8bit" . "\n";
$headers .= "From: {$sender}" . "\n";
$headers .= "Return-Path: {$sender}" . "\n";
$headers .= "Reply-To: {$sender}\n";
// IF BCC, SET TO AND BCC
if ($bcc) {
$headers .= "Bcc: {$recipient_email}\n";
$recipient_email = "noreply@domain.com";
}
// SEND MAIL
if ($setting_smtp_email['email_method'] == "mail") {
mail($recipient_email, $subject, $message, $headers);
} elseif ($setting_smtp_email['email_method'] == "smtp") {
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Subject = $subject;
$mailer->From = $setting['setting_email_fromemail'];
$mailer->FromName = $setting['setting_email_fromname'];
$mailer->MsgHTML($message);
$mailer->AddAddress($recipient_email);
$mailer->Host = $setting_smtp_email['smtp_host'];
$mailer->Username = $setting_smtp_email['smtp_user'];
$mailer->Password = $setting_smtp_email['smtp_pass'];
$mailer->Port = $setting_smtp_email['smtp_port'];
if ($setting_smtp_email['smtp_port'] == 465) {
$mailer->SMTPSecure = "ssl";
} else {
$mailer->SMTPSecure = "";
}
$mailer->Send();
}
return true;
}
示例3: search_poll
function search_poll()
{
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
// CONSTRUCT QUERY
$sql = "\r\n SELECT\r\n se_polls.poll_id,\r\n se_polls.poll_title,\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n FROM\r\n se_polls,\r\n se_users,\r\n se_levels\r\n WHERE\r\n se_polls.poll_user_id=se_users.user_id &&\r\n se_users.user_level_id=se_levels.level_id &&\r\n (\r\n se_polls.poll_search='1' ||\r\n se_levels.level_poll_search='0'\r\n ) &&\r\n (\r\n poll_title LIKE '%{$search_text}%' ||\r\n poll_desc LIKE '%{$search_text}%' ||\r\n poll_options LIKE '%{$search_text}%'\r\n )\r\n ";
// GET TOTAL ENTRIES
$total_polls = $database->database_num_rows($database->database_query($sql . " LIMIT 201"));
// IF NOT TOTAL ONLY
if ($t == "poll") {
// MAKE POLL PAGES
$start = ($p - 1) * $results_per_page;
$limit = $results_per_page + 1;
// SEARCH POLLS
$sql .= " ORDER BY se_polls.poll_id DESC LIMIT {$start}, {$limit}";
$resource = $database->database_query($sql) or die($database->database_error());
while ($poll_info = $database->database_fetch_assoc($resource)) {
// CREATE AN OBJECT FOR AUTHOR
$profile = new se_user();
$profile->user_info['user_id'] = $poll_info['user_id'];
$profile->user_info['user_username'] = $poll_info['user_username'];
$profile->user_info['user_fname'] = $poll_info['user_fname'];
$profile->user_info['user_lname'] = $poll_info['user_lname'];
$profile->user_info['user_photo'] = $poll_info['user_photo'];
$profile->user_displayname();
$result_url = $url->url_create('poll', $poll_info['user_username'], $poll_info['poll_id']);
$result_name = 2500112;
$result_desc = 2500113;
// IF EMPTY TITLE
if (!trim($poll_info['poll_title'])) {
SE_Language::_preload(589);
SE_Language::load();
$poll_info['poll_title'] = SE_Language::_get(589);
}
$results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/poll_poll48.gif', 'result_name' => $result_name, 'result_name_1' => $poll_info['poll_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $profile->user_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $poll_info['poll_desc']);
}
// SET TOTAL RESULTS
$total_results = $total_polls;
}
// SET ARRAY VALUES
SE_Language::_preload_multi(2500111, 2500112, 2500113);
if ($total_polls > 200) {
$total_polls = "200+";
}
$search_objects[] = array('search_type' => 'poll', 'search_lang' => 2500111, 'search_total' => $total_polls);
}
示例4: str_replace
$field_info[field_options] = $_POST['field_options'];
$field_info[field_suggestions] = $_POST['field_suggestions'];
// SAVE FIELD
$field_info = $field->field_save($field_info);
// GET ERROR
$is_error = $field->is_error;
if ($field->is_error != 0) {
SE_Language::_preload_multi($field->is_error);
SE_Language::load();
$error_message = str_replace("'", "\\'", SE_Language::_get($field->is_error));
}
// PULL OPTIONS INTO STRING
$field_options_detailed = array();
for ($i = 0; $i < count($field_info[field_options]); $i++) {
SE_Language::_preload_multi($field_info[field_options][$i][label]);
SE_Language::load();
$field_info[field_options][$i][label] = SE_Language::_get($field_info[field_options][$i][label]);
$field_options_detailed[] = $field_info[field_options][$i][value] . "<!>" . $field_info[field_options][$i][label] . "<!>" . $field_info[field_options][$i][dependency] . "<!>" . $field_info[field_options][$i][dependent_label] . "<!>" . $field_info[field_options][$i][dependent_id];
}
$field_options_detailed = implode("<~!~>", $field_options_detailed);
// SEND AJAX CONFIRMATION
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
echo "window.parent.savefield_result('{$is_error}', '{$error_message}', '{$old_field_id}', '{$field_info['field_id']}', '{$field_info['field_title']}', '{$field_info['field_cat_id']}', '{$field_options_detailed}');";
echo "</script></head><body></body></html>";
exit;
// ADD A NEW FIELD BOX
} elseif ($task == "addfield") {
$field->cat_list();
$cat_array = $field->cats;
$smarty->assign('hideSearch', $hideSearch);
$smarty->assign('hideDisplay', $hideDisplay);
示例5: comment_post
function comment_post($comment_body, $comment_secure, $object_title = "", $object_owner = "", $object_owner_id = 0, $object_privacy = "")
{
global $database, $user, $owner, $setting, $actions, $notify, $url;
$comment_id = 0;
$comment_date = time();
// RETRIEVE AND CHECK SECURITY CODE IF NECESSARY
if ($setting['setting_comment_code']) {
// NOW IN HEADER
$code_found = false;
if (@$_SESSION['code'] == $comment_secure) {
$code_found = true;
}
if (!empty($_SESSION['codes']) && is_array($_SESSION['codes'])) {
foreach ($_SESSION['codes'] as $index => $code_info) {
if ($code_info['code'] == $comment_secure) {
$code_found = true;
unset($_SESSION['codes'][$index]);
}
}
}
if (!$code_found) {
$this->is_error = 1;
}
//session_start();
//$code = $_SESSION['code'];
//if($code == "") { $code = randomcode(); }
//if($comment_secure != $code) { $this->is_error = 1; }
}
// MAKE SURE COMMENT BODY IS NOT EMPTY - ADD BREAKS AND CENSOR
$comment_body = cleanHTML(censor($comment_body), $setting['setting_comment_html'], array("style"));
$comment_body = preg_replace('/(\\r\\n?)/', "\n", $comment_body);
$comment_body = str_replace("\n", "<br>", $comment_body);
$comment_body = preg_replace('/(<br>){3,}/is', '<br><br>', $comment_body);
$comment_body = str_replace("'", "\\'", $comment_body);
if (!trim($comment_body)) {
$this->is_error = 1;
$comment_body = "";
}
// ADD COMMENT IF NO ERROR
if (!$this->is_error) {
$resource = $database->database_query("\r\n INSERT INTO `se_{$this->comment_type}comments` (\r\n `{$this->comment_type}comment_{$this->comment_identifier}`,\r\n `{$this->comment_type}comment_authoruser_id`,\r\n `{$this->comment_type}comment_date`,\r\n `{$this->comment_type}comment_body`\r\n ) VALUES (\r\n '{$this->comment_identifying_value}',\r\n '{$user->user_info['user_id']}',\r\n '{$comment_date}',\r\n '{$comment_body}'\r\n )\r\n ");
$comment_id = $database->database_insert_id();
// New handling - total cached in parent table
if ($resource && $this->comment_parent_type && $this->comment_parent_identifier) {
$database->database_query("\r\n UPDATE\r\n `se_{$this->comment_parent_type}`\r\n SET\r\n `{$this->comment_parent_identifier}_totalcomments`=`{$this->comment_parent_identifier}_totalcomments`+1\r\n WHERE\r\n `{$this->comment_identifier}`='{$this->comment_identifying_value}'\r\n LIMIT\r\n 1\r\n ");
}
// INSERT ACTION IF USER EXISTS
if ($user->user_exists) {
$commenter = $user->user_displayname;
$comment_body_encoded = strip_tags($comment_body);
if (strlen($comment_body_encoded) > 250) {
$comment_body_encoded = substr($comment_body_encoded, 0, 247) . "...";
}
$comment_body_encoded = str_replace(array("<br>", "<br />"), " ", $comment_body_encoded);
$actions->actions_add($user, $this->comment_type . "comment", array($user->user_info['user_username'], $user->user_displayname, $owner->user_info['user_username'], $owner->user_displayname, $comment_body_encoded, $this->comment_identifying_value, $object_title, $object_owner_id), array(), 0, false, $object_owner, $object_owner_id, $object_privacy);
} else {
SE_Language::_preload(835);
SE_Language::load();
$commenter = SE_Language::_get(835);
}
// SEND PROFILE COMMENT NOTIFICATION IF COMMENTER IS NOT OWNER
if ($owner->user_info['user_id'] != $user->user_info['user_id']) {
$notifytype = $notify->notify_add($owner->user_info['user_id'], $this->comment_type . "comment", $this->comment_identifying_value, array($owner->user_info['user_username'], $this->comment_identifying_value, $object_owner_id), array($object_title));
$object_url = $url->url_base . vsprintf($notifytype['notifytype_url'], array($owner->user_info['user_username'], $this->comment_identifying_value));
$owner->user_settings();
if ($owner->usersetting_info['usersetting_notify_' . $this->comment_type . 'comment']) {
send_systememail($this->comment_type . "comment", $owner->user_info['user_email'], array($owner->user_displayname, $commenter, "<a href=\"{$object_url}\">{$object_url}</a>"));
}
}
}
return array('comment_id' => $comment_id, 'comment_body' => $comment_body, 'comment_date' => $comment_date);
}
示例6: search_music
function search_music()
{
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results, $user;
// CONSTRUCT QUERY
$sql = "\r\n SELECT\r\n se_music.*,\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n FROM\r\n se_music\r\n LEFT JOIN\r\n se_users\r\n ON se_users.user_id=se_music.music_user_id\r\n WHERE\r\n se_music.music_title LIKE '%{$search_text}%'\r\n ";
// GET TOTAL RESULTS
$total_music = $database->database_num_rows($database->database_query($sql . " LIMIT 201"));
// IF NOT TOTAL ONLY
if ($t == "music") {
// MAKE MUSIC PAGES
$start = ($p - 1) * $results_per_page;
$limit = $results_per_page + 1;
// Lang for download song
SE_Language::_preload(4000095);
SE_Language::load();
// SEARCH MUSIC
$sql .= " ORDER BY se_music.music_id DESC LIMIT {$start}, {$limit}";
$resource = $database->database_query($sql) or die($database->database_error());
while ($music_info = $database->database_fetch_assoc($resource)) {
// CREATE AN OBJECT FOR USER
$profile = new se_user();
$profile->user_info['user_id'] = $music_info['user_id'];
$profile->user_info['user_username'] = $music_info['user_username'];
$profile->user_info['user_fname'] = $music_info['user_fname'];
$profile->user_info['user_lname'] = $music_info['user_lname'];
$profile->user_info['user_photo'] = $music_info['user_photo'];
$profile->user_displayname();
$result_url = $url->url_create('profile', $music_info['user_username']);
$result_name = 4000105;
$result_desc = 4000106;
$userdir = $url->url_userdir($music_info['user_id']);
$music_path = "{$userdir}{$music_info['music_id']}.{$music_info['music_ext']}";
// IF NO TITLE
if (!trim($music_info['music_title'])) {
SE_Language::_preload(589);
SE_Language::load();
$music_info['music_title'] = SE_Language::_get(589);
}
$dl_lv = SE_Language::_get(4000095);
$desc3 = <<<EOF
<br />
<table><tr><td>
<object width="17" height="17" data="images/music_button.swf?song_url={$music_path}" type="application/x-shockwave-flash">
<param value="images/music_button.swf?song_url={$music_path}" name="movie" />
<img width="17" height="17" alt="" src="noflash.gif" />
</object>
</td>
EOF;
if ($user->user_exists && $user->level_info['level_music_allow_downloads']) {
$desc3 .= <<<EOF
<td style="padding-left:10px;vertical-align:middle;">
<a type="application/force-download" href="{$music_path}">{$dl_lv}</a>
</td>
EOF;
}
$desc3 .= "</tr></table>";
$results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/music_music48.gif', 'result_name' => $result_name, 'result_name_1' => $music_info['music_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $profile->user_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $desc3);
}
// SET TOTAL RESULTS
$total_results = $total_music;
}
// SET ARRAY VALUES
SE_Language::_preload_multi(4000104, 4000105, 4000106);
if ($total_music > 200) {
$total_music = "200+";
}
$search_objects[] = array('search_type' => 'music', 'search_lang' => 4000104, 'search_total' => $total_music);
}
示例7: search_album
function search_album()
{
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
// CONSTRUCT QUERY
$album_query = "\r\n\t(\r\n\tSELECT\r\n '1' AS sub_type,\r\n\t se_media.media_album_id AS album_id,\r\n\t se_media.media_title AS title,\r\n\t se_media.media_desc AS description,\r\n\t se_media.media_id AS media_id,\r\n\t se_media.media_ext AS media_ext,\r\n\t se_users.user_id,\r\n\t se_users.user_username,\r\n\t se_users.user_photo,\r\n\t se_users.user_fname,\r\n\t se_users.user_lname\r\n\tFROM\r\n\t se_media,\r\n\t se_albums,\r\n\t se_users,\r\n\t se_levels\r\n\tWHERE\r\n\t se_media.media_album_id=se_albums.album_id AND\r\n\t se_albums.album_user_id=se_users.user_id AND\r\n\t se_users.user_level_id=se_levels.level_id AND\r\n\t (\r\n\t se_albums.album_search='1' OR\r\n\t se_levels.level_album_search='0'\r\n\t )\r\n\t AND\r\n\t (\r\n\t se_media.media_title LIKE '%{$search_text}%' OR\r\n\t se_media.media_desc LIKE '%{$search_text}%'\r\n\t )\r\n\tORDER BY media_id DESC\r\n\t)\r\n\tUNION ALL\r\n\t(\r\n\tSELECT\r\n\t '2' AS sub_type,\r\n\t se_albums.album_id AS album_id,\r\n\t se_albums.album_title AS title,\r\n\t se_albums.album_desc AS description,\r\n\t se_albums.album_cover AS media_id,\r\n\t se_media.media_ext AS media_ext,\r\n\t se_users.user_id,\r\n\t se_users.user_username,\r\n\t se_users.user_photo,\r\n\t se_users.user_fname,\r\n\t se_users.user_lname\r\n\tFROM\r\n\t se_albums,\r\n\t se_users,\r\n\t se_levels,\r\n\t se_media\r\n\tWHERE\r\n\t se_albums.album_user_id=se_users.user_id AND\r\n\t se_users.user_level_id=se_levels.level_id AND\r\n\t se_albums.album_cover=se_media.media_id AND \r\n\t (\r\n\t se_albums.album_search='1' OR\r\n\t se_levels.level_album_search='0'\r\n\t )\r\n\t AND\r\n\t (\r\n\t se_albums.album_title LIKE '%{$search_text}%' OR\r\n\t se_albums.album_desc LIKE '%{$search_text}%'\r\n\t )\r\n\tORDER BY album_id DESC\r\n\t)";
// GET TOTAL RESULTS
$total_albums = $database->database_num_rows($database->database_query($album_query . " LIMIT 201"));
// IF NOT TOTAL ONLY
if ($t == "album") {
// MAKE ALBUM PAGES
$start = ($p - 1) * $results_per_page;
$limit = $results_per_page + 1;
// SEARCH ALBUMS
$albums = $database->database_query($album_query . " ORDER BY album_id DESC LIMIT {$start}, {$limit}");
while ($album_info = $database->database_fetch_assoc($albums)) {
// CREATE AN OBJECT FOR USER
$profile = new se_user();
$profile->user_info['user_id'] = $album_info['user_id'];
$profile->user_info['user_username'] = $album_info['user_username'];
$profile->user_info['user_fname'] = $album_info['user_fname'];
$profile->user_info['user_lname'] = $album_info['user_lname'];
$profile->user_info['user_photo'] = $album_info['user_photo'];
$profile->user_displayname();
// RESULT IS A MEDIA
if ($album_info[sub_type] == 1) {
$result_url = $url->url_create('album_file', $album_info['user_username'], $album_info['album_id'], $album_info['media_id']);
$result_name = 1000119;
$result_desc = 1000121;
// RESULT IS AN ALBUM
} else {
$result_url = $url->url_create('album', $album_info['user_username'], $album_info['album_id']);
$result_name = 1000120;
$result_desc = 1000122;
}
// SET THUMBNAIL, IF AVAILABLE
switch ($album_info['media_ext']) {
case "jpeg":
case "jpg":
case "gif":
case "png":
case "bmp":
$thumb_path = $url->url_userdir($album_info['user_id']) . $album_info['media_id'] . "_thumb.jpg";
break;
case "mp3":
case "mp4":
case "wav":
$thumb_path = "./images/icons/audio_big.gif";
break;
case "mpeg":
case "mpg":
case "mpa":
case "avi":
case "swf":
case "mov":
case "ram":
case "rm":
$thumb_path = "./images/icons/video_big.gif";
break;
default:
$thumb_path = "./images/icons/file_big.gif";
}
if (!file_exists($thumb_path)) {
$thumb_path = "./images/icons/file_big.gif";
}
// IF NO TITLE
if ($album_info['title'] == "") {
SE_Language::_preload(589);
SE_Language::load();
$album_info['title'] = SE_Language::_get(589);
}
// IF DESCRIPTION IS LONG
if (strlen($album_info['description']) > 150) {
$album_info['description'] = substr($album_info['description'], 0, 147) . "...";
}
$results[] = array('result_url' => $result_url, 'result_icon' => $thumb_path, 'result_name' => $result_name, 'result_name_1' => $album_info['title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $album_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $album_info['description']);
}
// SET TOTAL RESULTS
$total_results = $total_albums;
}
// SET ARRAY VALUES
SE_Language::_preload_multi(1000118, 1000119, 1000120, 1000121, 1000122);
if ($total_albums > 200) {
$total_albums = "200+";
}
$search_objects[] = array('search_type' => 'album', 'search_lang' => 1000118, 'search_total' => $total_albums);
}
示例8: field_get
function field_get($field_id)
{
global $database;
$field_info = $database->database_fetch_assoc($database->database_query("SELECT " . $this->type . "field_id AS field_id, " . $this->type . "field_" . $this->type . "cat_id AS field_cat_id, " . $this->type . "field_order AS field_order, " . $this->type . "field_dependency AS field_dependency, " . $this->type . "field_title AS field_title, " . $this->type . "field_desc AS field_desc, " . $this->type . "field_error AS field_error, " . $this->type . "field_type AS field_type, " . $this->type . "field_style AS field_style, " . $this->type . "field_maxlength AS field_maxlength, " . $this->type . "field_link AS field_link, " . $this->type . "field_options AS field_options, " . $this->type . "field_required AS field_required, " . $this->type . "field_regex AS field_regex, " . $this->type . "field_special AS field_special, " . $this->type . "field_search AS field_search, " . $this->type . "field_display AS field_display, " . $this->type . "field_html AS field_html FROM se_" . $this->type . "fields WHERE " . $this->type . "field_id='{$field_id}'"));
// PULL OPTIONS INTO NEW ARRAY
$new_field_options = "";
$field_options = unserialize($field_info[field_options]);
for ($i = 0; $i < count($field_options); $i++) {
SE_Language::_preload_multi($field_options[$i][label]);
SE_Language::load();
$field_options[$i][label] = SE_Language::_get($field_options[$i][label]);
if ($field_options[$i][dependency] == 1) {
$dep_field = $database->database_query("SELECT " . $this->type . "field_id AS field_id, " . $this->type . "field_title AS field_title FROM se_" . $this->type . "fields WHERE " . $this->type . "field_id='" . $field_options[$i][dependent_id] . "'");
if ($database->database_num_rows($dep_field) != "1") {
$field_options[$i][dependency] = 0;
} else {
$field_options[$i][dependency] = 1;
$dep_field_info = $database->database_fetch_assoc($dep_field);
SE_Language::_preload_multi($dep_field_info[field_title]);
SE_Language::load();
$dep_field_info[field_title] = SE_Language::_get($dep_field_info[field_title]);
$field_options[$i][dependent_label] = $dep_field_info[field_title];
}
}
}
// LOAD FIELD TITLE
SE_Language::_preload_multi($field_info[field_title], $field_info[field_desc], $field_info[field_error]);
SE_Language::load();
$field_info[field_title] = SE_Language::_get($field_info[field_title]);
$field_info[field_desc] = SE_Language::_get($field_info[field_desc]);
$field_info[field_error] = SE_Language::_get($field_info[field_error]);
$field_info[field_options_detailed] = $field_options;
return $field_info;
}
示例9: get_errors
function get_errors()
{
// v3 compat .. uh ..
if (class_exists('SE_Language')) {
foreach ($this->errors as $k=>$v) {
if (is_numeric($v)) {
SE_Language::_preload($v);
$has_lang_id = true;
}
}
$errors = array();
if ($has_lang_id) {
SE_Language::load();
}
foreach ($this->errors as $k=>$v) {
if (is_numeric($v)) {
$v = SE_Language::_get($v);
}
$errors[$k] = $v;
}
}
else
{
$errors = $this->errors;
}
return $errors;
}
示例10: blog_trackback_receive
function blog_trackback_receive()
{
global $database, $user, $setting;
$is_error = FALSE;
// Create trackback class instance
$trackback = new Trackback(NULL, NULL, "UTF-8");
// Prepare data
$trackback_eid = $trackback->e_id;
$trackback_url = trim($trackback->url);
$trackback_title = trim($trackback->title);
$trackback_excerpt = trim($trackback->excerpt);
$trackback_bname = trim($trackback->bname);
$trackback_ip = $_SERVER['REMOTE_ADDR'];
$trackback_time = time();
$trackback_excerpthash = md5($trackback_excerpt);
// Clean body
$trackback_excerpt = str_replace("\r\n", "<br />", cleanHTML(censor(htmlspecialchars_decode($trackback_excerpt)), $setting['setting_comment_html']));
// Trackbacks not allowed
if (!$user->level_info['level_blog_trackbacks_allow']) {
$is_error = 1500013;
}
// No ID specified
if (!$trackback_eid) {
$is_error = 1500008;
}
// Trackback URL is empty
if (!$trackback_url) {
$is_error = 1500009;
}
// Get entry info. TODO: switch to SELECT NULL?
if (!$is_error) {
$sql = "\r\n SELECT\r\n NULL\r\n FROM\r\n se_blogentries\r\n WHERE\r\n se_blogentries.blogentry_id='{$trackback_eid}'\r\n LIMIT\r\n 1\r\n ";
$resource = $database->database_query($sql);
// Entry not found
if (!$database->database_num_rows($resource)) {
$is_error = 1500010;
}
}
// See if trackback has already been received
if (!$is_error) {
$sql = "\r\n SELECT\r\n NULL\r\n FROM\r\n se_blogtrackbacks\r\n WHERE\r\n blogtrackback_blogentry_id='{$trackback_eid}' &&\r\n blogtrackback_name='{$trackback_bname}' &&\r\n blogtrackback_excerpthash='{$trackback_excerpthash}'\r\n LIMIT\r\n 1\r\n ";
$resource = $database->database_query($sql);
// Already tracked
if ($database->database_num_rows($resource)) {
$is_error = 1500011;
}
}
// Only 1/15 seconds
if (!$is_error) {
$trackback_timeout = 15;
$sql = "\r\n SELECT\r\n NULL\r\n FROM\r\n se_blogtrackbacks\r\n WHERE\r\n blogtrackback_ip='{$trackback_ip}' &&\r\n blogtrackback_date>" . ($trackback_time - $trackback_timeout) . "\r\n LIMIT\r\n 1\r\n ";
$resource = $database->database_query($sql);
if ($database->database_num_rows($resource)) {
$is_error = 1500012;
}
}
// TODO: antispam
// INSERT
if (!$is_error) {
$sql = "\r\n INSERT INTO se_blogtrackbacks\r\n (\r\n blogtrackback_blogentry_id,\r\n blogtrackback_name,\r\n blogtrackback_title,\r\n blogtrackback_excerpt,\r\n blogtrackback_excerpthash,\r\n blogtrackback_url,\r\n blogtrackback_ip,\r\n blogtrackback_date\r\n ) VALUES (\r\n '{$trackback_eid}',\r\n '{$trackback_bname}',\r\n '{$trackback_title}',\r\n '{$trackback_excerpt}',\r\n '{$trackback_excerpthash}',\r\n '{$trackback_url}',\r\n '{$trackback_ip}',\r\n '{$trackback_time}'\r\n )\r\n ";
$resource = $database->database_query($sql);
if (!$database->database_affected_rows($resource)) {
$is_error = 1500013;
}
// UPDATE TRACKBACK COUNT
$sql = "UPDATE se_blogentries SET blogentry_totaltrackbacks=blogentry_totaltrackbacks+1 WHERE blogentry_id='{$trackback_eid}' LIMIT 1";
$database->database_query($sql);
}
// LOG
if (empty($blogentry_url) && !empty($_SERVER['HTTP_REFERER'])) {
$blogentry_url = $_SERVER['HTTP_REFERER'];
}
if (empty($blogentry_url) && !empty($_SERVER['REMOTE_ADDR'])) {
$blogentry_url = $_SERVER['REMOTE_ADDR'];
}
$sql = "\r\n INSERT INTO se_blogpings\r\n (\r\n blogping_blogentry_id,\r\n blogping_target_url,\r\n blogping_source_url,\r\n blogping_status,\r\n blogping_type,\r\n blogping_ip\r\n ) VALUES (\r\n '{$trackback_eid}',\r\n '" . $database->database_real_escape_string($_SERVER['REQUEST_URI']) . "',\r\n '" . $database->database_real_escape_string($blogentry_url) . "',\r\n '1',\r\n '2',\r\n '{$_SERVER['REMOTE_ADDR']}'\r\n )\r\n ";
$resource = $database->database_query($sql);
// GET ERROR MESSAGE
SE_Language::_preload($is_error ? $is_error : 1500014);
SE_Language::load();
$message = SE_Language::_get($is_error ? $is_error : 1500014);
return $trackback->recieve(!$is_error, $message);
}