Skip to:
Content
Pages
Categories
Search
Top
Bottom

URGENT: I NEED YOUR ASSISTANCE, PLEASE


  • loveme
    Participant

    @naijavine

    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”&gt;

    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


    <input type="hidden" name="encrypted" value="


    BEGIN PKCS7


    MIIH2QYJKoZIhvcNAQcEoIIHyjCCB8YCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBj5q6P4LVkd+EndLMAq8yqUb+15Crb6wybM3hcZkDU/AfDK72nq7cU8nWGtqCZwUIJq01Mv7OUWoj9vlj11eOHBdy+kIUmuJ8l2x4OlI2+zTJsob0REP3SbQCKDUJj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N5N+4kk7k+UCE5fq2aXD+1tW2Ape0IDwDVkIqGSOIwZ+Qw7dBeBwV8XWfe4/SQE2yOuDJOJMnKolH1h6k0s5BMnnFpToyKwiG9Be2EyH0q9gpadUH1ksB8UuAHfC6zaw+


    END PKCS7


    “>

    This plugin can make you money. Please consider a donation to the developer.

    <input name="your_adsense_share" type="text" id="your_adsense_share" value="” size=”3″ />

    <input name="your_adsense_code" type="text" id="your_adsense_code" value="” size=”50″ />

    <input type="submit" name="Submit" value="” />

    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

    <input name="user_adsense_code" type="text" id="user_adsense_code" value="” size=”50″ />
    (pub-1234567890)

    <input type="submit" name="Submit" value="” />

    <?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

Viewing 3 replies - 1 through 3 (of 3 total)
  • two things first please,
    One: topic titles need to be descriptive of the issue, not a genaralised plea for help, we know you want help otherwise you likely wouldn’t have posted

    Two: Please refrain from writing in caps, writing in capitals in lists and forums means that you are shouting, we would rather you didn’t shout at us.

    Some useful reading on how to do things the right way on forums:
    http://www.catb.org/esr/faqs/smart-questions.html

    As for turning that code into a widget have you considered approaching the plugin author? perhaps a small donation might help things along? After plugins are not really free, that’s a popular misconception they are very costly in development and testing terms.


    loveme
    Participant

    @naijavine

    Am sorry for that capital letter. The plugin ever the website was last updated in 2008. So the author is not activite again on the plugin. Please i need your assistance.


    Roger Coathup
    Participant

    @rogercoathup

    This page tells you how to create widgets for WordPress / BuddyPress:

    https://codex.wordpress.org/Widgets_API#Developing_Widgets

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘URGENT: I NEED YOUR ASSISTANCE, PLEASE’ is closed to new replies.
Skip to toolbar