示例#1
0
/**
 * Compose screen: display link files iframe
 * 
 * @param object Form
 * @param object LinkOwner object
 * @param string iframe name
 * @param boolean true if creating new owner object, false otherwise
 */
function attachment_iframe(&$Form, &$LinkOwner, $iframe_name = NULL, $creating = false)
{
    global $admin_url, $dispatcher;
    global $current_User;
    if (!isset($GLOBALS['files_Module'])) {
        return;
    }
    $fieldset_title = T_('Images & Attachments') . get_manual_link($LinkOwner->type . '_attachments_fieldset');
    if ($creating) {
        // Creating new Item
        $fieldset_title .= ' - <a id="title_file_add" href="#" >' . get_icon('folder', 'imgtag') . ' ' . T_('Add/Link files') . '</a> <span class="note">(popup)</span>';
        $Form->begin_fieldset($fieldset_title, array('id' => 'itemform_createlinks'));
        $Form->hidden('is_attachments', 'false');
        echo '<table cellspacing="0" cellpadding="0"><tr><td>';
        $Form->submit(array('actionArray[create_edit]', T_('Save & start attaching files'), 'SaveEditButton'));
        echo '</td></tr></table>';
        $Form->end_fieldset();
        return;
    }
    // Editing link owner
    $Blog =& $LinkOwner->get_Blog();
    if ($iframe_name == NULL) {
        $iframe_name = 'attach_' . generate_random_key(16);
    }
    $fieldset_title .= ' - <a href="' . $admin_url . '?ctrl=links&amp;action=edit_links&amp;link_type=' . $LinkOwner->type . '&amp;mode=iframe&amp;iframe_name=' . $iframe_name . '&amp;link_object_ID=' . $LinkOwner->get_ID() . '" target="' . $iframe_name . '">' . get_icon('refresh', 'imgtag') . ' ' . T_('Refresh') . '</a>';
    if ($current_User->check_perm('files', 'view', false, $Blog->ID) && $LinkOwner->check_perm('edit', false)) {
        // Check that we have permission to edit owner:
        $fieldset_title .= ' - <a href="' . $dispatcher . '?ctrl=links&amp;link_type=' . $LinkOwner->type . '&amp;fm_mode=link_object&amp;link_object_ID=' . $LinkOwner->get_ID() . '" onclick="return pop_up_window( \'' . $dispatcher . '?ctrl=files&amp;mode=upload&amp;iframe_name=' . $iframe_name . '&amp;fm_mode=link_object&amp;link_type=' . $LinkOwner->type . '&amp;link_object_ID=' . $LinkOwner->get_ID() . '\', \'fileman_upload\', 1000 )">' . get_icon('folder', 'imgtag') . ' ' . T_('Add/Link files') . '</a> <span class="note">(popup)</span>';
    }
    $Form->begin_fieldset($fieldset_title, array('id' => 'itemform_links'));
    echo '<iframe src="' . $admin_url . '?ctrl=links&amp;link_type=' . $LinkOwner->type . '&amp;action=edit_links&amp;mode=iframe&amp;iframe_name=' . $iframe_name . '&amp;link_object_ID=' . $LinkOwner->get_ID() . '" name="' . $iframe_name . '" width="100%" marginwidth="0" height="160" marginheight="0" align="top" scrolling="auto" frameborder="0" id="attachmentframe"></iframe>';
    $Form->end_fieldset();
}
示例#2
0
/**
 * Initialize Results object for hits list
 *
 * @param object Results
 * @param array Params
 */
function hits_results(&$Results, $params = array())
{
    $params = array_merge(array('default_order' => '--D'), $params);
    global $blog, $Session, $sess_ID;
    global $preset_results_title, $preset_referer_type, $preset_filter_all_url;
    global $hide_columns, $admin_url;
    $hide_columns = explode(',', $hide_columns);
    $Results->title = isset($preset_results_title) ? $preset_results_title : T_('Recent hits') . get_manual_link('recent-hits-list');
    $param_prefix = 'results_' . $Results->param_prefix;
    $tab = get_param('tab');
    $filter_presets = array();
    $filter_presets['all'] = array(T_('All'), isset($preset_filter_all_url) ? $preset_filter_all_url : $admin_url . '?ctrl=stats&amp;tab=' . $tab . '&amp;blog=' . $blog . '&amp;' . $param_prefix . 'order=' . $params['default_order']);
    if (!isset($preset_referer_type)) {
        // Show these presets only when referer type is not set
        $filter_presets['all_but_curr'] = array(T_('All but current session'), $admin_url . '?ctrl=stats&amp;tab=' . $tab . '&amp;blog=' . $blog . '&amp;sess_ID=' . $Session->ID . '&amp;exclude=1&amp;' . $param_prefix . 'order=' . $params['default_order']);
        $filter_presets['direct_hits'] = array(T_('Direct hits'), $admin_url . '?ctrl=stats&amp;agent_type=browser&amp;tab=' . $tab . '&amp;blog=' . $blog . '&amp;referer_type=direct&amp;exclude=0&amp;' . $param_prefix . 'order=' . $params['default_order']);
        $filter_presets['refered_hits'] = array(T_('Refered hits'), $admin_url . '?ctrl=stats&amp;agent_type=browser&amp;tab=' . $tab . '&amp;blog=' . $blog . '&amp;referer_type=referer&amp;exclude=0&amp;' . $param_prefix . 'order=' . $params['default_order']);
    }
    $Results->filter_area = array('callback' => 'filter_hits', 'url_ignore' => $param_prefix . 'page,exclude,sess_ID,remote_IP', 'presets' => $filter_presets);
    if ($sess_ID == NULL) {
        $session_link = '%stat_session_hits( #sess_ID#, #sess_ID# )%';
    } else {
        $session_link = '<a href="?ctrl=stats&amp;tab=' . $tab . '&amp;blog=' . $blog . '" title="' . T_('Show all sessions') . '">$sess_ID$</a>';
    }
    $Results->cols[] = array('th' => T_('Session'), 'order' => 'hit_sess_ID', 'td_class' => 'right compact_data', 'td' => $session_link);
    $Results->cols[] = array('th' => T_('User'), 'order' => 'user_login', 'td_class' => 'shrinkwrap compact_data', 'td' => '%stat_session_login( #user_login# )%');
    $Results->cols[] = array('th' => T_('Date Time'), 'order' => 'hit_ID', 'default_dir' => 'D', 'td_class' => 'timestamp compact_data', 'td' => '%mysql2localedatetime_spans( #hit_datetime#, "M-d" )%');
    $Results->cols[] = array('th' => T_('Agent'), 'order' => 'hit_agent_type', 'td_class' => 'shrinkwrap compact_data', 'td' => '$hit_agent_type$', 'extra' => array('style' => 'background-color: %hit_agent_type_color( "#hit_agent_type#" )%;', 'format_to_output' => false));
    $Results->cols[] = array('th' => T_('Device'), 'order' => 'sess_device', 'td_class' => 'shrinkwrap compact_data', 'td' => '$sess_device$', 'extra' => array('style' => 'background-color: %hit_device_color( "#sess_device#" )%;', 'format_to_output' => false));
    if (!in_array('referer', $hide_columns)) {
        // Referer Type & Domain
        $Results->cols[] = array('th_group' => T_('Referer'), 'th' => T_('Type'), 'order' => 'hit_referer_type', 'td_class' => 'shrinkwrap compact_data', 'td' => '$hit_referer_type$', 'extra' => array('style' => 'background-color: %hit_referer_type_color( "#hit_referer_type#" )%;', 'format_to_output' => false));
        $Results->cols[] = array('th_group' => T_('Referer'), 'th' => T_('Domain'), 'order' => 'dom_name', 'td_class' => 'nowrap compact_data', 'td' => '<a href="$hit_referer$">$dom_name$</a>');
    }
    // Keywords:
    $Results->cols[] = array('th' => T_('Search keywords'), 'order' => 'hit_keyphrase', 'td' => '%stats_search_keywords( #hit_keyphrase#, 45 )%', 'td_class' => 'compact_data');
    // Serp Rank:
    $Results->cols[] = array('th' => T_('SR'), 'th_title' => T_('Serp rank'), 'order' => 'hit_serprank', 'td_class' => 'center compact_data', 'td' => '$hit_serprank$');
    $Results->cols[] = array('th' => T_('Goal'), 'order' => 'goal_name', 'default_dir' => 'D', 'td' => '$goal_name$', 'td_class' => 'compact_data');
    $Results->cols[] = array('th' => T_('Collection'), 'order' => 'hit_coll_ID', 'td' => '$blog_shortname$', 'td_class' => 'compact_data');
    $Results->cols[] = array('th' => T_('Hit type'), 'order' => 'hit_type', 'td_class' => 'shrinkwrap compact_data', 'td' => '$hit_type$', 'extra' => array('style' => 'background-color: %hit_type_color( "#hit_type#" )%', 'format_to_output' => false));
    // Requested URI (linked to blog's baseurlroot+URI):
    $Results->cols[] = array('th' => T_('Requested URI'), 'order' => 'hit_uri', 'td' => '%stats_format_req_URI( #hit_coll_ID#, #hit_uri#, 40, #hit_disp#, #hit_ctrl#, #hit_action# )%', 'td_class' => 'compact_data');
    $Results->cols[] = array('th' => T_('HTTP resp'), 'order' => 'hit_response_code', 'td' => '$hit_response_code$', 'td_class' => '%hit_response_code_class( #hit_response_code# )% shrinkwrap compact_data');
    $Results->cols[] = array('th' => T_('Remote IP'), 'order' => 'hit_remote_addr', 'td' => '%disp_clickable_log_IP( #hit_remote_addr# )%', 'td_class' => 'compact_data');
    $Results->cols[] = array('th' => T_('Agent Name'), 'order' => 'hit_agent_ID', 'td' => '%get_hit_agent_name_by_ID( #hit_agent_ID# )%', 'td_class' => 'compact_data');
}
示例#3
0
$Form->hidden('action', 'update');
// --------------------------------------------
if ($current_User->check_perm('users', 'edit')) {
    $Form->begin_fieldset(T_('Locking down b2evolution for maintenance, upgrade or server switching...'));
    $Form->checkbox_input('system_lock', $Settings->get('system_lock'), T_('Lock system'), array('note' => T_('check this to prevent login (except for admins) and sending comments/messages. This prevents the DB from receiving updates (other than logging)') . '<br />' . T_('Note: for a more complete lock down, rename the file /conf/_maintenance.html to /conf/maintenance.html (complete lock) or /conf/imaintenance.html (gives access to /install)')));
    $Form->end_fieldset();
}
// --------------------------------------------
$Form->begin_fieldset(T_('Caching'));
$Form->checkbox_input('general_cache_enabled', $Settings->get('general_cache_enabled'), T_('Enable general cache'), array('note' => T_('Cache rendered pages that are not controlled by a skin. See Blog Settings for skin output caching.')));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Online Help') . get_manual_link('online help'));
$Form->checkbox_input('webhelp_enabled', $Settings->get('webhelp_enabled'), T_('Online Help links'), array('note' => T_('Online help links provide context sensitive help to certain features.')));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Hit & session logging') . get_manual_link('hit_logging'));
$Form->checklist(array(array('log_public_hits', 1, T_('on every public page'), $Settings->get('log_public_hits')), array('log_admin_hits', 1, T_('on every admin page'), $Settings->get('log_admin_hits'))), 'log_hits', T_('Log hits'));
// TODO: draw a warning sign if set to off
$Form->radio_input('auto_prune_stats_mode', $Settings->get('auto_prune_stats_mode'), array(array('value' => 'off', 'label' => T_('Off'), 'note' => T_('Not recommended! Your database will grow very large!'), 'onclick' => 'jQuery("#auto_prune_stats_container").hide();'), array('value' => 'page', 'label' => T_('On every page'), 'note' => T_('This is guaranteed to work but uses extra resources with every page displayed.'), 'onclick' => 'jQuery("#auto_prune_stats_container").show();'), array('value' => 'cron', 'label' => T_('With a scheduled job'), 'note' => T_('Recommended if you have your scheduled jobs properly set up.'), 'onclick' => 'jQuery("#auto_prune_stats_container").show();')), T_('Auto pruning'), array('note' => T_('Note: Even if you don\'t log hits, you still need to prune sessions!'), 'lines' => true));
echo '<div id="auto_prune_stats_container">';
$Form->text_input('auto_prune_stats', $Settings->get('auto_prune_stats'), 5, T_('Prune after'), T_('days. How many days of hits & sessions do you want to keep in the database for stats?'));
echo '</div>';
if ($Settings->get('auto_prune_stats_mode') == 'off') {
    // hide the "days" input field, if mode set to off:
    echo '<script type="text/javascript">jQuery("#auto_prune_stats_container").hide();</script>';
}
$Form->end_fieldset();
if ($current_User->check_perm('options', 'edit')) {
    $Form->end_form(array(array('submit', 'submit', T_('Save !'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
}
示例#4
0
        case 'utf8upgrade':
            // Upgrade DB to UTF-8
            db_upgrade_to_utf8_ascii();
            break;
    }
    $block_item_Widget->disp_template_raw('block_end');
}
if ($current_User->check_perm('users', 'edit')) {
    // Setting to lock system
    global $Settings;
    $Form = new Form(NULL, 'settings_checkchanges');
    $Form->begin_form('fform');
    $Form->add_crumb('tools');
    $Form->hidden('ctrl', 'tools');
    $Form->hidden('action', 'update_tools');
    $Form->begin_fieldset(T_('Locking down b2evolution for maintenance, upgrade or server switching...') . get_manual_link('system-lock'));
    $Form->checkbox_input('system_lock', $Settings->get('system_lock'), T_('Lock system'), array('note' => T_('check this to prevent login (except for admins) and sending comments/messages. This prevents the DB from receiving updates (other than logging)') . '<br />' . T_('Note: for a more complete lock down, rename the file /conf/_maintenance.html to /conf/maintenance.html (complete lock) or /conf/imaintenance.html (gives access to /install)')));
    if ($current_User->check_perm('options', 'edit')) {
        $Form->buttons(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton')));
    }
    $Form->end_fieldset();
    $Form->end_form();
}
// TODO: dh> this should really be a separate permission.. ("tools", "exec") or similar!
if ($current_User->check_perm('options', 'edit')) {
    // default admin actions:
    global $Settings;
    $block_item_Widget->title = T_('Cache management');
    // dh> TODO: add link to delete all caches at once?
    $block_item_Widget->disp_template_replaced('block_start');
    echo '<ul>';
示例#5
0
 * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
 *
 * @package evocore
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $Blog;
// Create query
$SQL = new SQL();
$SQL->SELECT('t.*, IF( tb.itc_ityp_ID > 0, 1, 0 ) AS type_enabled');
$SQL->FROM('T_items__type AS t');
$SQL->FROM_add('LEFT JOIN T_items__type_coll AS tb ON itc_ityp_ID = ityp_ID AND itc_coll_ID = ' . $Blog->ID);
// Create result set:
$Results = new Results($SQL->get(), 'ityp_');
$Results->title = T_('Item/Post/Page types') . get_manual_link('managing-item-types');
// get reserved and default ids
global $default_ids;
$default_ids = ItemType::get_default_ids();
/**
 * Callback to build possible actions depending on post type id
 *
 */
function get_actions_for_itemtype($id)
{
    global $default_ids;
    $action = action_icon(T_('Duplicate this Post Type...'), 'copy', regenerate_url('action', 'ityp_ID=' . $id . '&amp;action=new'));
    if (!ItemType::is_reserved($id)) {
        // Edit all post types except of not reserved post type
        $action = action_icon(T_('Edit this Post Type...'), 'edit', regenerate_url('action', 'ityp_ID=' . $id . '&amp;action=edit')) . $action;
    }
示例#6
0
    // We want to filter on final goals only:
    $SQL->WHERE_and('goal_redir_url IS NULL');
}
if (!empty($s)) {
    // We want to filter on search keyword:
    // Note: we use CONCAT_WS (Concat With Separator) because CONCAT returns NULL if any arg is NULL
    $SQL->WHERE_and('CONCAT_WS( " ", goal_name, goal_key, goal_redir_url ) LIKE "%' . $DB->escape($s) . '%"');
}
if (!empty($cat)) {
    // We want to filter on category:
    $SQL->WHERE_and('goal_gcat_ID = ' . $DB->quote($cat));
}
// Create result set:
$Results = new Results($SQL->get(), 'goals_', '-A');
$Results->Cache =& get_GoalCache();
$Results->title = T_('Goals') . get_manual_link('goal-settings');
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_goals(&$Form)
{
    $Form->checkbox_basic_input('final', get_param('final'), T_('Final only') . ' &bull;');
    $Form->text('s', get_param('s'), 30, T_('Search'), '', 255);
    $GoalCategoryCache =& get_GoalCategoryCache(NT_('All'));
    $GoalCategoryCache->load_all();
    $Form->select_input_object('cat', get_param('cat'), $GoalCategoryCache, T_('Category'), array('allow_none' => true));
}
$Results->filter_area = array('callback' => 'filter_goals', 'url_ignore' => 'results_goals_page,final', 'presets' => array('all' => array(T_('All'), '?ctrl=goals&amp;blog=' . $blog . '&amp;final=0&amp;s=&amp;cat=0'), 'final' => array(T_('Final'), '?ctrl=goals&amp;blog=' . $blog . '&amp;final=1')));
$Results->cols[] = array('th' => T_('ID'), 'order' => 'goal_ID', 'td_class' => 'center', 'td' => '$goal_ID$');
示例#7
0
    $SQL->WHERE_and('emlog_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
    $count_SQL->WHERE_and('emlog_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
}
if (!empty($datestop)) {
    // Filter by end date
    $SQL->WHERE_and('emlog_timestamp <= ' . $DB->quote($datestop . ' 23:59:59'));
    $count_SQL->WHERE_and('emlog_timestamp <= ' . $DB->quote($datestop . ' 23:59:59'));
}
if (!empty($email)) {
    // Filter by email
    $email = utf8_strtolower($email);
    $SQL->WHERE_and('emlog_to LIKE ' . $DB->quote($email));
    $count_SQL->WHERE_and('emlog_to LIKE ' . $DB->quote($email));
}
$Results = new Results($SQL->get(), 'emlog_', 'D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Sent emails') . get_manual_link('sent-emails');
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_email_sent(&$Form)
{
    global $datestart, $datestop, $email;
    $Form->date_input('datestartinput', $datestart, T_('From date'));
    $Form->date_input('datestopinput', $datestop, T_('To date'));
    $Form->text_input('email', $email, 40, T_('Email'));
}
$Results->filter_area = array('callback' => 'filter_email_sent', 'presets' => array('all' => array(T_('All'), $admin_url . '?ctrl=email&amp;tab=sent')));
$Results->cols[] = array('th' => T_('ID'), 'order' => 'emlog_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'right', 'td' => '$emlog_ID$');
$Results->cols[] = array('th' => T_('Date Time'), 'order' => 'emlog_timestamp', 'default_dir' => 'D', 'th_class' => 'shrinkwrap', 'td_class' => 'timestamp compact_data', 'td' => '%mysql2localedatetime_spans( #emlog_timestamp#, "M-d" )%');
// Get params from request
$s = param('s', 'string', '', true);
// Create query
$SQL = new SQL();
$SQL->SELECT('ctry_ID, ctry_code, ctry_name, curr_shortcut, curr_code, ctry_enabled, ctry_preferred, ctry_status, ctry_block_count');
$SQL->FROM('T_regional__country');
$SQL->FROM_add('LEFT JOIN T_regional__currency ON ctry_curr_ID=curr_ID');
$SQL->ORDER_BY('*, ctry_code ASC');
if (!empty($s)) {
    // We want to filter on search keyword:
    // Note: we use CONCAT_WS (Concat With Separator) because CONCAT returns NULL if any arg is NULL
    $SQL->WHERE('CONCAT_WS( " ", ctry_code, ctry_name, curr_code ) LIKE "%' . $DB->escape($s) . '%"');
}
// Create result set:
$Results = new Results($SQL->get(), 'ctry_', '-D');
$Results->title = T_('Countries') . get_manual_link('regional-countries-tab');
/*
 * STATUS TD:
 */
function ctry_td_enabled($ctry_enabled, $ctry_ID)
{
    $r = '';
    $redirect_ctrl = param('ctrl', 'string', 'countries');
    if ($ctry_enabled == true) {
        $r .= action_icon(T_('Disable the country!'), 'bullet_full', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=disable_country&amp;ctry_ID=' . $ctry_ID . '&amp;redirect_ctrl=' . $redirect_ctrl . '&amp;' . url_crumb('country')));
    } else {
        $r .= action_icon(T_('Enable the country!'), 'bullet_empty', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=enable_country&amp;ctry_ID=' . $ctry_ID . '&amp;redirect_ctrl=' . $redirect_ctrl . '&amp;' . url_crumb('country')));
    }
    return $r;
}
function ctry_td_preferred($ctry_preferred, $ctry_ID)
示例#9
0
}
init_system_check('Internal b2evo charset', $system_stats['evo_charset']);
disp_system_check('note');
init_system_check('Blog count', $system_stats['evo_blog_count']);
disp_system_check('note');
$block_item_Widget->disp_template_raw('block_end');
/*
 * Caching
 */
$block_item_Widget->title = T_('Caching');
$block_item_Widget->disp_template_replaced('block_start');
// Cache folder writable?
list($cachedir_status, $cachedir_msg) = system_get_result($system_stats['cachedir_status']);
$cachedir_long = '';
if ($cachedir_status == 'error') {
    $cachedir_long = '<p>' . T_('You will not be able to use page cache.') . "</p>\n" . '<p>' . T_('Your host requires that you set special file permissions on your cache directory.') . get_manual_link('cache_file_permission_errors') . "</p>\n";
}
init_system_check(T_('Cache directory'), $cachedir_msg . ' - ' . $cache_path);
disp_system_check($cachedir_status, $cachedir_long);
// cache folder size
init_system_check('Cache folder size', bytesreadable($system_stats['cachedir_size']));
disp_system_check('note');
if ($cachedir_status != 'error') {
    // 'cache/ directory exists and, it is writable
    // General cache is enabled
    init_system_check(T_('General caching'), $system_stats['general_pagecache_enabled'] ? 'Enabled' : 'Disabled');
    disp_system_check('note');
    // how many blogs have enabled caches
    $error_messages = system_check_caches(false);
    $enabled_message = $system_stats['blog_pagecaches_enabled'] . ' enabled /' . $system_stats['evo_blog_count'] . ' blogs';
    init_system_check(T_('Blog\'s cache setting'), $enabled_message);
 *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
 *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
 * }}
 *
 * {@internal Open Source relicensing agreement:
 * }}
 *
 * @package admin
 *
 * @version $Id: _stats_syndication.view.php 4361 2013-07-24 06:22:58Z yura $
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $blog, $admin_url, $rsc_url, $AdminUI, $agent_type_color;
echo '<h2>' . T_('Hits from RSS/Atom feed readers - Summary') . get_manual_link('feed-hits-summary') . '</h2>';
echo '<p class="notes">' . T_('Any user agent accessing the XML feeds will be flagged as an XML reader.') . '</p>';
$sql = "\n\tSELECT SQL_NO_CACHE COUNT(*) AS hits, EXTRACT(YEAR FROM hit_datetime) AS year,\n\t\t\t   EXTRACT(MONTH FROM hit_datetime) AS month, EXTRACT(DAY FROM hit_datetime) AS day\n\t\tFROM T_hitlog\n\t WHERE hit_type = 'rss'";
if ($blog > 0) {
    $sql .= ' AND hit_blog_ID = ' . $blog;
}
$sql .= ' GROUP BY year, month, day
					ORDER BY year DESC, month DESC, day DESC';
$res_hits = $DB->get_results($sql, ARRAY_A, 'Get rss summary');
/*
 * Chart
 */
if (count($res_hits)) {
    $last_date = 0;
    $chart['chart_data'][0] = array();
    $chart['chart_data'][1] = array();
$Form->info('', sprintf(T_('Feedbacks with a spam karma between these two thresholds will get the default status of the blog ("%s").'), T_('New feedback status')));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Misc') . get_manual_link('antispam-settings-misc'));
$Form->checkbox('antispam_block_spam_referers', $Settings->get('antispam_block_spam_referers'), T_('Block spam referers'), T_('If a referrer has been detected as spam, should we block the request with a "403 Forbidden" page?'));
$Form->checkbox('antispam_report_to_central', $Settings->get('antispam_report_to_central'), T_('Report to central blacklist'), T_('When banning a keyword, offer an option to report to the central blacklist.') . ' [<a href="http://b2evolution.net/about/terms.html">' . T_('Terms of service') . '</a>]');
$Form->end_fieldset();
$Form->begin_fieldset(T_('Spam detection relevance weight') . get_manual_link('antispam-settings-detection-relevance-weight'));
echo '<p>' . T_('This defines the weight of the plugin, in relation to the others.') . '</p>';
$karma_plugins = $Plugins->get_list_by_events(array('GetSpamKarmaForComment'));
if (empty($karma_plugins)) {
    echo '<p>' . T_('There are no spam karma plugins enabled.') . '</p>';
} else {
    foreach ($karma_plugins as $loop_Plugin) {
        $Form->text('antispam_plugin_spam_weight[' . $loop_Plugin->ID . ']', $Plugins->index_ID_rows[$loop_Plugin->ID]['plug_spam_weight'], 2, $loop_Plugin->name);
    }
}
$Form->end_fieldset();
$Form->begin_fieldset(T_('Suspect users') . get_manual_link('antispam-settings-suspect-users'));
$GroupCache =& get_GroupCache(true, NT_('Don\'t move suspect users'));
$Form->select_object('antispam_suspicious_group', $Settings->get('antispam_suspicious_group'), $GroupCache, T_('Move suspect users to'), '', true);
$trust_groups = $Settings->get('antispam_trust_groups') != '' ? explode(',', $Settings->get('antispam_trust_groups')) : array();
$groups_options = array();
$groups = $GroupCache->get_option_array();
foreach ($groups as $group_ID => $group_name) {
    $groups_options[] = array('antispam_trust_groups[]', $group_ID, $group_name, in_array($group_ID, $trust_groups));
}
$Form->checklist($groups_options, 'antispam_trust_groups', T_('Never touch users from these groups'));
$Form->end_fieldset();
if ($current_User->check_perm('options', 'edit')) {
    $Form->end_form(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton'), array('submit', 'submit[restore_defaults]', T_('Restore defaults'), 'ResetButton')));
}
示例#12
0
    die('Please, do not access this page directly.');
}
/**
 * @var Organization
 */
global $edited_Organization;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'organization_checkchanges', 'post', 'compact');
if (!$creating) {
    $Form->global_icon(T_('Delete this organization!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('organization')));
}
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,org_ID'));
$Form->begin_form('fform', ($creating ? T_('New organization') : T_('Organization')) . get_manual_link('organization-form'));
$Form->add_crumb('organization');
$Form->hiddens_by_key(get_memorized('action'));
// (this allows to come back to the right list order & page)
$Form->text_input('org_name', $edited_Organization->name, 32, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('org_url', $edited_Organization->url, 32, T_('Url'), '', array('maxlength' => 2000));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
if ($edited_Organization->ID > 0) {
    // Display users of this organization
    users_results_block(array('org_ID' => $edited_Organization->ID, 'filterset_name' => 'orgusr_' . $edited_Organization->ID, 'results_param_prefix' => 'orgusr_', 'results_title' => T_('Users of this organization') . get_manual_link('users_and_groups'), 'results_order' => '/uorg_accepted/D', 'page_url' => get_dispctrl_url('organizations', 'action=edit&amp;org_ID=' . $edited_Organization->ID), 'display_orgstatus' => true, 'display_ID' => false, 'display_btn_adduser' => false, 'display_btn_addgroup' => false, 'display_blogs' => false, 'display_source' => false, 'display_regdate' => false, 'display_regcountry' => false, 'display_update' => false, 'display_lastvisit' => false, 'display_contact' => false, 'display_reported' => false, 'display_group' => false, 'display_level' => false, 'display_status' => false, 'display_actions' => false, 'display_newsletter' => false));
}
// AJAX changing of an accept status of organizations for each user
echo_user_organization_js();
示例#13
0
     // Set param prefix for URLs
     $param_prefix = 'cmnt_fullview_';
     if (!empty($CommentList->param_prefix)) {
         $param_prefix = $CommentList->param_prefix;
     }
     // Get ready for display (runs the query):
     $CommentList->display_init();
 }
 if ($user_perm_moderate_cmt && $CommentList->result_num_rows) {
     // We have comments awaiting moderation
     load_funcs('comments/model/_comment_js.funcs.php');
     $nb_blocks_displayed++;
     $opentrash_link = get_opentrash_link(true, false, array('class' => 'btn btn-default'));
     $refresh_link = '<span class="floatright">' . action_icon(T_('Refresh comment list'), 'refresh', $admin_url . '?blog=' . $blog, ' ' . T_('Refresh'), 3, 4, array('onclick' => 'startRefreshComments( \'' . request_from() . '\' ); return false;', 'class' => 'btn btn-default')) . '</span> ';
     $show_statuses_param = $param_prefix . 'show_statuses[]=' . implode('&amp;' . $param_prefix . 'show_statuses[]=', $user_modeartion_statuses);
     $block_item_Widget->title = $refresh_link . $opentrash_link . T_('Comments awaiting moderation') . ' <a href="' . $admin_url . '?ctrl=comments&amp;blog=' . $Blog->ID . '&amp;' . $show_statuses_param . '" style="text-decoration:none">' . '<span id="badge" class="badge badge-important">' . $CommentList->get_total_rows() . '</span></a>' . get_manual_link('collection-dashboard');
     echo '<div class="evo_content_block">';
     echo '<div id="comments_block" class="dashboard_comments_block">';
     $block_item_Widget->disp_template_replaced('block_start');
     echo '<div id="comments_container">';
     // GET COMMENTS AWAITING MODERATION (the code generation is shared with the AJAX callback):
     show_comments_awaiting_moderation($Blog->ID, $CommentList);
     echo '</div>';
     $block_item_Widget->disp_template_raw('block_end');
     echo '</div>';
     echo '</div>';
 }
 /*
  * RECENT POSTS awaiting moderation
  */
 $post_moderation_statuses = explode(',', $Blog->get_setting('post_moderation_statuses'));
示例#14
0
        if (array_key_exists('note', $settings)) {
            $note = $settings['note'];
        } else {
            $note = get_affected_paths($settings['path']);
        }
        $Form->checkbox('bk_' . $name, $current_Backup->backup_paths[$name], $settings['label'], $note);
    }
}
$Form->end_fieldset();
// Backup settings for database tables
$Form->begin_fieldset(T_('Database tables'), array('class' => 'fieldset clear'));
// Display checkboxes
foreach ($backup_tables as $name => $settings) {
    $note = '';
    if (array_key_exists('note', $settings)) {
        $note = $settings['note'];
    } else {
        $note = get_affected_tables($settings['table']);
    }
    $Form->checkbox('bk_' . $name, $current_Backup->backup_tables[$name], $settings['label'], $note);
}
$Form->end_fieldset();
// Enable/Disable maintenance mode
$Form->begin_fieldset(T_('General Options') . get_manual_link('set-system-lock-during-backup'), array('class' => 'fieldset clear'));
$Form->radio('bk_lock_type', 'maintenance_mode', array(array('maintenance_mode', T_('Maintenance mode') . ' (' . T_('Recommended') . ')', T_('check this to completely lock b2evolution')), array('maintenance_lock', T_('Maintenance lock'), T_('check this to prevent login (except for admins), sending comments/messages and receiving DB updates (other than logging)')), array('open', T_('Leave the site open for modifications during backup. (Not recommended).'))), T_('Lock b2evolution while backing up'), true);
if (function_exists('gzopen')) {
    $Form->checkbox('bk_pack_backup_files', $current_Backup->pack_backup_files, 'ZIP', T_('Compress backup files into ZIP archive.'));
}
$Form->add_crumb('backup');
$Form->end_fieldset();
$Form->end_form(array(array('submit', 'actionArray[backup]', T_('Backup'), 'SaveButton')));
示例#15
0
文件: _blog.class.php 项目: LFSF/oras
 /**
  * Get the blog's media directory (and create it if necessary).
  *
  * If we're {@link is_admin_page() on an admin page}, it adds status messages.
  * @todo These status messages should rather go to a "syslog" and not be displayed to a normal user
  *
  * @param boolean Create the directory, if it does not exist yet?
  * @return string path string on success, false if the dir could not be created
  */
 function get_media_dir($create = true)
 {
     global $media_path, $Messages, $Settings, $Debuglog;
     if (!$Settings->get('fm_enable_roots_blog')) {
         // User directories are disabled:
         $Debuglog->add('Attempt to access blog media dir, but this feature is globally disabled', 'files');
         return false;
     }
     switch ($this->media_location) {
         case 'default':
             $mediadir = get_canonical_path($media_path . 'blogs/' . $this->urlname . '/');
             break;
         case 'subdir':
             $mediadir = get_canonical_path($media_path . $this->media_subdir);
             break;
         case 'custom':
             $mediadir = get_canonical_path($this->media_fullpath);
             break;
         case 'none':
         default:
             $Debuglog->add('Attempt to access blog media dir, but this feature is disabled for this blog', 'files');
             return false;
     }
     // TODO: use a File object here (to access perms, ..) when FileCache::get_by_path() is provided.
     if ($create && !is_dir($mediadir)) {
         // TODO: Link to some help page(s) with errors!
         if (!is_writable(dirname($mediadir))) {
             // add error
             if (is_admin_page()) {
                 $Messages->add(sprintf(T_("The blog's media directory &laquo;%s&raquo; could not be created, because the parent directory is not writable or does not exist."), rel_path_to_base($mediadir)) . get_manual_link('media_file_permission_errors'), 'error');
             }
             return false;
         } elseif (!@mkdir($mediadir)) {
             // add error
             if (is_admin_page()) {
                 $Messages->add(sprintf(T_("The blog's media directory &laquo;%s&raquo; could not be created."), rel_path_to_base($mediadir)) . get_manual_link('directory_creation_error'), 'error');
             }
             return false;
         } else {
             // chmod and add note:
             $chmod = $Settings->get('fm_default_chmod_dir');
             if (!empty($chmod)) {
                 @chmod($mediadir, octdec($chmod));
             }
             if (is_admin_page()) {
                 $Messages->add(sprintf(T_("The blog's media directory &laquo;%s&raquo; has been created with permissions %s."), rel_path_to_base($mediadir), substr(sprintf('%o', fileperms($mediadir)), -3)), 'success');
             }
         }
     }
     return $mediadir;
 }
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * View funcs
 */
require_once dirname(__FILE__) . '/_stats_view.funcs.php';
global $blog, $admin_url, $rsc_url;
// TOP REFERRING SEARCH ENGINES
?>

<h3><?php 
echo T_('Top referring search engines') . get_manual_link('top-referring-search-engines');
?>
</h3>

<?php 
global $res_stats, $row_stats;
refererList(20, 'global', 0, 0, "'search'", 'dom_name', $blog, true);
if (count($res_stats)) {
    ?>
	<table class="grouped table table-striped table-bordered table-hover table-condensed" cellspacing="0">
		<tr>
			<th class="firstcol"><?php 
    echo T_('Search engine');
    ?>
</th>
			<th><?php 
示例#17
0
global $debug;
global $UserSettings;
global $rsc_url, $htsrv_url;
global $Blog, $permission_to_change_admin;
$permission_to_change_admin = $current_User->check_perm('blog_admin', 'edit', false, $Blog->ID);
// Javascript:
echo '
<script type="text/javascript">var htsrv_url = "' . $htsrv_url . '";</script>
<script type="text/javascript" src="' . $rsc_url . 'js/collectionperms.js"></script>';
$Form = new Form(NULL, 'blogperm_checkchanges', 'post', 'fieldset');
$Form->begin_form('fform');
$Form->add_crumb('collection');
$Form->hidden_ctrl();
$Form->hidden('tab', 'perm');
$Form->hidden('blog', $edited_Blog->ID);
$Form->begin_fieldset(T_('User permissions') . get_manual_link('user_permissions'));
/*
 * Query user list:
 */
if (get_param('action') == 'filter2') {
    $keywords = param('keywords2', 'string', '', true);
    set_param('keywords1', $keywords);
} else {
    $keywords = param('keywords1', 'string', '', true);
    set_param('keywords2', $keywords);
}
$SQL = new SQL();
$SQL->SELECT('user_ID, user_login, user_level, bloguser_perm_poststatuses + 0 as perm_poststatuses, bloguser_perm_edit, bloguser_ismember,' . 'bloguser_perm_delcmts, bloguser_perm_recycle_owncmts, bloguser_perm_vote_spam_cmts, bloguser_perm_cmtstatuses + 0 as perm_cmtstatuses, bloguser_perm_edit_cmt,' . 'bloguser_perm_delpost, bloguser_perm_edit_ts, bloguser_perm_cats,' . 'bloguser_perm_properties, bloguser_perm_admin, bloguser_perm_media_upload,' . 'bloguser_perm_media_browse, bloguser_perm_media_change, bloguser_perm_page,' . 'bloguser_perm_intro, bloguser_perm_podcast, bloguser_perm_sidebar');
$SQL->FROM('T_users LEFT JOIN T_coll_user_perms ON (
				 						user_ID = bloguser_user_ID
										AND bloguser_blog_ID = ' . $edited_Blog->ID . ' )');
示例#18
0
    $SQL->WHERE_and('emret_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
    $count_SQL->WHERE_and('emret_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
}
if (!empty($datestop)) {
    // Filter by end date
    $SQL->WHERE_and('emret_timestamp <= ' . $DB->quote($datestop . ' 23:59:59'));
    $count_SQL->WHERE_and('emret_timestamp <= ' . $DB->quote($datestop . ' 23:59:59'));
}
if (!empty($email)) {
    // Filter by email
    $email = utf8_strtolower($email);
    $SQL->WHERE_and('emret_address LIKE ' . $DB->quote($email));
    $count_SQL->WHERE_and('emret_address LIKE ' . $DB->quote($email));
}
$Results = new Results($SQL->get(), 'emret_', 'D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Returned emails') . get_manual_link('email-returned');
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_email_return(&$Form)
{
    global $datestart, $datestop, $email;
    $Form->date_input('datestartinput', $datestart, T_('From date'));
    $Form->date_input('datestopinput', $datestop, T_('To date'));
    $Form->text_input('email', $email, 40, T_('Email'));
}
$Results->filter_area = array('callback' => 'filter_email_return', 'presets' => array('all' => array(T_('All'), $admin_url . '?ctrl=email&amp;tab=return')));
$Results->cols[] = array('th' => T_('ID'), 'order' => 'emret_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'right', 'td' => '$emret_ID$');
$Results->cols[] = array('th' => T_('Date Time'), 'order' => 'emret_timestamp', 'default_dir' => 'D', 'th_class' => 'shrinkwrap', 'td_class' => 'timestamp compact_data', 'td' => '%mysql2localedatetime_spans( #emret_timestamp#, "M-d" )%');
 * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
 *
 * @package evocore
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $admin_url, $tab;
global $users_numbers, $edited_EmailCampaign;
$Form = new Form(NULL, 'campaign_form');
$Form->begin_form('fform');
$Form->add_crumb('campaign');
$Form->hidden('ctrl', 'campaigns');
$Form->hidden('current_tab', $tab);
$Form->hidden('ecmp_ID', $edited_EmailCampaign->ID);
$Form->begin_fieldset(T_('Campaign info') . get_manual_link('creating-an-email-campaign'));
$Form->text_input('ecmp_name', $edited_EmailCampaign->get('name'), 60, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('ecmp_email_title', $edited_EmailCampaign->get('email_title'), 60, T_('Email title'), '', array('maxlength' => 255, 'required' => true));
$Form->info(T_('Campaign created'), mysql2localedatetime_spans($edited_EmailCampaign->get('date_ts'), 'M-d'));
$Form->info(T_('Last sent'), $edited_EmailCampaign->get('sent_ts') ? mysql2localedatetime_spans($edited_EmailCampaign->get('sent_ts'), 'M-d') : T_('Not sent yet'));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Newsletter recipients'));
if (!empty($users_numbers)) {
    // We know this data only one time after selecting users
    $Form->info(T_('Number of accounts in filterset'), $users_numbers['all']);
    $Form->info(T_('Number of active accounts in filterset'), $users_numbers['active']);
}
$Form->info(T_('Currently selected recipients'), $edited_EmailCampaign->get_users_count(), '(' . T_('Accounts which accept newsletter emails') . ') - <a href="' . $admin_url . '?ctrl=campaigns&amp;action=change_users&amp;ecmp_ID=' . $edited_EmailCampaign->ID . '">' . T_('Change selection') . ' &gt;&gt;</a>');
$Form->info(T_('Already received'), $edited_EmailCampaign->get_users_count('accept'), '(' . T_('Accounts which have already been sent this newsletter') . ')');
$Form->info(T_('Ready to send'), $edited_EmailCampaign->get_users_count('wait'), '(' . T_('Accounts which have not been sent this newsletter yet') . ')');
$Form->end_fieldset();
示例#20
0
if (isset($edited_Skin->version)) {
    // Skin version
    echo '<div class="skin_setting_row">';
    echo '<label>' . T_('Skin version') . ':</label>';
    echo '<span>' . $edited_Skin->version . '</span>';
    echo '</div>';
}
// Skin type
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Skin type') . ':</label>';
echo '<span>' . $edited_Skin->type . '</span>';
echo '</div>';
// Containers
if ($skin_containers = $edited_Skin->get_containers()) {
    $container_ul = '<ul><li>' . implode('</li><li>', $skin_containers) . '</li></ul>';
} else {
    $container_ul = '-';
}
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Containers') . ':</label>';
echo '<span>' . $container_ul . '</span>';
echo '</div>';
echo '</div>';
echo '<div class="skin_settings_form">';
$Form->begin_fieldset(T_('System Settings for this skin') . get_manual_link('skin-system-settings'));
$Form->text_input('skin_name', $edited_Skin->name, 32, T_('Skin name'), T_('As seen by blog owners'), array('required' => true));
$Form->radio('skin_type', $edited_Skin->type, array(array('normal', T_('Normal'), T_('Normal skin for general browsing')), array('mobile', T_('Mobile'), T_('Mobile skin for mobile phones browsers')), array('tablet', T_('Tablet'), T_('Tablet skin for tablet browsers')), array('feed', T_('XML Feed'), T_('Special system skin for XML feeds like RSS and Atom')), array('sitemap', T_('XML Sitemap'), T_('Special system skin for XML sitemaps'))), T_('Skin type'), true);
$Form->end_fieldset();
echo '</div>';
$Form->end_fieldset();
$Form->end_form(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton')));
示例#21
0
/**
 * Display a blog skin setting fieldset which can be normal, mobile or tablet ( used on _coll_skin_settings.form.php )
 *
 * @param object Form
 * @param integer skin ID
 * @param array display params
 */
function display_skin_fieldset(&$Form, $skin_ID, $display_params)
{
    $Form->begin_fieldset($display_params['fieldset_title'] . get_manual_link('blog_skin_settings') . ' ' . $display_params['fieldset_links']);
    if (!$skin_ID) {
        // The skin ID is empty use the same as normal skin ID
        echo '<div style="font-weight:bold;padding:0.5ex;">' . T_('Same as normal skin.') . '</div>';
    } else {
        $SkinCache =& get_SkinCache();
        $edited_Skin = $SkinCache->get_by_ID($skin_ID);
        echo '<div class="skin_settings well">';
        $disp_params = array('skinshot_class' => 'coll_settings_skinshot');
        Skin::disp_skinshot($edited_Skin->folder, $edited_Skin->name, $disp_params);
        // Skin name
        echo '<div class="skin_setting_row">';
        echo '<label>' . T_('Skin name') . ':</label>';
        echo '<span>' . $edited_Skin->name . '</span>';
        echo '</div>';
        if (isset($edited_Skin->version)) {
            // Skin version
            echo '<div class="skin_setting_row">';
            echo '<label>' . T_('Skin version') . ':</label>';
            echo '<span>' . $edited_Skin->version . '</span>';
            echo '</div>';
        }
        // Skin type
        echo '<div class="skin_setting_row">';
        echo '<label>' . T_('Skin type') . ':</label>';
        echo '<span>' . $edited_Skin->type . '</span>';
        echo '</div>';
        // Containers
        if ($skin_containers = $edited_Skin->get_containers()) {
            $container_ul = '<ul><li>' . implode('</li><li>', $skin_containers) . '</li></ul>';
        } else {
            $container_ul = '-';
        }
        echo '<div class="skin_setting_row">';
        echo '<label>' . T_('Containers') . ':</label>';
        echo '<span>' . $container_ul . '</span>';
        echo '</div>';
        echo '</div>';
        echo '<div class="skin_settings_form">';
        $skin_params = $edited_Skin->get_param_definitions($tmp_params = array('for_editing' => true));
        if (empty($skin_params)) {
            // Advertise this feature!!
            echo '<p>' . T_('This skin does not provide any configurable settings.') . '</p>';
        } else {
            load_funcs('plugins/_plugin.funcs.php');
            // Check if skin settings contain at least one fieldset
            $skin_fieldsets_exist = false;
            foreach ($skin_params as $l_name => $l_meta) {
                if (isset($l_meta['layout']) && $l_meta['layout'] == 'begin_fieldset') {
                    $skin_fieldsets_exist = true;
                    break;
                }
            }
            if (!$skin_fieldsets_exist) {
                // Enclose all skin settings in single group if no group on the skin
                array_unshift($skin_params, array('layout' => 'begin_fieldset', 'label' => T_('Skin settings')));
                array_push($skin_params, array('layout' => 'end_fieldset'));
            }
            // Loop through all widget params:
            foreach ($skin_params as $l_name => $l_meta) {
                // Display field:
                autoform_display_field($l_name, $l_meta, $Form, 'Skin', $edited_Skin);
            }
        }
        echo '</div>';
    }
    $Form->end_fieldset();
}
示例#22
0
/**
 * Get an error message text about file permissions
 */
function get_file_permissions_message()
{
    return sprintf(T_('(Please check UNIX file permissions on the parent folder. %s)'), get_manual_link('file-permissions'));
}
示例#23
0
    $group_filtered_SQL->WHERE('cgr_ID = ' . $DB->quote($g));
    $group_filtered_SQL->WHERE_and('cgr_user_ID = ' . $current_User->ID);
    $group_filtered_SQL->GROUP_BY('cgr_ID');
    $group_filtered = $DB->get_row($group_filtered_SQL->get());
}
// Create result set:
if ($Settings->get('allow_avatars')) {
    $default_order = '--A';
} else {
    $default_order = '-A';
}
$Results = new Results($select_SQL->get(), 'mct_', $default_order, NULL, $count_SQL->get());
$Results->title = T_('Contacts list');
if (is_admin_page()) {
    // Set an url for manual page:
    $Results->title .= get_manual_link('contacts-list');
}
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_contacts(&$Form)
{
    global $item_ID;
    $Form->text('s', get_param('s'), 30, T_('Search'), '', 255);
    $Form->select_input('g', get_param('g'), 'get_contacts_groups_options', T_('Group'));
    if ($item_ID > 0) {
        // Save item ID for the filter request
        $Form->hidden('item_ID', $item_ID);
    }
示例#24
0
$Form->global_icon($delete_title, 'recycle', $delete_url, $delete_text, 4, 3, $link_attribs);
$Form->global_icon(T_('Cancel editing!'), 'close', str_replace('&', '&amp;', $redirect_to), T_('cancel'), 4, 1);
$Form->begin_form('eform');
$Form->add_crumb('comment');
$Form->hidden('ctrl', 'comments');
$Form->hidden('redirect_to', $redirect_to);
$Form->hidden('comment_ID', $edited_Comment->ID);
?>

<div class="row">

<div class="left_col col-md-9">


	<?php 
$Form->begin_fieldset(T_('Comment contents') . get_manual_link('editing-comments'));
echo '<table cellspacing="0" class="compose_layout" align="center">';
echo '<tr><td width="1%"><strong>' . T_('In response to') . ':</strong></td>';
echo '<td>';
$comment_Item =& $edited_Comment->get_Item();
$comment_Item->title(array('link_type' => 'admin_view', 'max_length' => '30'));
echo '</td>';
$Blog_owner_User =& $Blog->get_owner_User();
if ($Blog_owner_User->ID == $current_User->ID || $current_User->check_perm('blog_admin', 'edit', false, $Blog->ID)) {
    // User has prmission to change comment's post, because user is the owner of the current blog, or user has admin full access permission for current blog
    $Form->switch_layout('none');
    // Move to another post
    echo '<td width="1%">&nbsp;&nbsp;<strong>' . T_('Move to post ID') . ':</strong></td>';
    echo '<td class="input">';
    $Form->text_input('moveto_post', $comment_Item->ID, 20, '', '', array('maxlength' => 100, 'style' => 'width:25%;'));
    echo '</td>';
示例#25
0
if ($r > 0) {
    // Filter by region:
    $sql_where[] = 'rgn_ID = "' . $DB->escape($r) . '"';
}
if ($sr > 0) {
    // Filter by sub-region:
    $sql_where[] = 'subrg_ID = "' . $DB->escape($sr) . '"';
}
if (count($sql_where) > 0) {
    // Some filters are applied
    $SQL->WHERE(implode(' AND ', $sql_where));
}
// Create result set:
//echo $SQL->get();
$Results = new Results($SQL->get(), 'city_', '-----A');
$Results->title = T_('Cities') . get_manual_link('countries_list');
/*
 * STATUS TD:
 */
function city_td_enabled($city_enabled, $city_ID)
{
    global $dispatcher;
    $r = '';
    if ($city_enabled == true) {
        $r .= action_icon(T_('Disable the city!'), 'bullet_full', regenerate_url('action', 'action=disable_city&amp;city_ID=' . $city_ID . '&amp;' . url_crumb('city')));
    } else {
        $r .= action_icon(T_('Enable the city!'), 'bullet_empty', regenerate_url('action', 'action=enable_city&amp;city_ID=' . $city_ID . '&amp;' . url_crumb('city')));
    }
    return $r;
}
function city_td_preferred($city_preferred, $city_ID)
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var Slug
 */
global $edited_IPRange;
// Determine if we are creating or updating...
global $action;
$creating = $action == 'iprange_new';
$Form = new Form(NULL, 'iprange_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,iprange_ID'));
$Form->begin_form('fform', ($creating ? T_('New IP Range') : T_('IP Range')) . get_manual_link('ip-range-editing'));
$Form->add_crumb('iprange');
$Form->hidden('action', $creating ? 'iprange_create' : 'iprange_update');
$Form->hidden_ctrl();
$Form->hidden('tab', get_param('tab'));
$Form->hidden('tab3', get_param('tab3'));
$Form->hidden('iprange_ID', param('iprange_ID', 'integer', 0));
$Form->select_input_array('aipr_status', $edited_IPRange->get('status'), aipr_status_titles(), T_('Status'), '', array('force_keys_as_values' => true, 'background_color' => aipr_status_colors(), 'required' => true));
$Form->text_input('aipr_IPv4start', int2ip($edited_IPRange->get('IPv4start')), 50, T_('IP Range Start'), '', array('maxlength' => 15, 'required' => true));
$Form->text_input('aipr_IPv4end', int2ip($edited_IPRange->get('IPv4end')), 50, T_('IP Range End'), '', array('maxlength' => 15, 'required' => true));
$Form->date_input('aipr_IP_timestamp', date2mysql($edited_IPRange->IP_timestamp), T_('Date'), array('required' => true));
$Form->info(T_('User count'), (int) $edited_IPRange->get('user_count'));
$Form->info(T_('Block count'), (int) $edited_IPRange->get('block_count'));
$Form->end_form(array(array('submit', 'submit', $creating ? T_('Record') : T_('Save Changes!'), 'SaveButton')));
示例#27
0
$Form->begin_form('fform', $creating ? T_('New scheduled job') : T_('Edit scheduled job'));
$Form->add_crumb('crontask');
$Form->hiddens_by_key(get_memorized('action'));
$Form->hidden('action', $creating ? 'create' : 'update');
$Form->begin_fieldset(T_('Job details') . get_manual_link('scheduled-job-form'));
if ($creating && $action != 'copy') {
    // New cronjob
    $cron_jobs_names = get_cron_jobs_config('name');
    // Exclude these cron jobs from manual creating
    unset($cron_jobs_names['send-post-notifications']);
    unset($cron_jobs_names['send-comment-notifications']);
    $Form->select_input_array('cjob_type', get_param('cjob_type'), $cron_jobs_names, T_('Job type'));
} else {
    // Edit cronjob
    if ($action == 'edit') {
        $Form->info(T_('Job #'), $edited_Cronjob->ID);
    }
    $Form->info(T_('Default job name'), cron_job_name($edited_Cronjob->key, '', $edited_Cronjob->params));
    $Form->text_input('cjob_name', $edited_Cronjob->name, 50, T_('Job name'), '', array('maxlength' => 255));
}
$Form->date_input('cjob_date', date2mysql($edited_Cronjob->start_timestamp), T_('Schedule date'), array('required' => true));
$Form->time_input('cjob_time', date2mysql($edited_Cronjob->start_timestamp), T_('Schedule time'), array('required' => true));
$Form->duration_input('cjob_repeat_after', $edited_Cronjob->repeat_after, T_('Repeat every'), 'days', 'minutes', array('minutes_step' => 1));
$Form->end_fieldset();
if (!$creating) {
    // We can edit only pending cron jobs, Show this field just for info
    $Form->begin_fieldset(T_('Execution details') . get_manual_link('scheduled-job-execution-details'));
    $Form->info(T_('Status'), 'pending');
    $Form->end_fieldset();
}
$Form->end_form(array(array('submit', 'submit', $creating ? T_('Create') : T_('Save Changes!'), 'SaveButton')));
示例#28
0
/**
 * Get the manual page link for the requested cron job, given by the key
 *
 * @param string job key
 * @return string Link to manual page of cron job task
 */
function cron_job_manual_link($job_key)
{
    $help_config = get_cron_jobs_config('help', $job_key);
    if (empty($help_config)) {
        // There was no 'help' topic defined for this job
        return '';
    }
    if ($help_config == '#') {
        // The 'help' topic is set to '#', use the default 'task-' + job_key
        return get_manual_link('task-' . $job_key);
    }
    if (is_url($help_config)) {
        // This cron job help topic is an url
        return action_icon(T_('Open relevant page in online manual'), 'manual', $help_config, T_('Manual'), 5, 1, array('target' => '_blank', 'style' => 'vertical-align:top'));
    }
    return get_manual_link($help_config);
}
示例#29
0
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
// Create result set:
$SQL = new SQL();
$SQL->SELECT('T_skins__skin.*, COUNT( DISTINCT( cset_coll_ID ) ) AS nb_blogs');
$SQL->FROM('T_skins__skin LEFT JOIN T_coll_settings ON skin_ID = cset_value AND
			( cset_name = "normal_skin_ID" OR cset_name = "mobile_skin_ID" OR cset_name = "tablet_skin_ID" )');
$SQL->GROUP_BY('skin_ID');
$CountSQL = new SQL();
$CountSQL->SELECT('COUNT( * )');
$CountSQL->FROM('T_skins__skin');
$Results = new Results($SQL->get(), 'skin_', '', NULL, $CountSQL->get());
$Results->Cache =& get_SkinCache();
$Results->title = T_('Installed skins') . get_manual_link('installed_skins');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'skin_name', 'td' => '<strong><a href="' . regenerate_url('', 'skin_ID=$skin_ID$&amp;action=edit') . '" title="' . TS_('Edit skin properties...') . '">$skin_name$</a></strong>');
} else {
    // We have NO permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'skin_name', 'td' => '<strong>$skin_name$</strong>');
}
$Results->cols[] = array('th' => T_('Skin type'), 'order' => 'skin_type', 'td_class' => 'center', 'td' => '$skin_type$');
$Results->cols[] = array('th' => T_('Blogs'), 'order' => 'nb_blogs', 'th_class' => 'shrinkwrap', 'td_class' => 'center', 'td' => '~conditional( (#nb_blogs# > 0), #nb_blogs#, \'&nbsp;\' )~');
$Results->cols[] = array('th' => T_('Skin Folder'), 'order' => 'skin_folder', 'td' => '$skin_folder$');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => action_icon(TS_('Edit skin properties...'), 'properties', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=edit\')%') . action_icon(TS_('Reload containers!'), 'reload', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=reload&amp;' . url_crumb('skin') . '\')%') . '~conditional( #nb_blogs# < 1, \'' . action_icon(TS_('Uninstall this skin!'), 'delete', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=delete&amp;' . url_crumb('skin') . '\')%') . '\', \'' . get_icon('delete', 'noimg') . '\' )~');
    $Results->global_icon(T_('Install new skin...'), 'new', regenerate_url('action,blog', 'action=new'), T_('Install new'), 3, 4);
}
示例#30
0
if (!empty($s)) {
    // We want to filter on search keyword:
    // Note: we use CONCAT_WS (Concat With Separator) because CONCAT returns NULL if any arg is NULL
    $sql_where[] = 'CONCAT_WS( " ", rgn_code, rgn_name ) LIKE "%' . $DB->escape($s) . '%"';
}
if ($c > 0) {
    // We want to filter on search country:
    $sql_where[] = 'rgn_ctry_ID = "' . $DB->escape($c) . '"';
}
if (count($sql_where) > 0) {
    // Some filters are applied
    $SQL->WHERE(implode(' AND ', $sql_where));
}
// Create result set:
$Results = new Results($SQL->get(), 'rgn_', '----A');
$Results->title = T_('Regions/States') . get_manual_link('countries_list');
/*
 * STATUS TD:
 */
function rgn_td_enabled($rgn_enabled, $rgn_ID)
{
    global $dispatcher;
    $r = '';
    if ($rgn_enabled == true) {
        $r .= action_icon(T_('Disable the region!'), 'bullet_full', regenerate_url('action', 'action=disable_region&amp;rgn_ID=' . $rgn_ID . '&amp;' . url_crumb('region')));
    } else {
        $r .= action_icon(T_('Enable the region!'), 'bullet_empty', regenerate_url('action', 'action=enable_region&amp;rgn_ID=' . $rgn_ID . '&amp;' . url_crumb('region')));
    }
    return $r;
}
function rgn_td_preferred($rgn_preferred, $rgn_ID)