• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP template_extract_block函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: keywords_add_config_button

function keywords_add_config_button($href, $title, $target, $link)
{
    global $template_gallery_admin_menu;
    $new_template = $template_gallery_admin_menu;
    $button = template_extract_block($new_template, 'documentation');
    $params = array('{DOCUMENTATION_HREF}' => $href, '{DOCUMENTATION_TITLE}' => $title, 'target="cpg_documentation"' => $target, '{DOCUMENTATION_LNK}' => $link);
    $new_button = "<!-- BEGIN {$link} -->" . template_eval($button, $params) . "<!-- END {$link} -->\n";
    template_extract_block($template_gallery_admin_menu, 'documentation', "<!-- BEGIN documentation -->" . $button . "<!-- END documentation -->\n" . $new_button);
}
开发者ID:phill104,项目名称:branches,代码行数:9,代码来源:codebase.php


示例2: FileMove_config_button

function FileMove_config_button($href, $title, $target, $link)
{
    global $template_gallery_admin_menu;
    $new_template = $template_gallery_admin_menu;
    $button = template_extract_block($new_template, 'update_database');
    $params = array('update.php' => $href, '{UPDATE_DATABASE_TITLE}' => $title, 'target="cpg_documentation"' => $target, '{UPDATE_DATABASE_LNK}' => $link, '{UPDATE_DATABASE_ICO}' => cpg_fetch_icon('download', 1));
    $new_button = "<!-- BEGIN {$link} -->" . template_eval($button, $params) . "<!-- END {$link} -->\n";
    template_extract_block($template_gallery_admin_menu, 'update_database', "<!-- BEGIN update_database -->" . $button . "<!-- END update_database -->\n" . $new_button);
}
开发者ID:phill104,项目名称:branches,代码行数:9,代码来源:codebase.php


示例3: keyword_list_add_admin_button

function keyword_list_add_admin_button($href, $title, $target, $link)
{
    global $template_sys_menu, $template_sys_menu_spacer;
    require 'plugins/keyword_list/include/init.inc.php';
    $new_template = $template_sys_menu;
    $button = template_extract_block($new_template, 'faq');
    $params = array('{FAQ_LNK}' => $target, '{FAQ_TITLE}' => $title, '{FAQ_TGT}' => $href, 'faq' => $link);
    $new_button = "<!-- BEGIN {$link} -->" . template_eval($button, $params) . "<!-- END {$link} -->\n";
    template_extract_block($template_sys_menu, 'faq', "<!-- BEGIN faq -->" . $button . "<!-- END faq -->\n" . $new_button);
}
开发者ID:phill104,项目名称:branches,代码行数:10,代码来源:codebase.php


示例4: photo_summary_add_admin_button

function photo_summary_add_admin_button($href, $title, $target, $link)
{
    global $template_sys_menu, $template_sys_menu_spacer;
    require 'plugins/photo_summary/include/init.inc.php';
    $new_template = $template_sys_menu;
    $button = template_extract_block($new_template, 'upload_pic');
    $params = array('{UPL_PIC_LNK}' => $target, '{UPL_PIC_TITLE}' => $title, '{UPL_PIC_TGT}' => $href, 'upload_pic' => $link);
    $new_button = "<!-- BEGIN {$link} -->" . template_eval($button, $params) . "<!-- END {$link} -->\n";
    template_extract_block($template_sys_menu, 'upload_pic', "<!-- BEGIN upload_pic -->" . $button . "<!-- END upload_pic -->\n" . $new_button);
}
开发者ID:phill104,项目名称:branches,代码行数:10,代码来源:codebase.php


示例5: form_publish

function form_publish()
{
    global $CONFIG, $CAT_LIST, $PHP_SELF;
    global $ONNEXT_SCRIPT, $ONBACK_SCRIPT, $WIZARD_BUTTONS;
    global $template_select_album;
    global $lang_xp_publish_php;
    $alb_count = 0;
    $html_album_list = html_album_list($alb_count);
    $html_cat_list = html_cat_list();
    if (!(USER_CAN_CREATE_ALBUMS || USER_IS_ADMIN)) {
        template_extract_block($template_select_album, 'existing_albums');
        template_extract_block($template_select_album, 'create_album');
        $params = array('{WELCOME}' => sprintf($lang_xp_publish_php['welcome'], USER_NAME), '{NO_ALBUM}' => $lang_xp_publish_php['no_alb']);
        echo template_eval($template_select_album, $params);
        $WIZARD_BUTTONS = "false,false,false";
    } elseif (!$alb_count) {
        template_extract_block($template_select_album, 'no_album');
        template_extract_block($template_select_album, 'existing_albums');
        if (!USER_IS_ADMIN) {
            template_extract_block($template_select_album, 'select_category');
        }
        $params = array('{WELCOME}' => sprintf($lang_xp_publish_php['welcome'], USER_NAME), '{CREATE_NEW}' => $lang_xp_publish_php['create_new'], '{ALBUM}' => $lang_xp_publish_php['album'], '{CATEGORY}' => $lang_xp_publish_php['category'], '{SELECT_CATEGORY}' => $html_cat_list, '{POST_ACTION}' => $PHP_SELF . '?cmd=create_album');
        echo template_eval($template_select_album, $params);
        $ONNEXT_SCRIPT = 'create_alb();';
        $ONBACK_SCRIPT = 'window.external.FinalBack();';
        $WIZARD_BUTTONS = 'true,true,false';
    } else {
        template_extract_block($template_select_album, 'no_album');
        if (!USER_IS_ADMIN) {
            template_extract_block($template_select_album, 'select_category');
        }
        $params = array('{WELCOME}' => sprintf($lang_xp_publish_php['welcome'], USER_NAME), '{UPLOAD}' => $lang_xp_publish_php['upload'], '{ALBUM}' => $lang_xp_publish_php['album'], '{SELECT_ALBUM}' => $html_album_list, '{CATEGORY}' => $lang_xp_publish_php['category'], '{SELECT_CATEGORY}' => $html_cat_list, '{CREATE_NEW}' => $lang_xp_publish_php['create_new'], '{POST_ACTION}' => $PHP_SELF . '?cmd=create_album');
        echo template_eval($template_select_album, $params);
        $ONNEXT_SCRIPT = 'create_alb_or_use_existing();';
        $ONBACK_SCRIPT = 'window.external.FinalBack();';
        $WIZARD_BUTTONS = 'true,true,false';
    }
}
开发者ID:BackupTheBerlios,项目名称:copperexport-svn,代码行数:38,代码来源:xp_publish.php


示例6: enlargeit_html_comments

function enlargeit_html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $comment_date_fmt, $HTML_SUBST;
    global $enlargeit_image_comments, $enlargeit_add_your_comment, $lang_display_comments;
    $html = '';
    // report to moderator buttons
    $tmpl_comment_edit_box = template_extract_block($enlargeit_image_comments, 'edit_box_smilies', '{EDIT}');
    template_extract_block($enlargeit_image_comments, 'edit_box_no_smilies');
    template_extract_block($enlargeit_add_your_comment, 'input_box_no_smilies');
    $tmpl_comments_buttons = template_extract_block($enlargeit_image_comments, 'buttons', '{BUTTONS}');
    $tmpl_comments_ipinfo = template_extract_block($enlargeit_image_comments, 'ipinfo', '{IPINFO}');
    if ($CONFIG['comments_sort_descending'] == 1) {
        $comment_sort_order = 'DESC';
    } else {
        $comment_sort_order = 'ASC';
    }
    $result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}' ORDER BY msg_id {$comment_sort_order}");
    while ($row = mysql_fetch_array($result)) {
        $user_can_edit = GALLERY_ADMIN_MODE || USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS || !USER_ID && USER_CAN_POST_COMMENTS && $USER['ID'] == $row['author_md5_id'];
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = '';
        $comment_ipinfo = $row['msg_raw_ip'] && GALLERY_ADMIN_MODE ? $tmpl_comments_ipinfo : '';
        $comment_body = make_clickable($row['msg_body']);
        $smilies = '';
        $ip = $row['msg_hdr_ip'];
        if ($row['msg_hdr_ip'] != $row['msg_raw_ip']) {
            $ip .= ' [' . $row['msg_raw_ip'] . ']';
        }
        $params = array('{EDIT}' => &$comment_edit_box, '{BUTTONS}' => &$comment_buttons, '{IPINFO}' => &$comment_ipinfo);
        $template = template_eval($enlargeit_image_comments, $params);
        $params = array('{MSG_AUTHOR}' => stripslashes($row['msg_author']), '{MSG_ID}' => $row['msg_id'], '{PID}' => $row['pid'], '{EDIT_TITLE}' => &$lang_display_comments['edit_title'], '{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'], '{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt), '{MSG_BODY}' => bb_decode($comment_body), '{MSG_BODY_RAW}' => $row['msg_body'], '{OK}' => &$lang_display_comments['OK'], '{SMILIES}' => '', '{IP}' => $ip, '{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'], '{WIDTH}' => $CONFIG['picture_table_width']);
        $html .= template_eval($template, $params);
    }
    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
        if (USER_ID) {
            $user_name_input = '<tr><td><input type="hidden" name="msg_author" value="" /></td>';
            template_extract_block($enlargeit_add_your_comment, 'user_name_input', $user_name_input);
            $user_name = '';
        } else {
            if (isset($USER['name'])) {
                $user_name = strtr($USER['name'], $HTML_SUBST);
            } else {
                $user_name = $lang_display_comments['your_name'];
            }
        }
        $params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'], '{NAME}' => $lang_display_comments['name'], '{COMMENT}' => $lang_display_comments['comment'], '{PIC_ID}' => $pid, '{USER_NAME}' => $user_name, '{MAX_COM_LENGTH}' => $CONFIG['max_com_size'], '{OK}' => $lang_display_comments['OK'], '{SMILIES}' => '', '{WIDTH}' => $CONFIG['picture_table_width']);
        template_extract_block($enlargeit_add_your_comment, 'smilies');
        $html .= template_eval($enlargeit_add_your_comment, $params);
    }
    return $html;
}
开发者ID:phill104,项目名称:branches,代码行数:51,代码来源:enl_comment.php


示例7: theme_slideshow

function theme_slideshow()
{
    global $CONFIG, $lang_display_image_php, $template_display_media;
    pageheader($lang_display_image_php['slideshow']);
    include "include/slideshow.inc.php";
    $start_slideshow = '<script language="JavaScript" type="text/JavaScript">runSlideShow()</script>';
    template_extract_block($template_display_media, 'img_desc', $start_slideshow);
    $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100, '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" /><br />', '{ADMIN_MENU}' => '');
    starttable();
    echo <<<EOT
        <tr>
            <td align="center" class="navmenu" style="white-space: nowrap;">
                <div id="Title"></div>
            </td>
        </tr>
EOT;
    endtable();
    starttable();
    echo template_eval($template_display_media, $params);
    endtable();
    starttable();
    echo <<<EOT
        <tr>
                <td align="center" class="navmenu" style="white-space: nowrap;">
                        <a href="javascript:endSlideShow()" class="navmenu">{$lang_display_image_php['stop_slideshow']}</a>
                </td>
        </tr>

EOT;
    endtable();
    pagefooter();
}
开发者ID:phill104,项目名称:branches,代码行数:32,代码来源:theme.php


示例8: slideshow

function slideshow()
{
    global $CONFIG, $template_display_picture, $CPG_M_DIR;
    if (function_exists('theme_slideshow')) {
        theme_slideshow();
        return;
    }
    pageheader(SLIDESHOW_TITLE);
    require_once "includes/coppermine/slideshow.inc";
    $start_slideshow = '<script language="JavaScript" type="text/JavaScript">runSlideShow()</script>';
    template_extract_block($template_display_picture, 'img_desc', $start_slideshow);
    $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100, '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" alt="" /><br />', '{ADMIN_MENU}' => '');
    starttable();
    echo template_eval($template_display_picture, $params);
    endtable();
    starttable();
    echo '
		<tr>
		<td style="text-align:center"  class="navmenu" style="white-space: nowrap;">
		<a href="javascript:endSlideShow()" class="navmenu">' . STOP_SLIDESHOW . '</a>
		</td>
		</tr>
';
    endtable();
    pagefooter();
}
开发者ID:cbsistem,项目名称:nexos,代码行数:26,代码来源:displayimage.php


示例9: theme_slideshow

function theme_slideshow($start_img, $title)
{
    global $CONFIG, $lang_display_image_php, $template_display_media, $lang_common, $album, $pid, $slideshow;
    global $cat, $date, $THEME_DIR;
    pageheader($lang_display_image_php['slideshow']);
    template_extract_block($template_display_media, 'img_desc', $start_slideshow);
    /** set styles to slideshow background */
    $setDimentionW = $CONFIG['picture_width'] + 100;
    $setDimentionH = $CONFIG['picture_width'] + 10;
    if (defined('THEME_HAS_PROGRESS_GRAPHICS')) {
        $prefix = $THEME_DIR;
    } else {
        $prefix = '';
    }
    $params = array('{SLIDESHOW_STYLE}' => 'width:' . $setDimentionW . 'px; height: ' . $setDimentionH . 'px; position: relative;', '{IMAGE}' => '<img id="showImage" src="' . $start_img . '" class="image" alt="" border="" /><br />', '{ADMIN_MENU}' => '', '{LOADER_ICON_PATH}' => $prefix . 'images/loader.gif');
    echo '<a name="top_display_media"></a>';
    starttable();
    echo <<<EOT
        <tr class="noscript">
            <td align="center" class="tableh2">
              <noscript>
                  {$lang_common['javascript_needed']}
              </noscript>
            </td>
        </tr>
        <tr>
            <td align="center" class="navmenu" style="white-space: nowrap;">
                <div id="title">{$title}</div>
            </td>
        </tr>
EOT;
    endtable();
    starttable();
    echo template_eval($template_display_media, $params);
    endtable();
    starttable();
    echo <<<EOT
        <tr>
                <td align="center" id="back-to" class="navmenu" >
                        <a class="navmenu" style="cursor:pointer">{$lang_display_image_php['stop_slideshow']}</a>
                </td>
        </tr>

EOT;
    endtable();
    pagefooter();
}
开发者ID:CatBerg-TestOrg,项目名称:coppermine_1.6.x,代码行数:47,代码来源:theme.php


示例10: theme_display_film_strip

function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb', $date = '', $filmstrip_prev_pos, $filmstrip_next_pos, $max_block_items, $thumb_width)
{
    global $CONFIG, $THEME_DIR;
    global $template_film_strip, $lang_film_strip, $lang_common, $pic_count, $mar_pic;
    $superCage = Inspekt::makeSuperCage();
    static $template = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $spacer = '';
    if (defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        set_js_var('vertstrip', 1);
    }
    if (!$template) {
        $template = $template_film_strip;
        $thumb_cell = template_extract_block($template, 'thumb_cell');
        $empty_cell = template_extract_block($template, 'empty_cell');
    }
    $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;
    $date_link = $date == '' ? '' : '&amp;date=' . $date;
    if ($superCage->get->getInt('uid')) {
        $uid_link = '&amp;uid=' . $superCage->get->getInt('uid');
    } else {
        $uid_link = '';
    }
    $i = 0;
    $thumb_strip = '';
    foreach ($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            if ($thumb['pos'] == $pos && !$superCage->get->keyExists('film_strip')) {
                $thumb['image'] = str_replace('class="image"', 'class="image middlethumb"', $thumb['image']);
            }
            // determine if thumbnail link targets should open in a pop-up
            if ($CONFIG['thumbnail_to_fullsize'] == 1) {
                // code for full-size pop-up
                if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                    $target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
                } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
                    $target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
                } else {
                    $target = 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
                }
            } elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
                $page = cpg_get_comment_page_number($thumb['msg_id']);
                $page = is_numeric($page) ? "&amp;page={$page}" : '';
                $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}&amp;msg_id={$thumb['msg_id']}{$page}#comment{$thumb['msg_id']}";
            } else {
                $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}#top_display_media";
            }
            $params = array('{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{ONE_WIDTH}' => "width:" . $thumb_width . "px; float: left");
        } else {
            $params = array('{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{ONE_WIDTH}' => "width:" . $thumb_width . "px; float: left");
        }
        $thumb_strip .= template_eval($thumb_cell, $params);
    }
    $tile1 = $THEME_DIR . 'images/tile1.gif';
    $tile2 = $THEME_DIR . 'images/tile2.gif';
    if (defined('THEME_HAS_NAVBAR_GRAPHICS')) {
        $location = $THEME_DIR;
    } else {
        $location = '';
    }
    $max_itme_width_ul = $max_block_items;
    if ($max_block_items % 2 == 0) {
        $max_itme_width_ul = $max_block_items + 1;
    }
    $set_width_to_film = "width:" . $max_block_items * ($thumb_width + 4) . "px; position:relative;";
    $params = array('{THUMB_STRIP}' => $thumb_strip, '{COLS}' => $i, '{TILE1}' => $tile1, '{TILE2}' => $tile2, '{SET_WIDTH}' => $set_width_to_film);
    ob_start();
    echo '<div id="filmstrip">';
    if (!defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        starttable($CONFIG['picture_table_width']);
    }
    echo template_eval($template, $params);
    if (!defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        endtable();
    }
    echo '</div>';
    $film_strip = ob_get_contents();
    ob_end_clean();
    return $film_strip;
}
开发者ID:phill104,项目名称:branches,代码行数:82,代码来源:theme.php


示例11: theme_slideshow

    function theme_slideshow($start_img, $title)
    {
        global $CONFIG, $lang_display_image_php, $template_display_media, $lang_common, $album, $pid, $slideshow;
        global $cat, $date;
        pageheader($lang_display_image_php['slideshow']);
        template_extract_block($template_display_media, 'img_desc', $start_slideshow);
        $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100, '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" id="showImage" />', '{ADMIN_MENU}' => '');
        starttable();
        echo <<<EOT
        <noscript>
        <tr>
            <td align="center" class="tableh2">
              {$lang_common['javascript_needed']}
            </td>
        </tr>
        </noscript>
        <tr>
            <td align="center" class="navmenu" style="white-space: nowrap;">
                <div id="Title">{$title}</div>
            </td>
        </tr>
EOT;
        endtable();
        starttable();
        echo template_eval($template_display_media, $params);
        endtable();
        starttable();
        echo <<<EOT
        <tr>
                <td align="center" class="navmenu" style="white-space: nowrap;">
                        <a class="navmenu" style="cursor:pointer">{$lang_display_image_php['stop_slideshow']}</a>
                </td>
        </tr>

EOT;
        endtable();
        pagefooter();
    }
开发者ID:phill104,项目名称:branches,代码行数:38,代码来源:themes.inc.php


示例12: theme_display_thumbnails

    function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date = '')
    {
        global $CONFIG;
        global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $lang_common, $template_tab_display, $template_thumbnail_view, $lang_album_list, $lang_errors, $lang_main_menu;
        global $REFERER, $lightbox;
        // plugin addition
        $superCage = Inspekt::makeSuperCage();
        static $header = '';
        static $thumb_cell = '';
        static $empty_cell = '';
        static $row_separator = '';
        static $footer = '';
        static $tabs = '';
        static $spacer = '';
        if ($header == '') {
            $thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
            $tabs = template_extract_block($template_thumbnail_view, 'tabs');
            $header = template_extract_block($template_thumbnail_view, 'header');
            $empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
            $row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
            $footer = template_extract_block($template_thumbnail_view, 'footer');
            $spacer = template_extract_block($template_thumbnail_view, 'spacer');
        }
        $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;
        $date_link = $date == '' ? '' : '&amp;date=' . $date;
        if ($superCage->get->getInt('uid')) {
            $uid_link = '&amp;uid=' . $superCage->get->getInt('uid');
        } else {
            $uid_link = '';
        }
        $theme_thumb_tab_tmpl = $template_tab_display;
        if ($mode == 'thumb') {
            $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
            $theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&amp;page=%d'));
        } else {
            $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
            $theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d'));
        }
        $thumbcols = $CONFIG['thumbcols'];
        $cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
        $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
        if (!GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row, 'admin_buttons') !== false) {
            template_extract_block($template_thumb_view_title_row, 'admin_buttons');
        }
        // The sort order options are not available for meta albums
        if ($sort_options) {
            if (GALLERY_ADMIN_MODE) {
                $param = array('{ALBUM_ID}' => $aid, '{CAT_ID}' => $cat > 0 ? $cat : $cat, '{MODIFY}' => cpg_fetch_icon('modifyalb', 1) . $lang_common['album_properties'], '{PARENT_CAT}' => cpg_fetch_icon('category', 1) . $lang_common['parent_category'], '{EDIT_PICS}' => cpg_fetch_icon('edit', 1) . $lang_common['edit_files'], '{ALBUM_MGR}' => cpg_fetch_icon('alb_mgr', 1) . $lang_common['album_manager']);
            } else {
                $param = array();
            }
            $param['{ALBUM_NAME}'] = $album_name;
            $title = template_eval($template_thumb_view_title_row, $param);
        } elseif ($aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) {
            //Lots of stuff can be added here later
            $param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => cpg_fetch_icon('zip', 2) . $lang_thumb_view['download_zip']);
            $title = template_eval($template_fav_thumb_view_title_row, $param);
        } else {
            $title = $album_name;
        }
        // plugin addition
        $lightbox['data']['referrer'] = urldecode($REFERER);
        if ($superCage->post->keyExists('search') && !$superCage->get->keyExists('album')) {
            $lightbox['data']['referrer'] .= "?album=search";
        }
        if (isset($lightbox['data']['activate_favsel'])) {
            echo '<form action="' . $lightbox['data']['referrer'] . '" method="post">';
        }
        if ($mode == 'thumb') {
            starttable('100%', $title, $thumbcols);
        } else {
            starttable('100%');
        }
        echo $header;
        $i = 0;
        global $thumb;
        // make $thumb accessible to plugins
        foreach ($thumb_list as $thumb) {
            $i++;
            if ($mode == 'thumb') {
                if ($aid == 'lastalb') {
                    $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
                } elseif ($aid == 'random') {
                    // determine if thumbnail link targets should open in a pop-up
                    if ($CONFIG['thumbnail_to_fullsize'] == 1) {
                        // code for full-size pop-up
                        if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                            $target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
                        } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
                            $target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
                        } else {
                            $target = 'javascript:;" onClick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
                        }
                    } else {
                        $target = "displayimage.php?pid={$thumb['pid']}{$uid_link}";
                    }
                    $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
                } else {
                    // determine if thumbnail link targets should open in a pop-up
                    if ($CONFIG['thumbnail_to_fullsize'] == 1) {
//.........这里部分代码省略.........
开发者ID:phill104,项目名称:branches,代码行数:101,代码来源:codebase.php


示例13: theme_display_thumbnails

function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date = '')
{
    global $CONFIG, $CURRENT_ALBUM_DATA;
    global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $lang_common, $template_tab_display, $template_thumbnail_view, $lang_album_list, $lang_errors;
    $superCage = Inspekt::makeSuperCage();
    static $header = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $row_separator = '';
    static $footer = '';
    static $tabs = '';
    static $spacer = '';
    if ($header == '') {
        $thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
        $tabs = template_extract_block($template_thumbnail_view, 'tabs');
        $header = template_extract_block($template_thumbnail_view, 'header');
        $empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
        $row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
        $footer = template_extract_block($template_thumbnail_view, 'footer');
        $spacer = template_extract_block($template_thumbnail_view, 'spacer');
    }
    $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;
    $date_link = $date == '' ? '' : '&amp;date=' . $date;
    if ($superCage->get->getInt('uid')) {
        $uid_link = '&amp;uid=' . $superCage->get->getInt('uid');
    } else {
        $uid_link = '';
    }
    $theme_thumb_tab_tmpl = $template_tab_display;
    if ($mode == 'thumb') {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
        $theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&amp;page=%d'));
    } else {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        $theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d'));
    }
    $thumbcols = $CONFIG['thumbcols'];
    $cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
    $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
    if (!GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row, 'admin_buttons') !== false) {
        template_extract_block($template_thumb_view_title_row, 'admin_buttons');
    }
    // The sort order options are not available for meta albums
    if ($sort_options) {
        if (GALLERY_ADMIN_MODE) {
            $param = array('{ALBUM_ID}' => $aid, '{CAT_ID}' => $cat > 0 ? $cat : $CURRENT_ALBUM_DATA['category'], '{MODIFY}' => cpg_fetch_icon('modifyalb', 1) . $lang_common['album_properties'], '{PARENT_CAT}' => cpg_fetch_icon('category', 1) . $lang_common['parent_category'], '{EDIT_PICS}' => cpg_fetch_icon('edit', 1) . $lang_common['edit_files'], '{ALBUM_MGR}' => cpg_fetch_icon('alb_mgr', 1) . $lang_common['album_manager']);
        } else {
            $param = array();
        }
        $param['{ALBUM_NAME}'] = $album_name;
        $title = template_eval($template_thumb_view_title_row, $param);
    } elseif ($aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) {
        //Lots of stuff can be added here later
        $param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => cpg_fetch_icon('zip', 2) . $lang_thumb_view['download_zip']);
        $title = template_eval($template_fav_thumb_view_title_row, $param);
    } else {
        $title = $album_name;
    }
    if ($mode == 'thumb') {
        starttable('100%', $title, $thumbcols);
    } else {
        starttable('100%');
    }
    echo $header;
    $i = 0;
    global $thumb;
    // make $thumb accessible to plugins
    foreach ($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            if ($aid == 'lastalb') {
                $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => str_replace('.gif', '.png', $thumb['caption']), '{ADMIN_MENU}' => $thumb['admin_menu']);
            } else {
                // determine if thumbnail link targets should open in a pop-up
                if ($CONFIG['thumbnail_to_fullsize'] == 1) {
                    // code for full-size pop-up
                    if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                        $target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
                    } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
                        $target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
                    } else {
                        $target = 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
                    }
                } elseif ($aid == 'random') {
                    $target = "displayimage.php?pid={$thumb['pid']}{$uid_link}#top_display_media";
                } elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
                    $page = cpg_get_comment_page_number($thumb['msg_id']);
                    $page = is_numeric($page) ? "&amp;page={$page}" : '';
                    $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}&amp;msg_id={$thumb['msg_id']}{$page}#comment{$thumb['msg_id']}";
                } else {
                    $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}#top_display_media";
                }
                $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => str_replace('.gif', '.png', $thumb['caption']), '{ADMIN_MENU}' => $thumb['admin_menu']);
            }
        } else {
            // mode != 'thumb'
            // Used for mode = 'user' from list_users() in index.php
            $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => str_replace('.gif', '.png', $thumb['caption']), '{ADMIN_MENU}' => '');
        }
        // Plugin Filter: allow plugin to modify or add tags to process
//.........这里部分代码省略.........
开发者ID:phill104,项目名称:branches,代码行数:101,代码来源:theme.php


示例14: theme_display_thumbnails

 function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')
 {
     global $CONFIG;
     global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $template_tab_display, $template_thumbnail_view, $lang_album_list;
     $superCage = Inspekt::makeSuperCage();
     static $header = '';
     static $thumb_cell = '';
     static $empty_cell = '';
     static $row_separator = '';
     static $footer = '';
     static $tabs = '';
     static $spacer = '';
     if ($header == '') {
         $thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
         $tabs = template_extract_block($template_thumbnail_view, 'tabs');
         $header = template_extract_block($template_thumbnail_view, 'header');
         $empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
         $row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
         $footer = template_extract_block($template_thumbnail_view, 'footer');
         $spacer = template_extract_block($template_thumbnail_view, 'spacer');
     }
     $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;
     $theme_thumb_tab_tmpl = $template_tab_display;
     if ($mode == 'thumb') {
         $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
         $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&amp;page=%d'));
         $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&amp;page=%d'));
         $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&amp;page=%d'));
     } else {
         // start of modified section
         $pl = $superCage->get->getAlpha('letter') ? '&amp;letter=' . $superCage->get->getAlpha('letter') : '';
         $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
         $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d' . $pl));
         $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d' . $pl));
         $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d' . $pl));
         // end of modified section
     }
     $thumbcols = $CONFIG['thumbcols'];
     $cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
     $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
     // The sort order options are not available for meta albums
     if ($sort_options) {
         $param = array('{ALBUM_NAME}' => $album_name, '{AID}' => $aid, '{PAGE}' => $page, '{NAME}' => $lang_thumb_view['name'], '{TITLE}' => $lang_thumb_view['title'], '{DATE}' => $lang_thumb_view['date'], '{SORT_TA}' => $lang_thumb_view['sort_ta'], '{SORT_TD}' => $lang_thumb_view['sort_td'], '{SORT_NA}' => $lang_thumb_view['sort_na'], '{SORT_ND}' => $lang_thumb_view['sort_nd'], '{SORT_DA}' => $lang_thumb_view['sort_da'], '{SORT_DD}' => $lang_thumb_view['sort_dd'], '{POSITION}' => $lang_thumb_view['position'], '{SORT_PA}' => $lang_thumb_view['sort_pa'], '{SORT_PD}' => $lang_thumb_view['sort_pd']);
         $title = template_eval($template_thumb_view_title_row, $param);
     } else {
         if ($aid == 'favpics' && $CONFIG['enable_zipdownload'] == 1) {
             //Lots of stuff can be added here later
             $param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => $lang_thumb_view['download_zip']);
             $title = template_eval($template_fav_thumb_view_title_row, $param);
         } else {
             $title = $album_name;
         }
     }
     if ($mode == 'thumb') {
         starttable('100%', $title, $thumbcols);
     } else {
         makejumpbox();
         starttable('100%');
     }
     echo $header;
     $i = 0;
     foreach ($thumb_list as $thumb) {
         $i++;
         if ($mode == 'thumb') {
             if ($aid == 'lastalb') {
                 $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
             } else {
                 $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "displayimage.php?album={$aid}{$cat_link}&amp;pos={$thumb['pos']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
             }
         } else {
             $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => '');
         }
         echo template_eval($thumb_cell, $params);
         if ($i % $thumbcols == 0 && $i < count($thumb_list)) {
             echo $row_separator;
         }
     }
     for (; $i % $thumbcols; $i++) {
         echo $empty_cell;
     }
     echo $footer;
     if ($display_tabs) {
         $params = array('{THUMB_COLS}' => $thumbcols, '{TABS}' => $tabs_html);
         echo template_eval($tabs, $params);
     }
     endtable();
     echo $spacer;
 }
开发者ID:phill104,项目名称:branches,代码行数:88,代码来源:codebase.php


示例15: fix_displayimage

function fix_displayimage()
{
    // no specifics for Thumbnail page today.
    if (!defined("DISPLAYIMAGE_PHP")) {
        return;
    }
    global $CONFIG, $film_strip;
    global $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $comments, $picture, $votes, $pic_info, $template_display_media, $THEME_DIR;
    global $saved_template_image_comments, $saved_template_add_your_comment, $lang_display_comments, $lang_contest, $template_image_rating;
    if (!array_key_exists('aid', $CURRENT_ALBUM_DATA)) {
        return;
    }
    //checks if current album is a contest - not extracted in displayimage.php
    $result = cpg_db_query("SELECT contest FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$CURRENT_ALBUM_DATA['aid']}'");
    if ($row = mysql_fetch_row($result)) {
        $CURRENT_ALBUM_DATA['contest'] = $row[0];
    } else {
        return;
    }
    // display the votes as a voting page.
    if ($CURRENT_ALBUM_DATA['votes'] != 'YES' && $CURRENT_ALBUM_DATA['contest'] == 'YES') {
        if (!defined('MAX_RATING')) {
            define('MAX_RATING', 5);
        }
        $title = $lang_contest['result'];
        $votetext = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_contest['evaluation'], round($CURRENT_PIC_DATA['pic_rating'] / 2000, 1), MAX_RATING, $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
        $votes = $template_image_rating;
        $pattern = "#(<a href)(.*?)(</a>)#s";
        if (preg_match_all($pattern, $votes, $matches)) {
            foreach ($matches[0] as $key => $match) {
                if (preg_match("rating", $match)) {
                    $votes = ereg_replace(preg_quote($match), "", $votes);
                }
            }
        }
        $votes = ereg_replace("{VOTES}", $votetext, $votes);
        $votes = ereg_replace("{TITLE}", $title, $votes);
        $votes = ereg_replace("{LOCATION}", $THEME_DIR, $votes);
        if (preg_match("<!-- BEGIN rating_boxes -->", $votes)) {
            template_extract_block($votes, 'rating_boxes', '');
        }
    }
    //to be used only for contests in progress
    if ($CURRENT_ALBUM_DATA['votes'] == 'YES' && $CURRENT_ALBUM_DATA['contest'] == 'YES') {
        // do not display pic infos,owner names, captions
        $pic_info = "";
        $pattern = "#(<!-- BEGIN img_desc -->)(.*?)(<!-- END img_desc -->)#s";
        if (preg_match($pattern, $picture, $matches)) {
            $picture = str_replace($matches[0], $matches[1] . $matche 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP template_files函数代码示例发布时间:2022-05-23
下一篇:
PHP template_eval函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap