Re: [pLog-General] change in mylink.class.php
Brought to you by:
jondaley
From: Oscar R. <os...@re...> - 2004-04-13 16:17:31
|
I think it looks good enough to be added into the core. We need a timestamp field in the links table in any case, so this is a good moment to add it. The bad news is that it won't be included in 0.3.1 because by definition, no changes in the structure of the database should be made in minor releases... Oh well, it'll have to wait for 1.0 :) And now that I see this, I will take a look at the part that generates the different feeds so that adding a feed is just a matter of dropping a .template file to the templates/rss/ folder (now also some changes to the code are needed, as Nick found out) Oscar On 9 Apr 2004, at 10:59, Nick Gerakines wrote: > Hmm, > I'm creating a template for xbel bookmark formatting. I figure it'd > be easier to just create a template file to format a blog's bookmarks > instead of creating a complex plugin to poll and list them all. One > thing that i am asking though is another field be added to the > bookmarks table. One for when the bookmark was added. General > timestamp would be fine. > > Oh bah, > I started writing on how one could do it but instead just made the > modifications myself. I'll post the changed files and describe what i > did as refference. > > Before you do anything, you need to alter the table that the links are > kept in. Simply runs this command: > ALTER TABLE `plog_mylinks` ADD `date` TIMESTAMP; > Without this you won't have a propperly formatted xbel document. If > you want to go without you can but for the sake of conformity please > go with it. Next you'll need to alter a couple of files used for the > links and rss output. First is mylink.class.php. This is the actual > link object. The major modification to this is the $date input on the > class initializer. The only kicker is that when you change this file > you have to change all of the other files that call this class. I also > added a setDate, getDate and getDateObject functions to the mylink > class that allow you to set the date object and then grab the date > object to format and pretty it up. > Next file that'll need changing is the mylinks.class.php. The only > changes here are the calls to the mylink class. Its two lines and > nothing too to big. After that you need to make a small change to > archivelink.class.php. This class is an extention of the mylink class > used to count the number of links for the archives. > The base of it is now complete, but you still want to be able to use > the xbel.template file under the rss folder to view all of your links. > This will be a bit easy, its just a matter of making changes to > rssaction.class.php. First we define xbel as an actual template, we > have to define it as a security measure to filter out junk post calls. > Next we go through the class and add it to the if/then statement used > to determine if the requested template is junk or not. > Last but not least just make sure xbel.template is in the > templates/rss dir and you are done. You can create the link in your > panel by calling: > <a title="Link to the xbel 1.0 feed." > href="{$url->rssLink("xbel")}">Xbel 1.0</a> > Hope this helps guys, just check the archive and either replace the > files altogether or examine them. If you find a bug let me know and > i'll update the tutorial for you. > ~ Nick > Update: > Had issues sending .zip attachments through the sf mailing list so > downlod the zip here. > http://www.socklabs.com/index.php? > op=ViewResource&blogId=2&resource=xbel.zip > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > pLog-General mailing list > pLo...@li... > https://lists.sourceforge.net/lists/listinfo/plog-general > |