YOURLS Plugin – Popular Links

UPDATE: This version only works for 1.5-1 and below. Version 1.6 and 1.7 you should go here http://laaatech.com/yourls-plugin-popular-links-1-7

 

Short post, but I have thrown together a short plugin for YOURLS (using a lot of the code from http://gkurl.us/popular) that shows the most popular links created in 1,30,365, and 1000 days on a YOURLS site. It’s based on code from Mrtech, but is now in the form of a plugin.

Download here, save as plugin.php and upload to YOURLS_DIRECTORY/user/plugins/popular-links

 

http://pastebin.com/raw.php?i=NmM9D2Pi

Advanced:

At the bottom of the plugin, you can edit the values

> show_top(1000,5);

1000 means the number of days you are selecting from the database

5 means the number of links you are selecting.

6 comments on “YOURLS Plugin – Popular Links

  1. david September 20, 2013 4:20 pm

    I have the following errors, how do you suggest I fix it? Thanks in advance.

    Notice: yourls_plural is deprecated since version 1.6! Use yourls_n instead. in /home/content/44/11042744/html/oxsi.com/s_private/includes/functions.php on line 2023

    Notice: Use of undefined constant host – assumed ‘host’ in /home/content/44/11042744/html/oxsi.com/s_private/user/plugins/popular-links/plugin.php on line 41

  2. Laaabaseball September 20, 2013 5:08 pm

    Doesnt work with 1.6, only 1.5

  3. david September 20, 2013 5:25 pm

    thanks, any pointer as how to fix it? Can you delete my domain name from the public posting as it is still under development. thanks.

  4. Dave January 13, 2014 2:58 pm

    This plugin is no longer compatible with YOURLS as one of the functions it uses (yourls_plural) has been deprecated. You can make the plugin work again by adding the function to plugin.php. Just add the following code:

    function yourls_plural( $word, $count=1 ) {
    return $word . ($count > 1 ? ‘s’ : ”);
    }

    Enjoy.

  5. aussiepunter January 23, 2014 9:50 pm

    Not working with 1.7 but thanks to Dave, adding the yourls_plural function is a simple fix.

    Cheers Dave.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>