Plugin Directory

Changeset 561284


Ignore:
Timestamp:
06/20/2012 07:02:23 PM (14 years ago)
Author:
gchokeen
Message:
 
Location:
wp-wiki-userprofile
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • wp-wiki-userprofile/trunk/readme.txt

    r553340 r561284  
    44Tags: widget, wiki
    55Requires at least: 2.8
    6 Tested up to: 3.3.2
    7 Stable tag: 1.0
     6Tested up to: 3.4
     7Stable tag: 1.1
    88License: GPLv2
    99
     
    1616using CURL request.
    1717
     18= Plugin Features =
     19
     20* Widget Support
     21* Shortcode support
     22
     23= Shortcode Usage =
     24*`[wikiuser]`
     25*`[wikiuser  param="editcount"]`
     26*`[wikiuser username="xxx" param="editcount"]`
     27
     28
    1829
    1930== Installation ==
     
    25361. Upload the entire `wp-wiki-userprofile` folder to the `/wp-content/plugins/` directory
    26372. Activate the plugin through the 'Plugins' menu in WordPress
     38
     39
    2740
    2841
     
    4457== Changelog ==
    4558
     59= 1.1 =
     60* Shortcode support added.
     61
    4662= 1.0 =
    4763* Initial release.
  • wp-wiki-userprofile/trunk/wp-wiki-userprofile.php

    r553340 r561284  
    44Plugin URI: http://wordpress.org/extend/plugins/wp-wiki-userprofile/
    55Description: This plugin is used to grab Wikipedia user contribution to wordpress blog.
    6 Version: 1.0
     6Version: 1.1
    77Author: Gowri Sankar Ramasamy.
    88License: GPL2
     
    6161   
    6262echo '
     63    <div class="wrap">
    6364    <form method="post" action="" name="wiki-profile-form">
    64     <div class="wrap">
     65
    6566  <div class="icon32" id="icon-options-general"><br>
    6667  </div>
     
    8687    <input type="submit" value="Save Changes" class="button-primary" name="wiki-profile-submit">
    8788  </p>
     89
     90</form>
     91<div class="shortcode-doc">
     92<strong>Example Shortcode Usage</strong>
     93<ul>
     94    <li>[wikiuser]</li>
     95    <li>[wikiuser  param="editcount"]</li>
     96    <li>[wikiuser username="xxx" param="editcount"]</li>
     97</ul>
    8898</div>
    89 </form>
     99<div class="feedback-doc">
     100<strong>Feedback</strong>
     101 <p>Feel free to contact me <a href="mailto:[email protected]?subject=Wp Wiki Userprofile">[email protected]</a>. I like to hear <a href="mailto:[email protected]?subject=Wp Wiki Userprofile Feedback">Feedback</a>, <a href="mailto:[email protected]?subject=Wp Wiki Userprofile Suggestion">Suggestion</a>, <a href="mailto:[email protected]?subject=Wp Wiki Userprofile Bug Report">Bug Report</a> or <a href="mailto:[email protected]?subject=Wp Wiki Userprofile Future request">Future request</a> from you.</p>
     102</div>
     103</div>
     104
    90105   
    91106    ';
     
    159174}
    160175
    161 function get_wiki_response(){
     176function get_wiki_response($wiki_username = "",$wiki_user_param=""){
    162177    do_action('get_wiki_response');
    163178
    164 $codecocktail_wiki_username =   get_option("codecocktail_wiki_username");
    165     $codecocktail_wiki_user_param =     get_option("codecocktail_wiki_user_param");
     179$codecocktail_wiki_username = ($wiki_username=="" ? get_option("codecocktail_wiki_username"):$wiki_username);
     180$codecocktail_wiki_user_param = ($wiki_user_param=="" ? get_option("codecocktail_wiki_user_param"):$wiki_user_param);
     181   
    166182           
    167183     $wiki_API_URL ="http://en.wikipedia.org/w/api.php?format=json&action=query&list=users&ususers=".$codecocktail_wiki_username."&usprop=".$codecocktail_wiki_user_param."";
     
    251267
    252268
    253 function get_wiki_display(){
    254    
    255     $array = get_wiki_response();
     269function get_wiki_display($wiki_username = "",$wiki_user_param=""){
     270   
     271    $array = get_wiki_response($wiki_username,$wiki_user_param);
    256272   
    257273     $wiki_reposnse = $array['query']['users'];
     
    359375add_action( 'widgets_init', create_function( '', 'register_widget( "wiki_profile_widget" );' ) );
    360376
     377    /**
     378     * short code support added.
     379     *
     380     * @version 1.1
     381     *
     382     * @param username,param.
     383     */
     384
     385function wikiuser_shortcode($atts) {
     386
     387$codecocktail_wiki_username =   get_option("codecocktail_wiki_username");
     388$codecocktail_wiki_user_param =     get_option("codecocktail_wiki_user_param");
     389   
     390     extract(shortcode_atts(array(
     391          'username' => $codecocktail_wiki_username,
     392          'param' => $codecocktail_wiki_user_param,
     393     ), $atts));
     394     
     395     return get_wiki_display($username,$param);
     396}
     397add_shortcode('wikiuser', 'wikiuser_shortcode');
Note: See TracChangeset for help on using the changeset viewer.