لینکهای خروجی بعد از یک دامنه بیاد مثل لینک ریدایرکت پرشین اسکریپت

anet311

کاربر عضو
سلام دوستان

همون طور که لینک های پرشین اسکریپت به سبک زیر میرن

کد:
http://go.persianscript.ir/index.php?url=

میخوام یه کاری کنم که سایت من هم لینکهای خروجی رو به سبک زیر انجام بده .

کد:
http://adf.ly/1756644/
چی کار کنم؟

سپاس :x:


 
آخرین ویرایش توسط مدیر:

imohammad

تازه وارد
اول باید یه کد بنویسی که از تابع GET مقدار آدرستو دریافت کنه بعد بزاره تو هیدر بقیه ش به .htaccess مربوط میشه که دوستان راهنماییت میکنن انشالله

 

Mohammad

مدیر انجمن
پرسنل مدیریت
این افزونه کار شما رو راه میندازه


کد:
http://wordpress.org/extend/plugins/adfly-wordpress-plugin/
 

anet311

کاربر عضو
@imohammad از شما بسیار ممنونم

@ Mohammad واقعا ممنونم . همون چیزی بود که میخواستم محمد جان . بی نهایت تشکر

ولی یک اشکال داره اون هم اینه که ساب دامینها رو هم میگیره

با اینکه گزینه ی outgoing links only رو هم انتخاب کردم اما ساب دامنه های سایت رو میگیره

میشه کاری کرد که بعضی لینکها رو به انتخاب خودم نادیده بگیره .؟ توی دیتابیس باید چیزی اضافه کنم؟

 
آخرین ویرایش توسط مدیر:

anet311

کاربر عضو
توی دیتابیس چیزی نداره :D

فقط یک کد ساده ی php ه

اگر بشه بعضی لینکها رو استثنا قائل بشه، و نادیده بگیره ، خیلی خوب میشه


کد:
<?php
/*
Plugin Name: adf.ly WordPress Plugin
Plugin URI: http://ninjaplugins.com/wordpress/adfly
Description: Monetize your site with <a href="http://adf.ly/?id=8714">adf.ly</a>, this plugin able to convert your links to adf.ly, no need to do it manually.
Version: 0.1
Author: NinjaPlugins
Author URI: http://ninjaplugins.com
License: GPL2
*/
/*
adf.ly WordPress Plugin


Options:

- Enable adf.ly
- Convert outgoing links only/all links to adf.ly
- Ad type: Intestitial or banner
- adf.ly id (http://adf.ly/tools.php?easylink)
*/

add_action('wp_footer', 'np_adfly_get_script');

//get options
function np_adfly_get_options(){
    $explode = explode('/',get_option('home'));
    $options = array(
        'np_adfly_id' => get_option('np_adfly_id'),
        'np_adfly_type' => get_option('np_adfly_type'),
        'np_adfly_convert' => (get_option('np_adfly_convert') == 'outgoing') ? $explode[2]:''
    );
    return $options;
}

function np_adfly_get_script(){
    if(!get_option('np_adfly_enable')){
        return false;
    }
    //get plugin options
    $options = np_adfly_get_options();

    //populate script;
    $script = "<script>\n";
    $script .= "var adfly_id = ".$options['np_adfly_id'].";\n";
    $script .= "var adfly_advert = '".$options['np_adfly_type']."';\n";
    $script .= "var exclude_domains = ['".$options['np_adfly_convert']."'];\n";
    $script .= "</script>\n";
    $script .= "<script src=\"http://adf.ly/js/link-converter.js\"></script>\n";

    echo $script;
}

//Let's create the options menu
// create custom plugin settings menu
add_action('admin_menu', 'np_adfly_create_menu');

function np_adfly_create_menu() {

    //create new top-level menu
    add_options_page('adf.ly Plugin Settings', 'adf.ly Settings', 'administrator', __FILE__, 'np_adfly_settings_page',plugins_url('/images/icon.png', __FILE__));

    //call register settings function
    add_action( 'admin_init', 'np_adfly_register_mysettings' );
}


function np_adfly_register_mysettings() {
    //register our settings
    register_setting( 'np-adfly-settings-group', 'np_adfly_enable' );
    register_setting( 'np-adfly-settings-group', 'np_adfly_id' );
    register_setting( 'np-adfly-settings-group', 'np_adfly_convert' );
    register_setting( 'np-adfly-settings-group', 'np_adfly_type' );
}

function np_adfly_settings_page() {
?>
<div class="wrap">
<h2>adf.ly WordPress Plugin by NinjaPlugins</h2>

<form method="post" action="options.php">
    <?php settings_fields( 'np-adfly-settings-group' ); ?>
    <table class="form-table">
        <tr valign="top">
        <th scope="row">Enable Plugin</th>
        <td><input type="checkbox" <?php if( get_option('np_adfly_enable' ) == 1){ echo 'checked'; }; ?> value="1" name="np_adfly_enable"/></td>
        </tr>

        <tr valign="top">
        <th scope="row">adf.ly id
        <td><input type="text" name="np_adfly_id" value="<?php echo get_option('np_adfly_id'); ?>" /> <br/>(to get it, login to adfly, then go to <a href="http://adf.ly/tools.php?easylink">http://adf.ly/tools.php?easylink</a> find http://adf.ly/xxxx/www.google.com). xxxx is your adf.ly id.</th>
        </td>
        </tr>

        <tr valign="top">
        <th scope="row">Convert</th>
        <td>
            <select name="np_adfly_convert">
                <option value="outgoing" <?php if(get_option('np_adfly_convert') == 'outgoing') { echo 'selected="selected"';}?>>Outgoing Links Only</options>
                <option value="all" <?php if(get_option('np_adfly_convert') == 'all') { echo 'selected="selected"';}?>>All Links</options>
            </select>
        </td>
        </tr>

        <tr valign="top">
        <th scope="row">Ad Type</th>
        <td>
            <select name="np_adfly_type">
                <option value="int" <?php if(get_option('np_adfly_type') == 'int') { echo 'selected="selected"';}?>>Interstitial Ad</options>
                <option value="banner" <?php if(get_option('np_adfly_type') == 'banner') { echo 'selected="selected"';}?>>Banner Ad</options>
            </select>
        </td>
        </tr>

    </table>

    <p class="submit">
    <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
    </p>

    <p>
        Feedback, bug report, and suggestions are greatly appreciated. Please submit any question to <a href="http://ninjaplugins.com">NinjaPlugins</a>.
    </p>

</form>
</div>
<?php } ?>
 

Mohammad

مدیر انجمن
پرسنل مدیریت
مشکل اینجاست که اطلاعات برای انتقال رو از adf.ly میگیره. نمیشه کاری کرد...

 

Ehs@n

کاربر عضو
تا جایی که من میدونم برای این که لینک های رو از سایت adf.lly بگیری باید یه اکانت بسازی و بعد سایتت رو تعریف کنی

ولی مشکل اینجاست که وقتی این کار رو بکنی فقط لینک های داخل سایت رو اینجوری میکنه!

حالا راه دیگه ای باشه من نمی دونم!

 
بالا