Plugin Directory

Changeset 979828


Ignore:
Timestamp:
09/04/2014 04:47:18 PM (12 years ago)
Author:
minojiro
Message:

fancy new feature: now you can foo *and* bar at the same time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-author-ranking/trunk/Readme.txt

    r979815 r979828  
    19193. Open the setting menu, it is possible to set the execution condition.
    2020
     21=== Get the ranking data. ===
     22
     23The function "get_wpAuthorRanking()" return the ranking data stored in an array.
     24This example prints ranking data.
     25
     26```
     27<?php
     28$rankingData = get_wpAuthorRanking();
     29for ($i=0; $i < count($rankingData); $i++) {
     30    echo '<li>';
     31    echo '<p>No'.$rankingData[$i]['rank'].'</p>';
     32    echo '<p><strong>'.$rankingData[$i]['display_name'].'</strong></p>';
     33    echo '<p>'.$rankingData[$i]['count'].'pv<p>';
     34    echo '</li>';
     35}
     36?>
     37```
     38
     39=== Informations the ranking data has. ===
     40
     41* ID
     42* user_login
     43* user_nicename
     44* user_email
     45* user_url
     46* user_registered
     47* user_activation_key
     48* display_name
     49* count (page view count)
     50* rank (rank)
     51
     52
     53==== Request options ====
     54
     55You have four options to require ranking data.
     56
     57* y (year)
     58* m (month)
     59* d (day)
     60* cpt (custom post type)
     61
     62This example gets columnist (post type 'column') ranking in September 2014.
     63
     64```
     65<?php
     66$rankingData = get_wpAuthorRanking(array('y'=>2014, 'm'=>9, 'cpt'=>'column'));
     67for ($i=0; $i < count($rankingData); $i++) {
     68    echo '<li>';
     69    echo '<p>No'.$rankingData[$i]['rank'].'</p>';
     70    echo '<p><strong>'.$rankingData[$i]['display_name'].'</strong></p>';
     71    echo '<p>'.$rankingData[$i]['count'].'pv<p>';
     72    echo '</li>';
     73}
     74?>
     75```
     76
     77
     78=== Count pv manually ===
     79
     80In default setting, page views are counted at single post page. You also have the function "count_wpAuthorRanking()" to count authors page views manually.
     81This example counts id-3 user on 'column' post type.
     82
     83```
     84<?php
     85count_wpAuthorRanking(array('user'=>3,'cpt'=>'column'));
     86?>
     87```
     88
     89
    2190== Screenshots ==
    2291 
Note: See TracChangeset for help on using the changeset viewer.