Advertisement
Guest User

Untitled

a guest
Jan 1st, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.01 KB | None | 0 0
  1. <?php
  2.     define('_LIMIT_' , 10 );
  3.     define('_AUTL_' , 7 );
  4.     define('BLOCK_TITLE_LEN' , 50 );
  5.  
  6. /* S2M en SF maken ruzie over de headerhook, de fix: */
  7. if(has_action( "login_head", "c_ws_plugin__s2member_login_customizations::login_header_styles" ) && (!in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ))) {
  8.   remove_action( "login_head", "c_ws_plugin__s2member_login_customizations::login_header_styles" );
  9. }
  10. /* Einde S2M-SF fix */
  11.    
  12.     /* google maps defines */
  13.     define('MAP_LAT'    , 48.85680934671159 );
  14.     define('MAP_LNG'    , 2.353348731994629 );
  15.     define('MAP_CLAT'   , 48.85700699730661 );
  16.     define('MAP_CLNG'   , 2.354121208190918 );
  17.     define('MAP_ZOOM'   , 15 );
  18.     define('DEFAULT_AVATAR'   , get_template_directory_uri()."/images/default_avatar.jpg" );
  19.     define('DEFAULT_AVATAR_100'   , get_template_directory_uri()."/images/default_avatar_100.jpg" );
  20.     define('DEFAULT_AVATAR_LOGIN'   , get_template_directory_uri()."/images/default_avatar_login.png" );
  21.     define( '_TN_'      , get_current_theme() );
  22.     define('BRAND'      , '' );
  23.     define('ZIP_NAME'   , 'iLoveit' );
  24.  
  25.  
  26.     add_action('admin_bar_menu', 'de_cosmotheme');
  27.    
  28.     include 'lib/php/main.php';
  29.  
  30.    
  31.    
  32.     include 'lib/php/actions.register.php';
  33.     include 'lib/php/menu.register.php';
  34.  
  35.     $content_width = 600;
  36.  
  37.     if( function_exists( 'add_theme_support' ) ){
  38.         add_theme_support( 'automatic-feed-links' );
  39.         add_theme_support( 'post-thumbnails' );
  40.     }
  41.  
  42.     image::add_size();
  43.  
  44.     if( isset( $_GET['post_id'] ) && $_GET['post_id'] == -1 ){
  45.         /*disable flash uploader, we need that to avoid uploader failure on front end*/
  46.         add_filter('flash_uploader', '__return_false', 5);
  47.     }
  48.  
  49.     add_custom_background();
  50.     add_theme_support( 'post-formats' , array( 'image' , 'video' , 'audio' ) );
  51.     add_editor_style('editor-style.css');
  52.    
  53.    
  54.  
  55.     /* Localization */
  56.     load_theme_textdomain( 'cosmotheme' );
  57.     load_theme_textdomain( 'cosmotheme' , get_template_directory() . '/languages' );
  58.    
  59.     if ( function_exists( 'load_child_theme_textdomain' ) ){
  60.         load_child_theme_textdomain( 'cosmotheme' );
  61.     }
  62.  
  63.     function remove_post_format_fields() {
  64.         remove_meta_box( 'formatdiv' , 'post' , 'side' );
  65.     }
  66.     add_action( 'admin_menu' , 'remove_post_format_fields' );
  67.    
  68.     if(is_admin() && ini_get('allow_url_fopen') == '1'){
  69.         /*New version check*/  
  70.         if( options::logic( 'cosmothemes' , 'show_new_version' ) ){
  71.             function versionNotify(){
  72.                 echo api_call::compareVersions();
  73.             }
  74.        
  75.             // Add hook for admin <head></head>
  76.             add_action('admin_head', 'versionNotify');
  77.         }
  78.  
  79.         /*Cosmo news*/
  80.         if( options::logic( 'cosmothemes' , 'show_cosmo_news' ) && !isset($_GET['post_id'])  && !isset($_GET['post'])){
  81.             function doCosmoNews(){
  82.                 echo api_call::getCosmoNews();
  83.             }
  84.        
  85.             // Add hook for admin <head></head>
  86.             add_action('admin_head', 'doCosmoNews');
  87.         }  
  88.     }
  89.  
  90.     /* Cosmothemes Backend link */
  91.     function de_cosmotheme() {
  92.         global $wp_admin_bar;    
  93.         if ( !is_super_admin() || !is_admin_bar_showing() ){
  94.             return;
  95.         }
  96.         $wp_admin_bar -> add_menu( array(
  97.             'id' => 'cosmothemes',
  98.             'parent' => '',
  99.             'title' => _TN_,
  100.             'href' => admin_url( 'admin.php?page=cosmothemes__general' )
  101.             ) );  
  102.     }
  103.  
  104.     add_filter('excerpt_length', 'cosmo_excerpt_length');
  105.     function cosmo_excerpt_length($length) {
  106.         return 70;  /* Or whatever you want the length to be. */
  107.     }
  108.  
  109.     /*allow subscribers to upload files*/
  110.     if ( current_user_can('subscriber') && !current_user_can('upload_files') )
  111.     add_action('admin_init', 'allow_subscriber_uploads');
  112.  
  113.     function allow_subscriber_uploads() {
  114.         $subscriber = get_role('subscriber');
  115.         $subscriber->add_cap('upload_files');
  116.     }
  117.  
  118.     if( !options::logic( 'general' , 'show_admin_bar' ) ){
  119.         add_filter( 'show_admin_bar', '__return_false' );
  120.     }
  121.  
  122.  
  123.     add_custom_background();
  124.     add_editor_style('editor-style.css');
  125. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement