';
}
}
function myplugin_register_widgets_adwol() {
register_widget( 'AdWolWidget1' );
}
add_action( 'widgets_init', 'myplugin_register_widgets_adwol' );
function inject_ad_text_after_n_chars_adwol($content) {
// only if post is longer than 500 characters
$enable_length = 500;
// insert after the first
after 500 characters
$after_character = 500;
if (is_single() && strlen($content) > $enable_length) {
$before_content = substr($content, 0, $after_character);
$after_content = substr($content, $after_character);
$after_content = explode('', $after_content);
$text = '';
array_splice($after_content, 1, 0, $text);
$after_content = implode('', $after_content);
return $before_content . $after_content;
}
else {
return $content;
}
}
if (get_option('wp_adwol_bei')!='ein') {
add_filter('the_content', 'inject_ad_text_after_n_chars_adwol');
}
function addRelAdWol($content) {
if ( is_single ( ) ) {
global $post;
global $adwolsave;
if ($adwolsave=='') {
$tags = wp_get_post_tags($post->ID);
$i = 0;
$titleadl=get_the_title();
if ($tags) {
foreach ($tags as $tagsin) {
$tagadlist.=$tagsin->name.',';
}
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
$related = array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'post_type' => 'post',
'posts_per_page'=>3,
'ignore_sticky_posts'=>1
);
$adwrel_query = new WP_Query($related);
if ( $adwrel_query ->have_posts() ) {
while ( $adwrel_query->have_posts() ) {
$adwrel_query->the_post();
$conad=$adwrel_query->posts[$i]->post_content;
$excad=substr(strip_tags($conad),0,100)."...";
preg_match('/.+?)[\'"].*>/i', $conad, $imageadw);
$imsrad='';
$imsrad='https://images.weserv.nl/?w=75&h=75&t=square&url='.urlencode(str_replace('http://','',str_replace('https://','',$imageadw['src'])));
if ($imsrad=='') {
$imsrad='https://images.weserv.nl/?w=75&h=75&t=square&url=adwol.com/norel.jpg';
}
if( $i < 1){
//ADWOL HINWEIS DARF NICHT ENTFERNT ODER GEÄNDERT WERDEN!
//IT IS NOT ALLOWED TO CHANGE OR REMOVE THE ADWOL BRANDING!
$html .= 'Das könnte interessant sein 
';
$html .= '';
}
if( $i == 1){
$html .= '';
}
$html .= '
 |
'.get_the_title().'
'.$excad.'
|
';
$i++;
}
$html .= '
';
}
wp_reset_query();
} else {
$categories = get_the_category();
if ($categories){
$category = $categories[0];
$cat_ID = $category->cat_ID;
} else {
$cat_ID = '';
}
$related = array(
'cat' => $cat_ID,
'post__not_in' => array($post->ID),
'post_type' => 'post',
'posts_per_page'=>3,
'ignore_sticky_posts'=>1
);
$adwrel_query2 = new WP_Query($related);
if ( $adwrel_query2->have_posts() ) {
while ( $adwrel_query2->have_posts() ) {
$adwrel_query2->the_post();
$conad=$adwrel_query2->posts[$i]->post_content;
$excad=substr(strip_tags($conad),0,100)."...";
preg_match('/.+?)[\'"].*>/i', $conad, $imageadw);
$imsrad='';
$imsrad='https://images.weserv.nl/?w=75&h=75&t=square&url='.urlencode(str_replace('http://','',str_replace('https://','',$imageadw['src'])));
if ($imsrad=='') {
$imsrad='https://images.weserv.nl/?w=75&h=75&t=square&url=adwol.com/norel.jpg';
}
if( $i < 1){
//ADWOL HINWEIS DARF NICHT ENTFERNT ODER GEÄNDERT WERDEN!
//IT IS NOT ALLOWED TO CHANGE OR REMOVE THE ADWOL BRANDING!
$html .= 'Das könnte interessant sein 
';
$html .= '';
}
if( $i == 1){
$html .= '';
}
$html .= '
 |
'.get_the_title().'
'.$excad.'
|
';
$i++;
}
$html .= '
';
}
wp_reset_query();
}
$adwolsave=$html;
}
$content = $content . $adwolsave;
return $content;
} else {
return $content;
}
}
if (get_option('wp_adwol_rel')!='ein') {
add_action('the_content', 'addRelAdWol');
}
add_action('admin_menu', 'my_plugin_menu_adwol_werbung');
function my_plugin_menu_adwol_werbung() {
add_options_page('Preferences', 'AdWol Werbung', 'manage_options', 'adwolwerbung', 'my_plugin_options_adwol_werbung');
}
function my_plugin_options_adwol_werbung() {
if (!current_user_can('manage_options'))
{
wp_die( __('You do not have sufficient permissions to access this page.') );
}
if( $_POST['publisher'] != '' ) {
update_option('wp_adwol_publisher',$_POST['publisher']);
$updatead=1;
}
if( $_POST['adwolbei'] != '' ) {
update_option('wp_adwol_bei',$_POST['adwolbei']);
$updatead=1;
}
if( $_POST['adwolrel'] != '' ) {
update_option('wp_adwol_rel',$_POST['adwolrel']);
$updatead=1;
}
if ($updatead==1) { ?>
AdWol Werbung
Anleitung zur Monetarisierung der Webseite.
- Registrieren Sie sich kostenlos unter adwol.com/register.
- Sie finden Ihre Publisher-ID im Benutzerbereich von AdWol: Publisher -> Website-Banner -> WordPress Plugin.
- Gebe Sie die Publisher-ID auf dieser Seite ein.
- Fügen Sie das Werbewidget von AdWol zu Ihrer Seite hinzu. Aktivieren Sie die "Werbung in Beiträgen" und "Ähnliche Beiträge inkl. Werbung".
Um die Funktion "Ähnliche Beiträge" nutzen zu können, müssen Sie entsprechende Tags und Kategorien anlegen.
Wir schließen Gewährleistung und Haftung aus. Nutzung dieses Plugins erfolgt auf eigene Gefahr. Bitte überprüfen Sie selbst den Quellcode.