PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/newexitinggames.kerihosting.com/wp-content/themes/spacebox/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : /home/trave494/newexitinggames.kerihosting.com/wp-content/themes/spacebox/functions.php |
<?php /** * FunGames * * @author Daniel Bakovic * @uri http://myarcadeplugin.com * * @author Italos Marios - Spacebox functions * @uri http://www.italosmarios.com * * @package WordPress * @subpackage FunGames */ define ( 'MYAPB_THEMEVERSION', '1.10'); define ( 'MYAPB_THEMENAME', 'Spacebox'); /** Include MyArcadePlugin Theme API **/ include_once('inc/myabp_api.php'); /** Include MyArcadePlugin Theme Options **/ include_once('inc/myabp_themeoptions.php'); /** Include MyArcadePlugin Theme Default Settings **/ include_once('inc/myabp_settings.php'); /** Include custom widgets **/ include_once('inc/myabp_widgets.php'); /** Include theme actions API **/ include_once('inc/actions.php'); /** Include buddypress integration file **/ include_once('inc/buddypress.php'); if ( !is_admin() ) { add_action('wp_print_scripts', 'funames_scripts_init'); add_action('wp_print_styles', 'spacebox_stylesheet_init'); } // Custom menu support add_theme_support( 'menus' ); // Custom widgetizing of areas if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'GameLeft', 'id' => 'gameleft', 'description' => 'This is the widgetized left sidebar below the 300x250 ad spot.', 'before_widget' => '<div class="w-wrap akd-wrap"><div class="widget sidebars-text"><div style="display: block; width: auto; height: auto; overflow: hidden;">', 'after_widget' => '</div></div></div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); register_sidebar(array( 'name' => 'GameMiddle', 'id' => 'gamemiddle', 'description' => 'This is the widgetized middle area below the game.', 'before_widget' => '<div class="play-game-div sidebars-text">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); register_sidebar(array( 'name' => 'GameRight', 'id' => 'gameright', 'description' => 'This is the widgetized right area below the 160x600 spot', 'before_widget' => '<br /><div id="play-advert-below" class="sidebars-text">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); } function spacebox_logo() { $custom_logo = get_option('spacebox_custom_logo'); if ( $custom_logo ) { echo '<style>#logo a {background: url('.$custom_logo.') top left no-repeat;}</style>'; } ?> <h1 id="logo"> <a href="<?php echo home_url();?>" title="<?php bloginfo('name');?>"></a></h1> <?php } function funames_scripts_init() { wp_enqueue_script('jquery'); // MyArcadePlugin Mochi Leaderboard if ( defined('MYARCADE_VERSION') && is_singular() ) { wp_enqueue_script('leaderboard', 'http://xs.mochiads.com/static/pub/swf/leaderboard.js', '', '', false); } } function spacebox_stylesheet_init() { //Should we include Buddypress adminbar css? if ( defined( 'BP_VERSION' ) ) { //$bpcss = WP_PLUGIN_URL . '/buddypress/bp-themes/bp-default/_inc/css/adminbar.css'; //wp_register_style('FunGamesBuddyPress', $bpcss); //wp_enqueue_style( 'FunGamesBuddyPress'); wp_register_style('FunGamesBuddyPressIntegration', $path_to_theme_css.'/buddypress.css'); wp_enqueue_style( 'FunGamesBuddyPressIntegration'); } } function spacebox_get_excluded_categories() { $result = 'exclude='; $blog = get_cat_ID( get_option('spacebox_blog_category') ); if ( $blog ) { $result = 'exclude='.$blog.','; } $result .= get_option('spacebox_exclude_front_cat'); return $result; } function spacebox_get_excerpt($excerpt_length = false, $echo = true) { global $post; // Get post excerpt $text = strip_shortcodes( $post->post_content ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $text = wp_trim_words( $text, 100, '' ); if ( $excerpt_length ) { if ( strlen($text) > $excerpt_length ) { $text = mb_substr($text, 0, $excerpt_length).' [...]'; } } if ($echo) echo $text; else return $text; } /*** REDIRECT MODIFICATION BEGIN ***/ function spacebox_login_redirect() { global $mngl_options, $pagenow; // Check if mingle is instaleld if ( defined('MNGL_PLUGIN_NAME') ) { if( isset($_GET['action']) ) $theaction = $_GET['action']; else $theaction =''; if ($pagenow == 'wp-login.php' && $theaction != 'logout') { if ($theaction == 'register') { // Redirect to the sign up page wp_redirect( get_permalink($mngl_options->signup_page_id) ); } else { // Redirect to the login page wp_redirect( get_permalink($mngl_options->login_page_id) ); } } } } /*** REDIRECT MODIFICATION END ***/ /** * Generate game manage buttons - only for admins * * @global type $post */ function spacebox_admin_links() { global $post; if ( current_user_can('delete_posts') ) { // Show edit and delete links echo '<div class="clear"></div>'; echo "<div style='float:right'><strong>Admin Actions: </strong><a href='" . wp_nonce_url("/wp-admin/post.php?action=delete&post=".$post->ID, 'delete-post_' . $post->ID) . "'>Delete</a>"; echo " | "; echo "<a href='" . wp_nonce_url("/wp-admin/post.php?post=".$post->ID."&action=edit") . "'>Edit</a></div>"; } } function spacebox_get_best_players( $count = 5 ) { global $wpdb; return $wpdb->get_results("SELECT h.user_id, COUNT(*) as highscores, u.plays as plays FROM ".MYARCADE_HIGHSCORES_TABLE." AS h INNER JOIN ".MYARCADE_USER_TABLE." AS u ON h.user_id=u.user_id GROUP BY h.user_id ORDER BY highscores DESC LIMIT ".$count); } function spacebox_contest_alert() { if ( !function_exists('myarcadecontest_get_contest_id_for_this_game') ) return; $contest_id = myarcadecontest_get_contest_id_for_this_game(); $user_id = get_current_user_id(); if (!$contest_id || myarcadecontest_check_user_is_in_contest($contest_id, $user_id) ) return; $permalink_open = '<a href="'.get_permalink($contest_id).'" title="'.get_the_title($contest_id).'">'; $permalink_close = '</a>'; ?> <div class="info"> <p> <strong><?php _e('Howdy!', 'fungames'); ?></strong> <?php echo sprintf( __('There is an active contest available for this game. Click %shere%s to join the contest!', 'fungames'), $permalink_open, $permalink_close); ?> </p> </div> <?php } /** * Display related or random games */ function spacebox_related() { if ( function_exists('related_entries') ) { related_entries(); } else { get_template_part('games', 'random'); } } /** * Display Google Rich Snippet * * @global type $post */ function spacebox_rich_snippet() { global $post; if ( function_exists('the_ratings') && get_option('spacebox_rich_snippet') == 'enable' ) { $ratings_user = intval(get_post_meta($post->ID, 'ratings_users', true)); $rating_average = get_post_meta($post->ID, 'ratings_average', true); $ratings_max = intval(get_option('postratings_max')); if ( empty($rating_average) ) $rating_average = 0; echo "\n"; ?> <!-- Google Rich Snipet --> <div itemscope itemtype="http://schema.org/SoftwareApplication"> <meta itemprop="name" content="<?php the_title(); ?>" /> <meta itemprop="image" content="<?php myabp_print_thumbnail_url(); ?>" /> <meta itemprop="description" content="<?php echo get_the_excerpt(); ?>" /> <meta itemprop="softwareApplicationCategory" content="GameApplication" /> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <span itemprop="ratingCount"><?php echo $ratings_user; ?></span> votes, average: <span itemprop="ratingValue"><?php echo $rating_average; ?></span>/<span itemprop="bestRating"><?php echo $ratings_max; ?></span> </div> </div> <?php echo "\n"; } } /** * SPACEBOX functions * @author Akondo */ function my_login_stylesheet() { echo '<link rel="stylesheet" id="custom_wp_admin_css" href="'.get_bloginfo('stylesheet_directory').'/style.css'.'" type="text/css" media="all" />'; echo '<link rel="stylesheet" id="custom_wp_admin_css" href="'.get_bloginfo('stylesheet_directory').'/style-login.css'.'" type="text/css" media="all" />'; } add_action('login_enqueue_scripts', 'my_login_stylesheet'); function my_login_logo_url() { return get_bloginfo('url'); } add_filter('login_headerurl', 'my_login_logo_url'); function my_login_logo_url_title() { return get_bloginfo('name'); } add_filter('login_headertitle', 'my_login_logo_url_title'); function mysite_login_redirect(){ return get_bloginfo('url'); } add_action( 'login_redirect', 'mysite_login_redirect'); function pagination($pages = '', $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if($pages > 1) { echo "<div class=\"pagination\">"; //echo "<span>Page ".$paged." of ".$pages."</span>"; //if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; //if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; for ($i=1; $i <= $pages; $i++) { if (!($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ) { $pgclass = "btn"; if($paged == $i) { $pgclass .= " current"; } echo "<a href='".get_pagenum_link($i)."' class=\"".$pgclass."\">".$i."</a>"; } } //if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; //if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; echo "</div>\n"; } } ?>