Joe主题教程: 接入tepass 打赏及付费

Tepass 是一款typecho 的会员支付插件。本文主要介绍如何接入 tepass 的文章打赏功能。

tepass是付费插件,关于tepass的设置可以直接查看tepass官网

上代码

post.tag.php 的操作按钮 section 下面添加一个按钮,代码如下

<a href="javascript:;" title="文章打赏" onclick="show_reward()">
    <section class="item reward" title="打赏">
            <svg t="1608275223502" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5405" width="200" height="200"><path d="M895.876947 612.428294c-0.00307-24.451902-7.306406-44.169989-21.26021-57.765635 11.045567-13.922081 21.073968-38.645159 21.073968-61.033052l-0.00307-0.242524c-1.217734-49.976228-48.848545-84.881203-115.830075-84.881203L626.548896 408.505881c11.148921-36.051077 16.07614-77.485769 13.934361-118.278847-2.436492-46.408983-13.833053-87.676875-32.089859-116.202559-10.674107-16.665565-23.408129-29.02301-37.849026-36.733623-11.406794-6.090718-23.567765-9.179057-36.145222-9.179057-27.122731 0-72.621994 11.471262-72.621994 88.303138 0 38.010709-1.577938 75.829036-20.59813 120.455419-8.363482 15.294334-62.974263 71.937402-117.904317 71.937402L212.079186 408.807756c-21.741163 0-41.21468 7.992021-56.313563 23.11137-17.865903 17.890462-27.683503 44.160779-27.643594 73.970712l0.045025 0.927115 28.829606 304.199257c4.075829 54.429657 33.410947 84.402295 82.613556 84.403319 0.149403 0.002047 23.152303 0.188288 40.220027 0.188288 8.861832 0 17.120936-0.070608 22.091134-0.190335 16.84976-0.553609 30.108738-10.371208 40.762379-18.260899l3.212158-2.375094c3.231601-2.394537 7.501858-5.558599 9.766434-6.464225 1.788739 0.791016 4.821819 2.278903 7.572466 3.628644 5.628184 2.759857 13.33368 6.541997 21.718651 10.106172 19.905352 8.407484 48.598858 13.8351 73.120344 13.8351l232.555543 0c109.080348 0 125.368312-55.06206 125.368312-87.883583 0-10.915607-1.732457-19.47147-6.02932-28.186969 33.93488-12.010545 53.774741-36.377512 53.774741-66.998927 0-9.695826-2.931772-23.857361-8.553817-34.497699C873.771487 666.73106 895.919926 641.20878 895.876947 612.428294zM810.448276 643.932822l-14.33959 0 0.635473 45.115524 6.78759 2.571568c2.697435 0.998747 9.014304 3.337002 9.030677 20.107967 0 19.717064-32.095999 26.877137-53.66934 26.877137l-9.898441-0.182149-0.638543 45.005007 7.944949 1.771343c2.90312 0.64673 8.305153 1.852184 8.280594 19.798928 0 11.907191-4.864798 20.868283-14.872732 27.40721-12.609179 8.238638-32.707936 12.416797-59.736523 12.416797L449.143417 844.822155c-9.468652 0-31.29168-6.058996-44.058448-12.233626-9.623171-4.652973-23.780613-12.465916-33.148981-17.635659-0.461511-0.25685-0.912789-0.50449-1.348718-0.744967L370.58727 451.726242c61.025888-19.799952 109.239983-71.485101 122.024148-95.916537l0.325411-0.683569c13.552667-31.515784 21.399379-64.909335 21.399379-142.334729 0-17.301038 3.228531-24.572652 5.937223-27.626197 2.288113-2.578732 5.662977-3.63069 11.648294-3.63069 8.261151 0 25.382087 11.17655 34.251082 25.056676 13.888312 21.684882 22.646789 57.328683 23.433712 95.355765 0.873903 42.215474-7.747451 83.897805-24.27487 117.369128l-0.481977 0.977257-9.697873 39.464827 225.877447-0.049119c30.606065 1.734504 63.025429 14.051017 63.175855 33.552164l-0.297782 9.719362c-0.38374 5.658883-2.922563 19.071358-9.417487 24.457018-6.570649 5.458315-11.655458 6.350638-12.583596 6.472412l-9.972119-0.213871 0.465604 10.094916-0.308015 36.576033 8.710382 1.173732c4.149507 0.571005 11.382235 2.317789 14.427594 4.411473 6.200212 4.252861 9.651824 13.360286 9.239432 24.364921-0.161682 4.469801-4.257977 12.799514-13.044084 21.35947C822.781162 640.09747 814.492382 643.932822 810.448276 643.932822zM318.870398 459.69268l0 371.557364c-4.03592 2.867304-7.269567 5.230118-9.076726 6.561439-5.079692 3.745301-9.174963 6.226818-10.896164 7.052626-13.258978 0.323365-50.435693 0.055259-61.83737-0.035816l-0.743944-0.00614c-12.706393 0-24.679076-13.285584-27.974122-30.969339l-28.754904-315.412646c0.217964-17.324574 13.755282-37.129642 31.639604-39.068807L318.870398 459.69268z" p-id="5406"></path></svg>
            <span>打赏</span>
    </section>
</a>

然后在文章页面 post.php 去添加一个 tepass 的输出, 看注释,选择自己想添加的位置,我是加在文章输出完之后,标签之前。

<?php $all = Typecho_Plugin::export();?>
<?php if (array_key_exists('TePass', $all['activated'])) : ?>
<?php echo TePass_Plugin::getTePass(); ?>
<?php echo TePass_Plugin::getReward(); ?>
<?php endif; ?>

加点css

.btn_reward{
    display: none!important;
}
.tips {
    font-size: 12px;
    color: #90949C;
    margin: 10px 0;
}
.j-post .main .tags .handle .item.reward {
    background-color: #dd524e !important;
}

下面为付费测试~0.1不过分吧!

给TA打赏
共{{data.count}}人
人已打赏
建站教程技术活

Joe主题美化教程四: 移动样式下添加二级分类

2020-12-18 10:22:39

建站教程技术活

typecho 全站CDN,免费,来嫖

2020-12-18 21:10:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索