Page 1 of 1

Safe plugin?

Posted: Wed May 12, 2004 6:01 am
by chief123
This is in reference to the thread at http://php-blog.sourceforge.net/forums/ ... .php?t=148 where it seemed that at the end it had gotten off topic a bit so I decided to post here.

Garvin says to use a real plugin for safety and reliability. Can anyone comment on using this code which is supposed to include a trusted script in the sidebars that generates a random quote.

Since I did this myself I wanted to make sure that this wasn't way out of whack despite whether it works or not.

Thanks for any comments.

Code: Select all

<?php 

class serendipity_plugin_rquote extends serendipity_plugin { 
    function introspect(&$propbag) 
    { 
        $propbag->add('name',          'Random Quote'); 
        $propbag->add('description',   'Lists random quote every time page is refreshed'); 
    } 

    function generate_content(&$title) 
    { 
        $title = "Quote of the day"; 
        
        include ("randomquote.php"); 
        
    } 
} 

?> 

Posted: Wed May 12, 2004 11:39 am
by garvinhicking
Yes, that's perfectly the way it's supposed to be. :-)