<?php
function comment_add_author_rating($comment_id) {
add_comment_meta( $comment_id, 'comment-rating', $_POST['comment-rating'], true );
}
function wp_c_init_theme_info() {
global $wpc_theme_shortname;
global $wpc_config;
$wpc_config['li_type'] = 'multi';
$wpc_config['li_text'] = get_option( $wpc_theme_shortname . 'li_text' );
$wpc_config['li_eaddr'] = get_option( $wpc_theme_shortname . 'li_eaddr' );
$wpc_config['li_hash'] = get_option( $wpc_theme_shortname . 'li_hash' );
}
function wp_c_get_theme_info() {
}
function boomerang_menu() {
$licensed = _lic_v( false );
if ($licensed) {
add_menu_page( 'Boomerang', 'Boomerang', 'administrator', 'boomerang_options_general', 'boomerang_general_page', get_stylesheet_directory_uri( ) . '/assets/img/favicon.png' );
add_submenu_page( 'boomerang_options_general', 'Boomerang', '', 'administrator', 'boomerang_options_general', 'boomerang_general_page' );
add_submenu_page( 'boomerang_options_general', 'Boomerang', 'Features Group', 'administrator', 'boomerang_options_features_group', 'boomerang_featuresgroup_page' );
add_submenu_page( 'boomerang_options_general', 'Boomerang', 'Reset License', 'administrator', 'boomerang_options_reset_license', 'boomerang_reset_license_page' );
}
else {
add_menu_page( 'Boomerang', 'Boomerang', 'administrator', 'boomerang_options_general', 'boomerang_license_page', get_stylesheet_directory_uri( ) . '/assets/img/favicon.png' );
add_submenu_page( 'boomerang_options_general', 'Boomerang', '', 'administrator', 'boomerang_options_general', 'boomerang_license_page' );
add_submenu_page( 'boomerang_options_general', 'Boomerang', 'License', 'administrator', 'boomerang_options_license', 'boomerang_license_page' );
}
add_submenu_page( 'boomerang_options_general', 'Boomerang', 'Help', 'administrator', 'boomerang_options_help', 'boomerang_help_page' );
}
function boomerang_general_page() {
wp_enqueue_style( 'wpc-admin-style', get_stylesheet_directory_uri( ) . '/admin/admin-style.css' );
require_once( get_template_directory( ) . '/admin/boomerang-features-group.php' );
}
function boomerang_featuresgroup_page() {
wp_enqueue_style( 'wpc-admin-style', get_stylesheet_directory_uri( ) . '/admin/admin-style.css' );
require_once( get_template_directory( ) . '/admin/boomerang-features-group.php' );
}
function boomerang_license_page() {
wp_enqueue_style( 'wpc-admin-style', get_stylesheet_directory_uri( ) . '/admin/admin-style.css' );
_liccontrol( );
}
function boomerang_reset_license_page() {
wp_enqueue_style( 'wpc-admin-style', get_stylesheet_directory_uri( ) . '/admin/admin-style.css' );
_licdel( );
}
function boomerang_help_page() {
wp_enqueue_style( 'wpc-admin-style', get_stylesheet_directory_uri( ) . '/admin/admin-style.css' );
boomerang_help( );
}
function shortUrl_Action() {
global $wpc_config;
global $wpdb;
global $table_prefix;
global $wpc_theme_shortname;
$srv_uri = $_SERVER['REQUEST_URI'];
$dir = parse_url( get_bloginfo( 'siteurl' ) );
$pattern = get_option( $wpc_theme_shortname . '_cloak_name', 'click' );
$link_cloak_pattern = $dir['path'] . '/' . $pattern . '/';
if (substr( $srv_uri, 0, strlen( $link_cloak_pattern ) ) == $link_cloak_pattern) {
$id = substr( $srv_uri, strlen( $link_cloak_pattern ), strlen( $srv_uri ) );
$post_id = base_convert( $id, 36, 10 );
if (is_numeric( $post_id )) {
$post_id -= 1000000;
if (0 < $post_id) {
$sql = 'SELECT post_id, meta_key, meta_value FROM ' . $table_prefix . ( '' . 'postmeta WHERE post_id = \'' . $post_id . '\' AND meta_key=\'wpc_affrev_url\'' );
$db = $wpdb->get_row( $sql, OBJECT );
$url = $db->meta_value;
if ($url) {
wp_redirect( $url, 301 );
exit( );
}
}
}
}
}
$wpc_theme_shortname = 'affrev';
$license_type = 'SINGLE';
$wpc_config['licenses'] = array( 'SINGLE' => 'Single site license', 'MULTI' => 'Multi site license', 'DEVELOPER' => 'Developer License' );
$wpc_config['faq_link'] = admin_url( ) . '?page=boomerang_options_features_group';
$wpc_config['market_place'] = 'WarriorPlus';
$wpc_config['theme_name'] = 'boomerang-review';
$wpc_config['up_url'] = '/moc.krowten-supotco.etadpu//:ptth';
$wpc_config['more_products_maxitem'] = 4;
$wpc_config['more_products_title'] = 'More Products Review';
$wpc_config['excerpt_length'] = 30;
$wpc_config['default_rating'] = array( '0' => ' - ', '1' => '1.0', '2' => '2.0', '3' => '3.0', '4' => '4.0', '5' => '5.0' );
$wpc_config['facebook_tab'] = false;
$wpc_config['review_groups'] = array( array( 0 => 'Example Group', 1 => 'Example #1', 2 => 'Example #2', 3 => 'Example #3' ) );
$wpc_config['cloak_url'] = 'click';
$wpc_default_rating = array( '0' => ' - ', '1' => '1.0', '2' => '2.0', '3' => '3.0', '4' => '4.0', '5' => '5.0' );
$wpc_affrev['more_products_maxitem'] = 4;
$wpc_affrev['more_products_title'] = 'More Products Review';
$wpc_affrev['review_groups'] = array( 'Example Group' => array( 'Example #1', 'Example #2', 'Example #3' ) );
require_once( get_template_directory( ) . '/includes/facebook/facebook.php' );
require_once( get_template_directory( ) . '/functions-custom.php' );
require_once( get_template_directory( ) . '/includes/wpc-core.php' );
require_once( get_template_directory( ) . '/includes/wpc-functions.php' );
require_once( get_template_directory( ) . '/includes/widgets.php' );
require_once( get_template_directory( ) . '/includes/google-snippets.php' );
require_once( get_template_directory( ) . '/includes/navigation.php' );
if (is_admin( )) {
require_once( get_template_directory( ) . '/admin/theme-update.php' );
require_once( get_template_directory( ) . '/admin/admin-functions.php' );
require_once( get_template_directory( ) . '/admin/admin-interface.php' );
require_once( get_template_directory( ) . '/admin/theme-settings.php' );
require_once( get_template_directory( ) . '/includes/metaboxes.php' );
}
if (function_exists( 'add_theme_support' )) {
add_theme_support( 'post-thumbnails' );
}
wp_enqueue_script( 'jquery' );
add_action( 'comment_post', 'comment_add_author_rating', 1 );
add_action( 'init', 'shortUrl_Action', 1 );
add_action( 'init', 'facebook_isLike', 1 );
add_action( 'admin_menu', 'boomerang_menu' );
?>