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


PHP go_return_options函数代码示例

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


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

示例1: go_register_task_tax_and_cpt

function go_register_task_tax_and_cpt()
{
    /*
     * Task Category Taxonomy
     */
    $task_cat_labels = array('name' => _x(go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'singular_name' => _x(go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'search_items' => _x('Search ' . go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'popular_items' => _x('Popular ' . go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'all_items' => _x('All ' . go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'parent_item' => _x(go_return_options('go_tasks_name') . ' Category Parent', 'task_categories'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_tasks_name') . ' Category:', 'task_categories'), 'edit_item' => _x('Edit ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'update_item' => _x('Update ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'add_new_item' => _x('Add New ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'new_item_name' => _x('New ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_tasks_name') . ' categories with commas', 'task_categories'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_tasks_name') . ' categories', 'task_categories'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_tasks_name') . ' categories', 'task_categories'), 'menu_name' => _x(go_return_options('go_tasks_name') . ' Categories', 'task_categories'));
    $task_cat_args = array('labels' => $task_cat_labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_categories', array('tasks'), $task_cat_args);
    /*
     * Task Focus Categories Taxonomy
     */
    $focus_labels = array('name' => _x(go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'singular_name' => _x(go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'search_items' => _x('Search ' . go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'popular_items' => _x('Popular ' . go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'all_items' => _x('All ' . go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'parent_item' => _x(go_return_options('go_focus_name') . ' Category Parent', 'task_focus_categories'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_focus_name') . ' Category:', 'task_focus_categories'), 'edit_item' => _x('Edit ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'update_item' => _x('Update ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'add_new_item' => _x('Add New ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'new_item_name' => _x('New ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_focus_name') . ' categories with commas', 'task_focus_categories'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_focus_name') . ' categories', 'task_focus_categories'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_focus_name') . ' categories', 'task_focus_categories'), 'menu_name' => _x(go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'));
    $focus_args = array('labels' => $focus_labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_focus_categories', array('tasks'), $focus_args);
    /*
     * Task Chains Taxonomy
     */
    $task_chains_labels = array('name' => _x(go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'singular_name' => _x(go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'search_items' => _x('Search ' . go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'popular_items' => _x('Popular ' . go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'all_items' => _x('All ' . go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'parent_item' => _x(go_return_options('go_tasks_name') . ' Chain Parent', 'task_chains'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_tasks_name') . ' Chain:', 'task_chains'), 'edit_item' => _x('Edit ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'update_item' => _x('Update ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'add_new_item' => _x('Add New ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'new_item_name' => _x('New ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_tasks_name') . ' chains with commas', 'task_chains'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_tasks_name') . ' chains', 'task_chains'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_tasks_name') . ' chains', 'task_chains'), 'menu_name' => _x(go_return_options('go_tasks_name') . ' Chains', 'task_chains'));
    $task_chains_args = array('labels' => $task_chains_labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_chains', array('tasks'), $task_chains_args);
    /*
     * Task Pods Taxonomy
     */
    $task_pods_labels = array('name' => _x(go_return_options('go_tasks_name') . ' Pods', 'task_pods'), 'singular_name' => _x(go_return_options('go_tasks_name') . ' Pod', 'task_pods'), 'search_items' => _x('Search ' . go_return_options('go_tasks_name') . ' Pods', 'task_pods'), 'popular_items' => _x('Popular ' . go_return_options('go_tasks_name') . ' Pods', 'task_pods'), 'all_items' => _x('All ' . go_return_options('go_tasks_name') . ' Pods', 'task_pods'), 'parent_item' => _x(go_return_options('go_tasks_name') . ' Pod Parent', 'task_pods'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_tasks_name') . ' Pod:', 'task_pods'), 'edit_item' => _x('Edit ' . go_return_options('go_tasks_name') . ' Pod', 'task_pods'), 'update_item' => _x('Update ' . go_return_options('go_tasks_name') . ' Pod', 'task_pods'), 'add_new_item' => _x('Add New ' . go_return_options('go_tasks_name') . ' Pod', 'task_pods'), 'new_item_name' => _x('New ' . go_return_options('go_tasks_name') . ' Pod', 'task_pods'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_tasks_name') . ' pods with commas', 'task_pods'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_tasks_name') . ' pods', 'task_pods'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_tasks_name') . ' pods', 'task_pods'), 'menu_name' => _x(go_return_options('go_tasks_name') . ' Pods', 'task_pods'));
    $task_pods_args = array('labels' => $task_pods_labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_pods', array('tasks'), $task_pods_args);
    /*
     * Task Custom Post Type
     */
    $labels_cpt = array('name' => _x(go_return_options('go_tasks_plural_name'), 'task'), 'singular_name' => _x(go_return_options('go_tasks_name'), 'task'), 'add_new' => _x('Add New ' . go_return_options('go_tasks_name'), 'task'), 'add_new_item' => _x('Add New ' . go_return_options('go_tasks_name'), 'task'), 'edit_item' => _x('Edit ' . go_return_options('go_tasks_name'), 'task'), 'new_item' => _x('New ' . go_return_options('go_tasks_name'), 'task'), 'view_item' => _x('View ' . go_return_options('go_tasks_name'), 'task'), 'search_items' => _x('Search ' . go_return_options('go_tasks_plural_name'), 'task'), 'not_found' => _x('No ' . go_return_options('go_tasks_plural_name') . ' found', 'task'), 'not_found_in_trash' => _x('No ' . go_return_options('go_tasks_plural_name') . ' found in Trash', 'task'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_tasks_name') . ':', 'task'), 'menu_name' => _x(go_return_options('go_tasks_plural_name'), 'task'));
    $args_cpt = array('labels' => $labels_cpt, 'hierarchical' => false, 'description' => go_return_options('go_tasks_plural_name'), 'supports' => array('title', 'publicize', 'thumbnail', 'custom-fields', 'revisions', 'page-attributes', 'comments'), 'taxonomies' => array('task_categories', 'post_tag', 'task_focus_categories'), 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 20, 'menu_icon' => plugins_url('images/ico.png', __FILE__), 'show_in_nav_menus' => true, 'exclude_from_search' => false, 'has_archive' => true, 'query_var' => true, 'can_export' => true, 'rewrite' => true, 'capability_type' => 'post');
    register_post_type('tasks', $args_cpt);
}
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:33,代码来源:task.php

示例2: register_taxonomy_task_categories

function register_taxonomy_task_categories()
{
    $labels = array('name' => _x(go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'singular_name' => _x(go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'search_items' => _x('Search ' . go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'popular_items' => _x('Popular ' . go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'all_items' => _x('All ' . go_return_options('go_tasks_name') . ' Categories', 'task_categories'), 'parent_item' => _x(go_return_options('go_tasks_name') . ' Category Parent', 'task_categories'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_tasks_name') . ' Category:', 'task_categories'), 'edit_item' => _x('Edit ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'update_item' => _x('Update ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'add_new_item' => _x('Add New ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'new_item_name' => _x('New ' . go_return_options('go_tasks_name') . ' Category', 'task_categories'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_tasks_name') . ' categories with commas', 'task_categories'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_tasks_name') . ' categories', 'task_categories'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_tasks_name') . ' categories', 'task_categories'), 'menu_name' => _x(go_return_options('go_tasks_name') . ' Categories', 'task_categories'));
    $args = array('labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_categories', array('tasks'), $args);
    $labels_focus = array('name' => _x(go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'singular_name' => _x(go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'search_items' => _x('Search ' . go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'popular_items' => _x('Popular ' . go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'all_items' => _x('All ' . go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'), 'parent_item' => _x(go_return_options('go_focus_name') . ' Category Parent', 'task_focus_categories'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_focus_name') . ' Category:', 'task_focus_categories'), 'edit_item' => _x('Edit ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'update_item' => _x('Update ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'add_new_item' => _x('Add New ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'new_item_name' => _x('New ' . go_return_options('go_focus_name') . ' Category', 'task_focus_categories'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_focus_name') . ' categories with commas', 'task_focus_categories'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_focus_name') . ' categories', 'task_focus_categories'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_focus_name') . ' categories', 'task_focus_categories'), 'menu_name' => _x(go_return_options('go_focus_name') . ' Categories', 'task_focus_categories'));
    $args_focus = array('labels' => $labels_focus, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_focus_categories', array('tasks'), $args_focus);
    $labels_task_chains = array('name' => _x(go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'singular_name' => _x(go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'search_items' => _x('Search ' . go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'popular_items' => _x('Popular ' . go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'all_items' => _x('All ' . go_return_options('go_tasks_name') . ' Chains', 'task_chains'), 'parent_item' => _x(go_return_options('go_tasks_name') . ' Chain Parent', 'task_chains'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_tasks_name') . ' Chain:', 'task_chains'), 'edit_item' => _x('Edit ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'update_item' => _x('Update ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'add_new_item' => _x('Add New ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'new_item_name' => _x('New ' . go_return_options('go_tasks_name') . ' Chain', 'task_chains'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_tasks_name') . ' chains with commas', 'task_chains'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_tasks_name') . ' chains', 'task_chains'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_tasks_name') . ' chains', 'task_chains'), 'menu_name' => _x(go_return_options('go_tasks_name') . ' Chains', 'task_chains'));
    $args_task_chains = array('labels' => $labels_task_chains, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('task_chains', array('tasks'), $args_task_chains);
}
开发者ID:SpencerNussbaum,项目名称:game-on,代码行数:12,代码来源:task.php

示例3: go_jquery_clipboard

function go_jquery_clipboard()
{
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-tabs');
    wp_enqueue_script('jquery-ui-accordion');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-sortable');
    wp_enqueue_script('jquery.dataTables.min.js', plugin_dir_url(__FILE__) . 'jquery.dataTables.min.js');
    wp_enqueue_script('go_jquery_clipboard', plugin_dir_url(__FILE__) . 'go_clipboard.js');
    wp_enqueue_script('go_jquery_clipboard_tablesorter', plugin_dir_url(__FILE__) . 'sorttable.js');
    wp_localize_script('go_jquery_clipboard', 'MyAjax', array('ajaxurl' => admin_url('admin-ajax.php')));
    wp_localize_script('go_jquery_clipboard', 'Minutes_limit', array('limit' => go_return_options('go_minutes_color_limit')));
}
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:13,代码来源:go_enque.php

示例4: go_display_user_focuses

function go_display_user_focuses($user_id)
{
    if (get_user_meta($user_id, 'go_focus', true)) {
        if (!is_array(get_user_meta($user_id, 'go_focus', true))) {
            $value = get_user_meta($user_id, 'go_focus', true);
        } else {
            $value = implode(', ', get_user_meta($user_id, 'go_focus', true));
        }
    } else {
        $value = 'No ' . go_return_options('go_focus_name');
    }
    return $value;
}
开发者ID:SpencerNussbaum,项目名称:game-on,代码行数:13,代码来源:go_returns.php

示例5: go_register_store_tax_and_cpt

function go_register_store_tax_and_cpt()
{
    /*
     * Store Types Taxonomy
     */
    $labels = array('name' => _x(get_option('go_store_name') . ' Categories', 'taxonomy general name'), 'singular_name' => _x(get_option('go_store_name') . ' Item Category', 'taxonomy singular name'), 'search_items' => __('Search ' . get_option('go_store_name') . ' Categories'), 'all_items' => __('All ' . get_option('go_store_name') . ' Categories'), 'parent_item' => __('Parent ' . get_option('go_store_name') . ' Categories'), 'parent_item_colon' => __('Parent ' . get_option('go_store_name') . ' Category:'), 'edit_item' => __('Edit ' . get_option('go_store_name') . ' Category'), 'update_item' => __('Update ' . get_option('go_store_name') . ' Category'), 'add_new_item' => __('Add New ' . get_option('go_store_name') . ' Category'), 'new_item_name' => __('New ' . get_option('go_store_name') . ' Category'));
    register_taxonomy('store_types', array('jobs'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'show_in_nav_menus' => true, 'rewrite' => array('slug' => 'store-types', 'with_front' => false)));
    /*
     * Store Focus Category Taxonomy
     */
    $labels_focus = array('name' => _x(go_return_options('go_focus_name') . ' Categories', 'store_focus_categories'), 'singular_name' => _x(go_return_options('go_focus_name') . ' Category', 'store_focus_categories'), 'search_items' => _x('Search ' . go_return_options('go_focus_name') . ' Categories', 'store_focus_categories'), 'popular_items' => _x('Popular ' . go_return_options('go_focus_name') . ' Categories', 'store_focus_categories'), 'all_items' => _x('All ' . go_return_options('go_focus_name') . ' Categories', 'store_focus_categories'), 'parent_item' => _x(go_return_options('go_focus_name') . ' Category Parent', 'store_focus_categories'), 'parent_item_colon' => _x('Parent ' . go_return_options('go_focus_name') . ' Category:', 'store_focus_categories'), 'edit_item' => _x('Edit ' . go_return_options('go_focus_name') . ' Category', 'store_focus_categories'), 'update_item' => _x('Update ' . go_return_options('go_focus_name') . ' Category', 'store_focus_categories'), 'add_new_item' => _x('Add New ' . go_return_options('go_focus_name') . ' Category', 'store_focus_categories'), 'new_item_name' => _x('New ' . go_return_options('go_focus_name') . ' Category', 'store_focus_categories'), 'separate_items_with_commas' => _x('Separate ' . go_return_options('go_focus_name') . ' categories with commas', 'store_focus_categories'), 'add_or_remove_items' => _x('Add or remove ' . go_return_options('go_focus_name') . ' categories', 'store_focus_categories'), 'choose_from_most_used' => _x('Choose from the most used ' . go_return_options('go_focus_name') . ' categories', 'store_focus_categories'), 'menu_name' => _x(go_return_options('go_focus_name') . ' Categories', 'store_focus_categories'));
    $args_focus = array('labels' => $labels_focus, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true);
    register_taxonomy('store_focus_categories', array('go_store'), $args_focus);
    /*
     * Store Custom Post Type
     */
    register_post_type('go_store', array('labels' => array('name' => __(get_option('go_store_name')), 'menu_name' => __(get_option('go_store_name')), 'singular_name' => __(get_option('go_store_name') . ' Item'), 'add_new' => __('New ' . get_option('go_store_name') . ' Item'), 'add_new_item' => __('New ' . get_option('go_store_name') . ' Item'), 'edit' => __('Edit ' . get_option('go_store_name') . ' Items'), 'edit_item' => __('Edit ' . get_option('go_store_name') . ' Items'), 'new_item' => __('New ' . get_option('go_store_name') . ' Item'), 'view' => __('View Items'), 'view_item' => __('View ' . get_option('go_store_name') . ' Items'), 'search_items' => __('Search ' . get_option('go_store_name') . ' Items'), 'not_found' => __('No ' . get_option('go_store_name') . ' Items found'), 'not_found_in_trash' => __('No ' . get_option('go_store_name') . ' Items found in Trash'), 'parent' => 'Parent Store Item'), 'taxonomies' => array('store_types'), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'store'), 'menu_icon' => plugins_url('/images/little-ico.png', __FILE__), 'hierachical' => true, 'menu_position' => 21, 'supports' => array('title', 'thumbnail', 'excerpt', 'page-attributes', 'editor', 'custom-fields', 'revisions', 'comments')));
}
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:18,代码来源:super-store.php

示例6: go_jquery_clipboard

function go_jquery_clipboard()
{
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-tabs');
    wp_enqueue_script('jquery-ui-accordion');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-sortable');
    wp_enqueue_script('go_excanvas', plugin_dir_url(__FILE__) . '/flot/excanvas.min.js');
    wp_enqueue_script('go_flot', plugin_dir_url(__FILE__) . '/flot/jquery.flot.min.js');
    wp_enqueue_script('go_flot_time', plugin_dir_url(__FILE__) . '/flot/jquery.flot.time.min.js');
    wp_enqueue_script('go_flot_selection', plugin_dir_url(__FILE__) . '/flot/jquery.flot.selection.min.js');
    wp_enqueue_script('go_flot_resize', plugin_dir_url(__FILE__) . '/flot/jquery.flot.resize.min.js');
    wp_enqueue_script('go_flot_navigate', plugin_dir_url(__FILE__) . '/flot/jquery.flot.navigate.min.js');
    wp_enqueue_script('go_flot_threshold', plugin_dir_url(__FILE__) . '/flot/jquery.flot.threshold.min.js');
    wp_enqueue_script('go_jquery_clipboard', plugin_dir_url(__FILE__) . 'go_clipboard.js');
    wp_enqueue_script('go_jquery_clipboard_tablesorter', plugin_dir_url(__FILE__) . 'sorttable.js');
    wp_localize_script('go_jquery_clipboard', 'MyAjax', array('ajaxurl' => admin_url('admin-ajax.php')));
    wp_localize_script('go_jquery_clipboard', 'Minutes_limit', array('limit' => go_return_options('go_minutes_color_limit')));
}
开发者ID:SpencerNussbaum,项目名称:game-on,代码行数:19,代码来源:go_enque.php

示例7: go_display_rewards

function go_display_rewards($points_array, $currency_array, $number_of_stages)
{
    echo '<div class="go_task_rewards" style="margin: 6px 0px 6px 0px;"><strong>Rewards</strong><br/>';
    for ($i = 0; $i < $number_of_stages; $i++) {
        if ($points_array[$i] == 0) {
            $points_array[$i] = '';
            $points_name = '';
        } else {
            $points_name = go_return_options('go_points_name');
        }
        if ($currency_array[$i] == 0) {
            $currency_array[$i] = '';
            $currency_name = '';
        } else {
            $currency_name = go_return_options('go_currency_name');
        }
        switch ($i) {
            case 0:
                echo go_return_options('go_first_stage_name') . ' - ' . $points_array[$i] . ' ' . $points_name . ' ' . $currency_array[$i] . ' ' . $currency_name . '<br/>';
                break;
            case 1:
                echo go_return_options('go_second_stage_name') . ' - ' . $points_array[$i] . ' ' . $points_name . ' ' . $currency_array[$i] . ' ' . $currency_name . '<br/>';
                break;
            case 2:
                echo go_return_options('go_third_stage_name') . ' - ' . $points_array[$i] . ' ' . $points_name . ' ' . $currency_array[$i] . ' ' . $currency_name . '<br/>';
                break;
            case 3:
                echo go_return_options('go_fourth_stage_name') . ' - ' . $points_array[$i] . ' ' . $points_name . ' ' . $currency_array[$i] . ' ' . $currency_name . '<br/>';
                break;
        }
    }
    echo '</div>';
}
开发者ID:zetheroth,项目名称:game-on,代码行数:33,代码来源:task_shortcode.php

示例8: go_task_pods

function go_task_pods()
{
    if (!empty($_GET['settings-updated']) && ($_GET['settings-updated'] === true || $_GET['settings-updated'] === 'true')) {
        echo "\n\t\t <script type='text/javascript'>\n\t\t\twindow.location = '" . esc_url(admin_url()) . "admin.php?page=go_pods'\n\t\t </script>";
    }
    $post_custom = get_post_custom(get_the_id());
    $pods_options = get_option('go_task_pod_globals');
    $pods_array = array();
    $args = array('pad_counts' => 1, 'taxonomy' => 'task_pods');
    ?>
	<div class="wrap go_wrap">
		<h2>Pods</h2><?php 
    go_options_help('http://maclab.guhsd.net/go/video/pods.mp4', 'Group ' . go_return_options('go_tasks_plural_name') . ' into pods where user must complete a designated amount of ' . go_return_options('go_tasks_plural_name') . ' to continue.', true);
    ?>
		<form method="post" action="options.php" id="go_pod_form">
			<?php 
    wp_nonce_field('update-options');
    foreach (get_categories($args) as $category) {
        $pods_array[] = $category;
    }
    foreach ($pods_array as $pod_category) {
        $link = get_category_link($pod_category);
        $slug = $pod_category->slug;
        $total = $pod_category->count;
        $name = $pod_category->name;
        echo "<span class='go_pod_list_item' id='go_pod_span_{$slug}'><b><a href='" . (!empty($pods_options[$slug]['go_pod_link']) ? $pods_options[$slug]['go_pod_link'] : '#') . "'>" . $pod_category->name . "</a></b>";
        ?>
				<br/>
				<input type='text' id='go_pod_link[<?php 
        echo $slug;
        ?>
]' name='go_task_pod_globals[<?php 
        echo $slug;
        ?>
][go_pod_link]' 
					value='<?php 
        echo !empty($pods_options[$slug]['go_pod_link']) ? $pods_options[$slug]['go_pod_link'] : '';
        ?>
' placeholder='Link to Pod Page'/><br/>
				Must Complete 
				<select id='go_pod_stage_select[<?php 
        echo $slug;
        ?>
]' name='go_task_pod_globals[<?php 
        echo $slug;
        ?>
][go_pod_stage_select]'>
					<option <?php 
        echo !empty($pods_options[$slug]['go_pod_stage_select']) && 'third_stage' == $pods_options[$slug]['go_pod_stage_select'] ? 'selected' : '';
        ?>
 
						value='third_stage'>Stage 3</option>
					<option <?php 
        echo !empty($pods_options[$slug]['go_pod_stage_select']) && 'fourth_stage' == $pods_options[$slug]['go_pod_stage_select'] ? 'selected' : '';
        ?>
 
						value='fourth_stage'>Stage 4</option>
				</select> 
				of 
				<input type='number' id='go_pod_number[ <?php 
        echo $slug;
        ?>
 ]' name='go_task_pod_globals[<?php 
        echo $slug;
        ?>
][go_pod_number]' 
					value='<?php 
        echo isset($pods_options[$slug]['go_pod_number']) ? $pods_options[$slug]['go_pod_number'] : 1;
        ?>
' style='width : 45px;' 
					min='0' max='<?php 
        echo $total;
        ?>
'/> <?php 
        echo go_return_options('go_tasks_plural_name');
        ?>
 
				to continue to 
				<select class='go_next_pod_select' id='go_next_pod_select[ <?php 
        echo $slug;
        ?>
 ]' name='go_task_pod_globals[<?php 
        echo $slug;
        ?>
][go_next_pod_select]'>
					<option>...</option>
					<?php 
        foreach ($pods_array as $pod) {
            if ($pod->slug !== $slug) {
                $pod_name = $pod->name;
                ?>
							<option <?php 
                echo !empty($pods_options[$slug]['go_next_pod_select']) && $pods_options[$slug]['go_next_pod_select'] == $pod_name ? 'selected' : '';
                ?>
 
								value='<?php 
                echo $pod_name;
                ?>
'
								slug='<?php 
//.........这里部分代码省略.........
开发者ID:AndrewMaclab,项目名称:game-on,代码行数:101,代码来源:go_pods.php

示例9: go_store_exchange

function go_store_exchange()
{
    $custom = get_post_custom();
    $content_array = !empty($custom['go_mta_store_exchange'][0]) ? unserialize($custom['go_mta_store_exchange'][0]) : null;
    $is_checked = !empty($content_array) ? $content_array[0] : null;
    if (empty($is_checked)) {
        $is_checked = "false";
    }
    $c_exchange = $content_array[1];
    $p_exchange = $content_array[2];
    $b_exchange = $content_array[3];
    $t_exchange = $content_array[4];
    echo "\n\t\t<input id='go_store_exchange_checkbox' name='go_mta_store_exchange' type='checkbox' " . ($is_checked == 'true' ? "checked" : "") . "/>\n\t\t<input class='go_store_exchange_input' name='go_store_exchange_currency' type='text' placeholder='" . go_return_options('go_currency_name') . "' " . (!empty($c_exchange) ? "value='{$c_exchange}'" : '') . "/>\n\t\t<input class='go_store_exchange_input' name='go_store_exchange_points' type='text' placeholder='" . go_return_options('go_points_name') . "' " . (!empty($p_exchange) ? "value='{$p_exchange}'" : '') . "/>\n\t\t<input class='go_store_exchange_input' name='go_store_exchange_bonus_currency' type='text' placeholder='" . go_return_options('go_bonus_currency_name') . "' " . (!empty($b_exchange) ? "value='{$b_exchange}'" : '') . "/>\n\t\t<input class='go_store_exchange_input' name='go_store_exchange_time' type='text' placeholder='" . go_return_options('go_minutes_name') . "' " . (!empty($t_exchange) ? "value='{$t_exchange}'" : '') . "/>\n\t";
}
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:14,代码来源:types.php

示例10: go_file_input

function go_file_input($atts, $content = null)
{
    extract(shortcode_atts(array('is_uploaded' => '0', 'status' => '1', 'user_id' => null, 'post_id' => null), $atts));
    global $wpdb;
    global $post;
    $table_go = "{$wpdb->prefix}go";
    switch ($status) {
        case 0:
            $db_task_stage_upload_var = 'e_uploaded';
            break;
        case 1:
            $db_task_stage_upload_var = 'a_uploaded';
            break;
        case 2:
            $db_task_stage_upload_var = 'c_uploaded';
            break;
        case 3:
            $db_task_stage_upload_var = 'm_uploaded';
            break;
        case 4:
            $db_task_stage_upload_var = 'r_uploaded';
            break;
    }
    if (empty($user_id) || is_null($user_id)) {
        $user_id = get_current_user_id();
    }
    if (empty($post_id) || is_null($post_id)) {
        $post_id = $post->ID;
    }
    $allow_full_name = get_option('go_full_student_name_switch');
    if (isset($_FILES['go_attachment'])) {
        $user_id = get_current_user_id();
        $user_info = get_userdata($user_id);
        $user_login = $user_info->user_login;
        $first_name = trim($user_info->first_name);
        $last_name = trim($user_info->last_name);
        if ($allow_full_name == 'On') {
            $user_name = "{$first_name} {$last_name}";
        } else {
            $last_initial = substr($last_name, 0, 1);
            $user_name = "{$first_name} {$last_initial}.";
        }
        $user_email = $user_info->user_email;
        $user_role = $user_info->roles;
        $task_title = $post->post_title;
        $task_name = go_return_options('go_tasks_name');
        $to = get_option('go_admin_email', '');
        require "mail/class.phpmailer.php";
        $mail = new PHPMailer();
        $mail->From = "no-reply@go.net";
        $mail->FromName = $user_name;
        $mail->AddAddress($to);
        $mail->Subject = "Upload: {$task_title} | {$user_name} {$user_login}";
        $mail->Body = "{$user_email}\n\nUser comments: \n\t{$_POST['go_attachment_com']}";
        $mail->WordWrap = 50;
        // This loop will upload all the files you have attached to your email.
        for ($i = 0; $i < count($_FILES['go_attachment']); $i++) {
            $name = $_FILES['go_attachment']['name'][$i];
            $path = $_FILES['go_attachment']['tmp_name'][$i];
            //And attach it using attachment method of PHPmailer.
            $mail->AddAttachment($path, $name);
        }
        if (!$mail->Send()) {
            if (is_array($user_role) && in_array('administrator', $user_role) || $user_role === 'administrator') {
                return "<div id='go_mailer_error_msg'>{$mail->ErrorInfo}</div>";
            } else {
                return "\n\t\t\t\t\t<div id='go_mailer_error_msg'>Message was not sent.</div>\n\t\t\t\t\t<form id='go_upload_form' action='' method='post' enctype='multipart/form-data' uploaded='0'>\n\t\t\t\t\t\t<div id='go_uploader'>\n\t\t\t\t\t\t\t<input type='file' name='go_attachment[]'/>\n\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button type='button' onClick='go_add_uploader();'>Attach More</button><br/>\n\t\t\t\t\t\tComments:\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t<textarea name='go_attachment_com' style='width: 50%; height: 100px; resize: vertical;' placeholder='Enter any comments you have...'></textarea>\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t<input type='submit' value='Submit'/>\n\t\t\t\t\t</form>\n\t\t\t\t";
            }
        } else {
            $wpdb->update($table_go, array($db_task_stage_upload_var => 1), array('uid' => $user_id, 'post_id' => $post_id));
            return "\n\t\t\t\t<div id='go_mailer_confirm_msg'>Message was sent.</div>\n\t\t\t\t<form id='go_upload_form' action='' method='post' enctype='multipart/form-data' uploaded='1'>\n\t\t\t\t\t<div id='go_uploader'>\n\t\t\t\t\t\t<input type='file' name='go_attachment[]'/>\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type='button' onClick='go_add_uploader();'>Attach More</button><br/>\n\t\t\t\t\tComments:\n\t\t\t\t\t<br/>\n\t\t\t\t\t<textarea name='go_attachment_com' style='width: 50%; height: 100px; resize: vertical;' placeholder='Enter any comments you have...'></textarea>\n\t\t\t\t\t<br/>\n\t\t\t\t\t<input type='submit' value='Submit'/>\n\t\t\t\t</form>\n\t\t\t";
        }
    } else {
        return "\n\t\t\t<form id='go_upload_form' action='' method='post' enctype='multipart/form-data' uploaded='{$is_uploaded}'>\n\t\t\t\t<div id='go_uploader'>\n\t\t\t\t\t<input type='file' name='go_attachment[]'/>\n\t\t\t\t\t<br/>\n\t\t\t\t</div>\n\t\t\t\t<button type='button' onClick='go_add_uploader();'>Attach More</button><br/>\n\t\t\t\tComments:\n\t\t\t\t<br/>\n\t\t\t\t<textarea name='go_attachment_com' style='width: 50%; height: 100px; resize: vertical;' placeholder='Enter any comments you have...'></textarea>\n\t\t\t\t<br/>\n\t\t\t\t<input type='submit' value='Submit'/>\n\t\t\t</form>\n\t\t";
    }
}
开发者ID:SpencerNussbaum,项目名称:game-on,代码行数:76,代码来源:go_mail.php

示例11: go_mail_item_reciept

function go_mail_item_reciept($user_id, $item_id, $req_currency, $req_points, $req_bonus_currency, $req_penalty, $req_mintues, $qty, $recipient_id = null)
{
    global $go_plugin_dir;
    $currency = ucwords(go_return_options('go_currency_name'));
    $points = ucwords(go_return_options('go_points_name'));
    $bonus_currency = ucwords(go_return_options('go_bonus_currency_name'));
    $penalty = ucwords(go_return_options('go_penalty_name'));
    $minutes = ucwords(go_return_options('go_minutes_name'));
    $item_title = get_the_title($item_id);
    $allow_full_name = get_option('go_full_student_name_switch');
    $user_info = get_userdata($user_id);
    $user_login = $user_info->user_login;
    $first_name = trim($user_info->first_name);
    $last_name = trim($user_info->last_name);
    if ($allow_full_name == 'On') {
        $user_name = "{$first_name} {$last_name}";
    } else {
        $last_initial = substr($last_name, 0, 1);
        $user_name = "{$first_name} {$last_initial}.";
    }
    $user_email = $user_info->user_email;
    $user_role = $user_info->roles;
    $req_currency *= $qty;
    $req_points *= $qty;
    $req_bonus_currency *= $qty;
    $req_penalty *= -1;
    $req_mintues *= $qty;
    $req_array = array($currency => $req_currency, $points => $req_points, $bonus_currency => $req_bonus_currency, $penalty => $req_penalty, $minutes => $req_mintues);
    $received_str = '';
    $spent_str = '';
    foreach ($req_array as $req_name => $val) {
        if (!empty($val)) {
            if ($req_name === $penalty) {
                $received_str .= "\t{$req_name}: {$val}\n\n";
            } else {
                if ($val < 0) {
                    $received_str .= "\t{$req_name}: " . -$val . "\n\n";
                } elseif ($val > 0) {
                    $spent_str .= "\t{$req_name}: {$val}\n\n";
                }
            }
        }
    }
    $to = get_option('go_admin_email', '');
    require "{$go_plugin_dir}/mail/class.phpmailer.php";
    $mail = new PHPMailer();
    $mail->From = get_option('go_email_from', 'no-reply@go.net');
    $mail->FromName = $user_name;
    $mail->AddAddress($to);
    $mail->Subject = "Purchase: {$item_title} ({$qty}) | {$user_name} {$user_login}";
    if (!empty($recipient_id)) {
        $recipient = get_userdata($recipient_id);
        $recipient_username = $recipient->user_login;
        $recipient_first_name = trim($recipient->first_name);
        $recipient_last_name = trim($recipient->last_name);
        if ($allow_full_name == 'On') {
            $recipient_full_name = "{$recipient_first_name} {$recipient_last_name}";
        } else {
            $recipient_last_initial = substr($recipient_last_name, 0, 1);
            $recipient_full_name = "{$recipient_first_name} {$recipient_last_name}.";
        }
        $mail->Subject .= " | {$recipient_full_name} {$recipient_username}";
    }
    $mail->Body = "{$user_email}\n\n" . (!empty($spent_str) ? "Spent:\n\n{$spent_str}" : "") . (!empty($received_str) ? "Received:\n\n{$received_str}" : "");
    $mail->WordWrap = 50;
    if (!$mail->Send()) {
        if (is_array($user_role) && in_array('administrator', $user_role) || $user_role === 'administrator') {
            return "<div id='go_mailer_error_msg'>{$mail->ErrorInfo}</div>";
        }
    }
}
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:71,代码来源:buy-ajax.php

示例12: go_update_user_focuses

function go_update_user_focuses()
{
    $new_user_focus = stripslashes($_POST['new_user_focus']);
    $user_id = $_POST['user_id'];
    if ($new_user_focus != 'No ' . go_return_options('go_focus_name')) {
        update_user_meta($user_id, 'go_focus', array($new_user_focus));
    } else {
        update_user_meta($user_id, 'go_focus', array());
    }
    echo $new_user_focus;
    die;
}
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:12,代码来源:go_clipboard.php

示例13: go_admin_bar

function go_admin_bar()
{
    global $wpdb;
    global $current_user_id;
    global $wp_admin_bar;
    global $current_points;
    //users current experience
    global $current_currency;
    //users current money
    global $current_rank;
    global $next_rank_points;
    global $current_rank_points;
    $dom = $next_rank_points - $current_rank_points;
    $rng = $current_points - $current_rank_points;
    $current_bonus_currency = go_return_bonus_currency(get_current_user_id());
    $current_penalty = go_return_penalty(get_current_user_id());
    $current_minutes = go_return_minutes(get_current_user_id());
    if ($dom <= 0) {
        $dom = 1;
    }
    $ranks_output = go_update_ranks($current_user_id, $current_points, false);
    $percentage = $rng / $dom * 100;
    if ($percentage <= 0) {
        $percentage = 0;
    } elseif ($percentage >= 100) {
        $percentage = 100;
    }
    $color = barColor($current_bonus_currency, $current_penalty);
    $wp_admin_bar->remove_menu('wp-logo');
    if (!is_user_logged_in()) {
        $wp_admin_bar->add_node(array('id' => 'go_toolbar_login', 'title' => 'Login', 'href' => wp_login_url()));
    }
    if (is_admin_bar_showing() && is_user_logged_in()) {
        $is_admin = false;
        $user_obj = get_user_by('id', $current_user_id);
        $user_roles = $user_obj->roles;
        if (!empty($user_roles)) {
            foreach ($user_roles as $role) {
                if ($role === "administrator") {
                    $is_admin = true;
                    break;
                }
            }
        }
        $wp_admin_bar->add_node(array('id' => 'go_info', 'title' => '<div style="padding-top:5px;"><div id="go_admin_bar_progress_bar_border"><div id="points_needed_to_level_up" class="go_admin_bar_text">' . $rng . '/' . $dom . '</div><div id="go_admin_bar_progress_bar" class="progress_bar" style="width: ' . $percentage . '%; background-color: ' . $color . ' ;"></div></div></div>', 'href' => '#'));
        $wp_admin_bar->add_node(array('id' => 'go_rank', 'title' => '<div id="go_admin_bar_rank">' . go_return_clean_rank($current_user_id) . '</div>', 'href' => '#', 'parent' => 'go_info'));
        $wp_admin_bar->add_node(array('id' => 'go_points', 'title' => '<div id="go_admin_bar_points">' . go_return_options('go_points_name') . ': ' . go_display_points($current_points) . '</div>', 'href' => '#', 'parent' => 'go_info'));
        $wp_admin_bar->add_node(array('id' => 'go_points', 'title' => '<div id="go_admin_bar_currency">' . go_return_options('go_currency_name') . ': ' . go_display_currency($current_currency) . '</div>', 'href' => '#', 'parent' => 'go_info'));
        $wp_admin_bar->add_node(array('id' => 'go_currency', 'title' => '<div id="go_admin_bar_bonus_currency">' . go_return_options('go_bonus_currency_name') . ': ' . go_display_bonus_currency($current_bonus_currency) . '</div>', 'href' => '#', 'parent' => 'go_info'));
        $wp_admin_bar->add_node(array('id' => 'go_penalty', 'title' => '<div id="go_admin_bar_penalty">' . go_return_options('go_penalty_name') . ': ' . go_display_penalty($current_penalty) . '</div>', 'href' => '#', 'parent' => 'go_info'));
        $wp_admin_bar->add_node(array('id' => 'go_minutes', 'title' => '<div id="go_admin_bar_minutes">' . go_return_options('go_minutes_name') . ': ' . go_display_minutes($current_minutes) . '</div>', 'href' => '#', 'parent' => 'go_info'));
        if (current_user_can('manage_options')) {
            $wp_admin_bar->add_node(array('id' => 'go_deactivate', 'title' => '<input type="button" id="go_admin_bar_deactivation" name="go_admin_bar_deactivation" value="Deactivate" onclick="go_deactivate_plugin()"/>', 'parent' => 'go_info'));
        }
        if (go_return_options('go_admin_bar_add_switch') == 'On') {
            $wp_admin_bar->add_node(array('id' => 'go_add', 'title' => 'Add', 'href' => '#'));
            if (go_return_options('go_admin_bar_add_minutes_switch') != 'On' || $role === 'administrator') {
                $wp_admin_bar->add_node(array('id' => 'go_add_bar', 'title' => '<div id="go_admin_bar_title">' . go_return_options('go_points_name') . '</div>
						<div id="go_admin_bar_input"><input type="text" class="go_admin_bar_points" id="go_admin_bar_points_points"/> For <input type="text" class="go_admin_bar_reason" id="go_admin_bar_points_reason"/></div>
						<div id="go_admin_bar_title">' . go_return_options('go_currency_name') . '</div>
						<div id="go_admin_bar_input"><input type="text" class="go_admin_bar_points" id="go_admin_bar_currency_points"/> For <input type="text" class="go_admin_bar_reason" id="go_admin_bar_currency_reason"/></div>
						<div id="go_admin_bar_title">' . go_return_options('go_bonus_currency_name') . '</div>
						<div id="go_admin_bar_input"><input type="text" class="go_admin_bar_points" id="go_admin_bar_bonus_currency_points"/> For <input type="text" class="go_admin_bar_reason" id="go_admin_bar_bonus_currency_reason"/></div>
						<div id="go_admin_bar_title">' . go_return_options('go_penalty_name') . '</div>
						<div id="go_admin_bar_input"><input type="text" class="go_admin_bar_points" id="go_admin_bar_penalty_points"/> For <input type="text" class="go_admin_bar_reason" id="go_admin_bar_penalty_reason"/></div>
						<div id="go_admin_bar_title">' . go_return_options('go_minutes_name') . '</div>
						<div id="go_admin_bar_input"><input type="text" class="go_admin_bar_points" id="go_admin_bar_minutes_points"/> For <input type="text" class="go_admin_bar_reason" id="go_admin_bar_minutes_reason"/></div>
						<div><input id="go_admin_bar_add_button" type="button" style="width:250px; height: 20px;margin-top: 7px;" name="go_admin_bar_submit" onclick="go_admin_bar_add();this.disabled = true;" value="Add"><div id="admin_bar_add_return"></div></div>', 'href' => false, 'parent' => 'go_add'));
            } else {
                $wp_admin_bar->add_node(array('id' => 'go_add_bar', 'title' => '<div id="go_admin_bar_title">' . go_return_options('go_minutes_name') . '</div>
						<div id="go_admin_bar_input"><input type="text" class="go_admin_bar_points" id="go_admin_bar_minutes_points"/> For <input type="text" class="go_admin_bar_reason" id="go_admin_bar_minutes_reason"/></div>
						<div><input id="go_admin_bar_add_button" type="button" style="width:250px; height: 20px;margin-top: 7px;" name="go_admin_bar_submit" onclick="go_admin_bar_add();this.disabled = true;" value="Add"><div id="admin_bar_add_return"></div></div>
						<script type="text/javascript">
							jQuery( "ul#wp-admin-bar-go_add-default.ab-submenu" ).css( "height", "125px" );
						</script>', 'href' => false, 'parent' => 'go_add'));
            }
        }
        $wp_admin_bar->add_node(array('id' => 'go_stats', 'title' => '<div onclick="go_admin_bar_stats_page_button();">Stats</div><div id="go_stats_page"></div>', 'href' => '#'));
        $wp_admin_bar->add_node(array('id' => 'go_task_search', 'title' => '
					<form role="search" method="get" id="go_admin_bar_task_search_form" class="searchform" action="' . home_url('/') . '">
						<div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
							<input type="text" value="' . get_search_query() . '" name="s" id="go_admin_bar_task_search_input" placeholder="Search for ' . strtolower(get_option("go_tasks_plural_name")) . '..."/>
							<input type="hidden" name="post_type[]" value="tasks"/>
							<input type="submit" id="go_admin_bar_task_search_submit" value="' . esc_attr__('Search') . '"/>
						</div>
					</form>'));
        if ($is_admin) {
            $wp_admin_bar->add_group(array('id' => 'go_site_name_menu', 'parent' => 'site-name', 'meta' => array('class' => 'go_site_name_menu')));
            $wp_admin_bar->add_node(array('id' => 'go_nav_clipboard', 'title' => 'Clipboard', 'href' => get_admin_url() . 'admin.php?page=go_clipboard', 'parent' => 'go_site_name_menu', 'meta' => array('class' => 'go_site_name_menu_item')));
            $wp_admin_bar->add_node(array('id' => 'go_nav_tasks', 'title' => get_option('go_tasks_plural_name'), 'href' => get_admin_url() . 'edit.php?post_type=tasks', 'parent' => 'go_site_name_menu', 'meta' => array('class' => 'go_site_name_menu_item')));
            $wp_admin_bar->add_node(array('id' => 'go_nav_store', 'title' => get_option('go_store_name'), 'href' => get_admin_url() . 'edit.php?post_type=go_store', 'parent' => 'go_site_name_menu', 'meta' => array('class' => 'go_site_name_menu_item')));
            $wp_admin_bar->add_node(array('id' => 'go_nav_options', 'title' => 'Game-On', 'href' => get_admin_url() . 'admin.php?page=game-on-options.php', 'parent' => 'go_site_name_menu', 'meta' => array('class' => 'go_site_name_menu_item')));
            $wp_admin_bar->add_node(array('id' => 'go_nav_posts', 'title' => 'Posts', 'href' => esc_url(get_admin_url()) . 'edit.php', 'parent' => 'appearance'));
            $wp_admin_bar->add_node(array('id' => 'go_nav_pages', 'title' => 'Pages', 'href' => esc_url(get_admin_url()) . 'edit.php?post_type=page', 'parent' => 'appearance'));
            $wp_admin_bar->add_node(array('id' => 'go_nav_media', 'title' => 'Media', 'href' => esc_url(get_admin_url()) . 'upload.php', 'parent' => 'appearance'));
            $wp_admin_bar->add_node(array('id' => 'go_nav_plugins', 'title' => 'Plugins', 'href' => esc_url(get_admin_url()) . 'plugins.php', 'parent' => 'appearance'));
            $wp_admin_bar->add_node(array('id' => 'go_nav_pods', 'title' => get_option('go_tasks_name') . ' Pods', 'href' => esc_url(get_admin_url()) . 'admin.php?page=go_pods', 'parent' => 'go_site_name_menu', 'meta' => array('class' => 'go_site_name_menu_item')));
        }
        echo $ranks_output;
    }
//.........这里部分代码省略.........
开发者ID:Gaestelj,项目名称:game-on-1,代码行数:101,代码来源:go_admin_bar.php

示例14: go_stats_leaderboard

function go_stats_leaderboard()
{
    global $wpdb;
    $go_totals_table_name = "{$wpdb->prefix}go_totals";
    $class_a_choice = $_POST['class_a_choice'];
    $focuses = $_POST['focuses'];
    $date = $_POST['date'];
    ?>
	<ul id='go_stats_leaderboard_list_points' class='go_stats_body_list go_stats_leaderboard_list'>
		<li class='go_stats_body_list_head'><?php 
    echo strtoupper(go_return_options('go_points_name'));
    ?>
</li>
		<?php 
    $counter = 1;
    $users_points = $wpdb->get_results("SELECT uid FROM {$go_totals_table_name} ORDER BY CAST(points as signed) DESC");
    go_return_user_leaderboard($users_points, $class_a_choice, $focuses, 'points', $counter);
    ?>
	</ul>
	<ul id='go_stats_leaderboard_list_currency' class='go_stats_body_list go_stats_leaderboard_list'>
		<li class='go_stats_body_list_head'><?php 
    echo strtoupper(go_return_options('go_currency_name'));
    ?>
</li>
		<?php 
    $counter = 1;
    $users_currency = $wpdb->get_results("SELECT uid FROM {$go_totals_table_name} ORDER BY CAST(currency as signed) DESC");
    go_return_user_leaderboard($users_currency, $class_a_choice, $focuses, 'currency', $counter);
    ?>
	</ul>
	<ul id='go_stats_leaderboard_list_bonus_currency' class='go_stats_body_list go_stats_leaderboard_list'>
		<li class='go_stats_body_list_head'><?php 
    echo strtoupper(go_return_options('go_bonus_currency_name'));
    ?>
</li>
		<?php 
    $counter = 1;
    $users_bonus_currency = $wpdb->get_results("SELECT uid FROM {$go_totals_table_name} ORDER BY CAST(bonus_currency as signed) DESC");
    go_return_user_leaderboard($users_bonus_currency, $class_a_choice, $focuses, 'bonus_currency', $counter);
    ?>
	</ul>
	<ul id='go_stats_leaderboard_list_badge_count' class='go_stats_body_list go_stats_leaderboard_list'>
		<li class='go_stats_body_list_head'>BADGES</li>
		<?php 
    $counter = 1;
    $users_badge_count = $wpdb->get_results("SELECT uid FROM {$go_totals_table_name} ORDER BY CAST(badge_count as signed) DESC");
    go_return_user_leaderboard($users_badge_count, $class_a_choice, $focuses, 'badges', $counter);
    ?>
	</ul>
	<?php 
    die;
}
开发者ID:SpencerNussbaum,项目名称:game-on,代码行数:52,代码来源:go_stats.php

示例15: go_the_lb_ajax

function go_the_lb_ajax()
{
    check_ajax_referer('go_lb_ajax_referall', 'nonce');
    global $wpdb;
    $table_name_go = $wpdb->prefix . "go";
    $the_id = $_POST["the_item_id"];
    $the_post = get_post($the_id);
    $the_title = $the_post->post_title;
    $item_content = get_post_field('post_content', $the_id);
    $the_content = wpautop($item_content);
    $custom_fields = get_post_custom($the_id);
    if (isset($custom_fields['go_mta_penalty_switch'])) {
        $penalty = true;
    }
    $store_cost = unserialize($custom_fields['go_mta_store_cost'][0]);
    if (!empty($store_cost)) {
        $req_currency = $store_cost[0];
        $req_points = $store_cost[1];
        $req_bonus_currency = $store_cost[2];
    }
    $store_filter = unserialize($custom_fields['go_mta_store_filter'][0]);
    $is_filtered = $store_filter[0];
    if ($is_filtered) {
        $req_rank = $store_filter[1];
        $bonus_filter = $store_filter[2] . length > 0 ? (int) $store_filter[2] : null;
        $penalty_filter = $store_filter[3] . length > 0 ? (int) $store_filter[3] : null;
    }
    $store_limit = unserialize($custom_fields['go_mta_store_limit'][0]);
    $is_limited = $store_limit[0];
    if ($is_limited == 'true') {
        $purchase_limit = $store_limit[1];
    }
    $user_id = get_current_user_id();
    $user_points = go_return_points($user_id);
    $user_bonus_currency = go_return_bonus_currency($user_id);
    $user_currency = go_return_currency($user_id);
    $user_penalties = go_return_penalty($user_id);
    $purchase_count = $wpdb->get_var("SELECT SUM(count) FROM {$table_name_go} WHERE post_id={$the_id} AND uid={$user_id} LIMIT 1");
    echo '<h2>' . $the_title . '</h2>';
    echo '<div id="go-lb-the-content">' . do_shortcode($the_content) . '</div>';
    if ($user_points >= $req_rank || $req_rank <= 0 || $penalty) {
        $lvl_color = "g";
    } else {
        $lvl_color = "r";
    }
    if ($user_currency >= $req_currency || $req_currency <= 0 || $penalty) {
        $gold_color = "g";
    } else {
        $gold_color = "r";
    }
    if ($user_points >= $req_points || $req_points <= 0 || $penalty) {
        $points_color = "g";
    } else {
        $points_color = "r";
    }
    if ($user_bonus_currency >= $req_bonus_currency || $req_bonus_currency <= 0 || $penalty) {
        $bonus_currency_color = "g";
    } else {
        $bonus_currency_color = "r";
    }
    if ($lvl_color == "g" && $gold_color == "g" && $points_color == "g") {
        $buy_color = "g";
    } else {
        $buy_color = "r";
    }
    $user_focuses = array();
    if ($is_filtered === 'true' && !is_null($penalty_filter) && $user_penalties >= $penalty_filter) {
        $penalty_diff = $user_penalties - $penalty_filter;
        if ($penalty_diff > 0) {
            die("You have {$penalty_diff} too many " . go_return_options('go_penalty_name') . ".");
        } else {
            if ($penalty_diff == 0) {
                die("You need less than {$penalty_filter} " . go_return_options('go_penalty_name') . " to buy this item.");
            }
        }
    }
    // Check if user has a focus
    if (get_user_meta($user_id, 'go_focus', true) != null) {
        $user_focuses = (array) get_user_meta($user_id, 'go_focus', true);
    }
    // Check if the item has a focus and the focus gateway is turned on
    if ($custom_fields['go_mta_focuses'][0] && $custom_fields['go_mta_focus_item_switch'][0] == 'on') {
        $item_focus = $custom_fields['go_mta_focuses'][0];
    }
    // If user has the focus and the item is a focus gateway echo this
    if ($item_focus && !empty($user_focuses) && in_array($item_focus, $user_focuses)) {
        die('You already have this ' . go_return_options('go_focus_name') . '!');
    }
    if ($is_filtered === 'true' && !is_null($bonus_filter) && $user_bonus_currency < $bonus_filter) {
        die('You require more ' . go_return_options('go_bonus_currency_name') . ' to view this item.');
    }
    if (!empty($purchase_limit) && $purchase_count >= $purchase_limit) {
        die("You've reached the maximum purchase limit.");
    }
    if ($user_points < $req_rank) {
        die("You need to reach {$req_rank_key} to purchase this item.");
    }
    ?>
	<div id="golb-fr-price" class="golb-fr-boxes-<?php 
    echo $gold_color;
//.........这里部分代码省略.........
开发者ID:zetheroth,项目名称:game-on,代码行数:101,代码来源:frontend-lightbox.php


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