. */ /** DEFINES */ define('BENDER_THEME_VERSION', '314'); if( (string)osc_get_preference('keyword_placeholder', 'bender')=="" ) { Params::setParam('keyword_placeholder', __('ie. PHP Programmer', 'bender') ) ; } osc_register_script('fancybox', osc_current_web_theme_url('js/fancybox/jquery.fancybox.pack.js'), array('jquery')); osc_enqueue_style('fancybox', osc_current_web_theme_url('js/fancybox/jquery.fancybox.css')); osc_enqueue_script('fancybox'); osc_enqueue_style('font-awesome', osc_current_web_theme_url('css/font-awesome-4.1.0/css/font-awesome.min.css')); // used for date/dateinterval custom fields osc_enqueue_script('php-date'); if(!OC_ADMIN) { osc_enqueue_style('fine-uploader-css', osc_assets_url('js/fineuploader/fineuploader.css')); osc_enqueue_style('bender-fine-uploader-css', osc_current_web_theme_url('css/ajax-uploader.css')); } osc_enqueue_script('jquery-fineuploader'); /** FUNCTIONS */ // install options if( !function_exists('bender_theme_install') ) { function bender_theme_install() { osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'bender'); osc_set_preference('version', BENDER_THEME_VERSION, 'bender'); osc_set_preference('footer_link', '1', 'bender'); osc_set_preference('donation', '0', 'bender'); osc_set_preference('defaultShowAs@all', 'list', 'bender'); osc_set_preference('defaultShowAs@search', 'list'); osc_set_preference('defaultLocationShowAs', 'dropdown', 'bender'); // dropdown / autocomplete osc_reset_preferences(); } } // update options if( !function_exists('bender_theme_update') ) { function bender_theme_update($current_version) { if($current_version==0) { bender_theme_install(); } osc_delete_preference('default_logo', 'bender'); $logo_prefence = osc_get_preference('logo', 'bender'); $logo_name = 'bender_logo'; $temp_name = WebThemes::newInstance()->getCurrentThemePath() . 'images/logo.jpg'; if( file_exists( $temp_name ) && !$logo_prefence) { $img = ImageResizer::fromFile($temp_name); $ext = $img->getExt(); $logo_name .= '.'.$ext; $img->saveToFile(osc_uploads_path().$logo_name); osc_set_preference('logo', $logo_name, 'bender'); } osc_set_preference('version', '301', 'bender'); if($current_version<313 || $current_version=='3.0.1') { // add preferences osc_set_preference('defaultLocationShowAs', 'dropdown', 'bender'); osc_set_preference('version', '313', 'bender'); } osc_set_preference('version', '314', 'bender'); osc_reset_preferences(); } } if(!function_exists('check_install_bender_theme')) { function check_install_bender_theme() { $current_version = osc_get_preference('version', 'bender'); //check if current version is installed or need an update< if( $current_version=='' ) { bender_theme_update(0); } else if($current_version < BENDER_THEME_VERSION){ bender_theme_update($current_version); } } } if(!function_exists('bender_add_body_class_construct')) { function bender_add_body_class_construct($classes){ $benderBodyClass = benderBodyClass::newInstance(); $classes = array_merge($classes, $benderBodyClass->get()); return $classes; } } if(!function_exists('bender_body_class')) { function bender_body_class($echo = true){ /** * Print body classes. * * @param string $echo Optional parameter. * @return print string with all body classes concatenated */ osc_add_filter('bender_bodyClass','bender_add_body_class_construct'); $classes = osc_apply_filter('bender_bodyClass', array()); if($echo && count($classes)){ echo 'class="'.implode(' ',$classes).'"'; } else { return $classes; } } } if(!function_exists('bender_add_body_class')) { function bender_add_body_class($class){ /** * Add new body class to body class array. * * @param string $class required parameter. */ $benderBodyClass = benderBodyClass::newInstance(); $benderBodyClass->add($class); } } if(!function_exists('bender_nofollow_construct')) { /** * Hook for header, meta tags robots nofollos */ function bender_nofollow_construct() { echo '' . PHP_EOL; echo '' . PHP_EOL; } } if( !function_exists('bender_follow_construct') ) { /** * Hook for header, meta tags robots follow */ function bender_follow_construct() { echo '' . PHP_EOL; echo '' . PHP_EOL; } } /* logo */ if( !function_exists('logo_header') ) { function logo_header() { $logo = osc_get_preference('logo','bender'); $html = ''; if( $logo!='' && file_exists( osc_uploads_path() . $logo ) ) { return $html; } else { return ''.osc_page_title().''; } } } /* logo */ if( !function_exists('bender_logo_url') ) { function bender_logo_url() { $logo = osc_get_preference('logo','bender'); if( $logo ) { return osc_uploads_url($logo); } return false; } } if( !function_exists('bender_draw_item') ) { function bender_draw_item($class = false,$admin = false, $premium = false) { $filename = 'loop-single'; if($premium){ $filename .='-premium'; } require WebThemes::newInstance()->getCurrentThemePath().$filename.'.php'; } } if( !function_exists('bender_show_as') ){ function bender_show_as(){ $p_sShowAs = Params::getParam('sShowAs'); $aValidShowAsValues = array('list', 'gallery'); if (!in_array($p_sShowAs, $aValidShowAsValues)) { $p_sShowAs = bender_default_show_as(); } return $p_sShowAs; } } if( !function_exists('bender_default_show_as') ){ function bender_default_show_as(){ return getPreference('defaultShowAs@all','bender'); } } if( !function_exists('bender_default_location_show_as') ){ function bender_default_location_show_as(){ return osc_get_preference('defaultLocationShowAs','bender'); } } if( !function_exists('bender_draw_categories_list') ) { function bender_draw_categories_list(){ ?> '; } ?> 0) { echo ''; } if($i == 0) { echo '