new plugin: Quick Link

Creating and modifying plugins.
Post Reply
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

new plugin: Quick Link

Post by oxygenws »

I developed a new plugin named "Quick Link".
It is something like "shoutbox" but for personal links.

You could use it, when you want to add links (news, attractive, fantastic(!) or nice links) to your weblog as fast as you can!

i did not upload this plugin to serendipity repository, please test it and feedback me!

i was uploaded this plugin here (sorry for download link :( ):
http://rapidshare.de/files/18559425/ser ... ar.gz.html

when user is NOT logged in:
Image

when user logged in:
Image

plugin control panel:
Image

note1: some scratched phrases are Persian, don't worry :D
note2: direction of pages in pictures are RTL

waiting for your feedbacks...
regards.
My Blog, powered by s9y is http://oxygenws.com/blog/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

VERISION 0.2

Post by oxygenws »

version 0.2 released :D

improvements:
- now you can add label for links. if you dont enter anything, it will show the link string as label.
- now you can set this plugin public or private, then visitors can send links too.
- before deleting a link, it will ask you.
- previous and next link will not shown, if BOTH of them are not linked!

the new version is here:
http://www.oxygenws.com/php/s9y/serendi ... ink.tar.gz

still waiting ;)
My Blog, powered by s9y is http://oxygenws.com/blog/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: new plugin: Quick Link

Post by garvinhicking »

Hi!

Wow, that is a great plugin! I am sure many people will love that to easily enhance their sidebar links! Great work.

I just inspected your plugin and only have a few recommendations:

1. You set the defaults of the "Next", "previous" etc. config items to hard-coded english strings. Instead I suggest to use also constants there, like this:

Code: Select all

            case 'next':
                $propbag->add('type', 'string');
                $propbag->add('name', PLUGIN_QUICKLINK_NEXT);
                $propbag->add('description', PLUGIN_QUICKLINK_NEXT_BLAHBLAH);
                $propbag->add('default',    NEXT_PAGE);
                break;
2. You use this code to detect limiting:

Code: Select all

        if (!empty($serendipity['GET']['start'])) {
        	$start = $serendipity['GET']['start'];
        }else{
        	$start = 0;
        }
This can be used for SQL injection. Use this instaed:

Code: Select all

        if (!empty($serendipity['GET']['start'])) {
        	$start = (int)$serendipity['GET']['start'];
        }else{
        	$start = 0;
        }
3. You use a limit clause like this:

Code: Select all

LIMIT ' . $start . ',' . $max_entries;
However that will not work on postgresql. You should use this serendipity function instead:

Code: Select all

' . serendipity_db_limit_sql(serendipity_db_limit($start, $max_entries)) . '
4. You just use

Code: Select all

if ($_SESSION['serendipityAuthedUser'] === true) {
to check if a user can delete quicklinks. With that you also allow any editor to a blog to delete something; instead I suggest to also check the userlevel and restrict it to chiefs:

Code: Select all

if ($_SESSION['serendipityAuthedUser'] === true && $serendipity['serendipityUserlevel'] >= USERLEVEL_CHIEF) {
If you have the time to change thos issues, would you like to commit the plugin for Spartacus? I think it would be great!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

Thanks Garvin :)

i released version 0.3!!!
all your nice suggestions done. (next and previous field compeletely removed from control panel)

and 2-3 small bugs fixed.

download new version, from the last link:
http://www.oxygenws.com/php/s9y/serendi ... ink.tar.gz
My Blog, powered by s9y is http://oxygenws.com/blog/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

committed for Spartacus. (wait for sourceforge daily updates!!)
My Blog, powered by s9y is http://oxygenws.com/blog/
Post Reply