Exemplo n.º 1
0
                    </ul>
                    <p class="fr"><?php 
echo date('l, ');
echo date(get_option('date_format'));
?>
</p>
    		</div>
    	</div>	
        <?php 
get_template_part('info/featured');
?>
        <?php 
get_template_part('info/latest-posts');
?>
        <?php 
$front_p_sidebar = admin_options::get_values('front_page', 'layout');
?>
        
        <div class="b c_1">
        	<?php 
getAdvertisement('zone_1');
?>
        	
        </div>
        <!--Categories and right side-->
		<div class="b c_2_l cat">
			<div class="cat <?php 
if ($front_p_sidebar == 'left-sidebar') {
    echo 'fr';
}
?>
Exemplo n.º 2
0
function getAdvertisement($ad_name)
{
    if (trim(admin_options::get_values('advertising', $ad_name)) != '') {
        echo '<div class="cosmo-ads">' . trim(admin_options::get_values('advertising', $ad_name)) . '</div>';
    }
}
Exemplo n.º 3
0
// BASE DEFINES
define('_HOME_LABEL_', 'Home');
define('_LIMIT_', 10);
define('BREAKING NEWS', 'breaking news');
define('FEATURED POSTS', 'featured post');
define('BLOCK_TITLE_LEN', 65);
define('ZIP_NAME', 'cosmomagazine');
// LIBRARY SETTINGS
include 'lib/db.php';
include 'lib/main.php';
// INIT ADMIN SIDE SETTINGS
if (function_exists('add_theme_support')) {
    add_theme_support('automatic-feed-links');
    add_theme_support('post-thumbnails');
}
admin_options::Init();
if (!isset($content_width)) {
    $content_width = 620;
}
/*New version check*/
if (is_admin()) {
    function versionNotify()
    {
        echo api_call::compareVersions();
    }
    // Add hook for admin <head></head>
    add_action('admin_head', 'versionNotify');
}
if (function_exists('add_theme_support')) {
    add_theme_support('automatic-feed-links');
    add_theme_support('post-thumbnails');
Exemplo n.º 4
0
            echo mysql2date(get_option('date_format'), $comment->comment_date);
            ?>
</span>	
				</li>
					
			<?php 
        }
    }
    /*EOF else*/
    ?>
		</ul>
	</div>
	<div>
		<?php 
    if (admin_options::get_values('tabber', 'max_nr_tags') != '') {
        $args = array('number' => admin_options::get_values('tabber', 'max_nr_tags'), 'orderby' => 'count', 'order' => 'DESC');
        $tags = get_tags($args);
    } else {
        $tags = get_tags();
    }
    if (!sizeof($tags)) {
        _e('There are no tags', 'cosmotheme');
    } else {
        foreach ($tags as $tag) {
            $tag_link = get_tag_link($tag->term_id);
            ?>
			
					
				<p class="tags"><a href="<?php 
            echo $tag_link;
            ?>
<?php

$number_latest_posts = 4;
/*get featured posts to be able to exclude them from latest posts*/
$numberposts = admin_options::get_values('featured_news', 'nr_posts');
$featured_categories_list = implode(',', admin_options::get_values('featured_news', 'category'));
$args = array('numberposts' => $numberposts, 'category' => $featured_categories_list);
$featured_posts = get_posts($args);
$excluded_posts = '0';
foreach ($featured_posts as $post) {
    $excluded_posts = $excluded_posts . ',' . $post->ID;
}
$args = array('numberposts' => $number_latest_posts, 'exclude' => $excluded_posts);
$latest_posts = get_posts($args);
if (count($latest_posts) > 0) {
    ?>
	<!--Latest posts-->
	<div class="b c_1">
		<div>
			<h3 class="h3title"><span><?php 
    _e('Latest news', 'cosmotheme');
    ?>
</span></h3>
		</div>
	</div>
	<div class="b c_4 latest">
		<?php 
    foreach ($latest_posts as $post) {
        if (get_post_thumbnail_id($post->ID)) {
            $latest_post_img = wp_get_attachment_image(get_post_thumbnail_id($post->ID), 'latest', '');
        } else {
Exemplo n.º 6
0
			<li><a href="#social_profiles"><span><?php 
_e('Social', 'cosmotheme');
?>
</span></a></li>
			<li><a href="#advertising"><span><?php 
_e('Advertisement', 'cosmotheme');
?>
</span></a></li>
            <li class="current"></li>
		</ul>
		<div id="scroller-window">
			<div id="scroller-vertical" style="background:#fff; opacity:0; min-height:500px; filter:Alpha(opacity='100'); ">
				<form method="post" action="options.php" class="settings" width="100%"  id="settings_form">
                    <?php 
settings_fields('settings');
?>
                    <?php 
admin_options::get_box(__('General Settings', 'cosmotheme'), array('logo', 'blog_settings'), 'general_settings');
admin_options::get_box(__('Front Page Settings', 'cosmotheme'), array('breaking_news', 'featured_news', 'front_page'), 'front_page_settings');
admin_options::get_box(__('Sidebar Tabber', 'cosmotheme'), 'tabber', 'tabber');
admin_options::get_box(__('Menu', 'cosmotheme'), 'menu', 'menu');
admin_options::get_box(__('Post Settings', 'cosmotheme'), 'post_settings', 'post_settings');
admin_options::get_box(__('Social Profiles', 'cosmotheme'), 'social_profiles', 'social_profiles');
admin_options::get_box(__('Advertising Settings', 'cosmotheme'), 'advertising', 'advertising');
?>
                </form>
			</div>
		</div>
        <br />
	</div>
</div>
Exemplo n.º 7
0
$default['tabber']['status'] = 'yes';
$default['tabber']['popular_num'] = 5;
$default['tabber']['latest_num'] = 5;
$default['tabber']['comments_num'] = 5;
$default['logo']['type'] = 'text_logo';
$default['front_page']['layout'] = 'right-sidebar';
$default['front_page']['categories'] = admin_options::get_categories(6, $exclude);
$default['front_page']['nr_post'] = 6;
$default['logo']['title'] = get_option('blogname');
$default['logo']['description'] = get_option('blogdescription');
$default['social_profiles']['twitter_id'] = 'cosmothemes';
$default['social_profiles']['fb_id'] = '158264557568118';
$default['advertising']['zone_1'] = '';
$default['post_settings']['social_sharing'] = 'yes';
$default['post_settings']['nbr_similar_posts'] = 4;
foreach ($inputs as $group => $inp) {
    if ($group != '_') {
        admin_options::$register['settings'][] = $group;
    }
}
admin_options::$inputs = $inputs;
admin_options::$default = $default;
if (isset($_GET['page']) && $_GET['page'] == 'settings') {
    update_option('blogname', admin_options::get_values('logo', 'title'));
    update_option('blogdescription', admin_options::get_values('logo', 'description'));
} else {
    $antet = get_option('logo');
    $antet['title'] = get_option('blogname');
    $antet['description'] = get_option('blogdescription');
    update_option('logo', $antet);
}
Exemplo n.º 8
0
    $category_link = get_category_link($category->cat_ID);
    ?>
		<div class="cat_list full">
			<h3 class="h3title"><a href="<?php 
    echo $category_link;
    ?>
"><span><?php 
    echo $category->cat_name;
    ?>
</span></a></h3>
			<div class="cat inline-block">
				<ul class="switch half clearfix">
		
		<?php 
    //$numberposts = admin::get_field_val('category_posts_nbr_front');
    $numberposts = admin_options::get_values('front_page', 'nr_post');
    $post_number = 0;
    $args = array('cat' => $category->cat_ID, 'showposts' => 100, 'orderby' => 'date');
    $cat_posts = new WP_Query($args);
    while ($cat_posts->have_posts()) {
        $cat_posts->the_post();
        if (get_post_thumbnail_id($post->ID)) {
            $post_img = wp_get_attachment_image(get_post_thumbnail_id($post->ID), '62x62', '');
        } else {
            $post_img = get_first_image($post->ID, '54x54');
        }
        if (in_category($category->cat_ID, $post->ID) && $post_number < $numberposts) {
            ?>
				<li <?php 
            if ($post_number % 2 == 1) {
                echo "class='col_2'";
/*EOF if*/
?>

	<!--Similar posts-->
	<?php 
$categoriess = wp_get_post_categories($post->ID);
/*here we get all categories for the current post*/
$excluded_categories = array_merge((array) admin_options::get_values('featured_news', 'category'), (array) admin_options::get_values('breaking_news', 'category'));
/* now we need to remove "featured post" and  "breaking news" categories */
foreach ($excluded_categories as $excluded_category) {
    if (is_numeric(array_search($excluded_category, $categoriess))) {
        unset($categoriess[array_search($excluded_category, $categoriess)]);
    }
}
$cats_list = implode(',', $categoriess);
$args = array('cat' => $cats_list, 'post__not_in' => array($post->ID), 'orderby' => 'modified', 'posts_per_page' => admin_options::get_values('post_settings', 'nbr_similar_posts'), 'order' => 'DESC');
$query = new WP_Query($args);
if ($query->found_posts > 0) {
    ?>
		<div class="cat inline-block">
			<div class="cat_list full">
				<h3 class="h3title"><span><?php 
    _e('Similar posts', 'cosmotheme');
    ?>
</span></h3>
				<div>
				<?php 
    $post_layout = get_post_meta($post->ID, 'layout', true);
    ?>
				<ul  class="switch half clearfix <?php 
    if ($post_layout == 'layout-full') {
Exemplo n.º 10
0
.cosmo-textures .cosmo-textures-img:hover, .cosmo-textures .cosmo-textures-img {
    border: 3px solid #AAAAAA;
}
 .cosmo-textures-img.selected{
border: 3px solid #AAAACC !important;
}


div.logo h1 a {
    float: left;
    font-family: '<?php 
echo admin_options::get_values('text_logo', 'font');
?>
' , arial, serif !important;
    font-size:<?php 
echo admin_options::get_values('text_logo', 'font_size');
?>
px;
    display:block;
    text-decoration:none;
    color:#343434;
}

div.logo h1 a span{
    float:left;
    width:100%;
    color:#9A9A9A;
    font-family:Arial;
    margin-top:15px;
    font-size:10px;
}
Exemplo n.º 11
0
			</div> <!-- EOF b_page -->
                        <div class="b_body_f">
                                <div class="b c_1">
                                        <div>
                                                <?php 
echo menu('menu_in_footer', array('number-items' => admin_options::get_values('menu', 'footer')));
?>
                                        </div>
                                        <div class="copyright">
                                            <p class="fl">&copy; 2013 <a href="<?php 
echo home_url();
?>
"><?php 
bloginfo('name');
?>
</a>. All Rights Reserved</p>
											<p class="fr">Powered By TFLSPBSMUN2013</p>
                                        </div>
                                </div>
                        </div>
		</div> <!-- b_body_c -->
	</div> 
</div> <!-- b_body -->
	<?php 
wp_footer();
echo admin_options::get_values('blog_settings', 'tracking_code');
?>
</body>
</html>
Exemplo n.º 12
0
"><?php 
echo $logo_text;
?>
<span><?php 
echo $logo_text_description;
?>
</span></a></h1>
					</div>
					<div class="fr">
						<?php 
get_search_form();
?>
					</div>
				</div>

				<!--Main menu-->
					<?php 
?>
					<div class="b c_1 top_menu">
						<div>
                            <?php 
$exclude = array_merge((array) admin_options::get_values('featured_news', 'category'), (array) admin_options::get_values('breaking_news', 'category'));
$menu = array('menu_id' => 'menu-top-menu', 'class' => 'sf-menu', 'type' => 'category', 'before-item' => '<span>&nbsp;</span>', 'exclude' => $exclude, 'number-items' => admin_options::get_values('menu', 'header'));
echo menu('menu_in_header', $menu);
?>
						</div>

					</div>
                </div>

                <div class="b_page">