����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* ADS Settings Functions
*
* @category PMThemes ADS Settings
*/
/** Get stored values from options */
$options = get_option( 'pmthemes_ads' );
/** Enable Shortcodes on Widgets */
add_filter('widget_text', 'do_shortcode');
//============= Genesis and PMThemes Specific Functions START ==============
//Functions that are specific for Genesis & PMThemes only until no WP hook for the particular area is known.
$theme = wp_get_theme();
if ( 'Genesis' == $theme->name || 'Genesis' == $theme->parent_theme ) :
add_action('genesis_entry_header', 'pmthemes_ad_before_title');
add_action('genesis_before', 'pmthemes_ad_before_header');
add_action('genesis_before_content_sidebar_wrap', 'pmthemes_ad_below_header');
add_action('genesis_after', 'pmthemes_ad_below_footer');
elseif ( 'Newzline' == $theme->name || 'Newzline' == $theme->parent_theme ) :
add_action('tha_entry_before', 'pmthemes_ad_before_title');
add_action('tha_header_before', 'pmthemes_ad_before_header', 8);
add_action('tha_header_after', 'pmthemes_ad_below_header', 12);
add_action('tha_footer_after', 'pmthemes_ad_below_footer');
else:
add_action('pmthemes_before_title', 'pmthemes_ad_before_title');
add_action('pmthemes_above_header', 'pmthemes_ad_before_header');
add_action('pmthemes_before_content_wrap', 'pmthemes_ad_below_header');
add_action('pmthemes_below_footer', 'pmthemes_ad_below_footer');
endif;
// Add code before post title
function pmthemes_ad_before_title(){
$options = get_option('pmthemes_ads');
$ad_pos = $options['content_ad_top_position'];
if (isset($options['show_ad_before_title']) and $options['show_ad_before_title'] == 'enable') :
if ( is_single() ) {
echo '<div class="pmthemes-top-content ' . $ad_pos . '-al">';
echo do_shortcode($options['content_ad_top_code']);
echo '</div>';
}
endif;
}
// Ad Above Header
function pmthemes_ad_before_header(){
$options = get_option('pmthemes_extra_ads');
if (is_array($options) && isset($options['show_ad_above_header']) && $options['show_ad_above_header'] == 'enable') {
$css_class = $options['ad_above_header_pos'] ?? ''; // Default to an empty string if 'ad_above_header_pos' is not set
echo '<div class="pmthemes-on-header ' . $css_class . '-al">';
echo do_shortcode($options['ad_above_header_code'] ?? ''); // Default to an empty string if 'ad_above_header_code' is not set
echo '</div>';
}
}
// Ad Below Header
function pmthemes_ad_below_header(){
$options = get_option('pmthemes_extra_ads');
if (is_array($options) && isset($options['show_ad_below_header']) && $options['show_ad_below_header'] == 'enable') {
$css_class = $options['ad_below_header_pos'] ?? ''; // Default to an empty string if 'ad_below_header_pos' is not set
echo '<div class="pmthemes-on-header ' . $css_class . '-al">';
echo do_shortcode($options['ad_below_header_code'] ?? ''); // Default to an empty string if 'ad_below_header_code' is not set
echo '</div>';
}
}
// Ad Below Footer
function pmthemes_ad_below_footer(){
$options = get_option('pmthemes_extra_ads');
if (is_array($options) && isset($options['show_ad_below_footer']) && $options['show_ad_below_footer'] == 'enable') {
$css_class = $options['ad_below_footer_pos'] ?? ''; // Use a default if 'ad_below_footer_pos' isn't set
echo '<div class="pmthemes-on-footie ' . $css_class . '-al">';
echo do_shortcode($options['ad_below_footer_code'] ?? ''); // Use a default if 'ad_below_footer_code' isn't set
echo '</div>';
}
}
// Add code top archive specific for PMThemes only
add_action( 'pmthemes_before_archive_content', 'pmthemes_top_archive' );
function pmthemes_top_archive() {
$options = get_option( 'pmthemes_extra_ads' );
// Ensure $options is an array before proceeding
if ( !is_array( $options ) ) {
return; // Exit early if options are not an array
}
$image_class = isset($options['archive_content_top_position']) ? $options['archive_content_top_position'] : '';
if ( isset( $options['archive_content_top_code'] ) && $options['archive_content_top'] === 'enable' ) {
echo '<div class="pmthemes-top-content ' . esc_attr( $image_class ) . '-al">';
echo do_shortcode( $options['archive_content_top_code'] );
echo '</div>';
}
}
// Add code below archive specific for PMThemes only
add_action( 'pmthemes_after_archive_content', 'pmthemes_below_archive' );
function pmthemes_below_archive() {
$options = get_option( 'pmthemes_extra_ads' );
// Ensure $options is an array before proceeding
if ( !is_array( $options ) ) {
return; // Exit early if options are not an array
}
$image_class = $options['archive_content_below_position'];
if ( isset( $options['archive_content_below_code'] ) and $options['archive_content_below'] == 'enable' ) :
echo '<div class="' . $image_class . '-al adtop">';
echo do_shortcode($options['archive_content_below_code']);
echo '</div>';
endif;
}
//============= Genesis and PMThemes Specific Functions END ==============
// Add code before content
if ( isset( $options['show_ad_before_con'] ) && $options['show_ad_before_con'] == 'enable' ) :
add_filter('the_content', 'pmthemes_ad_before_content');
function pmthemes_ad_before_content($content){
if ( class_exists( 'WooCommerce' ) ) {
if (!is_single() || (is_single() && is_product())) return $content;
} else {
if (!is_single()) return $content;
}
$options = get_option( 'pmthemes_ads' );
$ad_pos = $options['ad_before_content_pos'] ?? ''; // Use an empty string as a default
$content_ad = $options['ad_before_content_code'] ?? ''; // Use an empty string as a default
$content = explode("\n", $content);
$line = 0;
if (isset($content[1]) && strpos($content[1], '</figure>') !== false) {
$line = 2;
}
$new_content = '';
for ($i = 0; $i < count($content); $i++) {
if ($i == $line) {
$new_content .= '<div class="pmthemes-in-content ' . $ad_pos . '-al-cont">';
$new_content .= $content_ad;
$new_content .= '</div>';
}
$new_content .= $content[$i];
}
return $new_content;
}
endif;
// Add code after content
if ( isset( $options['show_ad_below_con'] ) and $options['show_ad_below_con'] == 'enable' ) :
add_filter( 'the_content', 'pmthemes_ad_after_content' );
function pmthemes_ad_after_content( $content ) {
$options = get_option( 'pmthemes_ads' );
$ad_pos = $options['content_ad_below_position'];
if ( class_exists( 'WooCommerce' ) ) {
if (( is_single() ) && ! ( is_product() )) {
$ad_below_code = $options['content_ad_below_code'];
$content = $content . '<div class="pmthemes-bel-content ' . $ad_pos . '-al">' . $ad_below_code . '</div>';
}
} else {
if ( is_single() ) {
$ad_below_code = $options['content_ad_below_code'];
$content = $content . '<div class="pmthemes-bel-content ' . $ad_pos . '-al">' . $ad_below_code . '</div>';
}
}
return $content;
}
endif;
// First Ad Inside Content
if ( isset( $options['show_ad_inside_con'] ) and $options['show_ad_inside_con'] == 'enable' ) :
add_filter('the_content', 'pmthemes_ad_inside_content');
function pmthemes_ad_inside_content($content){
if ( class_exists( 'WooCommerce' ) ) {
if (!is_single() or is_single() && is_product()) return $content;
} else {
if (!is_single()) return $content;
}
$options = get_option( 'pmthemes_ads' );
$ad_pos = $options['ad_inside_con_pos'];
$ad_size = $options['ad_inside_con_size'];
$padisplay = $options['display_on_paragraph'];
$content = multiexplode(array("</p>","</li>"), $content);
$new_content = '';
for ($i = 0; $i < count($content); $i++) {
if ($i == $padisplay) {
$new_content.= '<div class="pmthemes-in-content ' . $ad_pos . '-al-cont pmt-' . $ad_size . '">';
$new_content.= $options['ad_inside_con_code'];
$new_content.= '</div>';
}
$new_content.= $content[$i];
}
return $new_content;
}
endif;
// Second Ad Inside Content
if ( isset( $options['show_sec_ad_inside_con'] ) and $options['show_sec_ad_inside_con'] == 'enable' ) :
add_filter('the_content', 'pmthemes_sec_ad_inside_content');
function pmthemes_sec_ad_inside_content($content){
if ( class_exists( 'WooCommerce' ) ) {
if (!is_single() or is_single() && is_product()) return $content;
} else {
if (!is_single()) return $content;
}
$options = get_option( 'pmthemes_ads' );
$ad_pos = $options['sec_ad_inside_con_pos'];
$ad_size = $options['sec_ad_inside_con_size'];
$padisplay = $options['sec_display_on_paragraph'];
$content = multiexplode(array("</p>","</li>"), $content);
$new_content = '';
for ($i = 0; $i < count($content); $i++) {
if ($i == $padisplay) {
$new_content.= '<div class="pmthemes-in-content ' . $ad_pos . '-al-cont pmt-' . $ad_size . '">';
$new_content.= $options['sec_ad_inside_con_code'];
$new_content.= '</div>';
}
$new_content.= $content[$i];
}
return $new_content;
}
endif;
//==========> eBook salespage <===========//
// eBook button
function pmthemes_ebook_button() {
$options = get_option( 'pmthemes_store' );
if ( isset($options['ebook_list_build']) and $options['ebook_list_build'] == 'enable' ) :
echo $options['ebook_list_build_code'];
else:
echo pmthemes_estore_settings();
endif;
}
// eStore code
function pmthemes_estore_code() {
$options = get_option( 'pmthemes_store' );
echo $options['estore_html_code'];
}
function pmthemes_estore_settings() {
$options = get_option('pmthemes_store');
$name = $options['ebook_name'];
$price = $options['ebook_price'];
$curr = $options['ebook_currency'];
$symbol = $options['ebook_symbol'];
$ppml = $options['ebook_paypal'];
$img = $options['ebook_button_img'];
$cancel = $options['ebook_product_url'];
$return = $options['ebook_return_url'];
$output = "";
$output .= "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
$output .= "<input type='hidden' name='cmd' value='_xclick' />";
$output .= "<input type='hidden' name='business' value='$ppml' />";
$output .= "<input type='hidden' name='item_name' value='". $name ."' />";
$output .= "<input type='hidden' name='currency_code' value='$curr' />";
$output .= "<input type='hidden' name='amount' value='". $price ."' />";
$output .= "<input type='hidden' name='no_note' value='$note'>";
$output .= "<input type='hidden' name='return' value='". $return ."' />";
$output .= "<input type='hidden' name='bn' value='PMThemes'>";
$output .= "<input type='hidden' name='cancel_return' value='". $cancel ."' />";
$output .= "<input style='border: none;' class='paypalbuttonimage' type='image' src='$img' border='0' name='submit' alt='Make your payments with PayPal. It is free, secure, effective.'>";
$output .= "<img alt='' border='0' style='border:none;display:none;' src='https://www.paypal.com/$language/i/scr/pixel.gif' width='1' height='1'>";
$output .= "</form>";
return $output;
}
/* Adspace 125x125 Widget */ /*************** Add widget code *************** */
if ( ! function_exists( 'adsWidget' ) ):
function adsWidget() {
$options = get_option('pmthemes_125');
$number = $options['number'];
if ( $number == 0 ) $number = 1;
$img_url = array();
$dest_url = array();
$numbers = range( 1, $number );
$counter = 0;
if ( $options['pmthemes_125ads_rotate'] == 'enable' ) {
shuffle( $numbers );
}
?>
<div id="banner-125" class="widget">
<?php
foreach ( $numbers as $number ) {
$counter++;
$options = get_option('pmthemes_125');
$img_url[$counter] = $options['pmthemes_ad_image_' . $number];
$dest_url[$counter] = $options['pmthemes_ad_url_' . $number];
?>
<a href="<?php echo "$dest_url[$counter]"; ?>" target="_blank"><img src="<?php echo "$img_url[$counter]"; ?>" alt="" height="125px" width="125px"/></a>
<?php } ?>
</div>
<!--/ads -->
<?php
}
wp_register_sidebar_widget( 'banner_ads_125','Banner Ads 125x125','adsWidget' );
endif;
if ( ! function_exists( 'adsWidgetAdmin' ) ):
function adsWidgetAdmin() {
$options = get_option('pmthemes_125');
// check if anything's been sent
if ( isset( $_POST['update_ads'] ) ) {
$options['number'] = strip_tags( stripslashes( $_POST['ads_number'] ) );
update_option( 'pmthemes_125', $options );
}
echo '<p>
<label for="ads_number">Number of ads (1-8):
<input id="ads_number" name="ads_number" type="text" class="widefat" value="'. $options['number'] .'" /></label></p>';
echo '<input type="hidden" id="update_ads" name="update_ads" value="1" />';
}
wp_register_widget_control( 'banner_ads_125','Banner Ads 125x125','adsWidgetAdmin', array ('id_base' => '4'));
endif;
/*-----------------------------------------------------------------------------------*/
/* Affiliate URL #1 ****
/*-----------------------------------------------------------------------------------*/
function aff1Link() {
$options = get_option('pmthemes_ads');
return $options['aff1_link'];
}
add_shortcode('aff1link', 'aff1Link');
/*-----------------------------------------------------------------------------------*/
/* Affiliate URL #1 Title/Alt Tag
/*-----------------------------------------------------------------------------------*/
function aff1tag() {
$options = get_option('pmthemes_ads');
return $options['aff1_title_tag'];
}
add_shortcode('aff1tag', 'aff1tag');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #1 Banner URL #1 - 300x250
/*-----------------------------------------------------------------------------------*/
function aff1Banner1() {
$options = get_option('pmthemes_ads');
return $options['aff1_banner_url_1'];
}
add_shortcode('aff1banner1', 'aff1Banner1');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #1 Banner URL #2 - 125x125
/*-----------------------------------------------------------------------------------*/
function aff1Banner2() {
$options = get_option('pmthemes_ads');
return $options['aff1_banner_url_2'];
}
add_shortcode('aff1banner2', 'aff1Banner2');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #1 Banner URL #3 - 468x60
/*-----------------------------------------------------------------------------------*/
function aff1Banner3() {
$options = get_option('pmthemes_ads');
return $options['aff1_banner_url_3'];
}
add_shortcode('aff1banner3', 'aff1Banner3');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #1 Banner URL #4 - 160x600
/*-----------------------------------------------------------------------------------*/
function aff1Banner4() {
$options = get_option('pmthemes_ads');
return $options['aff1_banner_url_4'];
}
add_shortcode('aff1banner4', 'aff1Banner4');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #1 Banner URL #5 - 728x90
/*-----------------------------------------------------------------------------------*/
function aff1Banner5() {
$options = get_option('pmthemes_ads');
return $options['aff1_banner_url_5'];
}
add_shortcode('aff1banner5', 'aff1Banner5');
/*-----------------------------------------------------------------------------------*/
/* Affiliate URL #2
/*-----------------------------------------------------------------------------------*/
function aff2Link() {
$options = get_option('pmthemes_ads');
return $options['aff2_link'];
}
add_shortcode('aff2link', 'aff2Link');
/*-----------------------------------------------------------------------------------*/
/* Affiliate URL #2 Title/Alt Tag
/*-----------------------------------------------------------------------------------*/
function aff2tag() {
$options = get_option('pmthemes_ads');
return $options['aff2_title_tag'] ?? ''; // Return an empty string if 'aff2_title_tag' is not set
}
add_shortcode('aff2tag', 'aff2tag');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #2 Banner URL #1 - e.g. 300x250
/*-----------------------------------------------------------------------------------*/
function aff2Banner1() {
$options = get_option('pmthemes_ads');
return $options['aff2_banner_url_1'];
}
add_shortcode('aff2banner1', 'aff2Banner1');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #2 Banner URL #2 - e.g. 125x125
/*-----------------------------------------------------------------------------------*/
function aff2Banner2() {
$options = get_option('pmthemes_ads');
return $options['aff2_banner_url_2'];
}
add_shortcode('aff2banner2', 'aff2Banner2');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #2 Banner URL #3 - e.g. 468x60
/*-----------------------------------------------------------------------------------*/
function aff2Banner3() {
$options = get_option('pmthemes_ads');
return $options['aff2_banner_url_3'];
}
add_shortcode('aff2banner3', 'aff2Banner3');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #2 Banner URL #4 - 160x600
/*-----------------------------------------------------------------------------------*/
function aff2Banner4() {
$options = get_option('pmthemes_ads');
return $options['aff2_banner_url_4'];
}
add_shortcode('aff2banner4', 'aff2Banner4');
/*-----------------------------------------------------------------------------------*/
/* Affiliate #2 Banner URL #5 - 728x90
/*-----------------------------------------------------------------------------------*/
function aff2Banner5() {
$options = get_option('pmthemes_ads');
return $options['aff2_banner_url_5'];
}
add_shortcode('aff2banner5', 'aff2Banner5');
/*-----------------------------------------------------------------------------------*/
/* Amazon ID
/*-----------------------------------------------------------------------------------*/
function amazonid() {
$options = get_option('pmthemes_ads');
return $options['amazon_id'];
}
add_shortcode('amazonid', 'amazonid');
/*-----------------------------------------------------------------------------------*/
/* Amazon Keyword
/*-----------------------------------------------------------------------------------*/
function amazonkw() {
$options = get_option('pmthemes_ads');
return $options['amazon_keyword'];
}
add_shortcode('amazonkw', 'amazonkw');
/*-----------------------------------------------------------------------------------*/
/* Clickbank ID
/*-----------------------------------------------------------------------------------*/
function clickbankid() {
$options = get_option('pmthemes_ads');
return $options['clickbank_id'];
}
add_shortcode('clickbankid', 'clickbankid');
/*-----------------------------------------------------------------------------------*/
/* Clickbank Keyword
/*-----------------------------------------------------------------------------------*/
function clickbankkw() {
$options = get_option('pmthemes_ads');
return $options['clickbank_keyword'];
}
add_shortcode('clickbankkw', 'clickbankkw');
/*-----------------------------------------------------------------------------------*/
/* CB Engine ID
/*-----------------------------------------------------------------------------------*/
function cbengineid() {
$options = get_option('pmthemes_ads');
return $options['cbengine_id'];
}
add_shortcode('cbengineid', 'cbengineid');
/*-----------------------------------------------------------------------------------*/
/* CBPro Ads ID
/*-----------------------------------------------------------------------------------*/
function cbproid() {
$options = get_option('pmthemes_ads');
return $options['cbproads_id'];
}
add_shortcode('cbproid', 'cbproid');
/*-----------------------------------------------------------------------------------*/
/* Adsense Code #1
/*-----------------------------------------------------------------------------------*/
function adtop() {
$options = get_option('pmthemes_ads');
return $options['content_ad_top_code'];
}
add_shortcode('adtop', 'adtop');
/*-----------------------------------------------------------------------------------*/
/* Adsense Code #2
/*-----------------------------------------------------------------------------------*/
function adinside() {
$options = get_option('pmthemes_ads');
return $options['content_ad_inside_code'];
}
add_shortcode('adinside', 'adinside');
/*-----------------------------------------------------------------------------------*/
/* Adsense Code #3
/*-----------------------------------------------------------------------------------*/
function adbelow() {
$options = get_option('pmthemes_ads');
return $options['content_ad_below_code'];
}
add_shortcode('adbelow', 'adbelow');
/*-----------------------------------------------------------------------------------*/
/* Ad Code #1
/*-----------------------------------------------------------------------------------*/
function adcode1() {
$options = get_option('pmthemes_ads');
return $options['pmns_code_1'];
}
add_shortcode('adcode1', 'adcode1');
/*-----------------------------------------------------------------------------------*/
/* Ad Code #2
/*-----------------------------------------------------------------------------------*/
function adcode2() {
$options = get_option('pmthemes_ads');
return $options['pmns_code_2'];
}
add_shortcode('adcode2', 'adcode2');
/*-----------------------------------------------------------------------------------*/
/* Ad Code #3
/*-----------------------------------------------------------------------------------*/
function adcode3() {
$options = get_option('pmthemes_ads');
return $options['pmns_code_3'];
}
add_shortcode('adcode3', 'adcode3');
/*-----------------------------------------------------------------------------------*/
/* Ad Code #4
/*-----------------------------------------------------------------------------------*/
function adcode4() {
$options = get_option('pmthemes_ads');
return $options['pmns_code_4'];
}
add_shortcode('adcode4', 'adcode4');
/*-----------------------------------------------------------------------------------*/
/* Affiliate Store URL
/*-----------------------------------------------------------------------------------*/
function storeurl() {
$options = get_option('pmthemes_ads');
return $options['affiliate_storefront_url'];
}
add_shortcode('storeurl', 'storeurl');
/*-----------------------------------------------------------------------------------*/
/* Amazon Access Key ID
/*-----------------------------------------------------------------------------------*/
function amazonpin() {
return get_option('wp_amazonpin_abk');
}
add_shortcode('amazonpin', 'amazonpin');
/*-----------------------------------------------------------------------------------*/
/* Blog Info
/*-----------------------------------------------------------------------------------*/
function bloginfoSC( $atts ) {
extract(shortcode_atts(array( 'value' => '', ), $atts));
return get_bloginfo($value);
}
add_shortcode('bloginfo', 'bloginfoSC');| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| cmb2 | Folder | 0755 |
|
|
| ebook.php | File | 12.58 KB | 0644 |
|
| functions.php | File | 24.52 KB | 0644 |
|
| helpers.php | File | 1.78 KB | 0644 |
|
| settings.php | File | 42.25 KB | 0644 |
|