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


PHP TextHelper::html_entity_decode方法代码示例

本文整理汇总了PHP中TextHelper::html_entity_decode方法的典型用法代码示例。如果您正苦于以下问题:PHP TextHelper::html_entity_decode方法的具体用法?PHP TextHelper::html_entity_decode怎么用?PHP TextHelper::html_entity_decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextHelper的用法示例。


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

示例1: wiki_explode_menu

function wiki_explode_menu(&$content)
{
    $lines = explode("\n", $content);
    $num_lines = count($lines);
    $max_level_expected = 2;
    $list = array();
    //We read the text line by line
    foreach ($lines as $id => &$line) {
        for ($level = 2; $level <= $max_level_expected; $level++) {
            $matches = array();
            //If the line contains a title
            if (preg_match('`^(?:<br />)?\\s*[\\-]{' . $level . '}[\\s]+(.+)[\\s]+[\\-]{' . $level . '}(?:<br />)?\\s*$`', $line, $matches)) {
                $title_name = strip_tags(TextHelper::html_entity_decode($matches[1]));
                //We add it to the list
                $list[] = array($level - 1, $title_name);
                //Now we wait one of its children or its brother
                $max_level_expected = min($level + 1, WIKI_MENU_MAX_DEPTH + 1);
                //Réinsertion
                $class_level = $level - 1;
                $line = '<h' . $class_level . ' class="wiki_paragraph' . $class_level . '" id="paragraph_' . Url::encode_rewrite($title_name) . '">' . TextHelper::htmlspecialchars($title_name) . '</h' . $class_level . '><br />' . "\n";
            }
        }
    }
    $content = implode("\n", $lines);
    return $list;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:26,代码来源:wiki_functions.php

示例2: update_position

 private function update_position($request)
 {
     $fields_list = json_decode(TextHelper::html_entity_decode($request->get_value('tree')));
     foreach ($fields_list as $position => $tree) {
         PersistenceContext::get_querier()->inject("UPDATE " . DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST . " SET \r\n\t\t\t\tposition = :position\r\n\t\t\t\tWHERE id = :id", array('position' => $position, 'id' => $tree->id));
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:AdminExtendedFieldsMemberListController.class.php

示例3: parse

 public function parse()
 {
     $this->content = TextHelper::html_entity_decode($this->content);
     foreach (static::$parsers as $parser) {
         $this->content = $parser->unparse($this->content);
     }
 }
开发者ID:DrJoey,项目名称:MarkUp,代码行数:7,代码来源:MarkUpUnparser.class.php

示例4: Add_msg

 function Add_msg($idtopic, $idcat, $contents, $title, $last_page, $last_page_rewrite, $new_topic = false)
 {
     global $LANG;
     ##### Insertion message #####
     $last_timestamp = time();
     $result = PersistenceContext::get_querier()->insert(PREFIX . 'forum_msg', array('idtopic' => $idtopic, 'user_id' => AppContext::get_current_user()->get_id(), 'contents' => FormatingHelper::strparse($contents), 'timestamp' => $last_timestamp, 'timestamp_edit' => 0, 'user_id_edit' => 0, 'user_ip' => AppContext::get_request()->get_ip_address()));
     $last_msg_id = $result->get_last_inserted_id();
     //Topic
     PersistenceContext::get_querier()->inject("UPDATE " . PREFIX . "forum_topics SET " . ($new_topic ? '' : 'nbr_msg = nbr_msg + 1, ') . "last_user_id = '" . AppContext::get_current_user()->get_id() . "', last_msg_id = '" . $last_msg_id . "', last_timestamp = '" . $last_timestamp . "' WHERE id = '" . $idtopic . "'");
     //On met à jour le last_topic_id dans la catégorie dans le lequel le message a été posté
     PersistenceContext::get_querier()->update(ForumSetup::$forum_cats_table, array('last_topic_id' => $idtopic), 'WHERE id = :id', array('id' => $idcat));
     //Mise à jour du nombre de messages du membre.
     PersistenceContext::get_querier()->inject("UPDATE " . DB_TABLE_MEMBER . " SET posted_msg = posted_msg + 1 WHERE user_id = '" . AppContext::get_current_user()->get_id() . "'");
     //On marque le topic comme lu.
     mark_topic_as_read($idtopic, $last_msg_id, $last_timestamp);
     ##### Gestion suivi du sujet mp/mail #####
     if (!$new_topic) {
         //Message précédent ce nouveau message.
         $previous_msg_id = 0;
         try {
             $previous_msg_id = PersistenceContext::get_querier()->get_column_value(PREFIX . "forum_msg", 'MAX(id)', 'WHERE idtopic = :idtopic AND id < :id', array('idtopic' => $idtopic, 'id' => $last_msg_id));
         } catch (RowNotFoundException $e) {
         }
         $title_subject = TextHelper::html_entity_decode($title);
         $title_subject_pm = $title_subject;
         if (AppContext::get_current_user()->get_id() > 0) {
             $pseudo = '';
             try {
                 $pseudo = PersistenceContext::get_querier()->get_column_value(DB_TABLE_MEMBER, 'display_name', 'WHERE user_id = :id', array('id' => AppContext::get_current_user()->get_id()));
             } catch (RowNotFoundException $e) {
             }
             $pseudo_pm = '<a href="' . UserUrlBuilder::profile(AppContext::get_current_user()->get_id())->rel() . '">' . $pseudo . '</a>';
         } else {
             $pseudo = $LANG['guest'];
             $pseudo_pm = $LANG['guest'];
         }
         $next_msg_link = '/forum/topic' . url('.php?id=' . $idtopic . $last_page, '-' . $idtopic . $last_page_rewrite . '.php') . ($previous_msg_id ? '#m' . $previous_msg_id : '');
         $preview_contents = substr($contents, 0, 300);
         //Récupération des membres suivant le sujet.
         $max_time = time() - SessionsConfig::load()->get_active_session_duration();
         $result = PersistenceContext::get_querier()->select("SELECT m.user_id, m.display_name, m.email, tr.pm, tr.mail, v.last_view_id\n\t\t\tFROM " . PREFIX . "forum_track tr\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = tr.user_id\n\t\t\tLEFT JOIN " . PREFIX . "forum_view v ON v.idtopic = :idtopic AND v.user_id = tr.user_id\n\t\t\tWHERE tr.idtopic = :idtopic AND v.last_view_id IS NOT NULL AND m.user_id != :user_id", array('idtopic' => $idtopic, 'user_id' => AppContext::get_current_user()->get_id()));
         while ($row = $result->fetch()) {
             //Envoi un Mail à ceux dont le last_view_id est le message précedent.
             if ($row['last_view_id'] == $previous_msg_id && $row['mail'] == '1') {
                 AppContext::get_mail_service()->send_from_properties($row['email'], $LANG['forum_mail_title_new_post'], sprintf($LANG['forum_mail_new_post'], $row['display_name'], $title_subject, AppContext::get_current_user()->get_display_name(), $preview_contents, HOST . DIR . $next_msg_link, HOST . DIR . '/forum/action.php?ut=' . $idtopic . '&trt=1', 1));
             }
             //Envoi un MP à ceux dont le last_view_id est le message précedent.
             if ($row['last_view_id'] == $previous_msg_id && $row['pm'] == '1') {
                 $content = sprintf($LANG['forum_mail_new_post'], $row['display_name'], $title_subject_pm, AppContext::get_current_user()->get_display_name(), $preview_contents, '<a href="' . $next_msg_link . '">' . $next_msg_link . '</a>', '<a href="/forum/action.php?ut=' . $idtopic . '&trt=2">/forum/action.php?ut=' . $idtopic . '&trt=2</a>');
                 PrivateMsg::start_conversation($row['user_id'], $LANG['forum_mail_title_new_post'], nl2br($content), '-1', PrivateMsg::SYSTEM_PM);
             }
         }
         $result->dispose();
         forum_generate_feeds();
         //Regénération du flux rss.
     }
     return $last_msg_id;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:58,代码来源:Forum.class.php

示例5: update_position

 private function update_position(HTTPRequestCustom $request)
 {
     $fields = $this->config->get_fields();
     $sorted_fields = array();
     $fields_list = json_decode(TextHelper::html_entity_decode($request->get_value('tree')));
     foreach ($fields_list as $position => $tree) {
         $sorted_fields[$position + 1] = $fields[$tree->id];
     }
     $this->config->set_fields($sorted_fields);
     ContactConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:AdminContactFieldsListController.class.php

示例6: update_positions

 private function update_positions(HTTPRequestCustom $request)
 {
     if ($request->get_postvalue('submit', false)) {
         $categories = json_decode(TextHelper::html_entity_decode($request->get_value('tree')));
         foreach ($categories as $position => $tree) {
             $id = $tree->id;
             $children = $tree->children[0];
             $category = $this->get_categories_manager()->get_categories_cache()->get_category($id);
             $this->get_categories_manager()->update_position($category, Category::ROOT_CATEGORY, $position + 1);
             $this->update_childrens_positions($children, $category->get_id());
         }
         $this->tpl->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.position.update', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:14,代码来源:AbstractCategoriesManageController.class.php

示例7: parse

 /**
  * @desc Parses the parser content from BBCode to XHTML.
  * @return void You will find the result by using the get_content method
  */
 public function parse()
 {
     $this->content = TextHelper::html_entity_decode($this->content);
     //On supprime d'abord toutes les occurences de balises CODE que nous réinjecterons à la fin pour ne pas y toucher
     if (!in_array('code', $this->forbidden_tags)) {
         $this->pick_up_tag('code', '=[A-Za-z0-9#+-]+(?:,[01]){0,2}');
     }
     //On prélève tout le code HTML afin de ne pas l'altérer
     if (!in_array('html', $this->forbidden_tags) && AppContext::get_current_user()->check_auth($this->html_auth, 1)) {
         $this->pick_up_tag('html');
     }
     //Ajout des espaces pour éviter l'absence de parsage lorsqu'un séparateur de mot est éxigé
     $this->content = ' ' . $this->content . ' ';
     //Traitement du code HTML
     $this->protect_content();
     //Traitement des smilies
     $this->parse_smilies();
     //Interprétation des sauts de ligne
     $this->content = nl2br($this->content);
     // BBCode simple tags
     $this->parse_simple_tags();
     //Tableaux
     if (!in_array('table', $this->forbidden_tags) && strpos($this->content, '[table') !== false) {
         $this->parse_table();
     }
     //Listes
     if (!in_array('list', $this->forbidden_tags) && strpos($this->content, '[list') !== false) {
         $this->parse_list();
     }
     //On remet le code HTML mis de côté
     if (!empty($this->array_tags['html'])) {
         $this->array_tags['html'] = array_map(create_function('$string', 'return str_replace("[html]", "<!-- START HTML -->\\n", str_replace("[/html]", "\\n<!-- END HTML -->", $string));'), $this->array_tags['html']);
         $this->reimplant_tag('html');
     }
     parent::parse();
     //On réinsère les fragments de code qui ont été prévelevés pour ne pas les considérer
     if (!empty($this->array_tags['code'])) {
         $this->array_tags['code'] = array_map(create_function('$string', 'return preg_replace(\'`^\\[code(=.+)?\\](.+)\\[/code\\]$`isU\', \'[[CODE$1]]$2[[/CODE]]\', TextHelper::htmlspecialchars($string, ENT_NOQUOTES));'), $this->array_tags['code']);
         $this->reimplant_tag('code');
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:45,代码来源:BBCodeParser.class.php

示例8: parse

 /**
  * @desc Unparses the content of the parser.
  * Converts it from HTML syntax to BBcode syntax
  */
 public function parse()
 {
     //Isolement du code source et du code HTML qui ne sera pas protégé
     $this->unparse_html(self::PICK_UP);
     $this->unparse_code(self::PICK_UP);
     $this->content = TextHelper::html_entity_decode($this->content);
     //Smilies
     $this->unparse_smilies();
     //Remplacement des balises simples
     $this->unparse_simple_tags();
     //Unparsage de la balise table.
     if (strpos($this->content, '<table class="formatter-table"') !== false) {
         $this->unparse_table();
     }
     //Unparsage de la balise table.
     if (strpos($this->content, '<li class="formatter-li"') !== false) {
         $this->unparse_list();
     }
     $this->unparse_code(self::REIMPLANT);
     $this->unparse_html(self::REIMPLANT);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:25,代码来源:BBCodeUnparser.class.php

示例9: parse

 public function parse()
 {
     $this->content = str_replace(array("\r\n", "\r"), "\n", $this->content);
     $this->content = "\n" . $this->content . "\n";
     $this->content = TextHelper::html_entity_decode($this->content);
     foreach (static::$parsers as $parser) {
         $this->content = $parser->parse_save_tags($this->content);
     }
     $this->protect_content();
     foreach (static::$parsers as $parser) {
         $this->content = $parser->parse($this->content);
     }
     $this->parse_paragraphs();
     foreach (static::$parsers as $parser) {
         $this->content = $parser->restaure_tags($this->content);
     }
     foreach (static::$parsers as $parser) {
         if (method_exists($parser, "after_parse")) {
             $this->content = $parser->after_parse($this->content);
         }
     }
     parent::parse();
 }
开发者ID:DrJoey,项目名称:MarkUp,代码行数:23,代码来源:MarkUpParser.class.php

示例10: get_feed_data_struct

    public function get_feed_data_struct($idcat = 0, $name = '')
    {
        $config = ForumConfig::load();
        $category = ForumService::get_categories_manager()->get_categories_cache()->get_category($idcat);
        $data = new FeedData();
        $data->set_title(LangLoader::get_message('xml_forum_desc', 'common', 'forum'));
        $data->set_date(new Date());
        $data->set_link(DispatchManager::get_url('/syndication', '/rss/forum/' . $idcat . '/'));
        $data->set_host(HOST);
        $data->set_desc(LangLoader::get_message('xml_forum_desc', 'common', 'forum'));
        $data->set_lang(LangLoader::get_message('xml_lang', 'main'));
        $data->set_auth_bit(Category::READ_AUTHORIZATIONS);
        $categories = ForumService::get_categories_manager()->get_childrens($idcat, new SearchCategoryChildrensOptions(), true);
        $ids_categories = array_keys($categories);
        $results = PersistenceContext::get_querier()->select('SELECT t.id, t.idcat, t.title, t.last_timestamp, t.last_msg_id, t.display_msg, t.nbr_msg AS t_nbr_msg, msg.id mid, msg.contents
			FROM ' . PREFIX . 'forum_topics t
			LEFT JOIN ' . PREFIX . 'forum_msg msg ON msg.id = t.last_msg_id
			WHERE t.idcat IN :ids_categories
			ORDER BY t.last_timestamp DESC LIMIT :limit OFFSET 0', array('ids_categories' => $ids_categories, 'limit' => 2 * $config->get_number_messages_per_page()));
        foreach ($results as $row) {
            $item = new FeedItem();
            //Link
            $last_page = ceil($row['t_nbr_msg'] / $config->get_number_messages_per_page());
            $last_page_rewrite = $last_page > 1 ? '-' . $last_page : '';
            $last_page = $last_page > 1 ? 'pt=' . $last_page . '&amp;' : '';
            $link = new Url('/forum/topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . '+' . Url::encode_rewrite($row['title']) . '.php') . '#m' . $row['last_msg_id']);
            $item->set_title(($config->is_message_before_topic_title_displayed() && !empty($row['display_msg']) ? TextHelper::html_entity_decode($config->get_message_before_topic_title(), ENT_NOQUOTES) . ' ' : '') . stripslashes($row['title']));
            $item->set_link($link);
            $item->set_guid($link);
            $item->set_desc(FormatingHelper::second_parse($row['contents']));
            $item->set_date(new Date($row['last_timestamp'], Timezone::SERVER_TIMEZONE));
            $item->set_auth(ForumService::get_categories_manager()->get_heritated_authorizations($row['idcat'], Category::READ_AUTHORIZATIONS, Authorizations::AUTH_PARENT_PRIORITY));
            $data->add_item($item);
        }
        $results->dispose();
        return $data;
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:37,代码来源:ForumFeedProvider.class.php

示例11: execute

 public function execute(HTTPRequestCustom $request)
 {
     if ($this->check_authorizations()) {
         $pseudo = TextHelper::strprotect(utf8_decode($request->get_string('pseudo', '')));
         $contents = TextHelper::htmlentities($request->get_string('contents', ''), ENT_COMPAT, 'UTF-8');
         $contents = TextHelper::htmlspecialchars_decode(TextHelper::html_entity_decode($contents, ENT_COMPAT, 'windows-1252'));
         if ($pseudo && $contents) {
             //Mod anti-flood, autorisé aux membres qui bénificie de l'autorisation de flooder.
             $check_time = AppContext::get_current_user()->get_id() !== -1 && ContentManagementConfig::load()->is_anti_flood_enabled() ? PersistenceContext::get_querier()->get_column_value(PREFIX . "shoutbox", 'MAX(timestamp)', 'WHERE user_id = :id', array('id' => AppContext::get_current_user()->get_id())) : '';
             if (!empty($check_time) && !AppContext::get_current_user()->check_max_value(AUTH_FLOOD)) {
                 if ($check_time >= time() - ContentManagementConfig::load()->get_anti_flood_duration()) {
                     $code = -1;
                 }
             }
             //Vérifie que le message ne contient pas du flood de lien.
             $config_shoutbox = ShoutboxConfig::load();
             $contents = FormatingHelper::strparse($contents, $config_shoutbox->get_forbidden_formatting_tags());
             if (!TextHelper::check_nbr_links($contents, $config_shoutbox->get_max_links_number_per_message(), true)) {
                 //Nombre de liens max dans le message.
                 $code = -2;
             }
             $shoutbox_message = new ShoutboxMessage();
             $shoutbox_message->init_default_properties();
             $shoutbox_message->set_login($pseudo);
             $shoutbox_message->set_user_id(AppContext::get_current_user()->get_id());
             $shoutbox_message->set_contents($contents);
             $shoutbox_message->set_creation_date(new Date());
             $code = ShoutboxService::add($shoutbox_message);
         } else {
             $code = -3;
         }
     } else {
         $code = -4;
     }
     return new JSONResponse(array('code' => $code));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:36,代码来源:ShoutboxAjaxAddMessageController.class.php

示例12: save

 private function save()
 {
     $this->tpl_file->write(TextHelper::html_entity_decode($this->form->get_value('tpl_file')));
     $this->tpl_file->close();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:5,代码来源:AdminCustomizeEditorTPLFilesController.class.php

示例13: build_view

    private function build_view()
    {
        global $LANG, $config, $nbr_msg_not_read, $tpl_top, $tpl_bottom;
        $id_get = retrieve(GET, 'id', 0);
        try {
            $this->category = ForumService::get_categories_manager()->get_categories_cache()->get_category($id_get);
        } catch (CategoryNotFoundException $e) {
        }
        require_once PATH_TO_ROOT . '/forum/forum_begin.php';
        require_once PATH_TO_ROOT . '/forum/forum_tools.php';
        $this->view = new FileTemplate('forum/forum_index.tpl');
        //Affichage des sous-catégories de la catégorie.
        $display_cat = !empty($id_get);
        //Vérification des autorisations.
        $authorized_categories = ForumService::get_authorized_categories($id_get);
        //Calcul du temps de péremption, ou de dernière vue des messages par à rapport à la configuration.
        $max_time_msg = forum_limit_time_msg();
        $is_guest = AppContext::get_current_user()->get_id() == -1;
        $total_topic = 0;
        $total_msg = 0;
        $i = 0;
        //On liste les catégories et sous-catégories.
        $result = PersistenceContext::get_querier()->select('SELECT @id_cat:= c.id, c.id AS cid, c.id_parent, c.name, c.rewrited_name, c.description as subname, c.url, c.last_topic_id, t.id AS tid, t.idcat, t.title, t.last_timestamp, t.last_user_id, t.last_msg_id, t.nbr_msg AS t_nbr_msg, t.display_msg, t.status, m.user_id, m.display_name as login, m.level as user_level, m.groups, v.last_view_id,
		(SELECT COUNT(*) FROM ' . ForumSetup::$forum_topics_table . '
			WHERE idcat IN (
				@id_cat,
				(SELECT GROUP_CONCAT(id SEPARATOR \',\') FROM ' . ForumSetup::$forum_cats_table . ' WHERE id_parent = @id_cat), 
				(SELECT GROUP_CONCAT(childs.id SEPARATOR \',\') FROM ' . ForumSetup::$forum_cats_table . ' parents
				INNER JOIN ' . ForumSetup::$forum_cats_table . ' childs ON parents.id = childs.id_parent
				WHERE parents.id_parent = @id_cat)
			)
		) AS nbr_topic,
		(SELECT COUNT(*) FROM ' . ForumSetup::$forum_message_table . '
			WHERE idtopic IN (
				(SELECT GROUP_CONCAT(id SEPARATOR \',\') FROM ' . ForumSetup::$forum_topics_table . ' WHERE idcat = @id_cat), 
				(SELECT GROUP_CONCAT(t.id SEPARATOR \',\') FROM ' . ForumSetup::$forum_topics_table . ' t LEFT JOIN ' . ForumSetup::$forum_cats_table . ' c ON t.idcat = c.id WHERE id_parent = @id_cat)
			)
		) AS nbr_msg
		FROM ' . ForumSetup::$forum_cats_table . ' c
		LEFT JOIN ' . ForumSetup::$forum_topics_table . ' t ON t.id = c.last_topic_id
		LEFT JOIN ' . ForumSetup::$forum_view_table . ' v ON v.user_id = :user_id AND v.idtopic = t.id
		LEFT JOIN ' . DB_TABLE_MEMBER . ' m ON m.user_id = t.last_user_id
		WHERE ' . ($display_cat ? 'c.id_parent = :id_cat AND ' : '') . 'c.id IN :authorized_categories
		ORDER BY c.id, c.id_parent, c.c_order', array('id_cat' => $id_get, 'user_id' => AppContext::get_current_user()->get_id(), 'authorized_categories' => $authorized_categories));
        $categories = array();
        while ($row = $result->fetch()) {
            $categories[] = $row;
        }
        $result->dispose();
        $display_sub_cats = false;
        $is_sub_forum = array();
        foreach ($categories as $row) {
            $this->view->assign_block_vars('forums_list', array());
            if ($row['id_parent'] == Category::ROOT_CATEGORY && $i > 0 && $display_sub_cats) {
                $this->view->assign_block_vars('forums_list.endcats', array());
            }
            $i++;
            if ($row['id_parent'] == Category::ROOT_CATEGORY) {
                $this->view->assign_block_vars('forums_list.cats', array('IDCAT' => $row['cid'], 'NAME' => $row['name'], 'U_FORUM_VARS' => ForumUrlBuilder::display_category($row['cid'], $row['rewrited_name'])->rel()));
                $display_sub_cats = true;
            } else {
                if (in_array($row['id_parent'], $is_sub_forum)) {
                    $is_sub_forum[] = $row['cid'];
                }
                if (($display_sub_cats || !empty($id_get)) && !in_array($row['cid'], $is_sub_forum)) {
                    if ($display_cat) {
                        $this->view->assign_block_vars('forums_list.cats', array('IDCAT' => $this->category->get_id(), 'NAME' => $this->category->get_name(), 'U_FORUM_VARS' => PATH_TO_ROOT . '/forum/' . url('index.php?id=' . $this->category->get_id(), 'cat-' . $this->category->get_id() . '+' . $this->category->get_rewrited_name() . '.php')));
                        $display_cat = false;
                    }
                    $subforums = '';
                    $this->view->put_all(array('C_FORUM_ROOT_CAT' => false, 'C_FORUM_CHILD_CAT' => true, 'C_END_S_CATS' => false));
                    $children = ForumService::get_categories_manager()->get_categories_cache()->get_childrens($row['cid']);
                    if ($children) {
                        foreach ($children as $id => $child) {
                            if ($child->get_id_parent() == $row['cid'] && ForumAuthorizationsService::check_authorizations($child->get_id())->read()) {
                                $is_sub_forum[] = $child->get_id();
                                $link = $child->get_url() ? '<a href="' . $child->get_url() . '" class="small">' : '<a href="forum' . url('.php?id=' . $child->get_id(), '-' . $child->get_id() . '+' . $child->get_rewrited_name() . '.php') . '" class="small">';
                                $subforums .= !empty($subforums) ? ', ' . $link . $child->get_name() . '</a>' : $link . $child->get_name() . '</a>';
                            }
                        }
                        $subforums = '<strong>' . $LANG['subforum_s'] . '</strong>: ' . $subforums;
                    }
                    if (!empty($row['last_topic_id'])) {
                        //Si le dernier message lu est présent on redirige vers lui, sinon on redirige vers le dernier posté.
                        if (!empty($row['last_view_id'])) {
                            $last_msg_id = $row['last_view_id'];
                            $last_page = 'idm=' . $row['last_view_id'] . '&amp;';
                            $last_page_rewrite = '-0-' . $row['last_view_id'];
                        } else {
                            $last_msg_id = $row['last_msg_id'];
                            $last_page = ceil($row['t_nbr_msg'] / $config->get_number_messages_per_page());
                            $last_page_rewrite = $last_page > 1 ? '-' . $last_page : '';
                            $last_page = $last_page > 1 ? 'pt=' . $last_page . '&amp;' : '';
                        }
                        $last_topic_title = ($config->is_message_before_topic_title_displayed() && $row['display_msg'] ? $config->get_message_before_topic_title() : '') . ' ' . $row['title'];
                        $last_topic_title = stripslashes(strlen(TextHelper::html_entity_decode($last_topic_title)) > 20 ? TextHelper::substr_html($last_topic_title, 0, 20) . '...' : $last_topic_title);
                        $row['login'] = !empty($row['login']) ? $row['login'] : $LANG['guest'];
                        $group_color = User::get_group_color($row['groups'], $row['user_level']);
                        $last = '<a href="' . PATH_TO_ROOT . '/forum/topic' . url('.php?id=' . $row['tid'], '-' . $row['tid'] . '+' . Url::encode_rewrite($row['title']) . '.php') . '" class="small">' . $last_topic_title . '</a><br />
						<a href="' . PATH_TO_ROOT . '/forum/topic' . url('.php?' . $last_page . 'id=' . $row['tid'], '-' . $row['tid'] . $last_page_rewrite . '+' . Url::encode_rewrite($row['title']) . '.php') . '#m' . $last_msg_id . '"><i class="fa fa-hand-o-right"></i></a> ' . $LANG['on'] . ' ' . Date::to_format($row['last_timestamp'], Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE) . '<br />' . $LANG['by'] . ' ' . ($row['last_user_id'] != '-1' ? '<a href="' . UserUrlBuilder::profile($row['last_user_id'])->rel() . '" class="small ' . UserService::get_level_class($row['user_level']) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . '>' . $row['login'] . '</a>' : '<em>' . $LANG['guest'] . '</em>');
//.........这里部分代码省略.........
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:101,代码来源:ForumHomeController.class.php

示例14: save_position

function save_position($block_position)
{
    $menus = MenuService::get_menu_list();
    $menus_tree = json_decode(TextHelper::html_entity_decode(AppContext::get_request()->get_value('menu_tree_' . get_block($block_position))));
    foreach ($menus_tree as $position => $tree) {
        $id = $tree->id;
        if (array_key_exists($id, $menus)) {
            $menu = $menus[$id];
            $menu->set_block_position($position + 1);
            MenuService::move($menu, $block_position, $menu->get_block_position());
        }
    }
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:13,代码来源:menus.php

示例15: define

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/
define('PATH_TO_ROOT', '../../..');
include_once PATH_TO_ROOT . '/kernel/begin.php';
AppContext::get_session()->no_session_location();
//Permet de ne pas mettre jour la page dans la session.
include_once PATH_TO_ROOT . '/kernel/header_no_display.php';
$page_path_to_root = retrieve(REQUEST, 'path_to_root', '');
$page_path = retrieve(REQUEST, 'page_path', '');
//Quel éditeur utiliser ? Si ce n'est pas précisé on prend celui par défaut de l'utilisateur
$editor = retrieve(REQUEST, 'editor', ContentFormattingConfig::load()->get_default_editor());
$contents = TextHelper::htmlentities(retrieve(POST, 'contents', ''), ENT_COMPAT, 'UTF-8');
$contents = TextHelper::htmlspecialchars_decode(stripslashes(TextHelper::html_entity_decode($contents)));
$ftags = retrieve(POST, 'ftags', TSTRING_UNCHANGE);
$forbidden_tags = explode(',', $ftags);
$formatting_factory = AppContext::get_content_formatting_service()->create_factory($editor);
//On prend le bon parseur avec la bonne configuration
$parser = $formatting_factory->get_parser();
$parser->set_content($contents);
$parser->set_path_to_root($page_path_to_root);
$parser->set_page_path($page_path);
if (!empty($forbidden_tags)) {
    $parser->set_forbidden_tags($forbidden_tags);
}
$parser->parse();
//On parse la deuxième couche (code, math etc) pour afficher
$second_parser = $formatting_factory->get_second_parser();
$second_parser->set_content($parser->get_content());
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:content_xmlhttprequest.php


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