';
}
function gp_get_flag_img_country($country_name = '', $flagsize=32) {
global $countries_array;
$src = get_template_directory_uri() . '/lib/images/flags/'.$flagsize.'/';
if ($country_name) {
$country_code = array_search($country_name, $countries_array);
$src .= strtolower($country_code) . '.png';
} else {
$src .= 'none.png';
}
return '';
}
function gp_get_the_flag($userid, $flagsize=32) {
if ($userid) {
if (bp_has_profile('user_id=' . $userid)) {
while (bp_profile_groups()) {
bp_the_profile_group();
while (bp_profile_fields()) {
bp_the_profile_field();
if (bp_field_has_data()) {
$fieldname = strip_tags(bp_get_the_profile_field_name());
if ($fieldname == 'Country') {
$value = strip_tags(bp_get_the_profile_field_value(), '
');
$value = str_replace('/flags/32/', '/flags/'.$flagsize.'/', $value);
if ($value == '') {
return gp_get_flag_img('', $flagsize); // Bandera desconocida
} else {
return $value;
}
}
}
}
}
}
} else {
return gp_get_flag_img('', $flagsize); // Bandera desconocida
}
}
function gp_the_flag($userid, $flagsize=32) {
echo gp_get_the_flag($userid, $flagsize);
}
/* * ************************* Enqueue Styles ************************** */
function gp_enqueue_styles() {
if (!is_admin()) {
global $post;
require(ghostpool_inc . 'options.php');
wp_enqueue_style('reset', get_template_directory_uri() . '/lib/css/reset.css');
wp_enqueue_style('style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('prettyphoto', get_template_directory_uri() . '/lib/scripts/prettyPhoto/css/prettyPhoto.css');
wp_enqueue_style('videoslider', get_template_directory_uri() . '/lib/scripts/videoslider/css/videoGallery.css');
if (isset($_COOKIE['SkinCookie'])) {
$skin = $_COOKIE['SkinCookie'];
}
if (isset($_GET['skin'])) {
$skin = $_GET['skin'];
setcookie('SkinCookie', $skin);
}
if ($_GET['skin'] == "default") {
$skin = $theme_skin;
setcookie('SkinCookie', $skin, time() - 3600);
}
if (isset($_GET['skin']) OR (isset($_COOKIE['SkinCookie']) && $_COOKIE['SkinCookie'] != "default")) {
wp_enqueue_style('style-skin', get_template_directory_uri() . '/style-' . $skin . '.css');
} else {
if ((is_singular() && !is_attachment() && !is_404()) && (get_post_meta($post->ID, 'ghostpool_skin', true) && get_post_meta($post->ID, 'ghostpool_skin', true) != "Default")) {
wp_enqueue_style('style-skin', get_template_directory_uri() . '/style-' . get_post_meta($post->ID, 'ghostpool_skin', true) . '.css');
} else {
wp_enqueue_style('style-skin', get_template_directory_uri() . '/style-' . $theme_skin . '.css');
}
}
if ($theme_custom_stylesheet) {
wp_enqueue_style('style-theme-custom', get_template_directory_uri() . '/' . $theme_custom_stylesheet);
}
if ((is_single() OR is_page()) && get_post_meta($post->ID, 'ghostpool_custom_stylesheet', true)) {
wp_enqueue_style('style-custom', get_template_directory_uri() . '/' . get_post_meta($post->ID, 'ghostpool_custom_stylesheet', true));
}
}
}
add_action('wp_print_styles', 'gp_enqueue_styles');
/* * ************************* Enqueue Scripts ************************** */
function gp_enqueue_scripts() {
if (!is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_script('jqueryui');
//wp_enqueue_script('jqueryui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js', array('jquery'));
if (is_singular())
wp_enqueue_script('comment-reply');
wp_enqueue_script('swfobject', 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js');
//wp_enqueue_script('jwplayer', get_template_directory_uri() . '/lib/scripts/mediaplayer/jwplayer.js', array('jquery'));
//wp_enqueue_script('carousel', get_template_directory_uri().'/lib/scripts/jquery.carouFredSel.js', array('jquery'));
wp_enqueue_script('prettyphoto', get_template_directory_uri() . '/lib/scripts/prettyPhoto/js/jquery.prettyPhoto.js', array('jquery'));
wp_enqueue_script('jqtransform', get_template_directory_uri() . '/lib/scripts/jquery.jqtransform.js', array('jquery'));
wp_enqueue_script('jqueryeasing', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.easing.1.3.js', array('jquery'));
wp_enqueue_script('froogaloop', get_template_directory_uri() . '/lib/scripts/videoslider/js/froogaloop.min.js', array('jquery'));
wp_enqueue_script('apPlaylistManager', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.apPlaylistManager.min.js', array('jquery'));
//wp_enqueue_script('apPlaylistManager', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.apPlaylistManager.js', array('jquery'));
wp_enqueue_script('apYoutubePlayer', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.apYoutubePlayer.min.js', array('jquery'));
//wp_enqueue_script('apYoutubePlayer', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.apYoutubePlayer.js', array('jquery'));
wp_enqueue_script('apVimeoPlayer', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.apVimeoPlayer.min.js', array('jquery'));
//wp_enqueue_script('apVimeoPlayer', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.apVimeoPlayer.js', array('jquery'));
wp_enqueue_script('videoGallery', get_template_directory_uri().'/lib/scripts/videoslider/js/jquery.videoGallery.min.js', array('jquery'));
//wp_enqueue_script('videoGallery', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.videoGallery.js', array('jquery'));
wp_enqueue_script('mousewheel', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.mousewheel.js', array('jquery'));
//wp_enqueue_script('sharrre', get_template_directory_uri() . '/lib/scripts/videoslider/js/jquery.sharrre-1.3.0.min.js', array('jquery'));
wp_enqueue_script('fullscreen', get_template_directory_uri() . '/lib/scripts/jquery.fullscreen-min.js', array('jquery'));
wp_enqueue_script('jtypewriter', get_template_directory_uri(). '/lib/scripts/jquery.jtypewriter.js', array('jquery'));
}
}
add_action('wp_print_scripts', 'gp_enqueue_scripts');
/* * ************************* WP Header Hooks ************************** */
function gp_font_head() {
require(ghostpool_inc . 'options.php');
$fonts = array(
'Bad+Script' => "font-family: 'Bad Script', sans-serif;",
'Give+You+Glory' => "font-family: 'Give You Glory', sans-serif;",
'Handlee' => "font-family: 'Handlee', sans-serif;",
'Indie+Flower' => "font-family: 'Indie Flower', sans-serif;",
'Patrick+Hand' => "font-family: 'Patrick Hand', sans-serif;",
'Shadows+Into+Light' => "font-family: 'Shadows Into Light', sans-serif;",
'Shadows+Into+Light+Two' => "font-family: 'Shadows Into Light Two', sans-serif;",
);
$body_key = 'Bad+Script';
if (isset($theme_font_dedication))
$body_key = $theme_font_dedication;
if (isset($fonts[$body_key])) {
$body_font = $fonts[$body_key];
wp_enqueue_style('googleFonts', 'http://fonts.googleapis.com/css?family=' . $theme_font_dedication);
echo '';
}
}
function gp_wp_header() {
require(ghostpool_inc . 'options.php');
if ($theme_favicon_ico)
echo '';
if ($theme_favicon_png)
echo '';
if ($theme_apple_icon)
echo '';
if ($theme_custom_css)
echo '';
echo stripslashes($theme_scripts);
echo '
';
gp_font_head();
}
add_action('wp_head', 'gp_wp_header');
/* * ************************* Featured Image Sizes ************************** */
add_theme_support('post-thumbnails');
set_post_thumbnail_size(150, 150, true);
/* * ************************* bbPress Support ************************** */
if (is_admin()) {
add_theme_support('bbpress');
}
/* * ************************* Navigation Menus ************************** */
add_action('init', 'register_my_menus');
function register_my_menus() {
register_nav_menus(array(
'header-nav' => __('Header Navigation', 'gp_lang')
));
}
/* * ************************* Dedication category ********************* */
//add_action('init', 'register_dedication_category');
function register_dedication_category() {
global $wpdb;
if (!get_category_by_slug(DEDICATION_CATEGORY_SLUG)) {
$cat = array(
'cat_name' => 'Dedication',
'category_nicename' => DEDICATION_CATEGORY_SLUG);
wp_insert_category($cat);
}
}
/* * ************************* Concerts category ********************* */
//add_action('init', 'register_concerts_category');
function register_concerts_category() {
global $wpdb;
if (!get_category_by_slug(CONCERTS_CATEGORY_SLUG)) {
$cat = array(
'cat_name' => 'Concerts',
'category_nicename' => CONCERTS_CATEGORY_SLUG);
wp_insert_category($cat);
}
}
/* * ************************* Other Features ************************** */
// Add support for custom backgrounds
add_custom_background();
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Set the content width based on the theme's design and stylesheet.
if (!isset($content_width))
$content_width = 590;
// Add default posts and comments RSS feed links to
[' => '[', ']
' => ']', ']