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

PHP trigger_notify函数代码示例

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

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



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

示例1: __construct

 function __construct($source_filepath, $library = null)
 {
     $this->source_filepath = $source_filepath;
     trigger_notify('load_image_library', array(&$this));
     if (is_object($this->image)) {
         return;
         // A plugin may have load its own library
     }
     $extension = strtolower(get_extension($source_filepath));
     if (!in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) {
         die('[Image] unsupported file extension');
     }
     if (!($this->library = self::get_library($library, $extension))) {
         die('No image library available on your server.');
     }
     $class = 'image_' . $this->library;
     $this->image = new $class($source_filepath);
 }
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:18,代码来源:image.class.php


示例2: check_status

// | General Public License for more details.                              |
// |                                                                       |
// | 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_ADMINISTRATOR);
$help_link = get_root_url() . 'admin.php?page=help&section=';
$selected = null;
if (!isset($_GET['section'])) {
    $selected = 'add_photos';
} else {
    $selected = $_GET['section'];
}
$tabsheet = new tabsheet();
$tabsheet->set_id('help');
$tabsheet->select($selected);
$tabsheet->assign();
trigger_notify('loc_end_help');
$template->set_filenames(array('help' => 'help.tpl'));
$template->assign(array('HELP_CONTENT' => load_language('help/help_' . $tabsheet->selected . '.html', '', array('return' => true)), 'HELP_SECTION_TITLE' => $tabsheet->sheets[$tabsheet->selected]['caption']));
// +-----------------------------------------------------------------------+
// |                           sending html code                           |
// +-----------------------------------------------------------------------+
$template->assign_var_from_handle('ADMIN_CONTENT', 'help');
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:help.php


示例3: auto_login

    }
}
// Now check the auto-login
if ($user['id'] == $conf['guest_id']) {
    auto_login();
}
// using Apache authentication override the above user search
if ($conf['apache_authentication']) {
    $remote_user = null;
    foreach (array('REMOTE_USER', 'REDIRECT_REMOTE_USER') as $server_key) {
        if (isset($_SERVER[$server_key])) {
            $remote_user = $_SERVER[$server_key];
            break;
        }
    }
    if (isset($remote_user)) {
        if (!($user['id'] = get_userid($remote_user))) {
            $user['id'] = register_user($remote_user, '', '', false);
        }
    }
}
// automatic login by authentication key
if (isset($_GET['auth'])) {
    auth_key_login($_GET['auth']);
}
$user = build_user($user['id'], (defined('IN_ADMIN') and IN_ADMIN) ? false : true);
if ($conf['browser_language'] and (is_a_guest() or is_generic()) and $language = get_browser_language()) {
    $user['language'] = $language;
}
trigger_notify('user_init', $user);
开发者ID:donseba,项目名称:Piwigo,代码行数:30,代码来源:user.inc.php


示例4: l10n

            $_SESSION['page_infos'][] = l10n('Successfully registered, you will soon receive an email with your connection settings. Welcome!');
        }
        // log user and redirect
        $user_id = get_userid($_POST['login']);
        log_user($user_id, false);
        redirect(make_index_url());
    }
    $registration_post_key = get_ephemeral_key(2);
} else {
    $registration_post_key = get_ephemeral_key(6);
}
$login = !empty($_POST['login']) ? htmlspecialchars(stripslashes($_POST['login'])) : '';
$email = !empty($_POST['mail_address']) ? htmlspecialchars(stripslashes($_POST['mail_address'])) : '';
//----------------------------------------------------- template initialization
//
// Start output of page
//
$title = l10n('Registration');
$page['body_id'] = 'theRegisterPage';
$template->set_filenames(array('register' => 'register.tpl'));
$template->assign(array('U_HOME' => make_index_url(), 'F_KEY' => $registration_post_key, 'F_ACTION' => 'register.php', 'F_LOGIN' => $login, 'F_EMAIL' => $email, 'obligatory_user_mail_address' => $conf['obligatory_user_mail_address']));
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) or !in_array('theRegisterPage', $themeconf['hide_menu_on'])) {
    include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
}
include PHPWG_ROOT_PATH . 'include/page_header.php';
trigger_notify('loc_end_register');
flush_page_messages();
$template->parse('register');
include PHPWG_ROOT_PATH . 'include/page_tail.php';
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:31,代码来源:register.php


示例5: check

 /**
  * Check integrities
  *
  * @param void
  * @return void
  */
 function check()
 {
     global $page, $header_notes, $conf;
     // Ignore list
     $conf_c13y_ignore = unserialize($conf['c13y_ignore']);
     if (is_array($conf_c13y_ignore) and isset($conf_c13y_ignore['version']) and $conf_c13y_ignore['version'] == PHPWG_VERSION and is_array($conf_c13y_ignore['list'])) {
         $ignore_list_changed = false;
         $this->ignore_list = $conf_c13y_ignore['list'];
     } else {
         $ignore_list_changed = true;
         $this->ignore_list = array();
     }
     // Retrieve list
     $this->retrieve_list = array();
     $this->build_ignore_list = array();
     trigger_notify('list_check_integrity', $this);
     // Information
     if (count($this->retrieve_list) > 0) {
         $header_notes[] = l10n_dec('%d anomaly has been detected.', '%d anomalies have been detected.', count($this->retrieve_list));
     }
     // Treatments
     if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection'])) {
         $corrected_count = 0;
         $not_corrected_count = 0;
         foreach ($this->retrieve_list as $i => $c13y) {
             if (!empty($c13y['correction_fct']) and $c13y['is_callable'] and in_array($c13y['id'], $_POST['c13y_selection'])) {
                 if (is_array($c13y['correction_fct_args'])) {
                     $args = $c13y['correction_fct_args'];
                 } else {
                     if (!is_null($c13y['correction_fct_args'])) {
                         $args = array($c13y['correction_fct_args']);
                     } else {
                         $args = array();
                     }
                 }
                 $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
                 if ($this->retrieve_list[$i]['corrected']) {
                     $corrected_count += 1;
                 } else {
                     $not_corrected_count += 1;
                 }
             }
         }
         if ($corrected_count > 0) {
             $page['infos'][] = l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.', $corrected_count);
         }
         if ($not_corrected_count > 0) {
             $page['errors'][] = l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.', $not_corrected_count);
         }
     } else {
         if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection'])) {
             $ignored_count = 0;
             foreach ($this->retrieve_list as $i => $c13y) {
                 if (in_array($c13y['id'], $_POST['c13y_selection'])) {
                     $this->build_ignore_list[] = $c13y['id'];
                     $this->retrieve_list[$i]['ignored'] = true;
                     $ignored_count += 1;
                 }
             }
             if ($ignored_count > 0) {
                 $page['infos'][] = l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.', $ignored_count);
             }
         }
     }
     $ignore_list_changed = ($ignore_list_changed or count(array_diff($this->ignore_list, $this->build_ignore_list)) > 0 or count(array_diff($this->build_ignore_list, $this->ignore_list)) > 0);
     if ($ignore_list_changed) {
         $this->update_conf($this->build_ignore_list);
     }
 }
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:75,代码来源:check_integrity.class.php


示例6: get_quick_search_results_no_cache

/**
 * @see get_quick_search_results but without result caching
 */
function get_quick_search_results_no_cache($q, $options)
{
    global $conf;
    $q = trim(stripslashes($q));
    $search_results = array('items' => array(), 'qs' => array('q' => $q));
    $q = trigger_change('qsearch_pre', $q);
    $scopes = array();
    $scopes[] = new QSearchScope('tag', array('tags'));
    $scopes[] = new QSearchScope('photo', array('photos'));
    $scopes[] = new QSearchScope('file', array('filename'));
    $scopes[] = new QSearchScope('author', array(), true);
    $scopes[] = new QNumericRangeScope('width', array());
    $scopes[] = new QNumericRangeScope('height', array());
    $scopes[] = new QNumericRangeScope('ratio', array(), false, 0.001);
    $scopes[] = new QNumericRangeScope('size', array());
    $scopes[] = new QNumericRangeScope('filesize', array());
    $scopes[] = new QNumericRangeScope('hits', array('hit', 'visit', 'visits'));
    $scopes[] = new QNumericRangeScope('score', array('rating'), true);
    $scopes[] = new QNumericRangeScope('id', array());
    $createdDateAliases = array('taken', 'shot');
    $postedDateAliases = array('added');
    if ($conf['calendar_datefield'] == 'date_creation') {
        $createdDateAliases[] = 'date';
    } else {
        $postedDateAliases[] = 'date';
    }
    $scopes[] = new QDateRangeScope('created', $createdDateAliases, true);
    $scopes[] = new QDateRangeScope('posted', $postedDateAliases);
    // allow plugins to add their own scopes
    $scopes = trigger_change('qsearch_get_scopes', $scopes);
    $expression = new QExpression($q, $scopes);
    // get inflections for terms
    $inflector = null;
    $lang_code = substr(get_default_language(), 0, 2);
    @(include_once PHPWG_ROOT_PATH . 'include/inflectors/' . $lang_code . '.php');
    $class_name = 'Inflector_' . $lang_code;
    if (class_exists($class_name)) {
        $inflector = new $class_name();
        foreach ($expression->stokens as $token) {
            if (isset($token->scope) && !$token->scope->is_text) {
                continue;
            }
            if (strlen($token->term) > 2 && ($token->modifier & (QST_QUOTED | QST_WILDCARD)) == 0 && strcspn($token->term, '\'0123456789') == strlen($token->term)) {
                $token->variants = array_unique(array_diff($inflector->get_variants($token->term), array($token->term)));
            }
        }
    }
    trigger_notify('qsearch_expression_parsed', $expression);
    //var_export($expression);
    if (count($expression->stokens) == 0) {
        return $search_results;
    }
    $qsr = new QResults();
    qsearch_get_tags($expression, $qsr);
    qsearch_get_images($expression, $qsr);
    // allow plugins to evaluate their own scopes
    trigger_notify('qsearch_before_eval', $expression, $qsr);
    $ids = qsearch_eval($expression, $qsr, $tmp, $search_results['qs']['unmatched_terms']);
    $debug[] = "<!--\nparsed: " . $expression;
    $debug[] = count($expression->stokens) . ' tokens';
    for ($i = 0; $i < count($expression->stokens); $i++) {
        $debug[] = $expression->stokens[$i] . ': ' . count($qsr->tag_ids[$i]) . ' tags, ' . count($qsr->tag_iids[$i]) . ' tiids, ' . count($qsr->images_iids[$i]) . ' iiids, ' . count($qsr->iids[$i]) . ' iids' . ' modifier:' . dechex($expression->stoken_modifiers[$i]) . (!empty($expression->stokens[$i]->variants) ? ' variants: ' . implode(', ', $expression->stokens[$i]->variants) : '');
    }
    $debug[] = 'before perms ' . count($ids);
    $search_results['qs']['matching_tags'] = $qsr->all_tags;
    $search_results = trigger_change('qsearch_results', $search_results, $expression, $qsr);
    global $template;
    if (empty($ids)) {
        $debug[] = '-->';
        $template->append('footer_elements', implode("\n", $debug));
        return $search_results;
    }
    $permissions = !isset($options['permissions']) ? true : $options['permissions'];
    $where_clauses = array();
    $where_clauses[] = 'i.id IN (' . implode(',', $ids) . ')';
    if (!empty($options['images_where'])) {
        $where_clauses[] = '(' . $options['images_where'] . ')';
    }
    if ($permissions) {
        $where_clauses[] = get_sql_condition_FandF(array('forbidden_categories' => 'category_id', 'forbidden_images' => 'i.id'), null, true);
    }
    $query = '
SELECT DISTINCT(id) FROM ' . IMAGES_TABLE . ' i';
    if ($permissions) {
        $query .= '
    INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic ON id = ic.image_id';
    }
    $query .= '
  WHERE ' . implode("\n AND ", $where_clauses) . "\n" . $conf['order_by'];
    $ids = query2array($query, null, 'id');
    $debug[] = count($ids) . ' final photo count -->';
    $template->append('footer_elements', implode("\n", $debug));
    $search_results['items'] = $ids;
    return $search_results;
}
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:98,代码来源:functions_search.inc.php


示例7: prepend_append_array_items

        }
    }
    if (isset($search['fields']['ip'])) {
        $clauses[] = 'IP LIKE "' . $search['fields']['ip'] . '"';
    }
    $clauses = prepend_append_array_items($clauses, '(', ')');
    $where_separator = implode("\n    AND ", $clauses);
    $query = '
SELECT
    date,
    time,
    user_id,
    IP,
    section,
    category_id,
    tag_ids,
    image_id,
    image_type
  FROM ' . HISTORY_TABLE . '
  WHERE ' . $where_separator . '
;';
    // LIMIT '.$conf['nb_logs_page'].' OFFSET '.$page['start'].'
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $data[] = $row;
    }
    return $data;
}
add_event_handler('get_history', 'get_history');
trigger_notify('functions_history_included');
开发者ID:donseba,项目名称:Piwigo,代码行数:30,代码来源:functions_history.inc.php


示例8: array_diff

//    linked category
// 4. if no category reachable, no jumpto link
$query = '
SELECT category_id
  FROM ' . IMAGE_CATEGORY_TABLE . '
  WHERE image_id = ' . $_GET['image_id'] . '
;';
$authorizeds = array_diff(array_from_query($query, 'category_id'), explode(',', calculate_permissions($user['id'], $user['status'])));
if (isset($_GET['cat_id']) and in_array($_GET['cat_id'], $authorizeds)) {
    $url_img = make_picture_url(array('image_id' => $_GET['image_id'], 'image_file' => $image_file, 'category' => $cache['cat_names'][$_GET['cat_id']]));
} else {
    foreach ($authorizeds as $category) {
        $url_img = make_picture_url(array('image_id' => $_GET['image_id'], 'image_file' => $image_file, 'category' => $cache['cat_names'][$category]));
        break;
    }
}
if (isset($url_img)) {
    $template->assign('U_JUMPTO', $url_img);
}
// associate to albums
$query = '
SELECT id
  FROM ' . CATEGORIES_TABLE . '
    INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' ON id = category_id
  WHERE image_id = ' . $_GET['image_id'] . '
;';
$associated_albums = query2array($query, null, 'id');
$template->assign(array('associated_albums' => $associated_albums, 'represented_albums' => $represented_albums, 'STORAGE_ALBUM' => $storage_category_id, 'CACHE_KEYS' => get_admin_client_cache_keys(array('tags', 'categories'))));
trigger_notify('loc_end_picture_modify');
//----------------------------------------------------------- sending html code
$template->assign_var_from_handle('ADMIN_CONTENT', 'picture_modify');
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:picture_modify.php


示例9: unset

    unset($info);
}
if (count($user_representative_updates_for)) {
    $updates = array();
    foreach ($user_representative_updates_for as $cat_id => $image_id) {
        $updates[] = array('user_id' => $user['id'], 'cat_id' => $cat_id, 'user_representative_picture_id' => $image_id);
    }
    mass_updates(USER_CACHE_CATEGORIES_TABLE, array('primary' => array('user_id', 'cat_id'), 'update' => array('user_representative_picture_id')), $updates);
}
if (count($categories) > 0) {
    // Update filtered data
    if (function_exists('update_cats_with_filtered_data')) {
        update_cats_with_filtered_data($categories);
    }
    $template->set_filename('index_category_thumbnails', 'mainpage_categories.tpl');
    trigger_notify('loc_begin_index_category_thumbnails', $categories);
    $tpl_thumbnails_var = array();
    foreach ($categories as $category) {
        if (0 == $category['count_images']) {
            continue;
        }
        $category['name'] = trigger_change('render_category_name', $category['name'], 'subcatify_category_name');
        if ($page['section'] == 'recent_cats') {
            $name = get_cat_display_name_cache($category['uppercats'], null);
        } else {
            $name = $category['name'];
        }
        $representative_infos = $infos_of_image[$category['representative_picture_id']];
        $tpl_var = array_merge($category, array('ID' => $category['id'], 'representative' => $representative_infos, 'TN_ALT' => strip_tags($category['name']), 'URL' => make_index_url(array('category' => $category)), 'CAPTION_NB_IMAGES' => get_display_images_count($category['nb_images'], $category['count_images'], $category['count_categories'], true, '<br>'), 'DESCRIPTION' => trigger_change('render_category_literal_description', trigger_change('render_category_description', @$category['comment'], 'subcatify_category_description')), 'NAME' => $name));
        if ($conf['index_new_icon']) {
            $tpl_var['icon_ts'] = get_icon($category['max_date_last'], $category['is_child_date_last']);
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:31,代码来源:category_cats.inc.php


示例10: set_status_header

/**
 * Sets the http status header (200,401,...)
 * @param int $code
 * @param string $text for exotic http codes
 */
function set_status_header($code, $text = '')
{
    if (empty($text)) {
        switch ($code) {
            case 200:
                $text = 'OK';
                break;
            case 301:
                $text = 'Moved permanently';
                break;
            case 302:
                $text = 'Moved temporarily';
                break;
            case 304:
                $text = 'Not modified';
                break;
            case 400:
                $text = 'Bad request';
                break;
            case 401:
                $text = 'Authorization required';
                break;
            case 403:
                $text = 'Forbidden';
                break;
            case 404:
                $text = 'Not found';
                break;
            case 500:
                $text = 'Server error';
                break;
            case 501:
                $text = 'Not implemented';
                break;
            case 503:
                $text = 'Service unavailable';
                break;
        }
    }
    $protocol = $_SERVER["SERVER_PROTOCOL"];
    if ('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol) {
        $protocol = 'HTTP/1.0';
    }
    header("{$protocol} {$code} {$text}", true, $code);
    trigger_notify('set_status_header', $code, $text);
}
开发者ID:mathieumd,项目名称:Piwigo,代码行数:51,代码来源:functions_html.inc.php


示例11: redirect

    redirect(get_gallery_home_url());
}
if ('lost' == $page['action'] and !is_a_guest()) {
    redirect(get_gallery_home_url());
}
// +-----------------------------------------------------------------------+
// | template initialization                                               |
// +-----------------------------------------------------------------------+
$title = l10n('Password Reset');
if ('lost' == $page['action']) {
    $title = l10n('Forgot your password?');
    if (isset($_POST['username_or_email'])) {
        $template->assign('username_or_email', htmlspecialchars(stripslashes($_POST['username_or_email'])));
    }
}
$page['body_id'] = 'thePasswordPage';
$template->set_filenames(array('password' => 'password.tpl'));
$template->assign(array('title' => $title, 'form_action' => get_root_url() . 'password.php', 'action' => $page['action'], 'username' => isset($page['username']) ? $page['username'] : $user['username'], 'PWG_TOKEN' => get_pwg_token()));
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) or !in_array('thePasswordPage', $themeconf['hide_menu_on'])) {
    include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
}
// +-----------------------------------------------------------------------+
// |                           html code display                           |
// +-----------------------------------------------------------------------+
include PHPWG_ROOT_PATH . 'include/page_header.php';
trigger_notify('loc_end_password');
flush_page_messages();
$template->pparse('password');
include PHPWG_ROOT_PATH . 'include/page_tail.php';
开发者ID:squidjam,项目名称:Piwigo,代码行数:31,代码来源:password.php


示例12: make_picture_url

$template->assign('U_CANONICAL', make_picture_url(array('image_id' => $picture['current']['id'], 'image_file' => $picture['current']['file'])));
// +-----------------------------------------------------------------------+
// |                               sub pages                               |
// +-----------------------------------------------------------------------+
include PHPWG_ROOT_PATH . 'include/picture_rate.inc.php';
if ($conf['activate_comments']) {
    include PHPWG_ROOT_PATH . 'include/picture_comment.inc.php';
}
if ($metadata_showable and pwg_get_session_var('show_metadata') != null) {
    include PHPWG_ROOT_PATH . 'include/picture_metadata.inc.php';
}
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if ($conf['picture_menu'] and (!isset($themeconf['hide_menu_on']) or !in_array('thePicturePage', $themeconf['hide_menu_on']))) {
    if (!isset($page['start'])) {
        $page['start'] = 0;
    }
    include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
}
include PHPWG_ROOT_PATH . 'include/page_header.php';
trigger_notify('loc_end_picture');
flush_page_messages();
if ($page['slideshow'] and $conf['light_slideshow']) {
    $template->pparse('slideshow');
} else {
    $template->parse_picture_buttons();
    $template->pparse('picture');
}
//------------------------------------------------------------ log informations
pwg_log($picture['current']['id'], 'picture');
include PHPWG_ROOT_PATH . 'include/page_tail.php';
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:31,代码来源:picture.php


示例13: process_combinable

 /**
  * Process one combinable file.
  *
  * @param Combinable $combinable
  * @param bool $return_content
  * @param bool $force
  * @param string $header CSS directives that must appear first in
  *                       the minified file (only used when
  *                       $return_content===true)
  * @return null|string
  */
 private function process_combinable($combinable, $return_content, $force, &$header)
 {
     global $conf;
     if ($combinable->is_template) {
         if (!$return_content) {
             $key = array($combinable->path, $combinable->version);
             if ($conf['template_compile_check']) {
                 $key[] = filemtime(PHPWG_ROOT_PATH . $combinable->path);
             }
             $file = PWG_COMBINED_DIR . 't' . base_convert(crc32(implode(',', $key)), 10, 36) . '.' . $this->type;
             if (!$force && file_exists(PHPWG_ROOT_PATH . $file)) {
                 $combinable->path = $file;
                 $combinable->version = false;
                 return;
             }
         }
         global $template;
         $handle = $this->type . '.' . $combinable->id;
         $template->set_filename($handle, realpath(PHPWG_ROOT_PATH . $combinable->path));
         trigger_notify('combinable_preparse', $template, $combinable, $this);
         //allow themes and plugins to set their own vars to template ...
         $content = $template->parse($handle, true);
         if ($this->is_css) {
             $content = self::process_css($content, $combinable->path, $header);
         } else {
             $content = self::process_js($content, $combinable->path);
         }
         if ($return_content) {
             return $content;
         }
         file_put_contents(PHPWG_ROOT_PATH . $file, $content);
         $combinable->path = $file;
     } elseif ($return_content) {
         $content = file_get_contents(PHPWG_ROOT_PATH . $combinable->path);
         if ($this->is_css) {
             $content = self::process_css($content, $combinable->path, $header);
         } else {
             $content = self::process_js($content, $combinable->path);
         }
         return $content;
     }
 }
开发者ID:squidjam,项目名称:Piwigo,代码行数:53,代码来源:template.class.php


示例14: elseif

} elseif ('search' == $page['section']) {
    $page['meta_robots']['nofollow'] = 1;
}
if ($filter['enabled']) {
    $page['meta_robots']['noindex'] = 1;
}
// see if we need a redirect because of a permalink
if ('categories' == $page['section'] and isset($page['category'])) {
    $need_redirect = false;
    if (empty($page['category']['permalink'])) {
        if ($conf['category_url_style'] == 'id-name' and @$page['hit_by']['cat_url_name'] !== str2url($page['category']['name'])) {
            $need_redirect = true;
        }
    } else {
        if ($page['category']['permalink'] !== @$page['hit_by']['cat_permalink']) {
            $need_redirect = true;
        }
    }
    if ($need_redirect) {
        $redirect_url = script_basename() == 'picture' ? duplicate_picture_url() : duplicate_index_url();
        if (!headers_sent()) {
            // this is a permanent redirection
            set_status_header(301);
            redirect_http($redirect_url);
        }
        redirect($redirect_url);
    }
    unset($need_redirect, $page['hit_by']);
}
trigger_notify('loc_end_section_init');
开发者ID:squidjam,项目名称:Piwigo,代码行数:30,代码来源:section_init.inc.php


示例15: unset

        unset($letter['CHANGE_COLUMN']);
        $letter['TITLE'] = $current_letter;
        $template->append('letters', $letter);
    }
} else {
    // +-----------------------------------------------------------------------+
    // |                        tag cloud construction                         |
    // +-----------------------------------------------------------------------+
    // we want only the first most represented tags, so we sort them by counter
    // and take the first tags
    usort($tags, 'counter_compare');
    $tags = array_slice($tags, 0, $conf['full_tag_cloud_items_number']);
    // depending on its counter and the other tags counter, each tag has a level
    $tags = add_level_to_tags($tags);
    // we want tags diplayed in alphabetic order
    usort($tags, 'tag_alpha_compare');
    // display sorted tags
    foreach ($tags as $tag) {
        $template->append('tags', array_merge($tag, array('URL' => make_index_url(array('tags' => array($tag))))));
    }
}
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) or !in_array('theTagsPage', $themeconf['hide_menu_on'])) {
    include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
}
include PHPWG_ROOT_PATH . 'include/page_header.php';
trigger_notify('loc_end_tags');
flush_page_messages();
$template->pparse('tags');
include PHPWG_ROOT_PATH . 'include/page_tail.php';
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:31,代码来源:tags.php


示例16: trigger_notify

$template->set_filenames(array('tail' => 'footer.tpl'));
trigger_notify('loc_begin_page_tail');
$template->assign(array('VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 'PHPWG_URL' => defined('PHPWG_URL') ? PHPWG_URL : ''));
//--------------------------------------------------------------------- contact
if (!is_a_guest()) {
    $template->assign('CONTACT_MAIL', get_webmaster_mail_address());
}
//------------------------------------------------------------- generation time
$debug_vars = array();
if ($conf['show_queries']) {
    $debug_vars = array_merge($debug_vars, array('QUERIES_LIST' => $debug));
}
if ($conf['show_gt']) {
    if (!isset($page['count_queries'])) {
        $page['count_queries'] = 0;
        $page['queries_time'] = 0;
    }
    $time = get_elapsed_time($t2, get_moment());
    $debug_vars = array_merge($debug_vars, array('TIME' => $time, 'NB_QUERIES' => $page['count_queries'], 'SQL_TIME' => number_format($page['queries_time'], 3, '.', ' ') . ' s'));
}
$template->assign('debug', $debug_vars);
//------------------------------------------------------------- mobile version
if (!empty($conf['mobile_theme']) && (get_device() != 'desktop' || mobile_theme())) {
    $template->assign('TOGGLE_MOBILE_THEME_URL', add_url_params(htmlspecialchars($_SERVER['REQUEST_URI']), array('mobile' => mobile_theme() ? 'false' : 'true')));
}
trigger_notify('loc_end_page_tail');
//
// Generate the page
//
$template->parse('tail');
$template->p();
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:page_tail.php


示例17: array

}
// representant management
if ($category['has_images'] or !empty($category['representative_picture_id'])) {
    $tpl_representant = array();
    // picture to display : the identified representant or the generic random
    // representant ?
    if (!empty($category['representative_picture_id'])) {
        $query = '
SELECT id,representative_ext,path
  FROM ' . IMAGES_TABLE . '
  WHERE id = ' . $category['representative_picture_id'] . '
;';
        $row = pwg_db_fetch_assoc(pwg_query($query));
        $src = DerivativeImage::thumb_url($row);
        $url = get_root_url() . 'admin.php?page=photo-' . $category['representative_picture_id'];
        $tpl_representant['picture'] = array('SRC' => $src, 'URL' => $url);
    }
    // can the admin choose to set a new random representant ?
    $tpl_representant['ALLOW_SET_RANDOM'] = $category['has_images'] ? true : false;
    // can the admin delete the current representant ?
    if ($category['has_images'] and $conf['allow_random_representative'] or !$category['has_images'] and !empty($category['representative_picture_id'])) {
        $tpl_representant['ALLOW_DELETE'] = true;
    }
    $template->assign('representant', $tpl_representant);
}
if ($category['is_virtual']) {
    $template->assign('parent_category', empty($category['id_uppercat']) ? array() : array($category['id_uppercat']));
}
trigger_notify('loc_end_cat_modify');
//----------------------------------------------------------- sending html code
$template->assign_var_from_handle('ADMIN_CONTENT', 'album_properties');
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:31,代码来源:cat_modify.php


示例18: Template

        $template = new Template(PHPWG_ROOT_PATH . 'themes', $user['theme']);
        if (isset($_GET['no_photo_yet'])) {
            if ('browse' == $_GET['no_photo_yet']) {
                $_SESSION['no_photo_yet'] = 'browse';
                redirect(make_index_url());
                exit;
            }
            if ('deactivate' == $_GET['no_photo_yet']) {
                conf_update_param('no_photo_yet', 'false');
                redirect(make_index_url());
                exit;
            }
        }
        header('Content-Type: text/html; charset=' . get_pwg_charset());
        $template->set_filenames(array('no_photo_yet' => 'no_photo_yet.tpl'));
        if (is_admin()) {
            $url = $conf['no_photo_yet_url'];
            if (substr($url, 0, 4) != 'http') {
                $url = get_root_url() . $url;
            }
            $template->assign(array('step' => 2, 'intro' => l10n('Hello %s, your Piwigo photo gallery is empty!', $user['username']), 'next_step_url' => $url, 'deactivate_url' => get_root_url() . '?no_photo_yet=deactivate'));
        } else {
            $template->assign(array('step' => 1, 'U_LOGIN' => 'identification.php', 'deactivate_url' => get_root_url() . '?no_photo_yet=browse'));
        }
        trigger_notify('loc_end_no_photo_yet');
        $template->pparse('no_photo_yet');
        exit;
    } else {
        conf_update_param('no_photo_yet', 'false');
    }
}
开发者ID:squidjam,项目名称:Piwigo,代码行数:31,代码来源:no_photo_yet.inc.php


示例19: sendResponse

 /**
  * Encodes a response and sends it back to the browser.
  */
 function sendResponse($response)
 {
     $encodedResponse = $this->_responseEncoder->encodeResponse($response);
     $contentType = $this->_responseEncoder->getContentType();
     @header('Content-Type: ' . $contentType . '; charset=' . get_pwg_charset());
     print_r($encodedResponse);
     trigger_notify('sendResponse', $encodedResponse);
 }
开发者ID:squidjam,项目名称:Piwigo,代码行数:11,代码来源:ws_core.inc.php


示例20: define

// | USA.                                                                  |
// +-----------------------------------------------------------------------+
//----------------------------------------------------------- include
define('PHPWG_ROOT_PATH', './');
include_once PHPWG_ROOT_PATH . 'include/common.inc.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_GUEST);
//----------------------------------------------------- template initialization
//
// Start output of page
//
$title = l10n('About Piwigo');
$page['body_id'] = 'theAboutPage';
trigger_notify('loc_begin_about');
$template->set_filename('about', 'about.tpl');
$template->assign('ABOUT_MESSAGE', load_language('about.html', '', array('return' => true)));
$theme_about = load_language('about.html', PHPWG_THEMES_PATH . $user['theme'] . '/', array('return' => true));
if ($theme_about !== false) {
    $template->assign('THEME_ABOUT', $theme_about);
}
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) or !in_array('theAboutPage', $themeconf['hide_menu_on'])) {
    include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
}
include PHPWG_ROOT_PATH . 'include/page_header.php';
flush_page_messages();
$template->pparse('about');
include PHPWG_ROOT_PATH . 'include/page_tail.php';
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:about.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP trigger_plugin_hook函数代码示例发布时间:2022-05-23
下一篇:
PHP trigger_event函数代码示例发布时间: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