URGENT: I NEED YOUR ASSISTANCE, PLEASE
-
FIRST, LET ME APPRECIATE THE GROUP THAT DEVELOP THIS SCRIPT, IT IS A NICE PROJECT. AFTER STUDYING BUDDYPRESS AND WPMU FOR SOME TIME I KNOW IT HAS SO MANY THING TO OFFER. I LOVE THE PLUGIN OFFER LIKE Erocks Dashboard Lockdown
MY PROBLEM IS THAT, I WANT ANY OF MY USER WHO HAVE A BLOG TO HAVE ACCESS DISPLAY GOOGLE ADSENSE ON THEIR BLOG. AFTER SOME INVESTIGATION, I DISCOVERED THAT http://www.ringofblogs.com/…/adsense-revenue-sharing-plugin-for-wordpress-mu/ OFTER THAT PLUGIN FREE. BUT I DON’T WANT THEM TO HAVE ACCESS TO WORDPRESS DASHBORAD BY USING Erocks Dashboard Lockdown
BUT THE PROBLEM ENCOUNTER IS THAT EACH USER CAN ONLY INPUT THEIR PUB-NUMBER FROM GOOGLE INTO THEIR DASHBOARD AND I DON’T WANT WANT THEM TO HAVE ACCESS TO DASHBORAD.
HOW CAN I CONVERT IT TO WIDGET PLUGIN. THIS IS THE PROGRAMME<?php
/*
Plugin Name: Adsense Share for WPMU
Plugin URI: http://www.ringofblogs.com/2007/10/07/adsense-revenue-sharing-plugin-for-wordpress-mu/
Description: Share Adsense income with your wpmu users. This plugin is based on work done by Mike Smullin.
Version: 1.2.3
Author: Elad Salomons
Author URI: http://www.ringofblogs.com
License: Free
Last modified: 26-Feb-2008
*/// set to ‘true’ if you don’t want to allow the user to add an Adsense widget
$no_widgets = ‘false’;//add the widget to the sidebar
function widget_adsense($args) {$your_adsense_share = get_site_option(‘your_adsense_share’);
$your_adsense_code = get_site_option(‘your_adsense_code’);$options = array_merge(widget_adsense_options(), get_option(‘widget_adsense’));
unset($options[0]);//if the user entered a code in the option page then use it.
$uc = get_option(‘user_adsense_code’);
if(!empty($uc)) :
$options = $uc;
endif;if(rand(1, 100) >= 100 – $your_adsense_share) :
$options = $your_adsense_code ;
endif;//if the user did not enter his Adsense id use the owner code.
if(empty($options)) :
$options = $your_adsense_code ;
endif;echo $before_widget . $before_title . $options . $after_title; ?>
<!–
<?php
foreach($options as $key => $value)
echo “$key = “$value”;rn”;
?>//–>
<script type="text/javascript"
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>By rob
<?php
echo $after_widget;
}//add the widget in the backend
function widget_adsense_control() {
$tmp_options = get_option(‘widget_adsense’);
if (!is_array($tmp_options))
$tmp_options = array();
$options = array_merge(widget_adsense_options(), $tmp_options);
unset($options[0]);if ( $_POST ) {
foreach($options as $key => $value)
if(array_key_s(‘adsense-‘.$key, $_POST))
$options[$key] = strip_tags(stripslashes($_POST));update_option(‘widget_adsense’, $options);
}//if the user entered a code in the option page then use it.
$uc = get_option(‘user_adsense_code’);
if(!empty($uc)) :
$options = $uc;
endif;foreach($options as $key => $value): ?>
<label for="adsense-“>: <input style="width: 200px;" id="adsense-” name=”adsense-” type=”text” value=”” />
<?php endforeach;
$your_adsense_code = get_site_option(‘your_adsense_code’);
?><!–
google_ad_client = “”;
google_ad_output = “textlink”;
google_ad_format = “ref_text”;
google_cpa_choice = “CAAQnfzw4AIaCJwZC9ix5DwoKN2uuIEBMAA”;
//–><?php
echo ”;
}//init the widget
function widget_adsense_init() {if ( !function_exists(‘register_sidebar_widget’) )
return;$default_your_adsense_share = get_site_option(‘your_adsense_share’);
if (!$default_your_adsense_share) {
update_site_option( “your_adsense_share”, 20 );
}
$default_your_adsense_code = get_site_option(‘your_adsense_code’);
if (!$default_your_adsense_code) {
update_site_option( “your_adsense_code”, ‘pub-ca-xxx’ );
}function widget_adsense_options() {
return array(
‘Title’ => “”,
‘google_ad_client’ => “”,
‘google_ad_width’ => 120,
‘google_ad_height’ => 240,
‘google_ad_format’ => “120x240_as”,
‘google_ad_type’ => “text”,
‘google_ad_channel’ => “”,
‘google_color_border’ => “336699”,
‘google_color_bg’ => “FFFFFF”,
‘google_color_link’ => “0000FF”,
‘google_color_url’ => “008000”,
‘google_color_text’ => “000000”,
);
}register_sidebar_widget(‘Google AdSense’, ‘widget_adsense’);
register_widget_control(‘Google AdSense’, ‘widget_adsense_control’, 220, 100 + 50 * count(widget_adsense_options()));
}function add_adsense_share_page()
{
add_submenu_page(‘wpmu-admin.php’, ‘adsense_share’, ‘Adsense share’, 0, ‘adsense-share-mu.php’, ‘adsense_share_page’);
}// add the options page for admins
function adsense_share_page() {if ( !is_site_admin() ) {
die( __(‘You do not have permission to access this page.
‘) );
}$message = null;
$message_updated = __(“Adsense share Options Updated.”);// update options
if ($_POST && $_POST == ‘adsense_share_update’) {
$message = $message_updated;
update_site_option( “your_adsense_share”, $_POST[ ‘your_adsense_share’ ] );
update_site_option( “your_adsense_code”, $_POST[ ‘your_adsense_code’ ] );
}
?>Adsense Share Options
This plugin can make you money. Please consider a donation to the developer.
This plugin was developed by Elad Salomons.
<?php
}function add_adsense_user_page() {
if (function_exists(‘add_options_page’)) {
add_options_page(‘Adsense Publisher’, ‘Adsense Publisher’, 8, basename(__FILE__), ‘adsense_user_page’);
}
}//add the options page for the users
function adsense_user_page() {$message = null;
$message_updated = __(“Adsense Publisher Code Updated.”);// update options
if ($_POST && $_POST == ‘adsense_user_update’) {
$message = $message_updated;
update_option(‘user_adsense_code’, $_POST[ ‘user_adsense_code’ ]);
}
?>Enter Your Adsense Publisher Code
Don’t have one?
<!–
google_ad_client = “”;
google_ad_output = “textlink”;
google_ad_format = “ref_text”;
google_cpa_choice = “CAAQnfzw4AIaCJwZC9ix5DwoKN2uuIEBMAA”;
//–>The Adsense publisher code you enter here will override the one entered in the widget form
<?php
}
//a function to call from the themes to get an Adsense publisher code
function get_adsense_code() {
$your_adsense_share = get_site_option(‘your_adsense_share’);
$your_adsense_code = get_site_option(‘your_adsense_code’);$user_adsense_code = get_option(‘user_adsense_code’);
if(empty($user_adsense_code)) :
echo ‘”‘ . $your_adsense_code . ‘”‘;
return;
endif;if(rand(1, 100) >= 100 – $your_adsense_share) :
echo ‘”‘ . $your_adsense_code . ‘”‘;
return;
endif;echo ‘”‘ . $user_adsense_code . ‘”‘;
}//some action stuff…
if ($no_widgets == ‘false’) //if we want to allow widgets
add_action(‘plugins_loaded’, ‘widget_adsense_init’);
add_action(‘admin_menu’, ‘add_adsense_share_page’);
add_action(‘admin_menu’, ‘add_adsense_user_page’);
?>PLEASE WHERE WILL I EDIT. I HAVE KONWLEDGE ONLY IN HTML AND CSS
THANKS YOU
- The topic ‘URGENT: I NEED YOUR ASSISTANCE, PLEASE’ is closed to new replies.