当前位置: 首页>>代码示例>>PHP>>正文


PHP second_parse函数代码示例

本文整理汇总了PHP中second_parse函数的典型用法代码示例。如果您正苦于以下问题:PHP second_parse函数的具体用法?PHP second_parse怎么用?PHP second_parse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了second_parse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pages_second_parse

function pages_second_parse($contents)
{
    global $CONFIG;
    if ($CONFIG['rewrite'] == 0) {
        $contents = preg_replace('`<a href="/pages/([a-z0-9+#-]+)">(.*)</a>`sU', '<a href="/pages/pages.php?title=$1">$2</a>', $contents);
    }
    $contents = second_parse($contents);
    return $contents;
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:9,代码来源:pages_functions.php

示例2: get_cache

 function get_cache()
 {
     global $Sql;
     $guestbook_code = 'global $CONFIG_GUESTBOOK;' . "\n";
     $CONFIG_GUESTBOOK = unserialize($Sql->query("SELECT value FROM " . DB_TABLE_CONFIGS . " WHERE name = 'guestbook'", __LINE__, __FILE__));
     $CONFIG_GUESTBOOK = is_array($CONFIG_GUESTBOOK) ? $CONFIG_GUESTBOOK : array();
     if (isset($CONFIG_GUESTBOOK['guestbook_forbidden_tags'])) {
         $CONFIG_GUESTBOOK['guestbook_forbidden_tags'] = unserialize($CONFIG_GUESTBOOK['guestbook_forbidden_tags']);
     }
     $guestbook_code .= '$CONFIG_GUESTBOOK = ' . var_export($CONFIG_GUESTBOOK, true) . ';' . "\n";
     $guestbook_code .= "\n\n" . 'global $_guestbook_rand_msg;' . "\n";
     $guestbook_code .= "\n" . '$_guestbook_rand_msg = array();' . "\n";
     $result = $Sql->query_while("SELECT g.id, g.login, g.user_id, g.timestamp, m.login as mlogin, g.contents\n\t\tFROM " . PREFIX . "guestbook g\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = g.user_id\n\t\tORDER BY g.timestamp DESC\n\t\t" . $Sql->limit(0, 10), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $guestbook_code .= '$_guestbook_rand_msg[] = array(\'id\' => ' . var_export($row['id'], true) . ', \'contents\' => ' . var_export(nl2br(substr_html(strip_tags(second_parse($row['contents'])), 0, 150)), true) . ', \'user_id\' => ' . var_export($row['user_id'], true) . ', \'login\' => ' . var_export($row['login'], true) . ');' . "\n";
     }
     $Sql->query_close($result);
     return $guestbook_code;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:19,代码来源:guestbook_interface.class.php

示例3: export

 function export($template = false, $number = 10, $begin_at = 0)
 {
     import('content/parser/content_second_parser');
     if ($template === false) {
         $tpl = $this->tpl->copy();
     } else {
         $tpl = $template->copy();
     }
     global $User, $MODULES;
     if ($User->check_auth($MODULES[$this->module_id]['auth'], ACCESS_MODULE)) {
         if (!empty($this->data)) {
             $tpl->assign_vars(array('DATE' => $this->data->get_date(), 'DATE_RFC822' => $this->data->get_date_rfc822(), 'DATE_RFC3339' => $this->data->get_date_rfc3339(), 'TITLE' => $this->data->get_title(), 'U_LINK' => $this->data->get_link(), 'HOST' => $this->data->get_host(), 'DESC' => htmlspecialchars($this->data->get_desc(), ENT_COMPAT, 'ISO-8859-1'), 'LANG' => $this->data->get_lang()));
             $items = $this->data->subitems($number, $begin_at);
             foreach ($items as $item) {
                 $desc = $item->get_desc();
                 $tpl->assign_block_vars('item', array('TITLE' => $item->get_title(), 'U_LINK' => $item->get_link(), 'U_GUID' => $item->get_guid(), 'DESC' => htmlspecialchars(second_parse($desc), ENT_COMPAT, 'ISO-8859-1'), 'DATE' => $item->get_date(), 'DATE_RFC822' => $item->get_date_rfc822(), 'DATE_RFC3339' => $item->get_date_rfc3339(), 'C_IMG' => $item->get_image_url() != '' ? true : false, 'U_IMG' => $item->get_image_url()));
             }
         }
     }
     return $tpl->parse(TEMPLATE_STRING_MODE);
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:21,代码来源:feed.class.php

示例4: get_feed_data_struct

 function get_feed_data_struct($idcat = 0)
 {
     global $Cache, $Sql, $LANG, $MEDIA_LANG, $CONFIG, $MEDIA_CONFIG, $MEDIA_CATS;
     $Cache->load('media');
     load_module_lang('media');
     require_once PATH_TO_ROOT . '/media/media_constant.php';
     require_once PATH_TO_ROOT . '/media/media_cats.class.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     $data = new FeedData();
     $data->set_title($MEDIA_LANG['xml_media_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=media&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($MEDIA_LANG['xml_media_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(MEDIA_AUTH_READ);
     $cats = new MediaCats();
     $children_cats = array();
     $cats->build_children_id_list($idcat, $children_cats, RECURSIVE_EXPLORATION, ADD_THIS_CATEGORY_IN_LIST);
     $result = $Sql->query_while("SELECT id, idcat, name, contents, timestamp FROM " . PREFIX . "media WHERE infos = '" . MEDIA_STATUS_APROBED . "' AND idcat IN (" . implode($children_cats, ',') . " ) ORDER BY timestamp DESC" . $Sql->limit(0, $MEDIA_CONFIG['pagin']), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/media/media' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php'));
         $item->set_title($row['name']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($MEDIA_CATS[$row['idcat']]['image']);
         $item->set_auth($cats->compute_heritated_auth($row['idcat'], MEDIA_AUTH_READ, AUTH_PARENT_PRIORITY));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:37,代码来源:media_interface.class.php

示例5: elseif

        $Errorh->handler($LANG['require_cat_create'], E_USER_WARNING);
    }
    $Template->pparse('admin_web_management2');
} elseif (!empty($_POST['previs']) && !empty($id_post)) {
    $Template->set_filenames(array('admin_web_management' => 'web/admin_web_management2.tpl'));
    $row = $Sql->query_array(PREFIX . 'web', '*', "WHERE id = '" . $id . "'", __LINE__, __FILE__);
    $title = retrieve(POST, 'name', '', TSTRING_UNCHANGE);
    $contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE);
    $url = retrieve(POST, 'url', '', TSTRING_UNCHANGE);
    $idcat = retrieve(POST, 'idcat', 0);
    $compt = retrieve(POST, 'compt', 0);
    $aprob = retrieve(POST, 'aprob', 0);
    $aprob_enable = $aprob == 1 ? 'checked="checked"' : '';
    $aprob_disable = $aprob == 0 ? 'checked="checked"' : '';
    $cat = $Sql->query("SELECT name FROM " . PREFIX . "web_cat WHERE id = '" . $idcat . "'", __LINE__, __FILE__);
    $Template->assign_block_vars('web', array('NAME' => $title, 'CONTENTS' => second_parse(stripslashes(strparse($contents))), 'URL' => $url, 'IDCAT' => $idcat, 'CAT' => $cat, 'COMPT' => $compt, 'DATE' => gmdate_format('date_format_short'), 'MODULE_DATA_PATH' => $Template->get_module_data_path('web'), 'L_DESC' => $LANG['description'], 'L_DATE' => $LANG['date'], 'L_COM' => $LANG['com'], 'L_VIEWS' => $LANG['views'], 'L_NOTE' => $LANG['note'], 'L_CATEGORY' => $LANG['categorie']));
    $Template->assign_vars(array('MODULE_DATA_PATH' => $Template->get_module_data_path('web'), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'IDWEB' => $id_post, 'TITLE' => $title, 'KERNEL_EDITOR' => display_editor(), 'NAME' => $title, 'CONTENTS' => $contents, 'URL' => $url, 'IDWEB' => $row['id'], 'IDCAT' => $idcat, 'COMPT' => $compt, 'APROB_ENABLED' => $aprob_enable, 'APROB_DISABLED' => $aprob_disable, 'L_NOTE' => $LANG['note'], 'L_REQUIRE_NAME' => $LANG['require_title'], 'L_REQUIRE_URL' => $LANG['require_url'], 'L_REQUIRE_CAT' => $LANG['require_cat'], 'L_WEB_ADD' => $LANG['web_add'], 'L_WEB_MANAGEMENT' => $LANG['web_management'], 'L_WEB_CAT' => $LANG['cat_management'], 'L_WEB_CONFIG' => $LANG['web_config'], 'L_REQUIRE' => $LANG['require'], 'L_CATEGORY' => $LANG['categorie'], 'L_TITLE' => $LANG['title'], 'L_URL_LINK' => $LANG['url'], 'L_VIEWS' => $LANG['views'], 'L_DESC' => $LANG['description'], 'L_APROB' => $LANG['aprob'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_UPDATE' => $LANG['update'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset']));
    $i = 0;
    $result = $Sql->query_while("SELECT id, name \n\tFROM " . PREFIX . "web_cat", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $selected = $row['id'] == $idcat ? ' selected="selected"' : '';
        $Template->assign_block_vars('select', array('CAT' => '<option value="' . $row['id'] . '"' . $selected . '>' . $row['name'] . '</option>'));
        $i++;
    }
    $Sql->query_close($result);
    if ($i == 0) {
        $Errorh->handler($LANG['require_cat_create'], E_USER_WARNING);
    }
    $Template->pparse('admin_web_management');
} elseif (!empty($_POST['valid']) && !empty($id_post)) {
    $title = retrieve(POST, 'name', '');
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_web.php

示例6: header

if ($CONFIG['maintain'] != -1 && $CONFIG['maintain'] <= time()) {
    header('location: ' . get_start_page());
    exit;
}
$Template->set_filenames(array('maintain' => 'member/maintain.tpl'));
$array_time = array(0 => '-1', 1 => '0', 2 => '60', 3 => '300', 4 => '900', 5 => '1800', 6 => '3600', 7 => '7200', 8 => '86400', 9 => '172800', 10 => '604800');
$array_delay = array(0 => $LANG['unspecified'], 1 => '', 2 => '1 ' . $LANG['minute'], 3 => '5 ' . $LANG['minutes'], 4 => '15 ' . $LANG['minutes'], 5 => '30 ' . $LANG['minutes'], 6 => '1 ' . $LANG['hour'], 7 => '2 ' . $LANG['hours'], 8 => '1 ' . $LANG['day'], 9 => '2 ' . $LANG['days'], 10 => '1 ' . $LANG['week']);
if ($CONFIG['maintain'] != -1) {
    $key = 0;
    $current_time = time();
    for ($i = 10; $i >= 0; $i--) {
        $delay = $CONFIG['maintain'] - $current_time - $array_time[$i];
        if ($delay >= $array_time[$i]) {
            $key = $i;
            break;
        }
    }
    $seconds = gmdate_format('s', $CONFIG['maintain'], TIMEZONE_SITE);
    $array_release = array(gmdate_format('Y', $CONFIG['maintain'], TIMEZONE_SITE), gmdate_format('n', $CONFIG['maintain'], TIMEZONE_SITE) - 1, gmdate_format('j', $CONFIG['maintain'], TIMEZONE_SITE), gmdate_format('G', $CONFIG['maintain'], TIMEZONE_SITE), gmdate_format('i', $CONFIG['maintain'], TIMEZONE_SITE), $seconds < 10 ? trim($seconds, 0) : $seconds);
    $seconds = gmdate_format('s', time(), TIMEZONE_SITE);
    $array_now = array(gmdate_format('Y', time(), TIMEZONE_SITE), gmdate_format('n', time(), TIMEZONE_SITE) - 1, gmdate_format('j', time(), TIMEZONE_SITE), gmdate_format('G', time(), TIMEZONE_SITE), gmdate_format('i', time(), TIMEZONE_SITE), $seconds < 10 ? trim($seconds, 0) : $seconds);
} else {
    $key = -1;
    $array_release = array('0', '0', '0', '0', '0', '0');
    $array_now = array('0', '0', '0', '0', '0', '0');
}
$Template->assign_vars(array('SITE_NAME' => $CONFIG['site_name'], 'VERSION' => $CONFIG['version'], 'THEME' => get_utheme(), 'DELAY' => isset($array_delay[$key + 1]) ? $array_delay[$key + 1] : '0', 'MAINTAIN_NOW_FORMAT' => implode(',', $array_now), 'MAINTAIN_RELEASE_FORMAT' => implode(',', $array_release), 'U_INDEX' => !$User->check_level(ADMIN_LEVEL) ? '<a href="../admin/admin_index.php">' . $LANG['admin'] . '</a>' : '<a href="' . get_start_page() . '">' . $LANG['home'] . '</a>', 'L_XML_LANGUAGE' => $LANG['xml_lang'], 'L_MAINTAIN' => !empty($CONFIG['maintain_text']) ? second_parse($CONFIG['maintain_text']) : $LANG['maintain'], 'L_MAINTAIN_TITLE' => $LANG['title_maintain'], 'L_LOADING' => $LANG['loading'], 'L_DAYS' => $LANG['days'], 'L_HOURS' => $LANG['hours'], 'L_MIN' => $LANG['minutes'], 'L_SEC' => $LANG['seconds'], 'L_POWERED_BY' => $LANG['powered_by'], 'L_PHPBOOST_RIGHT' => $LANG['phpboost_right'], 'PHPBOOST_VERSION' => $CONFIG['version']));
if ($CONFIG['maintain_delay'] == 1 && $CONFIG['maintain'] != -1) {
    $Template->assign_vars(array('C_DISPLAY_DELAY' => true, 'DELAY' => isset($array_delay[$key + 1]) ? $array_delay[$key + 1] : '0', 'L_MAINTAIN_DELAY' => $LANG['maintain_delay']));
}
$Template->pparse('maintain');
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:maintain.php

示例7: get_ulang

 }
 $user_group_list = !empty($user_group_list) ? '<ul style="list-style-type:none;">' . $user_group_list . '</ul>' : $LANG['member'];
 $Template->assign_vars(array('C_USER_PROFIL_EDIT' => $User->get_attribute('user_id') === $id_get || $User->check_level(ADMIN_LEVEL) ? true : false, 'C_PROFIL_USER_VIEW' => true, 'SID' => SID, 'LANG' => get_ulang(), 'USER_NAME' => $row['login'], 'MAIL' => $user_mail, 'STATUT' => $row['user_warning'] < '100' || time() - $row['user_ban'] < 0 ? $user_rank : $LANG['banned'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'LAST_CONNECT' => gmdate_format('date_format_short', $row['last_connect']), 'USER_AVATAR' => $user_avatar, 'USER_MSG' => $row['user_msg'], 'USER_GROUPS_LIST' => $user_group_list, 'LOCAL' => !empty($row['user_local']) ? $row['user_local'] : '&nbsp;', 'WEB' => $user_web, 'OCCUPATION' => !empty($row['user_occupation']) ? $row['user_occupation'] : '&nbsp;', 'HOBBIES' => !empty($row['user_hobbies']) ? $row['user_hobbies'] : '&nbsp;', 'USER_SEX' => $user_sex, 'USER_AGE' => $row['user_born'] != '0000-00-00' && $user_born > 0 && $user_born < 125 ? $user_born . ' ' . $LANG['years_old'] : $LANG['unknow'], 'USER_DESC' => !empty($row['user_desc']) ? second_parse($row['user_desc']) : '&nbsp;', 'USER_MSN' => !empty($row['user_msn']) ? $row['user_msn'] : '&nbsp;', 'USER_YAHOO' => !empty($row['user_yahoo']) ? $row['user_yahoo'] : '&nbsp;', 'L_PROFIL' => $LANG['profile'], 'L_PROFIL_EDIT' => $LANG['profile_edition'], 'L_AVATAR' => $LANG['avatar'], 'L_PSEUDO' => $LANG['pseudo'], 'L_STATUT' => $LANG['status'], 'L_GROUPS' => $LANG['groups'], 'L_REGISTERED' => $LANG['registered_on'], 'L_LAST_CONNECT' => $LANG['last_connect'], 'L_NBR_MSG' => $LANG['nbr_message'], 'L_DISPLAY_USER_MSG' => $LANG['member_msg_display'], 'L_WEB_SITE' => $LANG['web_site'], 'L_LOCALISATION' => $LANG['localisation'], 'L_JOB' => $LANG['job'], 'L_HOBBIES' => $LANG['hobbies'], 'L_SEX' => $LANG['sex'], 'L_AGE' => $LANG['age'], 'L_BIOGRAPHY' => $LANG['biography'], 'L_CONTACT' => $LANG['contact'], 'L_MAIL' => $LANG['mail'], 'L_PRIVATE_MESSAGE' => $LANG['private_message'], 'U_USER_SCRIPT' => $User->get_attribute('user_id') === $id_get ? '../member/member' . url('.php?id=' . $User->get_attribute('user_id') . '&amp;edit=1') : '../admin/admin_members.php?id=' . $id_get . '&amp;edit=1', 'U_USER_MSG' => url('.php?id=' . $id_get), 'U_USER_PM' => url('.php?pm=' . $id_get, '-' . $id_get . '.php')));
 $extend_field_exist = $Sql->query("SELECT COUNT(*) FROM " . DB_TABLE_MEMBER_EXTEND_CAT . " WHERE display = 1", __LINE__, __FILE__);
 if ($extend_field_exist > 0) {
     $Template->assign_vars(array('C_PROFIL_MISCELLANEOUS' => true, 'L_MISCELLANEOUS' => $LANG['miscellaneous']));
     $result = $Sql->query_while("SELECT exc.name, exc.contents, exc.field, exc.field_name, exc.possible_values, exc.default_values, ex.*\n\t\t\tFROM " . DB_TABLE_MEMBER_EXTEND_CAT . " exc\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER_EXTEND . " ex ON ex.user_id = '" . $id_get . "'\n\t\t\tWHERE exc.display = 1\n\t\t\tORDER BY exc.class", __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $field = '';
         $row[$row['field_name']] = !empty($row[$row['field_name']]) ? $row[$row['field_name']] : $row['default_values'];
         switch ($row['field']) {
             case 1:
                 $field = $row[$row['field_name']];
                 break;
             case 2:
                 $field = second_parse($row[$row['field_name']]);
                 break;
             case 3:
                 $field = $row[$row['field_name']];
                 break;
             case 4:
                 $field = implode(', ', explode('|', $row[$row['field_name']]));
                 break;
             case 5:
                 $field = $row[$row['field_name']];
                 break;
             case 6:
                 $field = implode(', ', explode('|', $row[$row['field_name']]));
                 break;
         }
         $Template->assign_block_vars('miscellaneous_list', array('NAME' => ucfirst($row['name']), 'DESC' => !empty($row['contents']) ? $row['contents'] : '', 'FIELD' => $field));
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:member.php

示例8: array

    if (!$faq_display_block) {
        $template->assign_block_vars('questions', array());
    } else {
        $template->assign_block_vars('questions_block', array());
    }
    while ($row = $Sql->fetch_assoc($result)) {
        if (!$faq_display_block) {
            $template->assign_block_vars('questions.faq', array('ID_QUESTION' => $row['id'], 'QUESTION' => $row['question'], 'ANSWER' => second_parse($row['answer']), 'U_QUESTION' => url('faq.php?id=' . $id_faq . '&amp;question=' . $row['id'], 'faq-' . $id_faq . '+' . url_encode_rewrite($TITLE) . '.php?question=' . $row['id']) . '#q' . $row['id'], 'U_DEL' => url('action.php?del=' . $row['id'] . '&amp;token=' . $Session->get_token()), 'U_DOWN' => url('action.php?down=' . $row['id']), 'U_UP' => url('action.php?up=' . $row['id']), 'U_MOVE' => url('management.php?move=' . $row['id']), 'U_EDIT' => url('management.php?edit=' . $row['id']), 'C_HIDE_ANSWER' => $row['id'] != $id_question, 'C_SHOW_ANSWER' => $row['id'] == $id_question));
            if ($row['q_order'] > 1) {
                $template->assign_block_vars('questions.faq.up', array());
            }
            if ($row['q_order'] < $num_rows) {
                $template->assign_block_vars('questions.faq.down', array());
            }
        } else {
            $template->assign_block_vars('questions_block.header', array('QUESTION' => $row['question'], 'ID' => $row['id']));
            $template->assign_block_vars('questions_block.contents', array('ANSWER' => second_parse($row['answer']), 'QUESTION' => $row['question'], 'ID' => $row['id'], 'U_DEL' => url('action.php?del=' . $row['id'] . '&amp;token=' . $Session->get_token()), 'U_DOWN' => url('action.php?down=' . $row['id']), 'U_UP' => url('action.php?up=' . $row['id']), 'U_EDIT' => url('management.php?edit=' . $row['id']), 'U_MOVE' => url('management.php?move=' . $row['id']), 'U_QUESTION' => url('faq.php?id=' . $id_faq . '&amp;question=' . $row['id'], 'faq-' . $id_faq . '+' . url_encode_rewrite($TITLE) . '.php?question=' . $row['id']) . '#q' . $row['id']));
            if ($row['q_order'] > 1) {
                $template->assign_block_vars('questions_block.contents.up', array());
            }
            if ($row['q_order'] < $num_rows) {
                $template->assign_block_vars('questions_block.contents.down', array());
            }
        }
    }
} else {
    $template->assign_block_vars('no_question', array());
}
$template->assign_vars(array('L_NO_QUESTION_THIS_CATEGORY' => $FAQ_LANG['faq_no_question_here'], 'L_CAT_MANAGEMENT' => $FAQ_LANG['category_manage'], 'L_EDIT' => $FAQ_LANG['update'], 'L_DELETE' => $FAQ_LANG['delete'], 'L_UP' => $FAQ_LANG['up'], 'L_DOWN' => $FAQ_LANG['down'], 'L_MOVE' => $FAQ_LANG['move'], 'L_CONFIRM_DELETE' => $FAQ_LANG['confirm_delete'], 'L_QUESTION_URL' => 'URL de la question', 'LANG' => get_ulang(), 'THEME' => get_utheme(), 'C_ADMIN' => $User->check_level(ADMIN_LEVEL), 'U_MANAGEMENT' => url('management.php?faq=' . $id_faq), 'U_ADMIN_CAT' => $id_faq > 0 ? url('admin_faq_cats.php?edit=' . $id_faq) : url('admin_faq_cats.php')));
$template->parse();
include_once '../kernel/footer.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:faq.php

示例9: shoutbox_mini

function shoutbox_mini($position, $block)
{
    global $Cache, $LANG, $User, $CONFIG_SHOUTBOX, $nbr_members, $last_member_id, $last_member_login, $Sql;
    if (strpos(SCRIPT, '/shoutbox/shoutbox.php') === false) {
        load_module_lang('shoutbox');
        $Cache->load('shoutbox');
        ###########################Insertion##############################
        $shoutbox = retrieve(POST, 'shoutbox', false);
        if ($shoutbox) {
            if ($User->get_attribute('user_readonly') > time()) {
                $Errorh->handler('e_readonly', E_USER_REDIRECT);
            }
            $shout_pseudo = substr(retrieve(POST, 'shout_pseudo', $LANG['guest']), 0, 25);
            $shout_contents = retrieve(POST, 'shout_contents', '', TSTRING_UNCHANGE);
            if (!empty($shout_pseudo) && !empty($shout_contents)) {
                if ($User->check_level($CONFIG_SHOUTBOX['shoutbox_auth'])) {
                    $check_time = $User->get_attribute('user_id') !== -1 && $CONFIG['anti_flood'] == 1 ? $Sql->query("SELECT MAX(timestamp) as timestamp FROM " . PREFIX . "shoutbox WHERE user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__) : '';
                    if (!empty($check_time) && !$User->check_max_value(AUTH_FLOOD)) {
                        if ($check_time >= time() - $CONFIG['delay_flood']) {
                            redirect(HOST . DIR . '/shoutbox/shoutbox.php' . url('?error=flood', '', '&'));
                        }
                    }
                    $shout_contents = strparse($shout_contents, $CONFIG_SHOUTBOX['shoutbox_forbidden_tags']);
                    if (!check_nbr_links($shout_pseudo, 0)) {
                        redirect(HOST . DIR . '/shoutbox/shoutbox.php' . url('?error=lp_flood', '', '&'));
                    }
                    if (!check_nbr_links($shout_contents, $CONFIG_SHOUTBOX['shoutbox_max_link'])) {
                        redirect(HOST . DIR . '/shoutbox/shoutbox.php' . url('?error=l_flood', '', '&'));
                    }
                    $Sql->query_inject("INSERT INTO " . PREFIX . "shoutbox (login, user_id, level, contents, timestamp) VALUES ('" . $shout_pseudo . "', '" . $User->get_attribute('user_id') . "', '" . $User->get_attribute('level') . "', '" . $shout_contents . "', '" . time() . "')", __LINE__, __FILE__);
                    redirect(HOST . url(SCRIPT . '?' . QUERY_STRING, '', '&'));
                } else {
                    redirect(HOST . DIR . '/shoutbox/shoutbox.php' . url('?error=auth', '', '&'));
                }
            }
        }
        ###########################Affichage##############################
        $tpl = new Template('shoutbox/shoutbox_mini.tpl');
        import('core/menu_service');
        MenuService::assign_positions_conditions($tpl, $block);
        if ($User->get_attribute('user_id') !== -1) {
            $tpl->assign_vars(array('SHOUTBOX_PSEUDO' => $User->get_attribute('login'), 'C_HIDDEN_SHOUT' => true));
        } else {
            $tpl->assign_vars(array('SHOUTBOX_PSEUDO' => $LANG['guest'], 'C_VISIBLE_SHOUT' => true));
        }
        $refresh_delay = empty($CONFIG_SHOUTBOX['shoutbox_refresh_delay']) ? 60 : $CONFIG_SHOUTBOX['shoutbox_refresh_delay'];
        $tpl->assign_vars(array('SID' => SID, 'SHOUT_REFRESH_DELAY' => (int) max($refresh_delay, 0), 'L_ALERT_TEXT' => $LANG['require_text'], 'L_ALERT_UNAUTH_POST' => $LANG['e_unauthorized'], 'L_ALERT_FLOOD' => $LANG['e_flood'], 'L_ALERT_LINK_FLOOD' => sprintf($LANG['e_l_flood'], $CONFIG_SHOUTBOX['shoutbox_max_link']), 'L_ALERT_LINK_PSEUDO' => $LANG['e_link_pseudo'], 'L_ALERT_INCOMPLETE' => $LANG['e_incomplete'], 'L_ALERT_READONLY' => $LANG['e_readonly'], 'L_DELETE_MSG' => $LANG['alert_delete_msg'], 'L_SHOUTBOX' => $LANG['title_shoutbox'], 'L_MESSAGE' => $LANG['message'], 'L_PSEUDO' => $LANG['pseudo'], 'L_SUBMIT' => $LANG['submit'], 'L_REFRESH' => $LANG['refresh'], 'L_ARCHIVES' => $LANG['archives']));
        $array_class = array('member', 'modo', 'admin');
        $result = $Sql->query_while("SELECT id, login, user_id, level, contents\n    \tFROM " . PREFIX . "shoutbox\n    \tORDER BY timestamp DESC\n    \t" . $Sql->limit(0, 25), __LINE__, __FILE__);
        while ($row = $Sql->fetch_assoc($result)) {
            $row['user_id'] = (int) $row['user_id'];
            if ($User->check_level(MODO_LEVEL) || $row['user_id'] === $User->get_attribute('user_id') && $User->get_attribute('user_id') !== -1) {
                $del_message = '<script type="text/javascript"><!--
    			document.write(\'<a href="javascript:Confirm_del_shout(' . $row['id'] . ');" title="' . $LANG['delete'] . '"><img src="' . TPL_PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/delete_mini.png" alt="" /></a>\');
    			--></script><ins><noscript><p><a href="' . TPL_PATH_TO_ROOT . '/shoutbox/shoutbox' . url('.php?del=true&amp;id=' . $row['id']) . '"><img src="' . TPL_PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/delete_mini.png" alt="" /></a></p></noscript></ins>';
            } else {
                $del_message = '';
            }
            if ($row['user_id'] !== -1) {
                $row['login'] = $del_message . ' <a style="font-size:10px;" class="' . $array_class[$row['level']] . '" href="' . TPL_PATH_TO_ROOT . '/member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . (!empty($row['login']) ? wordwrap_html($row['login'], 16) : $LANG['guest']) . '</a>';
            } else {
                $row['login'] = $del_message . ' <span class="text_small" style="font-style: italic;">' . (!empty($row['login']) ? wordwrap_html($row['login'], 16) : $LANG['guest']) . '</span>';
            }
            $tpl->assign_block_vars('shout', array('IDMSG' => $row['id'], 'PSEUDO' => $row['login'], 'CONTENTS' => ucfirst(second_parse($row['contents']))));
        }
        $Sql->query_close($result);
        return $tpl->parse(TEMPLATE_STRING_MODE);
    }
    return '';
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:70,代码来源:shoutbox_mini.php

示例10: define

require_once '../kernel/begin.php';
define('TITLE', $LANG['title_register']);
require_once '../kernel/header.php';
$Cache->load('member');
if (!$CONFIG_USER['activ_register']) {
    redirect(get_start_page());
}
$key = retrieve(GET, 'key', '');
$get_error = retrieve(GET, 'error', '');
$get_erroru = retrieve(GET, 'erroru', '');
$register_valid = retrieve(POST, 'register_valid', '');
$register_confirm = retrieve(POST, 'confirm', '');
if (empty($key)) {
    if (!$User->check_level(MEMBER_LEVEL) && !empty($CONFIG_USER['msg_register']) && empty($register_confirm) && empty($get_error) && empty($get_erroru)) {
        $Template->set_filenames(array('register' => 'member/register.tpl'));
        $Template->assign_vars(array('C_CONFIRM_REGISTER' => true, 'L_HAVE_TO_ACCEPT' => !empty($register_valid) ? $LANG['register_have_to_accept'] : '', 'MSG_REGISTER' => second_parse($CONFIG_USER['msg_register']), 'L_REGISTER' => $LANG['register'], 'L_REGISTRATION_TERMS' => $LANG['register_terms'], 'L_ACCEPT' => $LANG['register_accept'], 'L_SUBMIT' => $LANG['submit']));
        $Template->pparse('register');
    } elseif ($User->check_level(MEMBER_LEVEL) !== true && (!empty($register_confirm) || empty($CONFIG_USER['msg_register']) || !empty($get_error) || !empty($get_erroru))) {
        $Template->set_filenames(array('register' => 'member/register.tpl'));
        switch ($get_error) {
            case 'verif_code':
                $errstr = $LANG['e_incorrect_verif_code'];
                break;
            case 'lenght_mini':
                $errstr = $LANG['pseudo_how'] . ', ' . $LANG['password_how'];
                break;
            case 'pass_same':
                $errstr = $LANG['e_pass_same'];
                break;
            case 'incomplete':
                $errstr = $LANG['e_incomplete'];
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:register.php

示例11: url

                $edit = '&nbsp;&nbsp;<a href="calendar' . url('.php?edit=1&amp;id=' . $row['id']) . '" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" class="valign_middle" /></a>';
                $del = '&nbsp;&nbsp;<a href="calendar' . url('.php?delete=1&amp;id=' . $row['id'] . '&amp;token=' . $Session->get_token()) . '" title="' . $LANG['delete'] . '" onclick="javascript:return Confirm_del();"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" class="valign_middle" alt="" /></a>';
                $java = '<script type="text/javascript">
				<!--
				function Confirm_del() {
				return confirm("' . $LANG['alert_delete_msg'] . '");
				}
				-->
				</script>';
            } else {
                $edit = '';
                $del = '';
                $java = '';
            }
            import('content/comments');
            $Template->assign_block_vars('action', array('DATE' => gmdate_format('date_format', $row['timestamp']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'LOGIN' => '<a class="com" href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>', 'COM' => Comments::com_display_link($row['nbr_com'], '../calendar/calendar' . url('.php?d=' . $day . '&amp;m=' . $month . '&amp;y=' . $year . '&amp;e=' . $row['id'] . '&amp;com=0', '-' . $day . '-' . $month . '-' . $year . '-' . $row['id'] . '.php?com=0'), $row['id'], 'calendar'), 'EDIT' => $edit, 'DEL' => $del, 'L_ON' => $LANG['on']));
            $check_action = true;
        }
        $Sql->query_close($result);
        if (!isset($check_action)) {
            $Template->assign_block_vars('action', array('TITLE' => '&nbsp;', 'LOGIN' => '', 'DATE' => gmdate_format('date_format_short', mktime(0, 0, 0, $month, $day, $year)), 'CONTENTS' => '<p style="text-align:center;">' . $LANG['no_current_action'] . '</p>'));
        }
        $Template->assign_vars(array('JAVA' => $java, 'L_ON' => $LANG['on']));
    }
    if (isset($_GET['com'])) {
        $Template->assign_vars(array('COMMENTS' => display_comments('calendar', $get_event, url('calendar.php?d=' . $day . '&amp;m=' . $month . '&amp;y=' . $year . '&amp;e=' . $get_event . '&amp;com=%s', 'calendar-' . $day . '-' . $month . '-' . $year . '-' . $get_event . '.php?com=%s'))));
    }
    $Template->pparse('calendar');
} elseif (!empty($id)) {
    if (!$User->check_level(ADMIN_LEVEL)) {
        $Errorh->handler('e_auth', E_USER_REDIRECT);
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:calendar.php

示例12: elseif

    } elseif ($row['user_sex'] == 2) {
        $user_sex = $LANG['sex'] . ': <img src="../templates/' . get_utheme() . '/images/woman.png" alt="" /><br />';
    } else {
        $user_sex = '';
    }
    if (!empty($row['user_local'])) {
        $user_local = $LANG['place'] . ': ' . (strlen($row['user_local']) > 15 ? substr_html($row['user_local'], 0, 15) . '...<br />' : $row['user_local'] . '<br />');
    } else {
        $user_local = '';
    }
    if ($row['user_msg'] >= 1) {
        $user_msg = '<a href="../forum/membermsg' . url('.php?id=' . $row['user_id'], '') . '" class="small_link">' . $LANG['message_s'] . '</a>: ' . $row['user_msg'];
    } else {
        $user_msg = !$is_guest ? '<a href="../forum/membermsg' . url('.php?id=' . $row['user_id'], '') . '" class="small_link">' . $LANG['message'] . '</a>: 0' : $LANG['message'] . ': 0';
    }
    $Template->assign_block_vars('msg', array('ID' => $row['id'], 'CLASS_COLOR' => $j % 2 == 0 ? '' : 2, 'FORUM_ONLINE_STATUT_USER' => !empty($row['connect']) ? 'online' : 'offline', 'FORUM_USER_LOGIN' => wordwrap_html($row['login'], 13), 'FORUM_MSG_DATE' => $LANG['on'] . ' ' . gmdate_format('date_format', $row['timestamp']), 'FORUM_MSG_CONTENTS' => second_parse($row['contents']), 'FORUM_USER_EDITOR_LOGIN' => $row['login_edit'], 'FORUM_USER_EDITOR_DATE' => gmdate_format('date_format', $row['timestamp_edit']), 'USER_RANK' => $row['user_warning'] < '100' || time() - $row['user_ban'] < 0 ? $user_rank : $LANG['banned'], 'USER_IMG_ASSOC' => $user_assoc_img, 'USER_AVATAR' => $user_avatar, 'USER_GROUP' => $user_groups, 'USER_DATE' => !$is_guest ? $LANG['registered_on'] . ': ' . gmdate_format('date_format_short', $row['registered']) : '', 'USER_SEX' => $user_sex, 'USER_MSG' => !$is_guest ? $user_msg : '', 'USER_LOCAL' => $user_local, 'USER_MAIL' => !empty($row['user_mail']) && $row['user_show_mail'] == '1' ? '<a href="mailto:' . $row['user_mail'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/email.png" alt="' . $row['user_mail'] . '" title="' . $row['user_mail'] . '" /></a>' : '', 'USER_MSN' => !empty($row['user_msn']) ? '<a href="mailto:' . $row['user_msn'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/msn.png" alt="' . $row['user_msn'] . '" title="' . $row['user_msn'] . '" /></a>' : '', 'USER_YAHOO' => !empty($row['user_yahoo']) ? '<a href="mailto:' . $row['user_yahoo'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/yahoo.png" alt="' . $row['user_yahoo'] . '" title="' . $row['user_yahoo'] . '" /></a>' : '', 'USER_SIGN' => !empty($row['user_sign']) ? '____________________<br />' . second_parse($row['user_sign']) : '', 'USER_WEB' => !empty($row['user_web']) ? '<a href="' . $row['user_web'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/user_web.png" alt="' . $row['user_web'] . '" title="' . $row['user_web'] . '" /></a>' : '', 'USER_WARNING' => $row['user_warning'], 'L_FORUM_QUOTE_LAST_MSG' => $quote_last_msg == 1 && $i == 0 ? $LANG['forum_quote_last_msg'] : '', 'C_FORUM_USER_LOGIN' => !empty($row['login']) ? true : false, 'C_FORUM_MSG_EDIT' => $edit, 'C_FORUM_MSG_DEL' => $del, 'C_FORUM_MSG_DEL_MSG' => !$first_message ? true : false, 'C_FORUM_MSG_CUT' => $cut, 'C_FORUM_USER_EDITOR' => $row['timestamp_edit'] > 0 && $CONFIG_FORUM['edit_mark'] == '1', 'C_FORUM_USER_EDITOR_LOGIN' => !empty($row['login_edit']) ? true : false, 'C_FORUM_MODERATOR' => $moderator, 'U_FORUM_USER_LOGIN' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_FORUM_MSG_EDIT' => url('.php?new=msg&amp;idm=' . $row['id'] . '&amp;id=' . $topic['idcat'] . '&amp;idt=' . $id_get), 'U_FORUM_USER_EDITOR_LOGIN' => url('.php?id=' . $row['user_id_edit'], '-' . $row['user_id_edit'] . '.php'), 'U_FORUM_MSG_DEL' => url('.php?del=1&amp;idm=' . $row['id'] . '&amp;token=' . $Session->get_token()), 'U_FORUM_WARNING' => url('.php?action=warning&amp;id=' . $row['user_id']), 'U_FORUM_PUNISHEMENT' => url('.php?action=punish&amp;id=' . $row['user_id']), 'U_FORUM_MSG_CUT' => url('.php?idm=' . $row['id']), 'U_VARS_ANCRE' => url('.php?id=' . $id_get . (!empty($page) ? '&amp;pt=' . $page : ''), '-' . $id_get . (!empty($page) ? '-' . $page : '') . $rewrited_title . '.php'), 'U_VARS_QUOTE' => url('.php?quote=' . $row['id'] . '&amp;id=' . $id_get . (!empty($page) ? '&amp;pt=' . $page : ''), '-' . $id_get . (!empty($page) ? '-' . $page : '-0') . '-0-' . $row['id'] . $rewrited_title . '.php'), 'USER_PM' => !$is_guest ? '<a href="../member/pm' . url('.php?pm=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/pm.png" alt="pm" /></a>' : ''));
    if (!empty($row['trackid'])) {
        $track = $row['track'] ? true : false;
        $track_pm = $row['trackpm'] ? true : false;
        $track_mail = $row['trackmail'] ? true : false;
    }
    $j++;
    $i++;
}
$Sql->query_close($result);
list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/topic.php' AND s.session_script_get LIKE '%id=" . $id_get . "%'");
$Template->assign_vars(array('TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SELECT_CAT' => forum_list_cat($topic['idcat'], $CAT_FORUM[$topic['idcat']]['level']), 'U_SUSCRIBE' => $track === false ? url('.php?t=' . $id_get) : url('.php?ut=' . $id_get), 'U_SUSCRIBE_PM' => url('.php?token=' . $Session->get_token() . '&amp;' . ($track_pm ? 'utp' : 'tp') . '=' . $id_get), 'U_SUSCRIBE_MAIL' => url('.php?token=' . $Session->get_token() . '&amp;' . ($track_mail ? 'utm' : 'tm') . '=' . $id_get), 'IS_TRACK' => $track ? 'true' : 'false', 'IS_TRACK_PM' => $track_pm ? 'true' : 'false', 'IS_TRACK_MAIL' => $track_mail ? 'true' : 'false', 'IS_CHANGE' => $topic['display_msg'] ? 'true' : 'false', 'U_ALERT' => url('.php?id=' . $id_get), 'L_TRACK_DEFAULT' => $track === false ? $LANG['track_topic'] : $LANG['untrack_topic'], 'L_SUSCRIBE_DEFAULT' => $track_mail === false ? $LANG['track_topic_mail'] : $LANG['untrack_topic_mail'], 'L_SUSCRIBE_PM_DEFAULT' => $track_pm === false ? $LANG['track_topic_pm'] : $LANG['untrack_topic_pm'], 'L_TRACK' => $LANG['track_topic'], 'L_UNTRACK' => $LANG['untrack_topic'], 'L_SUSCRIBE_PM' => $LANG['track_topic_pm'], 'L_UNSUSCRIBE_PM' => $LANG['untrack_topic_pm'], 'L_SUSCRIBE' => $LANG['track_topic_mail'], 'L_UNSUSCRIBE' => $LANG['untrack_topic_mail'], 'L_ALERT' => $LANG['alert_topic'], 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
$contents = '';
if (!empty($quote_get)) {
    $quote_msg = $Sql->query_array(PREFIX . 'forum_msg', 'user_id', 'contents', "WHERE id = '" . $quote_get . "'", __LINE__, __FILE__);
    $pseudo = $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $quote_msg['user_id'] . "'", __LINE__, __FILE__);
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:topic.php

示例13: retrieve

<?php

require_once '../kernel/begin.php';
require_once 'pages_defines.php';
$encoded_title = retrieve(GET, 'title', '', TSTRING);
$Cache->load('pages');
if (!empty($encoded_title)) {
    $page_infos = $Sql->query_array(PREFIX . "pages", 'id', 'title', 'auth', 'is_cat', 'id_cat', 'hits', 'count_hits', 'activ_com', 'nbr_com', 'redirect', 'contents', "WHERE encoded_title = '" . $encoded_title . "'", __LINE__, __FILE__);
    $num_rows = !empty($page_infos['title']) ? 1 : 0;
    if ($page_infos['redirect'] > 0) {
        $redirect_title = $page_infos['title'];
        $redirect_id = $page_infos['id'];
        $page_infos = $Sql->query_array(PREFIX . "pages", 'id', 'title', 'auth', 'is_cat', 'id_cat', 'hits', 'count_hits', 'activ_com', 'nbr_com', 'redirect', 'contents', "WHERE id = '" . $page_infos['redirect'] . "'", __LINE__, __FILE__);
    } else {
        $redirect_title = '';
    }
    $special_auth = !empty($page_infos['auth']);
    $array_auth = unserialize($page_infos['auth']);
    if ($special_auth && !$User->check_auth($array_auth, READ_PAGE) || !$special_auth && !$User->check_auth($_PAGES_CONFIG['auth'], READ_PAGE)) {
        redirect(HOST . DIR . url('/pages/pages.php?error=e_auth'));
    }
}
if (empty($page_infos['id'])) {
    exit;
}
require_once PATH_TO_ROOT . '/kernel/header_no_display.php';
$template = new Template('framework/content/print.tpl');
$template->assign_vars(array('PAGE_TITLE' => $page_infos['title'] . ' - ' . $CONFIG['site_name'], 'TITLE' => $page_infos['title'], 'L_XML_LANGUAGE' => $LANG['xml_lang'], 'CONTENT' => second_parse($page_infos['contents'])));
$template->parse();
require_once PATH_TO_ROOT . '/kernel/footer_no_display.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:30,代码来源:print.php

示例14: Confirm

        $Errorh->handler('e_unexist_link_web', E_USER_REDIRECT);
    }
    if ($User->check_level(ADMIN_LEVEL)) {
        $java = "<script language='JavaScript' type='text/javascript'>\n\t\t<!--\n\t\tfunction Confirm() {\n\t\treturn confirm('" . $LANG['delete_link'] . "');\n\t\t}\n\t\t-->\n\t\t</script>";
        $edit = '&nbsp;&nbsp;<a href="../web/admin_web' . url('.php?id=' . $web['id']) . '" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" class="valign_middle" /></a>';
        $del = '&nbsp;&nbsp;<a href="../web/admin_web.php?delete=1&amp;id=' . $web['id'] . '&amp;token=' . $Session->get_token() . '" title="' . $LANG['delete'] . '" onclick="javascript:return Confirm();"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" class="valign_middle" /></a>';
    } else {
        $edit = '';
        $del = '';
        $java = '';
    }
    $Template->assign_vars(array('JAVA' => $java, 'EDIT' => $edit, 'DEL' => $del));
    import('content/note');
    $Note = new Note('web', $idweb, url('web.php?cat=' . $idcat . '&amp;id=' . $idweb, 'web-' . $idcat . '-' . $idweb . '.php'), $CONFIG_WEB['note_max'], '', NOTE_DISPLAY_NOTE);
    import('content/comments');
    $Template->assign_vars(array('C_DISPLAY_WEB' => true, 'MODULE_DATA_PATH' => $Template->get_module_data_path('web'), 'IDWEB' => $web['id'], 'NAME' => $web['title'], 'CONTENTS' => second_parse($web['contents']), 'URL' => $web['url'], 'CAT' => $CAT_WEB[$idcat]['name'], 'DATE' => gmdate_format('date_format_short', $web['timestamp']), 'COMPT' => $web['compt'], 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'COM' => Comments::com_display_link($web['nbr_com'], '../web/web' . url('.php?cat=' . $idcat . '&amp;id=' . $idweb . '&amp;com=0', '-' . $idcat . '-' . $idweb . '.php?com=0'), $idweb, 'web'), 'KERNEL_NOTATION' => $Note->display_form(), 'U_WEB_CAT' => url('.php?cat=' . $idcat, '-' . $idcat . '.php'), 'L_DESC' => $LANG['description'], 'L_CAT' => $LANG['category'], 'L_DATE' => $LANG['date'], 'L_TIMES' => $LANG['n_time'], 'L_VIEWS' => $LANG['views']));
    if (isset($_GET['com'])) {
        $Template->assign_vars(array('COMMENTS' => display_comments('web', $idweb, url('web.php?cat=' . $idcat . '&amp;id=' . $idweb . '&amp;com=%s', 'web-' . $idcat . '-' . $idweb . '.php?com=%s'))));
    }
    $Template->pparse('web');
} elseif (!empty($idcat) && empty($idweb)) {
    $Template->set_filenames(array('web' => 'web/web.tpl'));
    if (!$User->check_level($CAT_WEB[$idcat]['secure'])) {
        $Errorh->handler('e_auth', E_USER_REDIRECT);
    }
    $nbr_web = $Sql->query("SELECT COUNT(*) as compt \n\tFROM " . PREFIX . "web \n\tWHERE aprob = 1 AND idcat = '" . $idcat . "'", __LINE__, __FILE__);
    $Template->assign_vars(array('C_WEB_LINK' => true, 'C_IS_ADMIN' => $User->check_level(ADMIN_LEVEL), 'CAT_NAME' => $CAT_WEB[$idcat]['name'], 'NO_CAT' => $nbr_web == 0 ? $LANG['none_link'] : '', 'MAX_NOTE' => $CONFIG_WEB['note_max'], 'L_LINK' => $LANG['link'], 'L_DATE' => $LANG['date'], 'L_VIEW' => $LANG['views'], 'L_NOTE' => $LANG['note'], 'L_COM' => $LANG['com'], 'U_WEB_ALPHA_TOP' => url('.php?sort=alpha&amp;mode=desc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=alpha&amp;mode=desc'), 'U_WEB_ALPHA_BOTTOM' => url('.php?sort=alpha&amp;mode=asc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=alpha&amp;mode=asc'), 'U_WEB_DATE_TOP' => url('.php?sort=date&amp;mode=desc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=date&amp;mode=desc'), 'U_WEB_DATE_BOTTOM' => url('.php?sort=date&amp;mode=asc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=date&amp;mode=asc'), 'U_WEB_VIEW_TOP' => url('.php?sort=view&amp;mode=desc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=view&amp;mode=desc'), 'U_WEB_VIEW_BOTTOM' => url('.php?sort=view&amp;mode=asc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=view&amp;mode=asc'), 'U_WEB_NOTE_TOP' => url('.php?sort=note&amp;mode=desc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=note&amp;mode=desc'), 'U_WEB_NOTE_BOTTOM' => url('.php?sort=note&amp;mode=asc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=note&amp;mode=asc'), 'U_WEB_COM_TOP' => url('.php?sort=com&amp;mode=desc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=com&amp;mode=desc'), 'U_WEB_COM_BOTTOM' => url('.php?sort=com&amp;mode=asc&amp;cat=' . $idcat, '-' . $idcat . '.php?sort=com&amp;mode=asc')));
    $get_sort = retrieve(GET, 'sort', '');
    switch ($get_sort) {
        case 'alpha':
            $sort = 'title';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:web.php

示例15: get_feed_data_struct

 function get_feed_data_struct($idcat = 0, $name = '')
 {
     require_once PATH_TO_ROOT . '/download/download_auth.php';
     require_once PATH_TO_ROOT . '/download/download_cats.class.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     global $Cache, $Sql, $LANG, $DOWNLOAD_LANG, $CONFIG, $CONFIG_DOWNLOAD, $DOWNLOAD_CATS;
     load_module_lang('download');
     $Cache->load('download');
     $data = new FeedData();
     $data->set_title($DOWNLOAD_LANG['xml_download_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=download&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($DOWNLOAD_LANG['xml_download_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(DOWNLOAD_READ_CAT_AUTH_BIT);
     $cats = new DownloadCats();
     $children_cats = array();
     $cats->build_children_id_list($idcat, $children_cats, RECURSIVE_EXPLORATION, ADD_THIS_CATEGORY_IN_LIST);
     $req = "SELECT id, idcat, title, contents, timestamp, image\n        FROM " . PREFIX . "download\n        WHERE visible = 1 AND idcat IN (" . implode($children_cats, ',') . " )\n        ORDER BY timestamp DESC" . $Sql->limit(0, $CONFIG_DOWNLOAD['nbr_file_max']);
     $result = $Sql->query_while($req, __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/download/download' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'));
         $item->set_title($row['title']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($row['image']);
         $item->set_auth($cats->compute_heritated_auth($row['idcat'], DOWNLOAD_READ_CAT_AUTH_BIT, AUTH_PARENT_PRIORITY));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:38,代码来源:download_interface.class.php


注:本文中的second_parse函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。