Plugin Directory

Changeset 528714


Ignore:
Timestamp:
04/07/2012 10:17:28 PM (14 years ago)
Author:
niry
Message:

Added parameters with new functionality and did some commenting to the code

Location:
showlinks
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • showlinks/tags/1.01/ShowLinks.php

    r528488 r528714  
    22/**
    33 * @package Show_Links
    4  * @version 1.0
     4 * @version 1.01
    55 */
    66/*
     
    99Description: Show links added with the dashboard using a shortcode [showlinks] in posts.
    1010Author: Niklas Rydén
    11 Version: 1.0
     11Version: 1.01
    1212Author URI: http://kafit.se/
    1313*/
    1414
    1515function showlinksfunc($slparams) {
     16//  The line below is only for debugging while coding...you can delete it if it bothers you.
     17//    printf('<pre>');print_r($slparams);printf('</pre>');
     18
     19    // The base parameters we want to use...
    1620    $parameters = 'title_li=&categorize=0';
    17     if (isset($slparams['category_name'])) {
    18     $parameters = $parameters.'&category_name='.$slparams['category_name'];
    19     }
     21
     22    // Comma-separated ID-list
     23    if (isset($slparams['category'])) { $parameters = $parameters.'&category='.$slparams['category']; }
     24
     25    // The actual category name...yes...it's kind of...stupid...need to change this to permalink somehow to avoid melt down.
     26    if (isset($slparams['category_name'])) { $parameters = $parameters.'&category_name='.$slparams['category_name']; }
     27
     28    // 1 = true (default), 0 = false
     29    if (isset($slparams['show_images'])) { $parameters = $parameters.'&show_images='.$slparams['show_images']; }
     30
     31    // 1 = true, 0 = false (default)   Only needed when using images.
     32    if (isset($slparams['show_name'])) { $parameters = $parameters.'&show_name='.$slparams['show_name']; }
     33
     34    // 1 = true, 0 = false (default)
     35    if (isset($slparams['show_description'])) { $parameters = $parameters.'&show_description='.$slparams['show_description']; }
     36
    2037    wp_list_bookmarks($parameters);
    2138}
  • showlinks/tags/1.01/readme.txt

    r528458 r528714  
    77Requires at least: 2.1
    88Tested up to: 3.3.1
    9 Stable tag: 1.0
     9Stable tag: 1.01
    1010
    11 A small plugin whose only purpose is to show links added with the Dashboard, using a short code.
     11A small plugin whose only purpose is to show links added with the Dashboard, using a shortcode.
    1212
    1313== Description ==
    14 A small plugin whose only purpose is to show links added with the Dashboard, using a short code.
     14A small plugin whose only purpose is to show links added with the Dashboard, using a shortcode.
    1515
    1616== Installation ==
    1717Place showlinks.php the plugin directory, activate it in the Dashboard, add the short code [showlinks] to any page or post.
    1818
     19Available parameters:
     20category=<comma-separated ID-list> // Cannot be used along with category name
     21category_name="<category title>" // Cannot be used along with category
     22show_images=1 or 0 (1=true (default), 0=false)
     23show_name=1 or 0 (1=true, 0=false (default)) // Only active when picture is set for link
     24show_description=1 or 0 (1=true, 0=false (default)
     25
     26Examples:
     27To show category ID's 2 and 5 along with the description
     28[showlinks category=2,5 show_description=1]
     29
     30To show link category "Räksmörgås" (Yes, this is some what stupid when using characters like this... use ID's instead if possible.)
     31[showlink category_name="Räksmörgås"]
     32
    1933Done!
    2034
     35== Changelog ==
    2136
     37= 1.0 =
     38* We removed all the code written when I was overthinking and left one line...
     39
     40= 1.01 =
     41* Added the options category, category_name, show_images, show_name and show_description.
     42
     43== Upgrade Notice ==
     44
     45= 1.01 =
     46Added a few of the parameters available with wp_list_bookmarks, if you want to limit or enhance the output in some way you want this upgrade.
  • showlinks/trunk/ShowLinks.php

    r528488 r528714  
    22/**
    33 * @package Show_Links
    4  * @version 1.0
     4 * @version 1.01
    55 */
    66/*
     
    99Description: Show links added with the dashboard using a shortcode [showlinks] in posts.
    1010Author: Niklas Rydén
    11 Version: 1.0
     11Version: 1.01
    1212Author URI: http://kafit.se/
    1313*/
    1414
    1515function showlinksfunc($slparams) {
     16//  The line below is only for debugging while coding...you can delete it if it bothers you.
     17//    printf('<pre>');print_r($slparams);printf('</pre>');
     18
     19    // The base parameters we want to use...
    1620    $parameters = 'title_li=&categorize=0';
    17     if (isset($slparams['category_name'])) {
    18     $parameters = $parameters.'&category_name='.$slparams['category_name'];
    19     }
     21
     22    // Comma-separated ID-list
     23    if (isset($slparams['category'])) { $parameters = $parameters.'&category='.$slparams['category']; }
     24
     25    // The actual category name...yes...it's kind of...stupid...need to change this to permalink somehow to avoid melt down.
     26    if (isset($slparams['category_name'])) { $parameters = $parameters.'&category_name='.$slparams['category_name']; }
     27
     28    // 1 = true (default), 0 = false
     29    if (isset($slparams['show_images'])) { $parameters = $parameters.'&show_images='.$slparams['show_images']; }
     30
     31    // 1 = true, 0 = false (default)   Only needed when using images.
     32    if (isset($slparams['show_name'])) { $parameters = $parameters.'&show_name='.$slparams['show_name']; }
     33
     34    // 1 = true, 0 = false (default)
     35    if (isset($slparams['show_description'])) { $parameters = $parameters.'&show_description='.$slparams['show_description']; }
     36
    2037    wp_list_bookmarks($parameters);
    2138}
  • showlinks/trunk/readme.txt

    r528458 r528714  
    77Requires at least: 2.1
    88Tested up to: 3.3.1
    9 Stable tag: 1.0
     9Stable tag: 1.01
    1010
    11 A small plugin whose only purpose is to show links added with the Dashboard, using a short code.
     11A small plugin whose only purpose is to show links added with the Dashboard, using a shortcode.
    1212
    1313== Description ==
    14 A small plugin whose only purpose is to show links added with the Dashboard, using a short code.
     14A small plugin whose only purpose is to show links added with the Dashboard, using a shortcode.
    1515
    1616== Installation ==
    1717Place showlinks.php the plugin directory, activate it in the Dashboard, add the short code [showlinks] to any page or post.
    1818
     19Available parameters:
     20category=<comma-separated ID-list> // Cannot be used along with category name
     21category_name="<category title>" // Cannot be used along with category
     22show_images=1 or 0 (1=true (default), 0=false)
     23show_name=1 or 0 (1=true, 0=false (default)) // Only active when picture is set for link
     24show_description=1 or 0 (1=true, 0=false (default)
     25
     26Examples:
     27To show category ID's 2 and 5 along with the description
     28[showlinks category=2,5 show_description=1]
     29
     30To show link category "Räksmörgås" (Yes, this is some what stupid when using characters like this... use ID's instead if possible.)
     31[showlink category_name="Räksmörgås"]
     32
    1933Done!
    2034
     35== Changelog ==
    2136
     37= 1.0 =
     38* We removed all the code written when I was overthinking and left one line...
     39
     40= 1.01 =
     41* Added the options category, category_name, show_images, show_name and show_description.
     42
     43== Upgrade Notice ==
     44
     45= 1.01 =
     46Added a few of the parameters available with wp_list_bookmarks, if you want to limit or enhance the output in some way you want this upgrade.
Note: See TracChangeset for help on using the changeset viewer.