本文整理汇总了PHP中xfieldsdataload函数的典型用法代码示例。如果您正苦于以下问题:PHP xfieldsdataload函数的具体用法?PHP xfieldsdataload怎么用?PHP xfieldsdataload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xfieldsdataload函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: explode
}
if ($is_logged) {
$fav_arr = explode(',', $member_id['favorites']);
if (!in_array($row['id'], $fav_arr) or $config['allow_cache'] == "yes") {
$tpl->set('{favorites}', "<a id=\"fav-id-" . $row['id'] . "\" href=\"{$PHP_SELF}?do=favorites&doaction=add&id=" . $row['id'] . "\"><img src=\"" . $config['http_home_url'] . "templates/{$config['skin']}/dleimages/plus_fav.gif\" onclick=\"doFavorites('" . $row['id'] . "', 'plus'); return false;\" title=\"" . $lang['news_addfav'] . "\" style=\"vertical-align: middle;border: none;\" alt=\"\" /></a>");
} else {
$tpl->set('{favorites}', "<a id=\"fav-id-" . $row['id'] . "\" href=\"{$PHP_SELF}?do=favorites&doaction=del&id=" . $row['id'] . "\"><img src=\"" . $config['http_home_url'] . "templates/{$config['skin']}/dleimages/minus_fav.gif\" onclick=\"doFavorites('" . $row['id'] . "', 'minus'); return false;\" title=\"" . $lang['news_minfav'] . "\" style=\"vertical-align: middle;border: none;\" alt=\"\" /></a>");
}
$tpl->set('[complaint]', "<a href=\"javascript:AddComplaint('" . $row['id'] . "', 'news')\">");
$tpl->set('[/complaint]', "</a>");
} else {
$tpl->set('{favorites}', "");
$tpl->set_block("'\\[complaint\\](.*?)\\[/complaint\\]'si", "");
}
// Обработка дополнительных полей
$xfieldsdata = xfieldsdataload($row['xfields']);
foreach ($xfields as $value) {
$preg_safe_name = preg_quote($value[0], "'");
if ($value[6] and !empty($xfieldsdata[$value[0]])) {
$temp_array = explode(",", $xfieldsdata[$value[0]]);
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if ($config['allow_alt_url'] == "yes") {
$value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode($value2) . "/\">" . $value2 . "</a>";
} else {
$value3[] = "<a href=\"{$PHP_SELF}?do=xfsearch&xf=" . urlencode($value2) . "\">" . $value2 . "</a>";
}
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
开发者ID:Zzepish,项目名称:IvanShikalovWebSIte,代码行数:31,代码来源:show.custom.php
示例2: NoAjaxQuery
case "send":
NoAjaxQuery();
$for_user_id = intval($_POST['for_user_id']);
$theme = ajax_utf8(textFilter(strip_tags($_POST['theme'])));
$msg = ajax_utf8(textFilter($_POST['msg']));
$attach_files = ajax_utf8(textFilter($_POST['attach_files']));
$attach_files = str_replace('vote|', 'hack|', $attach_files);
if (!$theme) {
$theme = '...';
}
if ($user_id != $for_user_id and $for_user_id and isset($msg) and !empty($msg) or isset($attach_files) or !empty($attach_files)) {
//Проверка на существование получателя
$row = $db->super_query("SELECT user_privacy FROM `" . PREFIX . "_users` WHERE user_id = '{$for_user_id}'");
if ($row) {
//Приватность
$user_privacy = xfieldsdataload($row['user_privacy']);
//ЧС
$CheckBlackList = CheckBlackList($for_user_id);
//Проверка естьли запрашиваемый юзер в друзьях у юзера который смотрит стр
if ($user_privacy['val_msg'] == 2) {
$check_friend = CheckFriends($for_user_id);
}
if (!$CheckBlackList and $user_privacy['val_msg'] == 1 or $user_privacy['val_msg'] == 2 and $check_friend) {
$xPrivasy = 1;
} else {
$xPrivasy = 0;
}
if ($xPrivasy) {
//Отправляем сообщение получателю
$db->query("INSERT INTO `" . PREFIX . "_messages` SET theme = '{$theme}', text = '{$msg}', for_user_id = '{$for_user_id}', from_user_id = '{$user_id}', date = '{$server_time}', pm_read = 'no', folder = 'inbox', history_user_id = '{$user_id}', attach = '" . $attach_files . "'");
$dbid = $db->insert_id();
开发者ID:skypach,项目名称:skypach.ru,代码行数:31,代码来源:messages.php
示例3: xfieldsload
$row['short_story'] = $parse->decodeBBCodes($row['short_story'], false);
$row['full_story'] = $parse->decodeBBCodes($row['full_story'], false);
}
$short_story = $parse->process($row['short_story']);
$full_story = $parse->process($row['full_story']);
$_POST['title'] = $row['title'];
if ($config['allow_admin_wysiwyg'] == "yes" or $row['allow_br'] != '1') {
$full_story = $db->safesql($parse->BB_Parse($full_story));
$short_story = $db->safesql($parse->BB_Parse($short_story));
} else {
$full_story = $db->safesql($parse->BB_Parse($full_story, false));
$short_story = $db->safesql($parse->BB_Parse($short_story, false));
}
if ($row['xfields'] != "") {
$xfields = xfieldsload();
$postedxfields = xfieldsdataload($row['xfields']);
$filecontents = array();
$newpostedxfields = array();
if (!empty($postedxfields)) {
foreach ($xfields as $name => $value) {
if ($value[3] == "textarea" and $postedxfields[$value[0]] != "") {
if ($config['allow_admin_wysiwyg'] == "yes" or $row['allow_br'] != '1') {
$postedxfields[$value[0]] = $parsexf->decodeBBCodes($postedxfields[$value[0]], true, "yes");
$newpostedxfields[$value[0]] = $parsexf->BB_Parse($parsexf->process($postedxfields[$value[0]]));
} else {
$postedxfields[$value[0]] = $parsexf->decodeBBCodes($postedxfields[$value[0]], false);
$newpostedxfields[$value[0]] = $parsexf->BB_Parse($parsexf->process($postedxfields[$value[0]]), false);
}
} elseif ($postedxfields[$value[0]] != "") {
$newpostedxfields[$value[0]] = $parsexf->process(stripslashes($postedxfields[$value[0]]));
}
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:rebuild.php
示例4: build_comments
//.........这里部分代码省略.........
$tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si", "");
}
}
$tpl->set('{mail}', $row['email']);
$tpl->set('{id}', $row['id']);
if (date('Ymd', $row['date']) == date('Ymd', $_TIME)) {
$tpl->set('{date}', $lang['time_heute'] . langdate(", H:i", $row['date']));
} elseif (date('Ymd', $row['date']) == date('Ymd', $_TIME - 86400)) {
$tpl->set('{date}', $lang['time_gestern'] . langdate(", H:i", $row['date']));
} else {
$tpl->set('{date}', langdate($config['timestamp_comment'], $row['date']));
}
$tpl->copy_template = preg_replace("#\\{date=(.+?)\\}#ie", "langdate('\\1', '{$row['date']}')", $tpl->copy_template);
if ($area == 'lastcomments') {
$row['category'] = intval($row['category']);
if ($config['allow_alt_url'] == "yes") {
if ($config['seo_type'] == 1 or $config['seo_type'] == 2) {
if ($row['category'] and $config['seo_type'] == 2) {
$full_link = $config['http_home_url'] . get_url($row['category']) . "/" . $row['post_id'] . "-" . $row['alt_name'] . ".html";
} else {
$full_link = $config['http_home_url'] . $row['post_id'] . "-" . $row['alt_name'] . ".html";
}
} else {
$full_link = $config['http_home_url'] . date('Y/m/d/', strtotime($row['newsdate'])) . $row['alt_name'] . ".html";
}
} else {
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['post_id'];
}
$tpl->set('{news_title}', "<a href=\"" . $full_link . "\">" . stripslashes($row['title']) . "</a>");
} else {
$tpl->set('{news_title}', "");
}
if ($xfound) {
$xfieldsdata = xfieldsdataload($row['xfields']);
foreach ($xfields as $value) {
$preg_safe_name = preg_quote($value[0], "'");
if ($value[5] != 1 or $member_id['user_group'] == 1 or $is_logged and $row['is_register'] and $member_id['name'] == $row['name']) {
if (empty($xfieldsdata[$value[0]])) {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[/xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template);
} else {
$tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[xfgiven_{$preg_safe_name}]", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[/xfgiven_{$preg_safe_name}]", "", $tpl->copy_template);
}
$tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", stripslashes($xfieldsdata[$value[0]]), $tpl->copy_template);
} else {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", "", $tpl->copy_template);
$tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
}
}
}
if ($area == 'ajax' and isset($ajax_adds)) {
$tpl->set('{comment-id}', "--");
} elseif ($area == 'lastcomments') {
$tpl->set('{comment-id}', $this->total_comments - $this->cstart - $this->intern_count + 1);
} else {
if ($config['comm_msort'] == "ASC") {
$tpl->set('{comment-id}', $this->cstart + $this->intern_count);
} else {
$tpl->set('{comment-id}', $this->total_comments - $this->cstart - $this->intern_count + 1);
}
}
if ($row['foto']) {
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:67,代码来源:comments.class.php
示例5: array
$text = $parse->BB_Parse($parse->process($_POST['text']), false);
} else {
$parse->wysiwyg = true;
$parse->ParseFilter(array('div', 'span', 'p', 'br', 'strong', 'em', 'ul', 'li', 'ol'), array(), 0, 1);
$text = $parse->BB_Parse($parse->process($_POST['text']));
}
$tpl->load_template('pm.tpl');
preg_replace("'\\[readpm\\](.*?)\\[/readpm\\]'ies", "del_tpl('\\1')", $tpl->copy_template);
if (strpos($tpl->copy_template, "[xfvalue_") !== false) {
$xfound = true;
} else {
$xfound = false;
}
if ($xfound) {
$xfields = xfieldsload(true);
$xfieldsdata = xfieldsdataload($member_id['xfields']);
foreach ($xfields as $value) {
$preg_safe_name = preg_quote($value[0], "'");
if ($value[5] != 1 or $member_id['user_group'] == 1 or $is_logged and $member_id['name'] == $row['user_from']) {
if (empty($xfieldsdata[$value[0]])) {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
} else {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "\\1", $tpl->copy_template);
}
$tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", stripslashes($xfieldsdata[$value[0]]), $tpl->copy_template);
} else {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", "", $tpl->copy_template);
}
}
}
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:pm.php
示例6: mozg_clear_cache_file
if ($val_wall3 <= 0 or $val_wall3 > 3) {
$val_wall3 = 1;
}
if ($val_info <= 0 or $val_info > 3) {
$val_info = 1;
}
$user_privacy = "val_msg|{$val_msg}||val_wall1|{$val_wall1}||val_wall2|{$val_wall2}||val_wall3|{$val_wall3}||val_info|{$val_info}||";
$db->query("UPDATE `" . PREFIX . "_users` SET user_privacy = '{$user_privacy}' WHERE user_id = '{$user_id}'");
mozg_clear_cache_file('user_' . $user_id . '/profile_' . $user_id);
die;
break;
//################### Приватность настройки ###################//
//################### Приватность настройки ###################//
case "privacy":
$sql_ = $db->super_query("SELECT user_privacy FROM `" . PREFIX . "_users` WHERE user_id = '{$user_id}'");
$row = xfieldsdataload($sql_['user_privacy']);
$tpl->load_template('settings/privacy.tpl');
$tpl->set('{val_msg}', $row['val_msg']);
$tpl->set('{val_msg_text}', strtr($row['val_msg'], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Никто')));
$tpl->set('{val_wall1}', $row['val_wall1']);
$tpl->set('{val_wall1_text}', strtr($row['val_wall1'], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Только я')));
$tpl->set('{val_wall2}', $row['val_wall2']);
$tpl->set('{val_wall2_text}', strtr($row['val_wall2'], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Только я')));
$tpl->set('{val_wall3}', $row['val_wall3']);
$tpl->set('{val_wall3_text}', strtr($row['val_wall3'], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Только я')));
$tpl->set('{val_info}', $row['val_info']);
$tpl->set('{val_info_text}', strtr($row['val_info'], array('1' => 'Все пользователи', '2' => 'Только друзья', '3' => 'Только я')));
$tpl->compile('info');
break;
//################### Добавление в черный список ###################//
//################### Добавление в черный список ###################//
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:settings.php
示例7: str_replace
$xfielddatavalue = str_replace("\r\n", "__NEWL__", $xfielddatavalue);
$filecontents[] = "{$xfielddataname}|{$xfielddatavalue}";
}
if (count($filecontents)) {
$filecontents = $db->safesql(implode("||", $filecontents));
} else {
$filecontents = '';
}
} else {
$filecontents = '';
}
break;
case "delete":
break;
case "templatereplace":
$xfieldsdata = xfieldsdataload($xfieldsid);
$xfieldsoutput = $xfieldsinput;
foreach ($xfields as $value) {
$preg_safe_name = preg_quote($value[0], "'");
if ($value[5] != 0) {
if (empty($xfieldsdata[$value[0]])) {
$xfieldsoutput = preg_replace("'\\[xfgiven_{$preg_safe_name}\\].*?\\[/xfgiven_{$preg_safe_name}\\]'is", "", $xfieldsoutput);
} else {
$xfieldsoutput = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "\\1", $xfieldsoutput);
}
}
$xfieldsoutput = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", stripslashes($xfieldsdata[$value[0]]), $xfieldsoutput);
}
break;
case "templatereplacepreview":
if (isset($_POST["xfield"])) {
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:xfields.php
示例8: CheckBlackList
$section = $_POST['section'];
//ЧС
$CheckBlackList = CheckBlackList($user_id);
if (!$CheckBlackList) {
//Получаем ID альбома
$check_album = $db->super_query("SELECT album_id FROM `" . PREFIX . "_photos` WHERE id = '{$photo_id}'");
//Если фотография вызвана не со стены
if (!$fuser and $check_album) {
//Проверяем на наличии файла с позициям только для этого фоток
$check_pos = mozg_cache('user_' . $user_id . '/position_photos_album_' . $check_album['album_id']);
//Если нету, то вызываем функцию генерации
if (!$check_pos) {
GenerateAlbumPhotosPosition($user_id, $check_album['album_id']);
$check_pos = mozg_cache('user_' . $user_id . '/position_photos_album_' . $check_album['album_id']);
}
$position = xfieldsdataload($check_pos);
}
$row = $db->super_query("SELECT tb1.id, photo_name, comm_num, descr, date, position, tb2.user_id, user_search_pref, user_country_city_name FROM `" . PREFIX . "_photos` tb1, `" . PREFIX . "_users` tb2 WHERE id = '{$photo_id}' AND tb1.user_id = tb2.user_id");
if ($row) {
//Вывод названия альбома, приватноть из БД
$info_album = $db->super_query("SELECT name, privacy FROM `" . PREFIX . "_albums` WHERE aid = '{$check_album['album_id']}'");
$album_privacy = explode('|', $info_album['privacy']);
//Проверка естьли запрашиваемый юзер в друзьях у юзера который смотрит стр
if ($user_info['user_id'] != $row['user_id']) {
$check_friend = CheckFriends($row['user_id']);
}
//Приватность
if ($album_privacy[0] == 1 or $album_privacy[0] == 2 and $check_friend or $user_info['user_id'] == $row['user_id']) {
//Если фотография вызвана не со стены
if (!$fuser) {
$exp_photo_num = count(explode('||', $check_pos));
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:photo.php
示例9: compile_comment
//.........这里部分代码省略.........
}
}
$tpl->set('{mail}', $row['gast_email']);
$tpl->set('{id}', $row['id']);
if (date('Ymd', $row['date']) == date('Ymd', $_TIME)) {
$tpl->set('{date}', $lang['time_heute'] . langdate(", H:i", $row['date']));
} elseif (date('Ymd', $row['date']) == date('Ymd', $_TIME - 86400)) {
$tpl->set('{date}', $lang['time_gestern'] . langdate(", H:i", $row['date']));
} else {
$tpl->set('{date}', langdate($config['timestamp_comment'], $row['date']));
}
$news_date = $row['date'];
$tpl->copy_template = preg_replace_callback("#\\{date=(.+?)\\}#i", "formdate", $tpl->copy_template);
if ($area == 'lastcomments') {
$row['category'] = intval($row['category']);
if ($config['allow_alt_url']) {
if ($config['seo_type'] == 1 or $config['seo_type'] == 2) {
if ($row['category'] and $config['seo_type'] == 2) {
$full_link = $config['http_home_url'] . get_url($row['category']) . "/" . $row['post_id'] . "-" . $row['alt_name'] . ".html";
} else {
$full_link = $config['http_home_url'] . $row['post_id'] . "-" . $row['alt_name'] . ".html";
}
} else {
$full_link = $config['http_home_url'] . date('Y/m/d/', strtotime($row['newsdate'])) . $row['alt_name'] . ".html";
}
} else {
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['post_id'];
}
$tpl->set('{news_title}', "<a href=\"" . $full_link . "\">" . stripslashes($row['title']) . "</a>");
} else {
$tpl->set('{news_title}', "");
}
if ($this->xfound) {
$xfieldsdata = xfieldsdataload($row['xfields']);
foreach ($this->xfields as $value) {
$preg_safe_name = preg_quote($value[0], "'");
if ($value[5] != 1 or $member_id['user_group'] == 1 or $is_logged and $row['is_register'] and $member_id['name'] == $row['name']) {
if (empty($xfieldsdata[$value[0]])) {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[xfnotgiven_{$value[0]}]", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template);
} else {
$tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[xfgiven_{$value[0]}]", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[/xfgiven_{$value[0]}]", "", $tpl->copy_template);
}
$tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", stripslashes($xfieldsdata[$value[0]]), $tpl->copy_template);
} else {
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", "", $tpl->copy_template);
$tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
}
}
}
if ($area == 'ajax' and isset($ajax_adds)) {
$tpl->set('{comment-id}', "--");
} elseif ($area == 'lastcomments') {
$tpl->set('{comment-id}', $this->total_comments - $this->cstart - $this->intern_count + 1);
} else {
if ($config['comm_msort'] == "ASC") {
$tpl->set('{comment-id}', $this->cstart + $this->intern_count);
} else {
$tpl->set('{comment-id}', $this->total_comments - $this->cstart - $this->intern_count + 1);
}
}
if (count(explode("@", $row['foto'])) == 2) {
开发者ID:Gordondalos,项目名称:union,代码行数:67,代码来源:comments.class.php
示例10: runBlockPro
//.........这里部分代码省略.........
$my_cat_icon[] = '<img class="bp-cat-icon" src="'.$this->cat_info[$element]['icon'].'" alt="'.$this->cat_info[$element]['name'].'" />';
else
$my_cat_icon[] = '<img class="bp-cat-icon" src="{THEME}/blockpro/'.$this->config['noicon'].'" alt="'.$this->cat_info[$element]['name'].'" />';
if( $this->dle_config['allow_alt_url'] == 'yes' )
$my_cat_link[] = '<a href="'.$this->dle_config['http_home_url'].get_url($element).'/">'.$this->cat_info[$element]['name'].'</a>';
else
$my_cat_link[] = '<a href="'.$PHP_SELF.'?do=cat&category='.$this->cat_info[$element]['alt_name'].'">'.$this->cat_info[$element]['name'].'</a>';
}
}
$categoryUrl = ($newsItem['category']) ? $this->dle_config['http_home_url'] . get_url(intval($newsItem['category'])) . '/' : '/' ;
// Ссылка на профиль юзера
if( $this->dle_config['allow_alt_url'] == 'yes' ) {
$go_page = $config['http_home_url'].'user/'.urlencode($newsItem['autor']).'/';
} else {
$go_page = $PHP_SELF.'?subaction=userinfo&user='.urlencode($newsItem['autor']);
}
// Выводим картинку
switch($this->config['image'])
{
// Изображение из дополнительного поля
case 'short_story':
$imgArray = $this->getImage($newsItem['short_story'], $newsItem['date']);
break;
// Первое изображение из полного описания
case 'full_story':
$imgArray = $this->getImage($newsItem['full_story'], $newsItem['date']);
break;
// По умолчанию - первое изображение из краткой новости
default:
$xfieldsdata = xfieldsdataload($newsItem['xfields'], $newsItem['date']);
if(!empty($xfieldsdata) && !empty($xfieldsdata[$this->config['image']]))
{
$imgArray = getImage($xfieldsdata[$this->config['image']]);
}
break;
}
// Определяем переменные, выводящие картинку
$image = ($imgArray['imgResized']) ? $imgArray['imgResized'] : '{THEME}/blockpro/'.$this->config['noimage'];
if (!$imgArray['imgResized']) {
$imageFull = '{THEME}/blockpro/'.$this->config['noimage_full'];
} else {
$imageFull = $imgArray['imgOriginal'];
}
// Формируем вид даты новости для вывода в шаблон
if(date('Ymd', $newsItem['date']) == date('Ymd')) {
$showDate = $this->dle_lang['time_heute'].langdate(', H:i', $newsItem['date']);
} elseif(date('Ymd', $newsItem['date']) == date('Ymd') - 1) {
$showDate = $this->dle_lang['time_gestern'].langdate(', H:i', $newsItem['date']);
} else {
$showDate = langdate($this->dle_config['timestamp_active'], $newsItem['date']);
}
/**
* Код, формирующий вывод шаблона новости
*/
$tpl->copy_template = preg_replace("#\{date=(.+?)\}#ie", "langdate('\\1', '{$newsItem['date']}')", $tpl->copy_template );
$output .= $this->applyTemplate($this->config['template'],
array(
'{title}' => $newsItem['title'],
开发者ID:n0wheremany,项目名称:Block.Pro.3,代码行数:67,代码来源:block.pro.3.php
示例11: custom_users
//.........这里部分代码省略.........
$not_found = "";
}
if (preg_match("#friends=['\"](.+?)['\"]#i", $param_str, $match)) {
$fids = array();
if ($match[1] == "current") {
$friend_que = $db->query("SELECT friend_id FROM " . PREFIX . "_users_friends WHERE user_id = '{$member_id['user_id']}' AND approve = '1'");
while ($row = $db->get_row($friend_que)) {
$fids[] = $row['friend_id'];
}
} else {
if ($match[1] == "profile") {
$friend_que = $db->query("SELECT f.friend_id FROM " . PREFIX . "_users_friends f LEFT JOIN " . PREFIX . "_users u ON ( u.user_id = f.user_id ) WHERE u.name = '{$_REQUEST['user']}' AND f.approve = '1'");
while ($row = $db->get_row($friend_que)) {
$fids[] = $row['friend_id'];
}
}
}
if (count($fids) > 0) {
$where[] = "u.user_id IN ('" . implode("','", $fids) . "')";
} else {
$where[] = "u.user_id = '0'";
}
} else {
$user_friends = false;
}
if (preg_match("#xfield=['\"](.+?)['\"]#i", $param_str, $match)) {
$_temp = explode(",", $match[1]);
$_rules = array();
foreach ($_temp as $_temp2) {
if (strpos($_temp2, "this.") !== False && isset($member_id)) {
$_temp3 = explode(":", $_temp2);
$_temp4 = trim(str_replace("this.", "", $_temp3[1]));
unset($_temp3);
$_thisxf = xfieldsdataload($member_id['xfields']);
if (array_key_exists($_temp4, $_thisxf)) {
$_rules[] = "u.xfields LIKE '%" . $_temp4 . "|" . $_thisxf[$_temp4] . "%'";
}
} else {
$_rules[] = "u.xfields LIKE '%" . str_replace(":", "|", $_temp2) . "%'";
}
}
if (count($_rules) > 0) {
$where[] = "( " . implode(" AND ", $_rules) . " )";
$use_xfield = True;
}
} else {
$use_xfield = False;
}
$user_yes = false;
$user_cols = array("email", "name", "user_id", "news_num", "comm_num", "user_group", "lastdate", "reg_date", "signature", "foto", "fullname", "land", "logged_ip");
if ($user_conf['sel_xfields']) {
$user_cols[] = "xfields";
}
$_WHERE = count($where) > 0 ? " WHERE " . implode(' AND ', $where) : "";
$build_navigation = false;
if (isset($_GET['cstart'])) {
$cstart = intval($_GET['cstart']);
} else {
$cstart = 0;
}
if (preg_match("#navigation=['\"](.+?)['\"]#i", $param_str, $match)) {
if ($match[1] == "yes" and $url_page !== false) {
$build_navigation = true;
$custom_limit = $user_limit;
//if ( $cstart > 10 ) $config['allow_cache'] = false;
if ($cstart) {
开发者ID:hiptc,项目名称:custom-users,代码行数:67,代码来源:custom.users.php
注:本文中的xfieldsdataload函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论