Пример #1
0
                echo 'rocio';
            }
            if (in_category($espera)) {
                echo ' espera';
            }
            ?>
" id="post-<?php 
            the_ID();
            ?>
">
				<?php 
            // Show the new category images
            foreach (get_the_category() as $category) {
                $proyectos = get_option('bach_projects');
                $proyecto = get_cat_id($proyectos);
                if (get_root_category($category) == $proyecto) {
                    echo '<a href="' . get_bloginfo('url') . '/category/' . $category->slug . '"><img src="' . trim(ereg_replace("</p>", "", category_description($category->cat_ID)), "<p>") . '" alt="' . $category->cat_name . '" class="logo" height="48px" width="48px" style="float:right;" /><a>';
                }
            }
            ?>
				
				<h3 class="titulillo"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
						<div align="center"><?php 
            include TEMPLATEPATH . '/clases.php';
            ?>
Пример #2
0
function get_meta_if_post($pid = '')
{
    global $post;
    $pid = !$pid ? $post->ID : $pid;
    $data['post_id'] = $pid;
    //for ref.
    setlocale(LC_ALL, get_locale());
    $meta = get_post_meta($pid);
    $post_categs = wp_get_post_categories($pid);
    $top_categ = get_root_category($post_categs[0]);
    //getting top category
    $data['antenna_id'] = $top_categ;
    $start = isset($meta['if_events_startdate']) ? $meta['if_events_startdate'][0] : null;
    $end = isset($meta['if_events_enddate']) ? $meta['if_events_enddate'][0] : null;
    $end = $end <= $start ? false : $end;
    $end = !empty($end) ? utf8_encode(strftime('%d %b', $end)) : null;
    $time = isset($meta['if_events_time']) ? $meta['if_events_time'][0] : null;
    $data['start'] = !empty($start) ? utf8_encode(strftime('%d %b', $start)) : null;
    $data['end'] = !$end ? strlen($time) ? ' / ' . $time : '' : ' / ' . $end;
    $data['time'] = $time;
    //add featured img id if exist
    $img = isset($meta['_thumbnail_id']) ? $meta['_thumbnail_id'] : array();
    $data['img'] = !empty($img) ? $img[0] : null;
    //booking infos
    $book = isset($meta['if_book_enable']) ? $meta['if_book_enable'][0] : null;
    if ($book == 'on') {
        $data['booking'] = $book;
        $data['book_mail'] = $meta['if_book_mail'][0];
        $data['book_desc'] = $meta['if_book_desc'][0];
    } else {
        $data['booking'] = "close";
    }
    //infos (about)
    $data['disciplines'] = isset($meta['if_events_disciplines']) ? unserialize($meta['if_events_disciplines'][0]) : null;
    $data['lieu'] = isset($meta['if_events_lieu']) ? $meta['if_events_lieu'][0] : null;
    $data['adresse'] = isset($meta['if_events_adresse']) ? $meta['if_events_adresse'][0] : null;
    $data['adressebis'] = isset($meta['if_events_adresse_bis']) ? $meta['if_events_adresse_bis'][0] : null;
    $data['zip'] = isset($meta['if_events_zip']) ? $meta['if_events_zip'][0] : null;
    $data['city'] = isset($meta['if_events_city']) ? $meta['if_events_city'][0] : null;
    $data['pays'] = isset($meta['if_events_pays']) ? $meta['if_events_pays'][0] : null;
    //TODO check code ISO to print Country
    $data['longitude'] = isset($meta['if_events_long']) ? $meta['if_events_long'][0] : null;
    $data['latitude'] = isset($meta['if_events_lat']) ? $meta['if_events_lat'][0] : null;
    $data['schedule'] = isset($meta['if_events_hour']) ? $meta['if_events_hour'][0] : null;
    //field schedule. not used for now.
    $data['tel'] = isset($meta['if_events_tel']) ? $meta['if_events_tel'][0] : null;
    $data['event_mail'] = isset($meta['if_events_mmail']) ? $meta['if_events_mmail'][0] : null;
    $data['link1'] = isset($meta['if_events_link1']) ? $meta['if_events_link3'][0] : null;
    $data['link2'] = isset($meta['if_events_link2']) ? $meta['if_events_link3'][0] : null;
    $data['link3'] = isset($meta['if_events_link3']) ? $meta['if_events_link3'][0] : null;
    return $data;
}
Пример #3
0
$abierto = get_option('bach_open');
$open = get_cat_id($abierto);
$cerrado = get_option('bach_closed');
$closed = get_cat_id($cerrado);
$esperas = get_option('bach_wait');
$espera = get_cat_id($esperas);
$prioridades = get_option('bach_priorities');
$priorities = get_cat_id($prioridades);
$proyectos = get_option('bach_projects');
$proyecto = get_cat_id($proyectos);
$bach_users = get_option('bach_users');
$users = get_cat_id($bach_users);
global $current_user;
get_currentuserinfo();
foreach (get_the_category() as $category) {
    if (get_root_category($category) == $users) {
        $usuario = $category->slug;
        $nombre = $category->name;
    }
    //endif
}
// end foreach
if ($comments) {
    echo "<h3>Comentarios</h3>\n";
    //echo "<ul id=\"comments\" class=\"commentlist\">\n";
    foreach ($comments as $comment) {
        ?>
<ul style="list-style-type:none;">

<li id="comment-<?php 
        comment_ID();
Пример #4
0
                        echo "</b>";
                        $remain = 100 - $valuelength;
                        $subexcerp = substr(get_the_excerpt(), 0, $remain);
                        echo $subexcerp;
                    } else {
                        echo $value;
                    }
                }
            } else {
                echo get_the_excerpt();
            }
            ?>
						</a></p>
						<p class="post_in_list_meta colorscheme_navi smalltext">
						<span class="colorsquare <?php 
            echo get_root_category(get_the_category())->slug;
            ?>
">&nbsp;</span>
						<?php 
            $datetime = get_the_date('j. F Y H:i');
            ?>
						<span title="<?php 
            echo "{$datetime}";
            ?>
">
							<?php 
            echo '<img src="' . get_bloginfo('template_directory') . '/images/calendar16px.png" alt="kalender"/> ' . TimeAgo(get_the_time('U'));
            ?>
						</span>
						<?php 
            echo '<img src="' . get_bloginfo('template_directory') . '/images/category16px.png" alt="rubrik"/> ';
Пример #5
0
    $categAdmin = get_cat_if_user(1);
    // Get displayed home categories for antenna.
    $home_cat = isset($options[$categAdmin]['theme_home_categ_country']) ? $options[$categAdmin]['theme_home_categ_country'][0] : false;
    if ($home_cat) {
        /**
         * Homepage country
         */
        ?>
			<div id="home-list">
			<?php 
        foreach ($home_cat as $id) {
            ?>
				<?php 
            $id = function_exists('icl_object_id') ? icl_object_id($id, 'category', true) : $id;
            $cat = get_category($id);
            $antparent = get_cat_name(get_root_category($id));
            ?>
				<div class="block-home">
					<h2 class="posts-category"><?php 
            echo $cat->name;
            ?>
 / <?php 
            echo $antparent;
            ?>
</h2>
					<?php 
            //alter query
            $time = time() - 60 * 60 * 24;
            $args = array('cat' => $id, 'meta_key' => 'if_events_startdate', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'posts_per_page' => $options[$categAdmin]['theme_home_nb_events_country'], 'meta_query' => array(array('key' => 'if_events_enddate', 'value' => $time, 'compare' => '>=')));
            $event_query = new WP_Query($args);
            include_once ABSPATH . 'wp-admin/includes/plugin.php';
Пример #6
0
/**
 * Returns an array of categories to choose for homepage for Institut Français.
 */
function iftheme_home_categories($pays = NULL)
{
    global $current_user;
    get_currentuserinfo();
    global $sitepress;
    $default_lg = isset($sitepress) ? $sitepress->get_default_language() : get_site_lang();
    $antenna_id = get_cat_if_user($current_user->ID);
    $antenna_id = function_exists('icl_object_id') ? icl_object_id($antenna_id, 'category', TRUE) : $antenna_id;
    //icl_object_id(ID, type, return_original_if_missing,language_code)
    $args = $pays ? array('hide_empty' => 0) : array('child_of' => $antenna_id, 'hide_empty' => 0);
    //$home_categ_options = new array;
    $categories = get_categories($args);
    foreach ($categories as $category) {
        $level = get_level($category->cat_ID);
        //get only second level categories
        //if($level == 1){
        //get all except the level 0 ones
        if ($category->parent) {
            $home_categ_options[$category->term_id] = array('value' => function_exists('icl_object_id') ? icl_object_id($category->term_id, 'category', TRUE, $default_lg) : $category->term_id, 'label' => $category->name, 'antenne' => $pays ? get_cat_name(get_root_category($category->term_id)) : NULL, 'level' => $level);
            if ($pays) {
                $root_categ[get_root_category($category->term_id)] = get_root_category($category->term_id);
            }
        }
    }
    if ($pays) {
        foreach ($root_categ as $k => $id) {
            unset($home_categ_options[$k]);
        }
    }
    return apply_filters('iftheme_home_categories', $home_categ_options);
}