本文整理汇总了PHP中load_funcs函数的典型用法代码示例。如果您正苦于以下问题:PHP load_funcs函数的具体用法?PHP load_funcs怎么用?PHP load_funcs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_funcs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
// Load to use function get_available_thumb_sizes()
load_funcs('files/model/_image.funcs.php');
$r = array_merge(array('menu_bg_color' => array('label' => T_('Menu background color'), 'note' => T_('E-g: #0000ff for blue'), 'defaultvalue' => '#333333', 'type' => 'color'), 'menu_text_color' => array('label' => T_('Menu text color'), 'note' => T_('E-g: #ff6600 for orange'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'page_bg_color' => array('label' => T_('Page background color'), 'note' => T_('E-g: #ff0000 for red'), 'defaultvalue' => '#666666', 'type' => 'color'), 'page_text_color' => array('label' => T_('Page text color'), 'note' => T_('E-g: #00ff00 for green'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'post_bg_color' => array('label' => T_('Post info background color'), 'note' => T_('E-g: #0000ff for blue'), 'defaultvalue' => '#555555', 'type' => 'color'), 'post_text_color' => array('label' => T_('Post info text color'), 'note' => T_('E-g: #ff6600 for orange'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'colorbox' => array('label' => T_('Colorbox Image Zoom'), 'note' => T_('Check to enable javascript zooming on images (using the colorbox script)'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_post' => array('label' => T_('Voting on Post Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_post_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_comment' => array('label' => T_('Voting on Comment Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_comment_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_user' => array('label' => T_('Voting on User Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_user_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'gender_colored' => array('label' => T_('Display gender'), 'note' => T_('Use colored usernames to differentiate men & women.'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'bubbletip' => array('label' => T_('Username bubble tips'), 'note' => T_('Check to enable bubble tips on usernames'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'autocomplete_usernames' => array('label' => T_('Autocomplete usernames'), 'note' => T_('Check to enable auto-completion of usernames entered after a "@" sign in the comment forms'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'banner_public' => array('label' => T_('"Public" banner'), 'note' => T_('Display banner for "Public" posts (posts & comments)'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'mediaidx_thumb_size' => array('label' => T_('Thumbnail size for media index'), 'note' => '', 'defaultvalue' => 'fit-128x128', 'options' => get_available_thumb_sizes(), 'type' => 'select'), 'posts_thumb_size' => array('label' => T_('Thumbnail size in post list'), 'note' => '', 'defaultvalue' => 'crop-192x192', 'options' => get_available_thumb_sizes(), 'type' => 'select'), 'single_thumb_size' => array('label' => T_('Thumbnail size in single page'), 'note' => '', 'defaultvalue' => 'fit-256x256', 'options' => get_available_thumb_sizes(), 'type' => 'select')), parent::get_param_definitions($params));
return $r;
}
示例2: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
// Load to use function get_available_thumb_sizes()
load_funcs('files/model/_image.funcs.php');
$r = array_merge(array('section_layout_start' => array('layout' => 'begin_fieldset', 'label' => T_('Layout Settings')), 'layout' => array('label' => T_('Layout'), 'note' => '', 'defaultvalue' => 'right_sidebar', 'options' => array('single_column' => T_('Single Column Large'), 'single_column_normal' => T_('Single Column'), 'single_column_narrow' => T_('Single Column Narrow'), 'single_column_extra_narrow' => T_('Single Column Extra Narrow'), 'left_sidebar' => T_('Left Sidebar'), 'right_sidebar' => T_('Right Sidebar')), 'type' => 'select'), 'section_layout_end' => array('layout' => 'end_fieldset'), 'section_image_start' => array('layout' => 'begin_fieldset', 'label' => T_('Images Layout')), 'max_image_height' => array('label' => T_('Max image height'), 'note' => 'px', 'defaultvalue' => '', 'type' => 'integer', 'allow_empty' => true), 'mediaidx_thumb_size' => array('label' => T_('Thumbnail size for media index'), 'note' => '', 'defaultvalue' => 'fit-80x80', 'options' => get_available_thumb_sizes(), 'type' => 'select'), 'section_image_end' => array('layout' => 'end_fieldset'), 'section_page_start' => array('layout' => 'begin_fieldset', 'label' => T_('Custom Page Styles')), 'page_bg_color' => array('label' => T_('Page background color'), 'note' => T_('E-g: #ff0000 for red'), 'defaultvalue' => '#666666', 'type' => 'color'), 'page_text_color' => array('label' => T_('Page text color'), 'note' => T_('E-g: #00ff00 for green'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'menu_bg_color' => array('label' => T_('Menu background color'), 'note' => T_('E-g: #0000ff for blue'), 'defaultvalue' => '#333333', 'type' => 'color'), 'menu_text_color' => array('label' => T_('Menu elements color'), 'note' => T_('E-g: #ff6600 for orange'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'menu_links_hover' => array('label' => T_('Menu links hover color'), 'note' => T_('E-g: #ff6600 for orange'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'post_bg_color' => array('label' => T_('Post info background color'), 'note' => T_('E-g: #0000ff for blue'), 'defaultvalue' => '#555555', 'type' => 'color'), 'post_border_col' => array('label' => T_('Post border color'), 'note' => T_('E-g: #0000ff for blue'), 'defaultvalue' => '#aaa', 'type' => 'color'), 'post_text_color' => array('label' => T_('Post info text color'), 'note' => T_('E-g: #ff6600 for orange'), 'defaultvalue' => '#AAAAAA', 'type' => 'color'), 'main_link_color' => array('label' => T_('Main content links color'), 'note' => T_('E-g: #fff for white'), 'defaultvalue' => '#fff', 'type' => 'color'), 'panel_titles' => array('label' => T_('Panel titles color'), 'note' => T_('E-g: #fff for white'), 'defaultvalue' => '#fff', 'type' => 'color'), 'section_page_end' => array('layout' => 'end_fieldset'), 'subm_prev_start' => array('layout' => 'begin_fieldset', 'label' => T_('Submit and Preview buttons styles')), 'prev_bgd' => array('label' => T_('Panel titles color'), 'defaultvalue' => '#aaa', 'type' => 'color'), 'subm_bgd' => array('label' => T_('Panel titles color'), 'defaultvalue' => '#333', 'type' => 'color'), 'subm_prev_end' => array('layout' => 'end_fieldset'), 'footer_start' => array('layout' => 'begin_fieldset', 'label' => T_('Submit and Preview buttons styles')), 'footer_bgd' => array('label' => T_('Footer background color'), 'defaultvalue' => '#aaa', 'type' => 'color'), 'footer_text' => array('label' => T_('Panel titles color'), 'defaultvalue' => '#aaa', 'type' => 'color'), 'footer_links' => array('label' => T_('Panel titles color'), 'defaultvalue' => '#aaa', 'type' => 'color'), 'footer_end' => array('layout' => 'end_fieldset'), 'section_colorbox_start' => array('layout' => 'begin_fieldset', 'label' => T_('Colorbox Image Zoom')), 'colorbox' => array('label' => T_('Colorbox Image Zoom'), 'note' => T_('Check to enable javascript zooming on images (using the colorbox script)'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_post' => array('label' => T_('Voting on Post Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_post_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_comment' => array('label' => T_('Voting on Comment Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_comment_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_user' => array('label' => T_('Voting on User Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_user_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'section_colorbox_end' => array('layout' => 'end_fieldset'), 'section_username_start' => array('layout' => 'begin_fieldset', 'label' => T_('Username options')), 'gender_colored' => array('label' => T_('Display gender'), 'note' => T_('Use colored usernames to differentiate men & women.'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'bubbletip' => array('label' => T_('Username bubble tips'), 'note' => T_('Check to enable bubble tips on usernames'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'autocomplete_usernames' => array('label' => T_('Autocomplete usernames'), 'note' => T_('Check to enable auto-completion of usernames entered after a "@" sign in the comment forms'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'section_username_end' => array('layout' => 'end_fieldset'), 'section_access_start' => array('layout' => 'begin_fieldset', 'label' => T_('When access is denied or requires login...')), 'access_login_containers' => array('label' => T_('Display on login screen'), 'note' => '', 'type' => 'checklist', 'options' => array(array('header', sprintf(T_('"%s" container'), NT_('Header')), 1), array('page_top', sprintf(T_('"%s" container'), NT_('Page Top')), 1), array('menu', sprintf(T_('"%s" container'), NT_('Menu')), 0), array('sidebar', sprintf(T_('"%s" container'), NT_('Sidebar')), 0), array('sidebar2', sprintf(T_('"%s" container'), NT_('Sidebar 2')), 0), array('footer', sprintf(T_('"%s" container'), NT_('Footer')), 1))), 'section_access_end' => array('layout' => 'end_fieldset')), parent::get_param_definitions($params));
return $r;
}
示例3: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
// Load to use function get_available_thumb_sizes()
load_funcs('files/model/_image.funcs.php');
$r = array_merge(array('section_layout_start' => array('layout' => 'begin_fieldset', 'label' => T_('General Layout Settings')), 'layout' => array('label' => T_('Default Pages Layout'), 'note' => T_('Select general skin layout.'), 'defaultvalue' => 'right_sidebar', 'options' => array('single_column' => T_('Single Column Large'), 'single_column_normal' => T_('Single Column'), 'single_column_narrow' => T_('Single Column Narrow'), 'single_column_extra_narrow' => T_('Single Column Extra Narrow'), 'left_sidebar' => T_('Left Sidebar'), 'right_sidebar' => T_('Right Sidebar')), 'type' => 'select'), 'max_image_height' => array('label' => T_('Max image height'), 'note' => 'px. ' . T_('Set maximum height for post images.'), 'defaultvalue' => '', 'type' => 'integer', 'allow_empty' => true, 'size' => '7'), 'links_color' => array('label' => T_('Links Color Schemes'), 'note' => T_('Default links color schemes is') . ' #096. ' . T_('This color is used for links, buttons, hover and active classes.'), 'defaultvalue' => '#096', 'type' => 'color'), 'site_bg_color' => array('label' => T_('Color scheme supporting color'), 'note' => T_('Default supporting color is') . ' #fff. ' . T_('This color appears as the second color scheme combination and is used as a supporting color for links and page sections.'), 'defaultvalue' => '#fff', 'type' => 'color'), 'site_borders' => array('label' => T_('Color scheme second supporting color'), 'note' => T_('Default color is') . ' #eee. ' . T_('This color is used as a third color used for the custom site color scheme. It is mostly used for borders on elements.'), 'defaultvalue' => '#eee', 'type' => 'color'), 'title_logo_w' => array('label' => T_('Display logo/title'), 'note' => T_('Decide whether you want to display blog title, logo or neither of both.'), 'defaultvalue' => 'display_logo', 'options' => array('display_logo' => T_('Display logo'), 'display_title' => T_('Display title'), 'none' => T_('None')), 'type' => 'select'), 'logo_w_path' => array('label' => T_('Logo path'), 'note' => T_('Works only if "Display logo" selected above. Please use logo from within the skin folder.'), 'defaultvalue' => 'logo.png', 'type' => 'text', 'size' => '25'), 'backtotop_vis' => array('label' => T_('"Back to Top" button'), 'note' => T_('Check to enable the "Back to Top" button.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'section_layout_end' => array('layout' => 'end_fieldset'), 'nav_links_start' => array('layout' => 'begin_fieldset', 'label' => T_('Navigation Menu Settings')), 'menu_bg_color' => array('label' => T_('Navigation background color'), 'note' => T_('Default color is.') . ' #fff.', 'defaultvalue' => '#fff', 'type' => 'color'), 'menu_a_color' => array('label' => T_('Navigation links color'), 'note' => T_('Default color is.') . ' #333.', 'defaultvalue' => '#333', 'type' => 'color'), 'nav_search' => array('label' => T_('Navigation Search Field'), 'note' => T_('Check to enable a skin-specific search field in navigation menu.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'nav_social' => array('label' => T_('Navigation Social Links'), 'note' => T_('Check to enable a special social links widget in the navigation.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'nav_hamb_menu' => array('label' => T_('Hamburger menu at'), 'note' => T_('px. Set the width in pixels below which menu will have hamburger layout.'), 'defaultvalue' => '820', 'type' => 'integer', 'size' => '7'), 'nav_links_end' => array('layout' => 'end_fieldset'), 'front_disp_start' => array('layout' => 'begin_fieldset', 'label' => T_('Front Page Settings')), 'layout_front' => array('label' => T_('Front Page Layout'), 'note' => T_('Select front page layout.'), 'defaultvalue' => 'single_column_narrow', 'options' => array('single_column' => T_('Single Column Large'), 'single_column_normal' => T_('Single Column'), 'single_column_narrow' => T_('Single Column Narrow'), 'single_column_extra_narrow' => T_('Single Column Extra Narrow'), 'left_sidebar' => T_('Left Sidebar'), 'right_sidebar' => T_('Right Sidebar')), 'type' => 'select'), 'fr_sec_enable' => array('label' => T_('Enable front page intro section'), 'note' => T_('Check this to show a special intro section on disp=front of this skin.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'fr_sec_txt' => array('label' => T_('Intro text'), 'note' => T_('This is the introduction text that will appear in the disp=front. Type text or code in this field.'), 'defaultvalue' => "\nWelcome to Ego skin. Built specially for <a href='http://b2evolution.net/'>b2evolution</a>. Set the button destination in the back-office:", 'type' => 'textarea'), 'frsec_but_enable' => array('label' => T_('Enable section button'), 'note' => T_('Check this to enable the linking button in this section.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'fr_sec_btn_link' => array('label' => T_('Link URL'), 'note' => T_('Type the link destination (URL) you want this button to lead on. It can be any page, even external.'), 'defaultvalue' => "http://b2evolution.net/", 'type' => 'text', 'size' => 50), 'fr_sec_btn_txt' => array('label' => T_('Link title'), 'note' => T_('Type the title of the link.'), 'defaultvalue' => 'Link title', 'type' => 'text', 'size' => 20), 'front_disp_end' => array('layout' => 'end_fieldset'), 'posts_disp_start' => array('layout' => 'begin_fieldset', 'label' => T_('Posts Page Settings')), 'layout_posts' => array('label' => T_('Posts Page Layout'), 'note' => T_('Select posts page layout.'), 'defaultvalue' => 'right_sidebar', 'options' => array('single_column' => T_('Single Column Large'), 'single_column_normal' => T_('Single Column'), 'single_column_narrow' => T_('Single Column Narrow'), 'single_column_extra_narrow' => T_('Single Column Extra Narrow'), 'left_sidebar' => T_('Left Sidebar'), 'right_sidebar' => T_('Right Sidebar')), 'type' => 'select'), 'posts_format' => array('label' => T_('Posts Format'), 'note' => '(' . T_('Select posts format on posts page.') . ')', 'type' => 'radio', 'options' => array(array('default', T_('Default')), array('simple', T_('Simple')), array('masonry', T_('Masonry'))), 'defaultvalue' => 'default'), 'posts_masonry' => array('label' => T_('Number of columns'), 'note' => '(' . T_('Select the number of columns if Masonry post format is selected above') . ')', 'type' => 'radio', 'options' => array(array('one', T_('1 Column')), array('two', T_('2 Columns')), array('three', T_('3 Columns'))), 'defaultvalue' => 'one'), 'top_pagination' => array('label' => T_('Enable top pagination'), 'note' => T_('Check this to enable top page pagination.'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'bottom_pagination' => array('label' => T_('Enable bottom pagination'), 'note' => T_('Check this to enable bottom page pagination.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'pag_alignment' => array('label' => T_('Pagination Alignment'), 'note' => T_('Select pagination alignment on posts page.'), 'type' => 'select', 'options' => array('left' => T_('Left'), 'center' => T_('Center'), 'right' => T_('Right')), 'defaultvalue' => 'left'), 'posts_disp_end' => array('layout' => 'end_fieldset'), 'single_disp_start' => array('layout' => 'begin_fieldset', 'label' => T_('Single Page Settings')), 'layout_single' => array('label' => T_('Single Page Layout'), 'note' => T_('Select single page layout.'), 'defaultvalue' => 'right_sidebar', 'options' => array('single_column' => T_('Single Column Large'), 'single_column_normal' => T_('Single Column'), 'single_column_narrow' => T_('Single Column Narrow'), 'single_column_extra_narrow' => T_('Single Column Extra Narrow'), 'left_sidebar' => T_('Left Sidebar'), 'right_sidebar' => T_('Right Sidebar')), 'type' => 'select'), 'sidebar2_single' => array('label' => T_('Sidebar2 on Single Page'), 'note' => T_('Check this to enable Sidebar2 container only on single pages. On other pages regular Sidebar container will be shown.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'cover_image_start' => array('layout' => 'begin_fieldset', 'label' => T_('Cover Image Settings')), 'spec_cover_image' => array('label' => T_('Special Cover Image Position'), 'note' => T_('Check this to enable a special cover image placement.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'cover_text' => array('label' => T_('Cover section text color'), 'note' => T_('Default color is') . ' #fefefe.', 'defaultvalue' => '#fefefe', 'type' => 'color'), 'cover_links' => array('label' => T_('Cover section links color'), 'note' => T_('Default color is') . ' #fefefe.', 'defaultvalue' => '#fefefe', 'type' => 'color'), 'cover_borders' => array('label' => T_('Cover section borders color'), 'note' => T_('Default color is') . ' #fefefe.', 'defaultvalue' => '#fefefe', 'type' => 'color'), 'cover_image_end' => array('layout' => 'end_fieldset'), 'single_disp_end' => array('layout' => 'end_fieldset'), 'mediaidx_start' => array('layout' => 'begin_fieldset', 'label' => T_('Media Page Settings')), 'mediaidx_thumb_size' => array('label' => T_('Thumbnail size'), 'note' => T_('Thumbnail size for Media index page.'), 'defaultvalue' => 'crop-480x320', 'options' => get_available_thumb_sizes(), 'type' => 'select'), 'mediaidx_masonry' => array('label' => T_('Masonry Columns'), 'note' => '(' . T_('Select the number of columns for displaying media items') . ')', 'type' => 'radio', 'options' => array(array('one', T_('1 Column')), array('two', T_('2 Columns')), array('three', T_('3 Columns'))), 'defaultvalue' => 'three'), 'mediaidx_end' => array('layout' => 'end_fieldset'), 'catdir_start' => array('layout' => 'begin_fieldset', 'label' => T_('Category Page Settings')), 'catdir_layout' => array('label' => T_('Category Page Layout'), 'note' => '(' . T_('Select the number of columns for displaying media items') . ')', 'type' => 'radio', 'options' => array(array('catdir_list', T_('List')), array('catdir_masonry', T_('Masonry'))), 'defaultvalue' => 'catdir_list'), 'catdir_masonry_cols' => array('label' => T_('Masonry Columns'), 'note' => '(' . T_('Select the number of columns for displaying media items') . ')', 'type' => 'radio', 'options' => array(array('one', T_('1 Column')), array('two', T_('2 Columns')), array('three', T_('3 Columns'))), 'defaultvalue' => 'two'), 'catdir_thumb_size' => array('label' => T_('Thumbnail size'), 'note' => T_('Use this only if Masonry layout is enabled.'), 'defaultvalue' => 'crop-480x320', 'options' => get_available_thumb_sizes(), 'type' => 'select'), 'catdir_end' => array('layout' => 'end_fieldset'), 'footer_start' => array('layout' => 'begin_fieldset', 'label' => T_('Footer Settings')), 'b2evo_credits' => array('label' => T_('b2evolution credits'), 'note' => T_('Please help us promote b2evolution and leave b2evolution credits on your website.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'spec_sw_footer' => array('label' => T_('Special sitewide footer'), 'note' => T_('Check to enable the special sitewide footer (cookies declaration) layout.'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'sp_sw_f_bg_col' => array('label' => T_('SW Footer background color'), 'note' => T_('Set the background color of the special sitewide footer section.'), 'defaultvalue' => '#333', 'type' => 'color'), 'sp_sw_f_col' => array('label' => T_('SW Footer color'), 'note' => T_('Set the color of the special sitewide footer section.'), 'defaultvalue' => '#fff', 'type' => 'color'), 'footer_end' => array('layout' => 'end_fieldset'), 'section_colorbox_start' => array('layout' => 'begin_fieldset', 'label' => T_('Colorbox Image Zoom')), 'colorbox' => array('label' => T_('Colorbox Image Zoom'), 'note' => T_('Check to enable javascript zooming on images (using the colorbox script)'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_post' => array('label' => T_('Voting on Post Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_post_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_comment' => array('label' => T_('Voting on Comment Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_comment_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_user' => array('label' => T_('Voting on User Images'), 'note' => T_('Check this to enable AJAX voting buttons in the colorbox zoom view'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'colorbox_vote_user_numbers' => array('label' => T_('Display Votes'), 'note' => T_('Check to display number of likes and dislikes'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'section_colorbox_end' => array('layout' => 'end_fieldset'), 'section_username_start' => array('layout' => 'begin_fieldset', 'label' => T_('Username Settings')), 'gender_colored' => array('label' => T_('Display gender'), 'note' => T_('Use colored usernames to differentiate men & women.'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'bubbletip' => array('label' => T_('Username bubble tips'), 'note' => T_('Check to enable bubble tips on usernames'), 'defaultvalue' => 0, 'type' => 'checkbox'), 'autocomplete_usernames' => array('label' => T_('Autocomplete usernames'), 'note' => T_('Check to enable auto-completion of usernames entered after a "@" sign in the comment forms'), 'defaultvalue' => 1, 'type' => 'checkbox'), 'section_username_end' => array('layout' => 'end_fieldset'), 'section_access_start' => array('layout' => 'begin_fieldset', 'label' => T_('When access is denied or requires login...')), 'access_login_containers' => array('label' => T_('Display on login screen'), 'note' => '', 'type' => 'checklist', 'options' => array(array('menu', sprintf(T_('"%s" container'), NT_('Menu')), 1), array('sidebar', sprintf(T_('"%s" container'), NT_('Sidebar')), 1), array('sidebar2', sprintf(T_('"%s" container'), NT_('Sidebar 2')), 1), array('footer', sprintf(T_('"%s" container'), NT_('Footer')), 1))), 'section_access_end' => array('layout' => 'end_fieldset')), parent::get_param_definitions($params));
return $r;
}
示例4: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
/**
* @var ItemTypeCache
*/
$ItemTypeCache =& get_ItemTypeCache();
$item_type_options = array('' => T_('All')) + $ItemTypeCache->get_option_array();
$r = array_merge(array('title' => array('label' => T_('Block title'), 'note' => T_('Title to display in your skin.'), 'size' => 40, 'defaultvalue' => T_('Recent photos')), 'item_type' => array('label' => T_('Item type'), 'note' => T_('What kind of items do you want to list?'), 'type' => 'select', 'options' => $item_type_options, 'defaultvalue' => '1'), 'thumb_size' => array('label' => T_('Thumbnail size'), 'note' => T_('Cropping and sizing of thumbnails'), 'type' => 'select', 'options' => get_available_thumb_sizes(), 'defaultvalue' => 'crop-80x80'), 'thumb_layout' => array('label' => T_('Layout'), 'note' => T_('How to lay out the thumbnails'), 'type' => 'select', 'options' => array('grid' => T_('Grid'), 'list' => T_('List')), 'defaultvalue' => 'grid'), 'disp_image_title' => array('label' => T_('Display image title'), 'note' => T_('Check this to display image title. This falls back to post title if image title is not set.'), 'type' => 'checkbox', 'defaultvalue' => false), 'grid_nb_cols' => array('label' => T_('Columns'), 'note' => T_('Number of columns in grid mode.'), 'size' => 4, 'defaultvalue' => 2), 'limit' => array('label' => T_('Max items'), 'note' => T_('Maximum number of items to display.'), 'size' => 4, 'defaultvalue' => 3), 'order_by' => array('label' => T_('Order by'), 'note' => T_('How to sort the items'), 'type' => 'select', 'options' => get_available_sort_options(), 'defaultvalue' => 'datestart'), 'order_dir' => array('label' => T_('Direction'), 'note' => T_('How to sort the items'), 'type' => 'radio', 'options' => array(array('ASC', T_('Ascending')), array('DESC', T_('Descending'))), 'defaultvalue' => 'DESC'), 'blog_ID' => array('label' => T_('Blogs'), 'note' => T_('IDs of the blogs to use, leave empty for the current blog. Separate multiple blogs by commas.'), 'size' => 4)), parent::get_param_definitions($params));
return $r;
}
示例5: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
/**
* @var ItemTypeCache
*/
$ItemTypeCache =& get_ItemTypeCache();
$item_type_options = array('' => T_('All')) + $ItemTypeCache->get_option_array();
$r = array_merge(array('title' => array('label' => T_('Block title'), 'note' => T_('Title to display in your skin.'), 'size' => 40, 'defaultvalue' => T_('Recent photos')), 'item_visibility' => array('label' => T_('Item visibility'), 'note' => T_('What post statuses should be included in the list?'), 'type' => 'radio', 'field_lines' => true, 'options' => array(array('public', T_('show public images (cacheable)')), array('all', T_('show all images the current user is allowed to see (not cacheable)'))), 'defaultvalue' => 'all'), 'item_type' => array('label' => T_('Post type'), 'note' => T_('What kind of items do you want to list?'), 'type' => 'select', 'options' => $item_type_options, 'defaultvalue' => '1'), 'thumb_size' => array('label' => T_('Thumbnail size'), 'note' => T_('Cropping and sizing of thumbnails'), 'type' => 'select', 'options' => get_available_thumb_sizes(), 'defaultvalue' => 'crop-80x80'), 'thumb_layout' => array('label' => T_('Layout'), 'note' => T_('How to lay out the thumbnails'), 'type' => 'select', 'options' => array('grid' => T_('Grid'), 'list' => T_('List'), 'flow' => T_('Flowing Blocks')), 'defaultvalue' => 'flow'), 'disp_image_title' => array('label' => T_('Display image title'), 'note' => T_('Check this to display image title. This falls back to post title if image title is not set.'), 'type' => 'checkbox', 'defaultvalue' => false), 'grid_nb_cols' => array('label' => T_('Columns'), 'note' => T_('Number of columns in grid mode.'), 'size' => 4, 'defaultvalue' => 2), 'limit' => array('label' => T_('Max items'), 'note' => T_('Maximum number of items to display.'), 'size' => 4, 'defaultvalue' => 3), 'order_by' => array('label' => T_('Order by'), 'note' => T_('How to sort the items'), 'type' => 'select', 'options' => get_available_sort_options(), 'defaultvalue' => 'datestart'), 'order_dir' => array('label' => T_('Direction'), 'note' => T_('How to sort the items'), 'type' => 'radio', 'options' => array(array('ASC', T_('Ascending')), array('DESC', T_('Descending'))), 'defaultvalue' => 'DESC'), 'blog_ID' => array('label' => T_('Collection'), 'note' => T_('ID of the collection to use, leave empty for the current collection.'), 'size' => 4, 'type' => 'integer', 'allow_empty' => true)), parent::get_param_definitions($params));
return $r;
}
示例6: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
/**
* @var ItemTypeCache
*/
$ItemTypeCache =& get_ItemTypeCache();
$item_type_options = array('#' => T_('Default'), '' => T_('All')) + $ItemTypeCache->get_option_array();
$r = array_merge(array('title' => array('label' => T_('Block title'), 'note' => T_('Title to display in your skin.'), 'size' => 60, 'defaultvalue' => T_('Items')), 'title_link' => array('label' => T_('Link to blog'), 'note' => T_('Link the block title to the blog?'), 'type' => 'checkbox', 'defaultvalue' => false), 'item_type' => array('label' => T_('Item type'), 'note' => T_('What kind of items do you want to list?'), 'type' => 'select', 'options' => $item_type_options, 'defaultvalue' => '#'), 'thumb_size' => array('label' => T_('Thumbnail size'), 'note' => T_('Cropping and sizing of thumbnails'), 'type' => 'select', 'options' => get_available_thumb_sizes(), 'defaultvalue' => 'crop-80x80'), 'follow_mainlist' => array('label' => T_('Follow Main List'), 'note' => T_('Do you want to restrict to contents related to what is displayed in the main area?'), 'type' => 'radio', 'options' => array(array('no', T_('No')), array('tags', T_('By tags'))), 'defaultvalue' => 'no'), 'blog_ID' => array('label' => T_('Blog'), 'note' => T_('ID of the blog to use, leave empty for the current blog.'), 'size' => 4), 'item_group_by' => array('label' => T_('Group by'), 'note' => T_('Do you want to group the Items?'), 'type' => 'radio', 'options' => array(array('none', T_('None')), array('chapter', T_('By category/chapter'))), 'defaultvalue' => 'none'), 'order_by' => array('label' => T_('Order by'), 'note' => T_('How to sort the items'), 'type' => 'select', 'options' => get_available_sort_options(), 'defaultvalue' => 'datestart'), 'order_dir' => array('label' => T_('Direction'), 'note' => T_('How to sort the items'), 'type' => 'radio', 'options' => array(array('ASC', T_('Ascending')), array('DESC', T_('Descending'))), 'defaultvalue' => 'DESC'), 'limit' => array('label' => T_('Max items'), 'note' => T_('Maximum number of items to display.'), 'size' => 4, 'defaultvalue' => 20), 'disp_title' => array('label' => T_('Titles'), 'note' => T_('Display title.'), 'type' => 'checkbox', 'defaultvalue' => true), 'item_title_link_type' => array('label' => T_('Link titles'), 'note' => T_('Where should titles be linked to?'), 'type' => 'select', 'options' => array('auto' => T_('Automatic'), 'permalink' => T_('Item permalink'), 'linkto_url' => T_('Item URL'), 'none' => T_('Nowhere')), 'defaultvalue' => 'auto'), 'attached_pics' => array('label' => T_('Attached pictures'), 'note' => '', 'type' => 'radio', 'options' => array(array('none', T_('None')), array('first', T_('Display first')), array('all', T_('Display all'))), 'defaultvalue' => 'none'), 'item_pic_link_type' => array('label' => T_('Link pictures'), 'note' => T_('Where should pictures be linked to?'), 'type' => 'select', 'options' => array('auto' => T_('Automatic'), 'permalink' => T_('Item permalink'), 'linkto_url' => T_('Item URL'), 'none' => T_('Nowhere')), 'defaultvalue' => 'auto'), 'disp_excerpt' => array('label' => T_('Excerpt'), 'note' => T_('Display excerpt for each item.'), 'type' => 'checkbox', 'defaultvalue' => false), 'disp_teaser' => array('label' => T_('Content teaser'), 'type' => 'checkbox', 'defaultvalue' => false, 'note' => T_('Display content teaser for each item.')), 'disp_teaser_maxwords' => array('label' => T_('Max Words'), 'type' => 'integer', 'defaultvalue' => 20, 'note' => T_('Max number of words for the teasers.'))), parent::get_param_definitions($params));
// pre_dump( $r['item_type']['options'] );
return $r;
}
示例7: dbm_repair_cache
/**
* Repair cache
*/
function dbm_repair_cache()
{
global $Messages;
load_funcs('tools/model/_system.funcs.php');
$result = system_check_caches();
if (empty($result)) {
$Messages->add(T_('All cache folders are working properly.'), 'success');
} else {
$error_message = T_('Unable to repair all cache folders becaue of file permissions') . ':<br />';
$Messages->add($error_message . implode('<br />', $result));
}
}
示例8: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
$r = array_merge(array('display_blog_title' => array('label' => T_('Blog Title'), 'note' => T_('Display blog title.'), 'type' => 'checkbox', 'defaultvalue' => true), 'open_children_levels' => array('label' => T_('Open children levels'), 'note' => T_('From 0 to 20.'), 'type' => 'integer', 'defaultvalue' => '0', 'valid_pattern' => array('pattern' => '~^(1?\\d|20)$~i', 'error' => T_('We can display from 0 to 20 children levels.'))), 'blog_ID' => array('label' => T_('Collection'), 'note' => T_('ID of the collection to use, leave empty for the current collection.'), 'size' => 4, 'type' => 'integer', 'allow_empty' => true)), parent::get_param_definitions($params));
if (isset($r['allow_blockcache'])) {
// Disable "allow blockcache" because this widget uses the selected items and the content is dynamic
$r['allow_blockcache']['defaultvalue'] = false;
$r['allow_blockcache']['disabled'] = 'disabled';
$r['allow_blockcache']['note'] = T_('This widget cannot be cached in the block cache.');
}
return $r;
}
示例9: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
$r = array_merge(array('profile_picture_size' => array('label' => T_('Profile picture size'), 'note' => '', 'type' => 'select', 'options' => get_available_thumb_sizes(), 'defaultvalue' => 'crop-top-15x15'), 'blog_ID' => array('label' => T_('Collection ID'), 'note' => T_('Leave empty for current collection.'), 'type' => 'integer', 'allow_empty' => true, 'size' => 5, 'defaultvalue' => '')), parent::get_param_definitions($params));
if (isset($r['allow_blockcache'])) {
// Disable "allow blockcache" because this widget uses the selected items
$r['allow_blockcache']['defaultvalue'] = false;
$r['allow_blockcache']['disabled'] = 'disabled';
$r['allow_blockcache']['note'] = T_('This widget cannot be cached in the block cache.');
}
return $r;
}
示例10: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
$r = array_merge(array('title' => array('label' => T_('Block title'), 'note' => T_('Title to display in your skin.'), 'size' => 40, 'defaultvalue' => T_('User log in')), 'password_link_show' => array('label' => T_('Password recovery link'), 'note' => T_('Show link'), 'type' => 'checkbox', 'defaultvalue' => 1), 'password_link' => array('size' => 30, 'note' => T_('Link text to display'), 'type' => 'text', 'defaultvalue' => T_('Lost password?')), 'register_link_show' => array('label' => T_('Register link'), 'note' => T_('Show link'), 'type' => 'checkbox', 'defaultvalue' => 1), 'register_link' => array('size' => 30, 'note' => T_('Link text to display'), 'type' => 'text', 'defaultvalue' => T_('No account yet? Register here »')), 'profile_picture_size' => array('label' => T_('Profile picture'), 'note' => '', 'type' => 'select', 'options' => get_available_thumb_sizes(T_('none')), 'defaultvalue' => 'crop-top-32x32'), 'group_show' => array('label' => T_('User group'), 'note' => T_('Show user group'), 'type' => 'checkbox', 'defaultvalue' => 1), 'group_text' => array('size' => 30, 'note' => T_('Group text to display'), 'type' => 'text', 'defaultvalue' => T_('Your group: $group$')), 'level_show' => array('label' => T_('User level'), 'note' => T_('Show user level'), 'type' => 'checkbox', 'defaultvalue' => 1), 'level_text' => array('size' => 30, 'note' => T_('Level text to display'), 'type' => 'text', 'defaultvalue' => T_('Your level: $level$')), 'greeting_show' => array('label' => T_('Greeting'), 'note' => T_('Show greeting'), 'type' => 'checkbox', 'defaultvalue' => 1), 'greeting_text' => array('size' => 30, 'note' => T_('Greeting text to display'), 'type' => 'text', 'defaultvalue' => T_('Hello $login$!'))), parent::get_param_definitions($params));
if (isset($r['allow_blockcache'])) {
// Set default blockcache to false and disable this setting because caching is never allowed for this widget
$r['allow_blockcache']['defaultvalue'] = false;
$r['allow_blockcache']['disabled'] = 'disabled';
$r['allow_blockcache']['note'] = T_('This widget cannot be cached in the block cache.');
}
return $r;
}
示例11: get_param_definitions
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions($params)
{
load_funcs('files/model/_image.funcs.php');
/**
* @var ItemTypeCache
*/
$ItemTypeCache =& get_ItemTypeCache();
$item_type_options = array('#' => T_('Default'), '' => T_('All')) + $ItemTypeCache->get_option_array();
$r = array_merge(array('title' => array('label' => T_('Block title'), 'note' => T_('Title to display in your skin.'), 'size' => 60, 'defaultvalue' => T_('Items')), 'title_link' => array('label' => T_('Link to blog'), 'note' => T_('Link the block title to the blog?'), 'type' => 'checkbox', 'defaultvalue' => false), 'item_visibility' => array('label' => T_('Item visibility'), 'note' => T_('What post statuses should be included in the list?'), 'type' => 'radio', 'field_lines' => true, 'options' => array(array('public', T_('show public posts')), array('all', T_('show all posts the current user is allowed to see'))), 'defaultvalue' => 'all'), 'item_type' => array('label' => T_('Post type'), 'note' => T_('What kind of items do you want to list?'), 'type' => 'select', 'options' => $item_type_options, 'defaultvalue' => '#'), 'follow_mainlist' => array('label' => T_('Follow Main List'), 'note' => T_('Do you want to restrict to contents related to what is displayed in the main area?'), 'type' => 'radio', 'options' => array(array('no', T_('No')), array('tags', T_('By tags'))), 'defaultvalue' => 'no'), 'blog_ID' => array('label' => T_('Collections'), 'note' => T_('List collection IDs separated by \',\', \'*\' for all collections, \'-\' for current collection without aggregation or leave empty for current collection including aggregation.'), 'size' => 4, 'type' => 'text', 'valid_pattern' => array('pattern' => '/^(\\d+(,\\d+)*|-|\\*)?$/', 'error' => T_('Invalid list of Collection IDs.')), 'defaultvalue' => ''), 'cat_IDs' => array('label' => T_('Categories'), 'note' => T_('List category IDs separated by ,'), 'size' => 15, 'type' => 'text', 'valid_pattern' => array('pattern' => '/^(\\d+(,\\d+)*|-|\\*)?$/', 'error' => T_('Invalid list of Category IDs.'))), 'item_group_by' => array('label' => T_('Group by'), 'note' => T_('Do you want to group the Items?'), 'type' => 'radio', 'options' => array(array('none', T_('None')), array('chapter', T_('By category/chapter'))), 'defaultvalue' => 'none'), 'order_by' => array('label' => T_('Order by'), 'note' => T_('How to sort the items'), 'type' => 'select', 'options' => get_available_sort_options(), 'defaultvalue' => 'datestart'), 'order_dir' => array('label' => T_('Direction'), 'note' => T_('How to sort the items'), 'type' => 'radio', 'options' => array(array('ASC', T_('Ascending')), array('DESC', T_('Descending'))), 'defaultvalue' => 'DESC'), 'limit' => array('label' => T_('Max items'), 'note' => T_('Maximum number of items to display.'), 'size' => 4, 'defaultvalue' => 20), 'disp_title' => array('label' => T_('Titles'), 'note' => T_('Display title.'), 'type' => 'checkbox', 'defaultvalue' => true), 'item_title_link_type' => array('label' => T_('Link titles to'), 'note' => T_('Where should titles be linked to?'), 'type' => 'select', 'options' => array('auto' => T_('Automatic'), 'permalink' => T_('Item permalink'), 'linkto_url' => T_('Item URL'), 'none' => T_('Nowhere')), 'defaultvalue' => 'permalink'), 'attached_pics' => array('label' => T_('Attached pictures'), 'note' => '', 'type' => 'radio', 'options' => array(array('none', T_('None')), array('first', T_('Display first picture')), array('all', T_('Display all pictures'))), 'defaultvalue' => 'none'), 'disp_first_image' => array('label' => T_('First picture'), 'note' => '', 'type' => 'radio', 'options' => array(array('special', T_('Special placement before title')), array('normal', T_('No special treatment (same as other pictures)'))), 'defaultvalue' => 'normal'), 'max_pics' => array('label' => T_('Max pictures'), 'note' => T_('Maximum number of pictures to display after the title.'), 'size' => 4, 'type' => 'integer', 'defaultvalue' => '', 'allow_empty' => true), 'thumb_size' => array('label' => T_('Image size'), 'note' => T_('Cropping and sizing of thumbnails'), 'type' => 'select', 'options' => get_available_thumb_sizes(), 'defaultvalue' => 'crop-80x80'), 'item_pic_link_type' => array('label' => T_('Link pictures'), 'note' => T_('Where should pictures be linked to?'), 'type' => 'select', 'options' => array('auto' => T_('Automatic'), 'permalink' => T_('Item permalink'), 'linkto_url' => T_('Item URL'), 'none' => T_('Nowhere')), 'defaultvalue' => 'auto'), 'disp_excerpt' => array('label' => T_('Excerpt'), 'note' => T_('Display excerpt for each item.'), 'type' => 'checkbox', 'defaultvalue' => false), 'disp_teaser' => array('label' => T_('Content teaser'), 'type' => 'checkbox', 'defaultvalue' => false, 'note' => T_('Display content teaser for each item.')), 'disp_teaser_maxwords' => array('label' => T_('Max Words'), 'type' => 'integer', 'defaultvalue' => 20, 'note' => T_('Max number of words for the teasers.'))), parent::get_param_definitions($params));
if (isset($r['allow_blockcache'])) {
// Disable "allow blockcache" because this widget uses the selected items
$r['allow_blockcache']['defaultvalue'] = false;
$r['allow_blockcache']['disabled'] = 'disabled';
$r['allow_blockcache']['note'] = T_('This widget cannot be cached in the block cache.');
}
return $r;
}
示例12: die
* This file is part of the evoCore framework - {@link http://evocore.net/}
* See also {@link https://github.com/b2evolution/b2evolution}.
*
* @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
*
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
* Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
*
* @package admin
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
// Check minimum permission:
$current_User->check_perm('options', 'view', true);
load_funcs('locales/model/_translation.funcs.php');
// Memorize this as the last "tab" used in the Global Settings:
$UserSettings->set('pref_glob_settings_tab', $ctrl);
$UserSettings->set('pref_glob_regional_tab', $ctrl);
$UserSettings->dbupdate();
$AdminUI->set_path('options', 'regional', 'locales');
$action = param_action();
param('edit_locale', 'string');
if (param('loc_transinfo', 'integer', NULL) !== NULL) {
// Save visibility status of translation info in Session
$Session->set('loc_transinfo', $loc_transinfo);
$Session->dbsave();
}
$loc_transinfo = $Session->get('loc_transinfo');
// Load all available locale defintions:
locales_load_available_defs();
示例13: detect_referer
/**
* Get & Analyze referer
*
* Due to potential non-thread safety with getenv() (fallback), we'd better do this early.
*
* referer_type: enum('search', 'blacklist', 'referer', 'direct'); 'spam' gets used internally
*/
function detect_referer($referer = NULL)
{
global $Debuglog, $debug;
global $self_referer_list, $SpecialList;
// used to detect $referer_type
global $skins_path, $siteskins_path;
global $Settings;
if (isset($referer)) {
$this->referer = $referer;
} else {
// Get referer from HTTP request
$this->referer = $this->get_referer();
}
if (empty($this->referer)) {
// NO referer
// This type may be superseeded and set to 'admin'
if (!$this->detect_admin_page()) {
// Not an admin page:
$this->referer_type = 'direct';
} else {
if (empty($this->hit_type)) {
$this->hit_type = 'admin';
}
$this->referer_type = 'direct';
}
return;
}
// ANALYZE referer...
// Check self referer list, see {@link $self_referer_list}
// fplanque: we log these (again), because if we didn't we woudln't detect
// reloads on these... and that would be a problem!
foreach ($self_referer_list as $self_referer) {
$pos = strpos($this->referer, $self_referer);
// If not starting within in the first 12 chars it's probably an url param as in &url=http://this_blog.com
if ($pos !== false && $pos <= 12 && !($debug && strpos($this->referer, '/search.html'))) {
// This type may be superseeded by admin page
if (!$this->detect_admin_page()) {
// Not an admin page:
$Debuglog->add('Hit: detect_referer(): self referer (' . $self_referer . ')', 'request');
$this->referer_type = 'self';
} else {
if (empty($this->hit_type)) {
$this->hit_type = 'admin';
}
$this->referer_type = 'self';
}
return;
}
}
// Check Special list, see {@link $SpecialList}
// NOTE: This is NOT the antispam!!
// fplanque: we log these (again), because if we didn't we woudln't detect
// reloads on these... and that would be a problem!
foreach ($SpecialList as $lSpeciallist) {
$pos = strpos($this->referer, $lSpeciallist);
// If not starting within in the first 12 chars it's probably an url param as in &url=http://this_blog.com
if ($pos !== false && $pos <= 12) {
// Not an admin page:
$Debuglog->add('Hit: detect_referer(): blacklist (' . $lSpeciallist . ')', 'request');
$this->referer_type = 'special';
return;
}
}
// Check if the referer is valid and does not match the antispam blacklist:
// NOTE: requests to admin pages should not arrive here, because they should be matched above through $self_referer_list!
load_funcs('_core/_url.funcs.php');
if ($error = validate_url($this->referer, 'commenting')) {
// This is most probably referer spam!!
$Debuglog->add('Hit: detect_referer(): ' . $error . ' (SPAM)', 'hit');
$this->referer_type = 'spam';
if ($Settings->get('antispam_block_spam_referers')) {
// In order to preserve server resources, we're going to stop processing immediatly (no logging)!!
require $siteskins_path . '_403_referer_spam.main.php';
// error & exit
exit(0);
// just in case.
// THIS IS THE END!!
}
return;
// type "spam"
}
// Is the referer a search engine?
if ($this->is_search_referer($this->referer)) {
$Debuglog->add('Hit: detect_referer(): search engine', 'request');
$this->referer_type = 'search';
return;
}
$this->referer_type = 'referer';
}
示例14: phpbb_unique_urlname
/**
* Get the unique url name
*
* @param string Source text
* @param string Table name
* @param string Field name
* @return string category's url name
*/
function phpbb_unique_urlname($source, $table, $field)
{
global $DB;
// Replace special chars/umlauts, if we can convert charsets:
load_funcs('locales/_charset.funcs.php');
$url_name = strtolower(replace_special_chars($source));
$url_number = 1;
$url_name_correct = $url_name;
do {
// Check for unique url name in DB
$SQL = new SQL();
$SQL->SELECT($field);
$SQL->FROM($table);
$SQL->WHERE($field . ' = ' . $DB->quote($url_name_correct));
$category = $DB->get_var($SQL->get());
if ($category) {
// Category already exists with such url name; Change it
$url_name_correct = $url_name . '-' . $url_number;
$url_number++;
}
} while (!empty($category));
return $url_name_correct;
}
示例15: tool_create_sample_hits
/**
* Create sample hits and display a process of creating
*
* @param integer Days of stats to generate
* @param integer Minimal interval between 2 consecutive hits (sec)
* @param integer Maximal interval between 2 consecutive hits (sec)
*/
function tool_create_sample_hits($days, $min_interval, $max_interval)
{
global $Messages, $DB;
load_funcs('sessions/model/_hitlog.funcs.php');
echo T_('Creating of the sample hits...');
evo_flush();
/**
* Disable log queries because it increases the memory and stops the process with error "Allowed memory size of X bytes exhausted..."
*/
$DB->log_queries = false;
$insert_data_count = generate_hit_stat($days, $min_interval, $max_interval, true);
echo ' OK.';
$Messages->add(sprintf('%d test data hits are added.', $insert_data_count), 'success');
}