
內容簡介
Counter 外掛能讓您計算使用者對文章的讚和倒讚數。
計算功能是使用 AJAX。
為防止作弊,每個 IP 地址每 10 分鐘才能投票一次。
使用方法
只需要在 single.php 的迴圈內使用 CS_Likes::show_buttons_like() 函式即可
<?php while(have_post()) : the_post(); ?>
<?php echo CS_Likes::show_buttons_like(); ?>
<?php endwhile; ?>
如果在迴圈外,也可以使用文章的 ID 來呼叫函式
<?php echo CS_Likes::show_buttons_like($post_id); ?>
要獲取贊數,使用以下函式:
<?php $likes_count = CS_Likes::get_post_likes($post_id); ?>
要獲取倒讚數,使用以下函式:
<?php $dislikes_count = CS_Likes::get_post_dislikes($post_id); ?>
外掛標籤
開發者團隊
原文外掛簡介
Counter allows you to count the likes and dislikes.
Counting is carried out using AJAX.
Limitation of cheating over IP (from one IP can vote with 10 minutes intervals).
Usage
Simply place the template single.php function call inside the loop
Or use ID of post, if function call outside the loop
To obtain the number of likes, use the function:
To obtain the number of dislikes, use the function:
