Plugin Directory

Changeset 2087315


Ignore:
Timestamp:
05/14/2019 02:08:19 AM (7 years ago)
Author:
smyx
Message:

V2.6.1

Location:
wptao
Files:
23 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • wptao/trunk/Readme.txt

    r2086848 r2087315  
    55Requires at least: 3.5
    66Tested up to: 4.9.8
    7 Stable tag: 2.6
     7Stable tag: 2.6.1
    88
    99匹配不同的淘宝客主题,实现自动填充商品信息及推广链接(CPS),支持多麦CPS广告联盟。
     
    7070== Changelog ==
    7171
    72 = 2.6 / 3.7.2 =
     72= 2.6.1 / 3.7.2 =
    7373 
    74742019/5/13
  • wptao/trunk/wp-functions.php

    r2086848 r2087315  
    759759}
    760760function _wptao_red_title($title, $post) {
    761     $in_header = 0;
    762761    if (is_object($post)) {
    763762        $id = $post->ID;
    764         $in_header = 1;
    765763    } else {
    766764        $id = $post;
    767765    }
    768     $red_title = wptao_red_title($id);
    769     if (!$in_header && $red_title) {
    770         $red_title = '<span class="wptao-red">' . $red_title . '</span>';
    771     }
    772     return $title . ' ' . $red_title;
     766    $red_title = wptao_red_title($id, 0);
     767    return $title . ($red_title ? ' ' . $red_title : '');
    773768}
    774769// 自定义函数
    775 function wptao_red_title($post_id = 0) {
     770function wptao_red_title($post_id = 0, $color = 1) {
    776771    if (!$post_id) $post_id = get_the_ID();
    777772    if (!$post_id) return '';
     
    782777        $red_title = get_post_meta($post_id, $fields['red_title'], true);
    783778    }
    784     return $red_title ? $red_title : '';
     779    return $red_title ? ($color ? '<span class="wptao-red">' . $red_title . '</span>' : $red_title) : '';
    785780}
    786781function get_red_title($tbk) {
  • wptao/trunk/wptao.php

    r2086848 r2087315  
    77Plugin URI: https://wptao.com/wptao.html
    88Description: 匹配不同的淘宝客主题,实现自动填充商品信息及推广链接(CPS)。(目前支持多麦CPS广告联盟(仅推广链接)、淘宝网、天猫、京东、国美、苏宁、当当网、亚马逊、聚划算、网易考拉等)
    9 Version: 2.6
     9Version: 2.6.1
    1010*/
    1111
    12 define('WPTAO_V', '2.6');
     12define('WPTAO_V', '2.6.1');
    1313define("WPTAO_ULTIMATE", false);
    1414define("WPTAO_URL", plugins_url('wptao'));
     
    444444                            echo '<tr><th scope="row"><label for="wptao_cj_' . $key . '">' . $value['title'] . '</label></th><td><label><input id="wptao_cj_' . $key . '" name="wptao[caiji][' . $key . ']" type="text" value="' . $wptao['caiji'][$key] . '" /></label>';
    445445                            echo $value['_desc'] ? '<p class="description"><code>' . $value['_desc'] . '</code></p>' : '';
     446                            if ($key == 'red_title') {
     447                                echo '<p>格式:<select name="wptao[red_title_format]"><option value="1">xxx元或者券后xxx元</option><option value="2"'. selected($wptao['red_title_format'] == 2, true, false) .'>xxx元或者优惠券后xxx元</option></select></p><p><label><input type="checkbox" name="wptao[red_title_add]" value="1"'. checked($wptao['red_title_add'], true, false) .'> 添加到文章标题最后面(不含红色字体) </label><code>或者自定义函数(含红色字体):&lt;?php if (function_exists(\'wptao_red_title\')) echo wptao_red_title($post->ID);?&gt;</code></p>';
     448                            }
    446449                            echo '</td></tr>';
    447                             if ($key == 'red_title') {
    448                                 echo '<tr><th scope="row"></th><td>格式:<select name="wptao[red_title_format]"><option value="1">xxx元或者券后xxx元</option><option value="2"'. selected($wptao['red_title_format'] == 2, true, false) .'>xxx元或者优惠券后xxx元</option></select> <label><input type="checkbox" name="wptao[red_title_add]" value="1"'. checked($wptao['red_title_add'], true, false) .'> 添加到文章标题最后面 </label><code>或者自定义函数:&lt;?php if (function_exists(\'wptao_red_title\')) echo wptao_red_title($post->ID);?&gt;</code></tr>';
    449                             }
    450450                        }
    451451                    }
     
    522522                  <p class="wptao-box yellow">如果您的主题是普通主题(即没有直达链接/购买链接),也可以改造成淘宝客主题,即给文章增加【去购买】链接。
    523523                  <br />1.使用此功能时,您必须在【对接主题】配置【直达链接/推广链接】(可以写<code>buylink</code>)、【商品链接】、【优惠券链接】、【红色标题】、【商品价格】等。
    524                   <br />2.如果下面设置无效,您可以直接修改主题文件,在适当位置添加函数:<code>&lt;?php if (function_exists('wptao_buylink')) echo wptao_buylink($post->ID);?&gt;</code> 可根据需要添加参数,第2个参数是购买文字(默认:去购买),第3个参数是样式class(默认:buy_btn)</p>
     524                  <br />2.如果下面设置无效,您可以直接修改主题文件,在适当位置添加函数:<code>&lt;?php if (function_exists('wptao_buylink')) echo wptao_buylink($post->ID);?&gt;</code> 可根据需要添加参数,第2个参数是购买文字(默认:去购买),第3个参数是样式class(默认:wptao-buy)</p>
    525525                  <table class="form-table">
    526526                    <tbody>
Note: See TracChangeset for help on using the changeset viewer.