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


PHP TextHelper::wordwrap_html方法代码示例

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


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

示例1: get_menu_content

 public function get_menu_content()
 {
     $tpl = new FileTemplate('online/OnlineModuleMiniMenu.tpl');
     $lang = LangLoader::get('common', 'online');
     $tpl->add_lang($lang);
     $online_config = OnlineConfig::load();
     $condition = 'WHERE s.timestamp > :time ORDER BY ' . $online_config->get_display_order_request();
     $parameters = array('time' => time() - SessionsConfig::load()->get_active_session_duration());
     $users = OnlineService::get_online_users($condition, $parameters);
     foreach ($users as $user) {
         $this->incremente_level($user);
         if ($this->total_users <= $online_config->get_number_member_displayed()) {
             $group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
             if ($user->get_level() != User::VISITOR_LEVEL) {
                 $tpl->assign_block_vars('users', array('U_PROFILE' => UserUrlBuilder::profile($user->get_id())->rel(), 'PSEUDO' => TextHelper::wordwrap_html($user->get_display_name(), 19), 'LEVEL_CLASS' => UserService::get_level_class($user->get_level()), 'C_GROUP_COLOR' => !empty($group_color), 'GROUP_COLOR' => $group_color));
             }
         }
     }
     $main_lang = LangLoader::get('main');
     $tpl->put_all(array('C_MORE_USERS' => $this->total_users > $online_config->get_number_member_displayed(), 'L_VISITOR' => $this->number_visitor > 1 ? $main_lang['guest_s'] : $main_lang['guest'], 'L_MEMBER' => $this->number_member > 1 ? $main_lang['member_s'] : $main_lang['member'], 'L_MODO' => $this->number_moderator > 1 ? $main_lang['modo_s'] : $main_lang['modo'], 'L_ADMIN' => $this->number_administrator > 1 ? $main_lang['admin_s'] : $main_lang['admin'], 'L_USERS_ONLINE' => $this->total_users > 1 ? $lang['online_users'] : $lang['online_user'], 'L_TOTAL' => $main_lang['total'], 'TOTAL_USERS_CONNECTED' => $this->total_users, 'TOTAL_VISITOR_CONNECTED' => $this->number_visitor, 'TOTAL_MEMBER_CONNECTED' => $this->number_member, 'TOTAL_MODERATOR_CONNECTED' => $this->number_moderator, 'TOTAL_ADMINISTRATOR_CONNECTED' => $this->number_administrator));
     return $tpl->render();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:22,代码来源:OnlineModuleMiniMenu.class.php

示例2: build_view


//.........这里部分代码省略.........
                    if ($thumbnails_after < $nbr_pics_display_after) {
                        $start_thumbnails += $nbr_pics_display_after - $thumbnails_after;
                    }
                    $html_protected_name = $info_pics['name'];
                    $comments_topic->set_id_in_module($info_pics['id']);
                    $comments_topic->set_url(new Url('/gallery/gallery.php?cat=' . $category->get_id() . '&id=' . $g_idpics . '&com=0'));
                    //Liste des catégories.
                    $search_category_children_options = new SearchCategoryChildrensOptions();
                    $search_category_children_options->add_authorizations_bits(Category::READ_AUTHORIZATIONS);
                    $search_category_children_options->add_authorizations_bits(Category::WRITE_AUTHORIZATIONS);
                    $categories_tree = GalleryService::get_categories_manager()->get_select_categories_form_field($info_pics['id'] . 'cat', '', $info_pics['idcat'], $search_category_children_options);
                    $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options');
                    $method->setAccessible(true);
                    $categories_tree_options = $method->invoke($categories_tree);
                    $cat_list = '';
                    foreach ($categories_tree_options as $option) {
                        $cat_list .= $option->display()->render();
                    }
                    $group_color = User::get_group_color($info_pics['groups'], $info_pics['level']);
                    //Affichage de l'image et de ses informations.
                    $this->tpl->put_all(array('C_GALLERY_PICS_MAX' => true, 'C_GALLERY_PICS_MODO' => $is_modo, 'C_AUTHOR_DISPLAYED' => $config->is_author_displayed(), 'C_VIEWS_COUNTER_ENABLED' => $config->is_views_counter_enabled(), 'C_TITLE_ENABLED' => $config->is_title_enabled(), 'C_COMMENTS_ENABLED' => $config->are_comments_enabled(), 'C_NOTATION_ENABLED' => $config->is_notation_enabled(), 'ID' => $info_pics['id'], 'NAME' => '<span id="fi_' . $info_pics['id'] . '">' . stripslashes($info_pics['name']) . '</span> <span id="fi' . $info_pics['id'] . '"></span>', 'POSTOR' => '<a class="small ' . UserService::get_level_class($info_pics['level']) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . ' href="' . UserUrlBuilder::profile($info_pics['user_id'])->rel() . '">' . $info_pics['display_name'] . '</a>', 'DATE' => Date::to_format($info_pics['timestamp'], Date::FORMAT_DAY_MONTH_YEAR), 'VIEWS' => $info_pics['views'] + 1, 'DIMENSION' => $info_pics['width'] . ' x ' . $info_pics['height'], 'SIZE' => NumberHelper::round($info_pics['weight'] / 1024, 1), 'L_COMMENTS' => CommentsService::get_number_and_lang_comments('gallery', $info_pics['id']), 'KERNEL_NOTATION' => $activ_note ? NotationService::display_active_image($notation) : '', 'COLSPAN' => $config->get_columns_number() + 2, 'CAT' => $cat_list, 'RENAME' => $html_protected_name, 'RENAME_CUT' => $html_protected_name, 'IMG_APROB' => $info_pics['aprob'] == 1 ? 'fa fa-eye-slash' : 'fa fa-eye', 'ARRAY_JS' => $array_js, 'NBR_PICS' => $i - 1, 'MAX_START' => $i - 1 - $nbr_column_pics, 'START_THUMB' => $pos_pics - $start_thumbnails > 0 ? $pos_pics - $start_thumbnails : 0, 'END_THUMB' => $pos_pics + $end_thumbnails, 'L_KB' => LangLoader::get_message('unit.kilobytes', 'common'), 'L_INFORMATIONS' => $LANG['informations'], 'L_NAME' => $LANG['name'], 'L_POSTOR' => $LANG['postor'], 'L_VIEWS' => $LANG['views'], 'L_ADD_ON' => $LANG['add_on'], 'L_DIMENSION' => $LANG['dimension'], 'L_SIZE' => $LANG['size'], 'L_NOTE' => LangLoader::get_message('note', 'common'), 'L_COM' => $LANG['com'], 'L_EDIT' => LangLoader::get_message('edit', 'common'), 'L_APROB_IMG' => $info_pics['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'L_THUMBNAILS' => $LANG['thumbnails'], 'U_DEL' => url('gallery.php?del=' . $info_pics['id'] . '&amp;token=' . AppContext::get_session()->get_token() . '&amp;cat=' . $category->get_id()), 'U_MOVE' => url('gallery.php?id=' . $info_pics['id'] . '&amp;token=' . AppContext::get_session()->get_token() . '&amp;move=\' + this.options[this.selectedIndex].value'), 'U_PREVIOUS' => $pos_pics > 0 ? '<a href="' . GalleryUrlBuilder::get_link_item($category->get_id(), $id_previous) . '#pics_max"><i class="fa fa-arrow-left fa-2x"></i></a> <a href="' . GalleryUrlBuilder::get_link_item($category->get_id(), $id_previous) . '#pics_max">' . $LANG['previous'] . '</a>' : '', 'U_NEXT' => $pos_pics < $i - 1 ? '<a href="' . GalleryUrlBuilder::get_link_item($category->get_id(), $id_next) . '#pics_max">' . $LANG['next'] . '</a> <a href="' . GalleryUrlBuilder::get_link_item($category->get_id(), $id_next) . '#pics_max"><i class="fa fa-arrow-right fa-2x"></i></a>' : '', 'U_LEFT_THUMBNAILS' => $pos_pics - $start_thumbnails > 0 ? '<span id="display_left"><a href="javascript:display_thumbnails(\'left\')"><i class="fa fa-arrow-left fa-2x"></i></a></span>' : '<span id="display_left"></span>', 'U_RIGHT_THUMBNAILS' => $pos_pics - $start_thumbnails <= $i - 1 - $nbr_column_pics ? '<span id="display_right"><a href="javascript:display_thumbnails(\'right\')"><i class="fa fa-arrow-right fa-2x"></i></a></span>' : '<span id="display_right"></span>', 'U_COMMENTS' => GalleryUrlBuilder::get_link_item($info_pics['idcat'], $info_pics['id'], 0, $g_sort) . '#comments-list', 'U_IMG_MAX' => 'show_pics.php?id=' . $info_pics['id'] . '&amp;cat=' . $info_pics['idcat']));
                    //Affichage de la liste des miniatures sous l'image.
                    $i = 0;
                    foreach ($array_pics as $pics) {
                        if ($i >= $pos_pics - $start_thumbnails && $i <= $pos_pics + $end_thumbnails) {
                            $this->tpl->assign_block_vars('list_preview_pics', array('PICS' => $pics));
                        }
                        $i++;
                    }
                    //Commentaires
                    if (AppContext::get_request()->get_getint('com', 0) == 0 && $config->are_comments_enabled()) {
                        $this->tpl->put_all(array('COMMENTS' => CommentsService::display($comments_topic)->render()));
                    }
                }
            } else {
                $sort = retrieve(GET, 'sort', '');
                //On crée une pagination si le nombre de photos est trop important.
                $page = AppContext::get_request()->get_getint('pp', 1);
                $pagination = new ModulePagination($page, $nbr_pics, $config->get_pics_number_per_page());
                $pagination->set_url(new Url('/gallery/gallery.php?pp=%d' . (!empty($sort) ? '&amp;sort=' . $sort : '') . '&amp;cat=' . $category->get_id()));
                if ($pagination->current_page_is_empty() && $page > 1) {
                    $error_controller = PHPBoostErrors::unexisting_page();
                    DispatchManager::redirect($error_controller);
                }
                $this->tpl->put_all(array('C_GALLERY_MODO' => $is_modo, 'C_PICTURE_NAME_DISPLAYED' => $config->is_title_enabled(), 'C_AUTHOR_DISPLAYED' => $config->is_author_displayed(), 'C_VIEWS_COUNTER_ENABLED' => $config->is_views_counter_enabled(), 'C_COMMENTS_ENABLED' => $config->are_comments_enabled(), 'C_PAGINATION' => $pagination->has_several_pages(), 'PAGINATION' => $pagination->display(), 'L_EDIT' => LangLoader::get_message('edit', 'common'), 'L_VIEW' => $LANG['view'], 'L_VIEWS' => $LANG['views']));
                $is_connected = AppContext::get_current_user()->check_level(User::MEMBER_LEVEL);
                $j = 0;
                $result = $this->db_querier->select("SELECT g.id, g.idcat, g.name, g.path, g.timestamp, g.aprob, g.width, g.height, g.user_id, g.views, g.aprob, m.display_name, m.groups, m.level, notes.average_notes, notes.number_notes, note.note\n\t\t\t\tFROM " . GallerySetup::$gallery_table . " g\n\t\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = g.user_id\n\t\t\t\tLEFT JOIN " . DB_TABLE_COMMENTS_TOPIC . " com ON com.id_in_module = g.id AND com.module_id = 'gallery'\n\t\t\t\tLEFT JOIN " . DB_TABLE_AVERAGE_NOTES . " notes ON notes.id_in_module = g.id AND notes.module_name = 'gallery'\n\t\t\t\tLEFT JOIN " . DB_TABLE_NOTE . " note ON note.id_in_module = g.id AND note.module_name = 'gallery' AND note.user_id = :user_id\n\t\t\t\tWHERE g.idcat = :idcat AND g.aprob = 1\n\t\t\t\t" . $g_sql_sort . "\n\t\t\t\tLIMIT :number_items_per_page OFFSET :display_from", array('user_id' => AppContext::get_current_user()->get_id(), 'idcat' => $category->get_id(), 'number_items_per_page' => $pagination->get_number_items_per_page(), 'display_from' => $pagination->get_display_from()));
                while ($row = $result->fetch()) {
                    //Si la miniature n'existe pas (cache vidé) on regénère la miniature à partir de l'image en taille réelle.
                    if (!file_exists(PATH_TO_ROOT . '/gallery/pics/thumbnails/' . $row['path'])) {
                        $Gallery->Resize_pics(PATH_TO_ROOT . '/gallery/pics/' . $row['path']);
                    }
                    //Redimensionnement + création miniature
                    $onclick = '';
                    //Affichage de l'image en grand.
                    if ($config->get_pics_enlargement_mode() == GalleryConfig::FULL_SCREEN) {
                        $display_link = PATH_TO_ROOT . '/gallery/pics/' . $row['path'] . '" onmousedown="increment_view(' . $row['id'] . ');" title="' . str_replace('"', '', stripslashes($row['name']));
                    } elseif ($config->get_pics_enlargement_mode() == GalleryConfig::POPUP) {
                        $onclick = 'increment_view(' . $row['id'] . ');display_pics_popup(\'' . PATH_TO_ROOT . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']) . '\', \'' . $row['width'] . '\', \'' . $row['height'] . '\');return false;';
                        $display_link = '';
                    } elseif ($config->get_pics_enlargement_mode() == GalleryConfig::RESIZE) {
                        $onclick = 'increment_view(' . $row['id'] . ');display_pics(' . $row['id'] . ', \'' . PATH_TO_ROOT . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']) . '\');return false;';
                        $display_link = '';
                    } else {
                        $onclick = true;
                        $display_link = url('gallery.php?cat=' . $row['idcat'] . '&amp;id=' . $row['id'], 'gallery-' . $row['idcat'] . '-' . $row['id'] . '.php') . '#pics_max';
                    }
                    //Liste des catégories.
                    $search_category_children_options = new SearchCategoryChildrensOptions();
                    $search_category_children_options->add_authorizations_bits(Category::READ_AUTHORIZATIONS);
                    $search_category_children_options->add_authorizations_bits(Category::WRITE_AUTHORIZATIONS);
                    $categories_tree = GalleryService::get_categories_manager()->get_select_categories_form_field($row['id'] . 'cat', '', $row['idcat'], $search_category_children_options);
                    $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options');
                    $method->setAccessible(true);
                    $categories_tree_options = $method->invoke($categories_tree);
                    $cat_list = '';
                    foreach ($categories_tree_options as $option) {
                        $cat_list .= $option->display()->render();
                    }
                    $notation = new Notation();
                    $notation->set_module_name('gallery');
                    $notation->set_notation_scale($config->get_notation_scale());
                    $notation->set_id_in_module($row['id']);
                    $notation->set_number_notes($row['number_notes']);
                    $notation->set_average_notes($row['average_notes']);
                    $notation->set_user_already_noted(!empty($row['note']));
                    $group_color = User::get_group_color($row['groups'], $row['level']);
                    $comments_topic->set_id_in_module($row['id']);
                    $html_protected_name = $row['name'];
                    $this->tpl->assign_block_vars('pics_list', array('C_IMG_APROB' => $row['aprob'] == 1, 'C_OPEN_TR' => is_int($j++ / $nbr_column_pics), 'C_CLOSE_TR' => is_int($j / $nbr_column_pics), 'ID' => $row['id'], 'APROB' => $row['aprob'], 'PATH' => $row['path'], 'NAME' => stripslashes($row['name']), 'SHORT_NAME' => TextHelper::wordwrap_html(stripslashes($row['name']), 22, ' '), 'POSTOR' => $LANG['by'] . (!empty($row['display_name']) ? ' <a class="small ' . UserService::get_level_class($row['level']) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . ' href="' . UserUrlBuilder::profile($row['user_id'])->rel() . '">' . $row['display_name'] . '</a>' : ' ' . $LANG['guest']), 'VIEWS' => $row['views'], 'L_VIEWS' => $row['views'] > 1 ? $LANG['views'] : $LANG['view'], 'L_COMMENTS' => CommentsService::get_number_and_lang_comments('gallery', $row['id']), 'KERNEL_NOTATION' => $config->is_notation_enabled() && $is_connected ? NotationService::display_active_image($notation) : NotationService::display_static_image($notation), 'CAT' => $cat_list, 'ONCLICK' => $onclick, 'RENAME' => $html_protected_name, 'RENAME_CUT' => $html_protected_name, 'L_APROB_IMG' => $row['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'U_PICTURE_LINK' => PATH_TO_ROOT . '/gallery/gallery' . url('.php?cat=' . $row['idcat'] . '&amp;id=' . $row['id'], '-' . $row['idcat'] . '-' . $row['id'] . '.php'), 'U_PICTURE' => PATH_TO_ROOT . '/gallery/pics/thumbnails/' . $row['path'], 'U_DEL' => url('gallery.php?del=' . $row['id'] . '&amp;token=' . AppContext::get_session()->get_token() . '&amp;cat=' . $category->get_id()), 'U_MOVE' => url('gallery.php?id=' . $row['id'] . '&amp;token=' . AppContext::get_session()->get_token() . '&amp;move=\' + this.options[this.selectedIndex].value'), 'U_DISPLAY' => $display_link, 'U_COMMENTS' => PATH_TO_ROOT . '/gallery/gallery' . url('.php?cat=' . $row['idcat'] . '&amp;id=' . $row['id'] . '&amp;com=0', '-' . $row['idcat'] . '-' . $row['id'] . '.php?com=0') . '#comments-list'));
                }
                $result->dispose();
                //Création des cellules du tableau si besoin est.
                while (!is_int($j / $nbr_column_pics)) {
                    $this->tpl->assign_block_vars('end_table', array('TD_END' => '<td class="td-end" style="width:' . $column_width_pics . '%">&nbsp;</td>', 'TR_END' => is_int(++$j / $nbr_column_pics) ? '</tr>' : ''));
                }
            }
        }
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:101,代码来源:GalleryDisplayCategoryController.class.php

示例3: ceil

     //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['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;' : '';
     }
     //On encode l'url pour un éventuel rewriting, c'est une opération assez gourmande
     $rewrited_title = ServerEnvironmentConfig::load()->is_url_rewriting_enabled() ? '+' . Url::encode_rewrite($row['title']) : '';
     //Affichage du dernier message posté.
     $last_group_color = User::get_group_color($row['last_user_groups'], $row['last_user_level']);
     $last_msg = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><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'] . ' ' . (!empty($row['last_login']) ? '<a class="small ' . UserService::get_level_class($row['last_user_level']) . '"' . (!empty($last_group_color) ? ' style="color:' . $last_group_color . '"' : '') . ' href="' . UserUrlBuilder::profile($row['last_user_id'])->rel() . '">' . TextHelper::wordwrap_html($row['last_login'], 13) . '</a>' : '<em>' . $LANG['guest'] . '</em>');
     //Ancre ajoutée aux messages non lus.
     $new_ancre = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><i class="fa fa-hand-o-right"></i></a>';
     //On crée une pagination (si activé) si le nombre de topics est trop important.
     $page = AppContext::get_request()->get_getint('pt', 1);
     $topic_pagination = new ModulePagination($page, $row['nbr_msg'], $config->get_number_messages_per_page(), Pagination::LIGHT_PAGINATION);
     $topic_pagination->set_url(new Url('/forum/topic.php?id=' . $row['id'] . '&amp;pt=%d'));
     $group_color = User::get_group_color($row['groups'], $row['user_level']);
     $tpl->assign_block_vars('topics', array('C_PAGINATION' => $topic_pagination->has_several_pages(), 'C_IMG_POLL' => !empty($row['question']), 'C_IMG_TRACK' => !empty($row['idtrack']), 'C_DISPLAY_MSG' => $config->is_message_before_topic_title_displayed() && $config->is_message_before_topic_title_icon_displayed() && $row['display_msg'], 'C_HOT_TOPIC' => $row['type'] == '0' && $row['status'] != '0' && $row['nbr_msg'] > $config->get_number_messages_per_page(), 'C_BLINK' => $blink, 'IMG_ANNOUNCE' => $img_announce, 'ANCRE' => $new_ancre, 'TYPE' => $type[$row['type']], 'TITLE' => stripslashes($row['title']), 'AUTHOR' => !empty($row['login']) ? '<a href="' . UserUrlBuilder::profile($row['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>', 'DESC' => $row['subtitle'], 'PAGINATION' => $topic_pagination->display(), 'MSG' => $row['nbr_msg'] - 1, 'VUS' => $row['nbr_views'], 'U_TOPIC_VARS' => url('.php?id=' . $row['id'], '-' . $row['id'] . $rewrited_title . '.php'), 'U_LAST_MSG' => $last_msg, 'L_DISPLAY_MSG' => $config->is_message_before_topic_title_displayed() && $row['display_msg'] ? $config->get_message_before_topic_title() : ''));
 }
 $result->dispose();
 //Le membre a déjà lu tous les messages.
 if ($nbr_topics == 0) {
     $tpl->put_all(array('C_NO_TOPICS' => true, 'L_NO_TOPICS' => '0 ' . $LANG['no_last_read']));
 }
 //Listes les utilisateurs en lignes.
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:lastread.php

示例4: retrieve

if (!empty($writingpad)) {
    $content = retrieve(POST, 'writing_pad_content', '', TSTRING_UNCHANGE);
    $writing_pad_content = WritingPadConfig::load();
    $writing_pad_content->set_content($content);
    WritingPadConfig::save();
    AppContext::get_response()->redirect(HOST . REWRITED_SCRIPT);
}
$tpl = new FileTemplate('admin/admin_index.tpl');
$result = PersistenceContext::get_querier()->select("\n\tSELECT comments.*, topic.*, member.*\n\tFROM " . DB_TABLE_COMMENTS . " comments\n\tLEFT JOIN " . DB_TABLE_COMMENTS_TOPIC . " topic ON comments.id_topic = topic.id_topic\n\tLEFT JOIN " . DB_TABLE_MEMBER . " member ON member.user_id = comments.user_id\n\tORDER BY comments.timestamp DESC\n\tLIMIT 30");
$i = 0;
while ($row = $result->fetch()) {
    if (!empty($row['user_id'])) {
        $group_color = User::get_group_color($row['groups'], $row['level']);
        $com_pseudo = '<a href="' . UserUrlBuilder::profile($row['user_id'])->rel() . '" title="' . $row['display_name'] . '" class="' . UserService::get_level_class($row['level']) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . '>' . TextHelper::wordwrap_html($row['display_name'], 13) . '</a>';
    } else {
        $com_pseudo = '<span style="font-style:italic;">' . (!empty($row['display_name']) ? TextHelper::wordwrap_html($row['display_name'], 13) : $LANG['guest']) . '</span>';
    }
    $tpl->assign_block_vars('comments_list', array('CONTENT' => FormatingHelper::second_parse($row['message']), 'U_PSEUDO' => $com_pseudo, 'U_LINK' => Url::to_rel($row['path']) . '#com' . $row['id']));
    $i++;
}
$result->dispose();
//Advises
$advises_form = new HTMLForm('advises_list', '', false);
AdminServerSystemReportController::get_advises($advises_form);
//Header logo
$theme = ThemesManager::get_theme(AppContext::get_current_user()->get_theme());
$customize_interface = $theme->get_customize_interface();
$header_logo_path = $customize_interface->get_header_logo_path();
$tpl->put_all(array('L_QUICK_ACCESS' => $LANG['quick_access'], 'L_ADD_CONTENT' => $LANG['add_content'], 'L_MODULES_MANAGEMENT' => $LANG['modules_management'], 'L_ADD_ARTICLES' => $LANG['add_articles'], 'L_ADD_NEWS' => $LANG['add_news'], 'L_CUSTOMIZE_SITE' => $LANG['customize_site'], 'L_ADD_TEMPLATE' => $LANG['add_template'], 'L_MENUS_MANAGEMENT' => $LANG['menus_management'], 'L_CUSTOMIZE_TEMPLATE' => $LANG['customize_template'], 'L_SITE_MANAGEMENT' => $LANG['site_management'], 'L_GENERAL_CONFIG' => $LANG['general_config'], 'L_EMPTY_CACHE' => $LANG['empty_cache'], 'L_SAVE_DATABASE' => $LANG['save_database'], 'L_WELCOME_TITLE' => $LANG['welcome_title'], 'L_WELCOME_DESC' => $LANG['welcome_desc'], 'WRITING_PAD_CONTENT' => WritingPadConfig::load()->get_content(), 'C_HEADER_LOGO' => !empty($header_logo_path), 'HEADER_LOGO' => Url::to_rel($header_logo_path), 'C_NO_COM' => $i == 0, 'C_UNREAD_ALERTS' => (bool) AdministratorAlertService::get_number_unread_alerts(), 'L_INDEX_ADMIN' => $LANG['administration'], 'L_ADMIN_ALERTS' => $LANG['administrator_alerts'], 'L_NO_UNREAD_ALERT' => $LANG['no_unread_alert'], 'L_UNREAD_ALERT' => $LANG['unread_alerts'], 'L_DISPLAY_ALL_ALERTS' => $LANG['display_all_alerts'], 'L_ADMINISTRATOR_ALERTS' => $LANG['administrator_alerts'], 'L_QUICK_LINKS' => $LANG['quick_links'], 'L_ACTION_USERS_MANAGEMENT' => $LANG['action.members_management'], 'L_ACTION_MENUS_MANAGEMENT' => $LANG['action.menus_management'], 'L_ACTION_MODULES_MANAGEMENT' => $LANG['action.modules_management'], 'L_ACTION_THEMES_MANAGEMENT' => $LANG['action.themes_management'], 'L_ACTION_LANGS_MANAGEMENT' => $LANG['action.langs_management'], 'L_NO_COMMENT' => LangLoader::get_message('no_item_now', 'common'), 'L_LAST_COMMENTS' => $LANG['last_comments'], 'L_VIEW_ALL_COMMENTS' => $LANG['view_all_comments'], 'L_WRITING_PAD' => $LANG['writing_pad'], 'L_STATS' => $LANG['stats'], 'L_USER_ONLINE' => $LANG['user_online'], 'L_USER_IP' => $LANG['user_ip'], 'L_LOCALISATION' => $LANG['localisation'], 'L_LAST_UPDATE' => $LANG['last_update'], 'L_WEBSITE_UPDATES' => $LANG['website_updates'], 'L_BY' => $LANG['by'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'ADVISES' => $advises_form->display()));
//Liste des personnes en lignes.
$result = PersistenceContext::get_querier()->select("SELECT s.user_id, s.ip, s.timestamp, s.location_script, s.location_title, m.display_name, m.groups, m.level\nFROM " . DB_TABLE_SESSIONS . " s\nLEFT JOIN " . DB_TABLE_MEMBER . " m ON s.user_id = m.user_id\nWHERE s.timestamp > :timestamp\nORDER BY s.timestamp DESC", array('timestamp' => time() - SessionsConfig::load()->get_active_session_duration()));
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:admin_index.php

示例5: while

 while ($row = $result->fetch()) {
     $row['user_id'] = (int) $row['user_id'];
     $is_admin = $row['user_id'] === -1;
     if ($is_admin) {
         $row['level'] = 2;
     }
     if (!$is_guest_in_convers) {
         $is_guest_in_convers = empty($row['display_name']);
     }
     //Avatar
     $user_avatar = !empty($row['user_avatar']) ? Url::to_rel($row['user_avatar']) : ($user_accounts_config->is_default_avatar_enabled() ? Url::to_rel('/templates/' . $current_user->get_theme() . '/images/' . $user_accounts_config->get_default_avatar_name()) : '');
     //Reprise du dernier message de la page précédente.
     $row['contents'] = $quote_last_msg == 1 && $i == 0 ? '<span class="text-strong">' . $LANG['quote_last_msg'] . '</span><br /><br />' . $row['contents'] : $row['contents'];
     $i++;
     $group_color = User::get_group_color($row['groups'], $row['level']);
     $tpl->assign_block_vars('pm.msg', array('C_MODERATION_TOOLS' => $current_user->get_id() === $row['user_id'] && $row['id'] === $convers['last_msg_id'] && $row['view_status'] === '0', 'C_VISITOR' => $is_admin, 'C_AVATAR' => $row['user_avatar'] || $user_accounts_config->is_default_avatar_enabled(), 'C_GROUP_COLOR' => !empty($group_color), 'ID' => $row['id'], 'CONTENTS' => FormatingHelper::second_parse($row['contents']), 'DATE' => $LANG['on'] . ' ' . Date::to_format($row['timestamp'], Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE), 'USER_AVATAR' => $user_avatar, 'PSEUDO' => $is_admin ? $LANG['admin'] : (!empty($row['display_name']) ? TextHelper::wordwrap_html($row['display_name'], 13) : $LANG['guest']), 'LEVEL_CLASS' => UserService::get_level_class($row['level']), 'GROUP_COLOR' => $group_color, 'U_PROFILE' => UserUrlBuilder::profile($row['user_id'])->rel(), 'L_LEVEL' => $row['warning_percentage'] < '100' || time() - $row['delay_banned'] < 0 ? UserService::get_level_lang($row['level'] !== null ? $row['level'] : '-1') : LangLoader::get_message('banned', 'user-common')));
     //Marqueur de suivis du sujet.
     if (!empty($row['track'])) {
         $track = true;
     }
     $j++;
 }
 $result->dispose();
 //Récupération du message quoté.
 if (!empty($quote_get)) {
     try {
         $quote_msg = PersistenceContext::get_querier()->select_single_row(DB_TABLE_PM_MSG, array('user_id', 'contents'), 'WHERE id = :id', array('id' => $quote_get));
     } catch (RowNotFoundException $e) {
         $error_controller = PHPBoostErrors::unexisting_element();
         DispatchManager::redirect($error_controller);
     }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:pm.php

示例6: parse_search_result

 /**
  *  @desc Return the string to print the result
  *  @param &string[] $result_data the result's data
  *  @return string[] The string to print the result of a search element
  */
 public function parse_search_result($result_data)
 {
     global $LANG;
     load_module_lang('forum');
     //Chargement de la langue du module.
     $tpl = new FileTemplate('forum/forum_generic_results.tpl');
     $tpl->put_all(array('L_ON' => $LANG['on'], 'L_TOPIC' => $LANG['topic']));
     $rewrited_title = ServerEnvironmentConfig::load()->is_url_rewriting_enabled() ? '+' . Url::encode_rewrite($result_data['title']) : '';
     $tpl->put_all(array('USER_ONLINE' => '<i class="fa ' . (!empty($result_data['connect']) && $result_data['user_id'] !== -1 ? 'fa-online' : 'fa-offline') . '"></i>', 'U_USER_PROFILE' => !empty($result_data['user_id']) ? UserUrlBuilder::profile($result_data['user_id'])->rel() : '', 'USER_PSEUDO' => !empty($result_data['display_name']) ? TextHelper::wordwrap_html($result_data['display_name'], 13) : $LANG['guest'], 'U_TOPIC' => PATH_TO_ROOT . '/forum/topic' . url('.php?id=' . $result_data['topic_id'], '-' . $result_data['topic_id'] . $rewrited_title . '.php') . '#m' . $result_data['msg_id'], 'TITLE' => stripslashes($result_data['title']), 'DATE' => Date::to_format($result_data['date'], 'd/m/y'), 'CONTENTS' => FormatingHelper::second_parse(stripslashes($result_data['contents'])), 'USER_AVATAR' => '<img src="' . (UserAccountsConfig::load()->is_default_avatar_enabled() && !empty($result_data['avatar']) ? $result_data['avatar'] : PATH_TO_ROOT . '/templates/' . AppContext::get_current_user()->get_theme() . '/images/' . UserAccountsConfig::load()->get_default_avatar_name()) . '" alt="' . LangLoader::get_message('avatar', 'user-common') . '" class="message-avatar"/>'));
     return $tpl->render();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:16,代码来源:ForumSearchable.class.php

示例7: url

 }
 $user_accounts_config = UserAccountsConfig::load();
 //Avatar
 if (empty($row['user_avatar'])) {
     $user_avatar = $user_accounts_config->is_default_avatar_enabled() == '1' ? '<img src="../templates/' . AppContext::get_current_user()->get_theme() . '/images/' . $user_accounts_config->get_default_avatar_name() . '" alt="' . LangLoader::get_message('avatar', 'user-common') . '" />' : '';
 } else {
     $user_avatar = '<img src="' . Url::to_rel($row['user_avatar']) . '" alt="' . LangLoader::get_message('avatar', 'user-common') . '"/>';
 }
 //Affichage du nombre de message.
 if ($row['posted_msg'] >= 1) {
     $posted_msg = '<a href="' . UserUrlBuilder::messages($row['user_id'])->rel() . '" class="small">' . $LANG['message_s'] . '</a>: ' . $row['posted_msg'];
 } else {
     $posted_msg = !$is_guest ? '<a href="' . PATH_TO_ROOT . '/forum/membermsg' . url('.php?id=' . $row['user_id'], '') . '" class="small">' . $LANG['message'] . '</a>: 0' : $LANG['message'] . ': 0';
 }
 $user_sign_field = $extended_fields_cache->get_extended_field_by_field_name('user_sign');
 $tpl->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' => TextHelper::wordwrap_html($row['login'], 13), 'FORUM_MSG_DATE' => $LANG['on'] . ' ' . Date::to_format($row['timestamp'], Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE), 'FORUM_MSG_CONTENTS' => FormatingHelper::second_parse(stripslashes($row['contents'])), 'FORUM_USER_EDITOR_LOGIN' => $row['login_edit'], 'FORUM_USER_EDITOR_DATE' => Date::to_format($row['timestamp_edit'], Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE), 'USER_RANK' => $row['warning_percentage'] < '100' || time() - $row['delay_banned'] < 0 ? $user_rank : LangLoader::get_message('banned', 'user-common'), 'USER_IMG_ASSOC' => $user_assoc_img, 'USER_AVATAR' => $user_avatar, 'USER_GROUP' => $user_groups, 'USER_DATE' => !$is_guest ? $LANG['registered_on'] . ': ' . Date::to_format($row['registered'], Date::FORMAT_DAY_MONTH_YEAR) : '', 'USER_MSG' => !$is_guest ? $posted_msg : '', 'USER_MAIL' => !empty($row['email']) && $row['show_email'] == '1' ? '<a href="mailto:' . $row['email'] . '" class="basic-button smaller">Mail</a>' : '', 'USER_SIGN' => !empty($row['user_sign']) && !empty($user_sign_field) && $user_sign_field['display'] ? '____________________<br />' . FormatingHelper::second_parse($row['user_sign']) : '', 'USER_WARNING' => $row['warning_percentage'], 'L_FORUM_QUOTE_LAST_MSG' => $quote_last_msg == 1 && $i == 0 ? $LANG['forum_quote_last_msg'] : '', 'C_USER_ONLINE' => !empty($row['connect']), 'C_FORUM_USER_LOGIN' => !empty($row['login']), 'C_FORUM_MSG_EDIT' => $edit, 'C_FORUM_MSG_DEL' => $del, 'C_FORUM_MSG_DEL_MSG' => !$first_message, 'C_FORUM_MSG_CUT' => $cut, 'C_FORUM_USER_EDITOR' => $row['timestamp_edit'] > 0 && $config->is_edit_mark_enabled(), 'C_FORUM_USER_EDITOR_LOGIN' => !empty($row['login_edit']), 'C_FORUM_MODERATOR' => $moderator, 'U_FORUM_USER_PROFILE' => UserUrlBuilder::profile($row['user_id'])->rel(), 'U_FORUM_MSG_EDIT' => url('.php?new=msg&amp;idm=' . $row['id'] . '&amp;id=' . $topic['idcat'] . '&amp;idt=' . $id_get), 'U_FORUM_USER_EDITOR_PROFILE' => UserUrlBuilder::profile($row['user_id_edit'])->rel(), 'U_FORUM_MSG_DEL' => url('.php?del=1&amp;idm=' . $row['id'] . '&amp;token=' . AppContext::get_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 && AppContext::get_current_user()->check_level(User::MEMBER_LEVEL) ? '<a href="' . UserUrlBuilder::personnal_message($row['user_id'])->rel() . '" class="basic-button smaller">MP</a>' : ''));
 foreach ($displayed_extended_fields as $field_type) {
     $field = $extended_fields_cache->get_extended_field_by_field_name($field_type);
     if (!empty($row[$field_type]) && !empty($field) && $field['display']) {
         $button = '';
         if ($field['regex'] == 4) {
             foreach (MemberShortTextExtendedField::$brands_pictures_list as $id => $parameters) {
                 if (strstr($row[$field_type], $id)) {
                     $button = '<a href="mailto:' . $row[$field_type] . '" class="basic-button smaller"><i class="fa ' . $parameters['picture'] . '"></i> ' . $parameters['title'] . '</a>';
                 }
             }
         } else {
             if ($field['regex'] == 5) {
                 $button = '<a href="' . $row[$field_type] . '" class="basic-button smaller">' . LangLoader::get_message('regex.website', 'admin-user-common') . '</a>';
                 foreach (MemberShortTextExtendedField::$brands_pictures_list as $id => $parameters) {
                     if (strstr($row[$field_type], $id)) {
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:topic.php


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