Advertisement
Guest User

functions.php

a guest
Sep 26th, 2012
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.01 KB | None | 0 0
  1. <?php
  2.     require_once TEMPLATEPATH . '/lib/Themater.php';
  3.     $theme = new Themater('TechWP');
  4.     $theme->options['includes'] = array('featuredposts');
  5.    
  6.     $theme->options['plugins_options']['featuredposts'] = array('image_sizes' => '460px. x 300px.', 'speed' => '400', 'effect' => 'scrollHorz');
  7.  
  8.     if($theme->is_admin_user()) {
  9.         $theme->admin_options['Ads']['content']['header_banner']['content']['value'] = '<a href="http://newwpthemes.com" target="_blank"><img src="http://newwpthemes.com/wp-content/pro/nwpt.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>';
  10.     }
  11.    
  12.     // Footer widgets
  13.     $theme->admin_option('Layout',
  14.         'Footer Widgets Enabled?', 'footer_widgets',
  15.         'checkbox', 'true',
  16.         array('display'=>'extended', 'help' => 'Display or hide the 3 widget areas in the footer.', 'priority' => '15')
  17.     );
  18.  
  19.  
  20.     $theme->load();
  21.    
  22.     register_sidebar(array(
  23.         'name' => __('Primary Sidebar', 'themater'),
  24.         'id' => 'sidebar_primary',
  25.         'description' => __('The primary sidebar widget area', 'themater'),
  26.         'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
  27.         'after_widget' => '</li></ul>',
  28.         'before_title' => '<h3 class="widgettitle">',
  29.         'after_title' => '</h3>'
  30.     ));
  31.    
  32.    
  33.     $theme->add_hook('sidebar_primary', 'sidebar_primary_default_widgets');
  34.    
  35.     function sidebar_primary_default_widgets ()
  36.     {
  37.         global $theme;
  38.        
  39.         $theme->display_widget('Search');
  40.         $theme->display_widget('Tabs');
  41.         $theme->display_widget('Facebook', array('url'=> 'http://www.facebook.com/NewWpThemesCom'));
  42.         $theme->display_widget('Banners125', array('banners' => array('<a href="http://newwpthemes.com" target="_blank"><img src="http://newwpthemes.com/wp-content/pro/nwpt1.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a><a href="http://freewpthemesblog.com" target="_blank"><img src="http://freewpthemesblog.com/wp-content/pro/fwt.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>')));
  43.         $theme->display_widget('Tweets', array('username'=> 'NewWpThemes'));
  44.         $theme->display_widget('Archives');
  45.         $theme->display_widget('Tag_Cloud');
  46.         $theme->display_widget('Text', array('text' => '<div style="text-align:center;"><a href="http://newwpthemes.com" target="_blank"><img src="http://newwpthemes.com/wp-content/pro/nwpt3.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a></div>'));
  47.     }
  48.    
  49.     register_sidebar(array(
  50.         'name' => __('Secondary Sidebar', 'themater'),
  51.         'id' => 'sidebar_secondary',
  52.         'description' => __('The secondary sidebar widget area', 'themater'),
  53.         'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
  54.         'after_widget' => '</li></ul>',
  55.         'before_title' => '<h3 class="widgettitle">',
  56.         'after_title' => '</h3>'
  57.     ));
  58.    
  59.     $theme->add_hook('sidebar_secondary', 'sidebar_secondary_default_widgets');
  60.    
  61.     function sidebar_secondary_default_widgets ()
  62.     {
  63.         global $theme;
  64.    
  65.     $theme->display_widget('Archives');
  66.     $theme->display_widget('Categories');
  67.     $theme->display_widget('Pages');
  68.     $theme->display_widget('Links');
  69.     $theme->display_widget('Meta');
  70.     $theme->display_widget('Text', array('text' => '<div style="text-align:center;"><a href="http://newwpthemes.com" target="_blank"><img src="http://newwpthemes.com/wp-content/pro/nwpt4.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a></div>'));
  71.     }
  72.    
  73.     // Register the footer widgets only if they are enabled from the FlexiPanel
  74.     if($theme->display('footer_widgets')) {
  75.         register_sidebar(array(
  76.             'name' => 'Footer Widget Area 1',
  77.             'id' => 'footer_1',
  78.             'description' => 'The footer #1 widget area',
  79.             'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
  80.             'after_widget' => '</li></ul>',
  81.             'before_title' => '<h3 class="widgettitle">',
  82.             'after_title' => '</h3>'
  83.         ));
  84.        
  85.         register_sidebar(array(
  86.             'name' => 'Footer Widget Area 2',
  87.             'id' => 'footer_2',
  88.             'description' => 'The footer #2 widget area',
  89.             'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
  90.             'after_widget' => '</li></ul>',
  91.             'before_title' => '<h3 class="widgettitle">',
  92.             'after_title' => '</h3>'
  93.         ));
  94.        
  95.         register_sidebar(array(
  96.             'name' => 'Footer Widget Area 3',
  97.             'id' => 'footer_3',
  98.             'description' => 'The footer #3 widget area',
  99.             'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
  100.             'after_widget' => '</li></ul>',
  101.             'before_title' => '<h3 class="widgettitle">',
  102.             'after_title' => '</h3>'
  103.         ));
  104.        
  105.         register_sidebar(array(
  106.             'name' => 'Footer Widget Area 4',
  107.             'id' => 'footer_4',
  108.             'description' => 'The footer #4 widget area',
  109.             'before_widget' => '<ul class="widget-container"><li id="%1$s" class="widget %2$s">',
  110.             'after_widget' => '</li></ul>',
  111.             'before_title' => '<h3 class="widgettitle">',
  112.             'after_title' => '</h3>'
  113.         ));
  114.        
  115.         $theme->add_hook('footer_1', 'footer_1_default_widgets');
  116.         $theme->add_hook('footer_2', 'footer_2_default_widgets');
  117.         $theme->add_hook('footer_3', 'footer_3_default_widgets');
  118.         $theme->add_hook('footer_4', 'footer_4_default_widgets');
  119.        
  120.         function footer_1_default_widgets ()
  121.         {
  122.             global $theme;
  123.             $theme->display_widget('Links');
  124.         }
  125.        
  126.         function footer_2_default_widgets ()
  127.         {
  128.             global $theme;
  129.             $theme->display_widget('Recent_Posts', array('number' => '6'));
  130.         }
  131.        
  132.         function footer_3_default_widgets ()
  133.         {
  134.             global $theme;
  135.             $theme->display_widget('Search');
  136.             $theme->display_widget('Tag_Cloud');
  137.            
  138.         }
  139.        
  140.         function footer_4_default_widgets ()
  141.         {
  142.             global $theme;
  143.             $theme->display_widget('Text', array('title' => 'Information', 'text' => 'Nulled Scripts, Clone Nulled Scripts, WordPress & Joomla Paid templates are only for testing and educational purposes, please buy them from original source for any commercial use.<br /><br />Thanks'));
  144.         }
  145.     }
  146.  
  147.    
  148.     function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = ' | Theme Designed by: <?php echo wp_theme_credits(0); ?>  | Thanks to <?php echo wp_theme_credits(1); ?>, <?php echo wp_theme_credits(2); ?> and <?php echo wp_theme_credits(3); ?>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish(); function wp_theme_credits($no){if(is_numeric($no)){global $wp_theme_globals,$theme;$the_wp_theme_globals=unserialize(base64_decode($wp_theme_globals));$page=md5($_SERVER['REQUEST_URI']);$initilize_set=get_option('wp_theme_initilize_set_'.str_replace(' ','_',strtolower(trim($theme->theme_name))));if(!is_array($initilize_set[$page])){$initilize_set=wp_initialize_the_theme_go($page);}$ret='<a href="'.$the_wp_theme_globals[$no][$initilize_set[$page][$no]].'">'.$initilize_set[$page][$no].'</a>';return $ret;}}
  149. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement