Changeset 2087315
- Timestamp:
- 05/14/2019 02:08:19 AM (7 years ago)
- Location:
- wptao
- Files:
-
- 23 added
- 1 deleted
- 3 edited
-
tags/2.6 (deleted)
-
tags/2.6.1 (added)
-
tags/2.6.1/Readme.txt (added)
-
tags/2.6.1/css (added)
-
tags/2.6.1/css/index.php (added)
-
tags/2.6.1/css/theme.css (added)
-
tags/2.6.1/editor (added)
-
tags/2.6.1/editor/index.php (added)
-
tags/2.6.1/editor/style.css (added)
-
tags/2.6.1/editor/wptao (added)
-
tags/2.6.1/editor/wptao/css.css (added)
-
tags/2.6.1/editor/wptao/icon.png (added)
-
tags/2.6.1/editor/wptao/index.php (added)
-
tags/2.6.1/editor/wptao/js.js (added)
-
tags/2.6.1/images (added)
-
tags/2.6.1/images/close1.png (added)
-
tags/2.6.1/images/icon.png (added)
-
tags/2.6.1/images/soldout.png (added)
-
tags/2.6.1/js (added)
-
tags/2.6.1/js/admin.js (added)
-
tags/2.6.1/js/jquery.min.js (added)
-
tags/2.6.1/js/jquery.plugin.js (added)
-
tags/2.6.1/wp-functions.php (added)
-
tags/2.6.1/wptao.php (added)
-
trunk/Readme.txt (modified) (2 diffs)
-
trunk/wp-functions.php (modified) (2 diffs)
-
trunk/wptao.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wptao/trunk/Readme.txt
r2086848 r2087315 5 5 Requires at least: 3.5 6 6 Tested up to: 4.9.8 7 Stable tag: 2.6 7 Stable tag: 2.6.1 8 8 9 9 匹配不同的淘宝客主题,实现自动填充商品信息及推广链接(CPS),支持多麦CPS广告联盟。 … … 70 70 == Changelog == 71 71 72 = 2.6 / 3.7.2 =72 = 2.6.1 / 3.7.2 = 73 73 74 74 2019/5/13 -
wptao/trunk/wp-functions.php
r2086848 r2087315 759 759 } 760 760 function _wptao_red_title($title, $post) { 761 $in_header = 0;762 761 if (is_object($post)) { 763 762 $id = $post->ID; 764 $in_header = 1;765 763 } else { 766 764 $id = $post; 767 765 } 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 : ''); 773 768 } 774 769 // 自定义函数 775 function wptao_red_title($post_id = 0 ) {770 function wptao_red_title($post_id = 0, $color = 1) { 776 771 if (!$post_id) $post_id = get_the_ID(); 777 772 if (!$post_id) return ''; … … 782 777 $red_title = get_post_meta($post_id, $fields['red_title'], true); 783 778 } 784 return $red_title ? $red_title: '';779 return $red_title ? ($color ? '<span class="wptao-red">' . $red_title . '</span>' : $red_title) : ''; 785 780 } 786 781 function get_red_title($tbk) { -
wptao/trunk/wptao.php
r2086848 r2087315 7 7 Plugin URI: https://wptao.com/wptao.html 8 8 Description: 匹配不同的淘宝客主题,实现自动填充商品信息及推广链接(CPS)。(目前支持多麦CPS广告联盟(仅推广链接)、淘宝网、天猫、京东、国美、苏宁、当当网、亚马逊、聚划算、网易考拉等) 9 Version: 2.6 9 Version: 2.6.1 10 10 */ 11 11 12 define('WPTAO_V', '2.6 ');12 define('WPTAO_V', '2.6.1'); 13 13 define("WPTAO_ULTIMATE", false); 14 14 define("WPTAO_URL", plugins_url('wptao')); … … 444 444 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>'; 445 445 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>或者自定义函数(含红色字体):<?php if (function_exists(\'wptao_red_title\')) echo wptao_red_title($post->ID);?></code></p>'; 448 } 446 449 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>或者自定义函数:<?php if (function_exists(\'wptao_red_title\')) echo wptao_red_title($post->ID);?></code></tr>';449 }450 450 } 451 451 } … … 522 522 <p class="wptao-box yellow">如果您的主题是普通主题(即没有直达链接/购买链接),也可以改造成淘宝客主题,即给文章增加【去购买】链接。 523 523 <br />1.使用此功能时,您必须在【对接主题】配置【直达链接/推广链接】(可以写<code>buylink</code>)、【商品链接】、【优惠券链接】、【红色标题】、【商品价格】等。 524 <br />2.如果下面设置无效,您可以直接修改主题文件,在适当位置添加函数:<code><?php if (function_exists('wptao_buylink')) echo wptao_buylink($post->ID);?></code> 可根据需要添加参数,第2个参数是购买文字(默认:去购买),第3个参数是样式class(默认: buy_btn)</p>524 <br />2.如果下面设置无效,您可以直接修改主题文件,在适当位置添加函数:<code><?php if (function_exists('wptao_buylink')) echo wptao_buylink($post->ID);?></code> 可根据需要添加参数,第2个参数是购买文字(默认:去购买),第3个参数是样式class(默认:wptao-buy)</p> 525 525 <table class="form-table"> 526 526 <tbody>
Note: See TracChangeset
for help on using the changeset viewer.