<?php
/**
* Zomag Yellow
* Designed by HPA
* Coded by misbah (ini_misbah@yahoo.com)
*/
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Main Sidebar',
'before_widget' => '<li id="%1$s" class="widget %2$s"><div class="widget-in">',
'after_widget' => '</div></li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
register_sidebar(array(
'name' => 'Front Widget',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
register_sidebars(2,array(
'name' => 'Small Sidebar %d',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
}
//Check for widgets in widget-ready areas http://wordpress.org/support/topic/190184?replies=7#post-808787
//Thanks to Chaos Kaizer http://blog.kaizeku.com/
function is_sidebar_active( $index = 1){
$sidebars = wp_get_sidebars_widgets();
$key = (string) 'sidebar-'.$index;
return (isset($sidebars[$key]));
}
function my_excerpt($str)
{
$arrStr = explode(' ', $str);
if(count($arrStr) > 20){
$arrStr = array_slice($arrStr,0,20);
$str = implode(' ',$arrStr);
}
echo $str;
}
require_once(TEMPLATEPATH . '/widget.php');
include(dirname(__FILE__).'/themetoolkit.php');
$themeName = 'Promag Theme';
$codename = "promag";
$getCategories = get_categories('hide_empty=0&hierarchical=1');
$catArray = array();
foreach ($getCategories as $cat) {
$catArray[$cat->cat_ID] = $cat->cat_name;
}
array_unshift($catArray, "Select a category:");
$numberEntries = '|0|Select a Number:|1|1|2|2|3|3|4|4|5|5|6|6|7|7|8|8|9|9|10|10|12|12|14|14|16|16|18|18|20|20';
$catTmp = '';
foreach ($catArray as $key=>$cat) {
$catTmp .= "|$cat|$cat";
}
themetoolkit(
$codename,
array(
'separator1' => 'Featured Post Settings {separator}',
'featuredCat' => 'Featured Post Category {select'.$catTmp.'} ## Select the category that you would like to have displayed in the top featured post section on your homepage.',
'featuredWidth' => 'Featured Width ## Enter width your featured (default 630) pixel.',
'featuredHeight' => 'Featured Height ## Enter height your featured (default 350) pixel.',
'separator2' => 'Sliding Panel Settings {separator}',
'slideCat' => 'Sliding Panel Category {select'.$catTmp.'} ## Select the category that you would like to have displayed on the sliding.',
'slideNum' => 'Number of sliding panel {select'.$numberEntries.'} ## Select the number of posts to display.',
'feedBurnerID' => 'Feedburner ID ## Your feedburner ID',
'imageLogo' => 'Logo ## Your Logo Url (leave empty for default (text) logo',
),
__FILE__ /* Parent. DO NOT MODIFY THIS LINE !
* This is used to check which file (and thus theme) is calling
* the function (useful when another theme with a Theme Toolkit
* was installed before */
);
if (!$$codename->is_installed()) {
$set_defaults['featuredWidth'] = '630';
$set_defaults['featuredHeight'] = '350';
$result = $$codename->store_options($set_defaults);
}
?>