Monday, August 21, 2006

Latest Posts v1.0 by Cypher

While looking for plugins for Jutia Group I stumbled upon Latest Posts v1.0. It is on the left side, under "10 Newest Entries".


I needed some more functionality out of it so I took the liberty to modify the code a bit. Just to make it a tad more flexible.


I started by changing the function call for inside the template. I changed it from:


to


What this does is, before the function is called its existence will be verified. This will prevent your theme from braking and your pages loading halfway and then displaying errors when the function is called:


  • if you disable the plugin (now you can turn on and off the plugin without the visitors getting page errors)

  • the plugin file is moved, corrupted or deleted


In other words, if something happens to the plugin and you are unaware of the problem, your site will not brake. This of course is bad, but it will not have a negative effect on your site.


My next change was to make the number of posts being displayed flexible. With other plugins and the ability to call the function in any page or post you might want to display different number of posts at different places.


I started by deleting the variable

$max_posts
from the global declaration.


Then I placed that variable in the function declaration.


Old

function cypher_latestposts($before='', $after='
')

New
function cypher_latestposts($max_posts, $before='', $after='
')


Now when you call your function you can set the number of post to be displayed at the function call location. Like this:


In this example I want 10 posts. You can change this number to anything you want.


Here is an extra. Some of you might want to display your links in a list, others separated by a comma (no idea why), slashes, hyphens or as in the original just with a line breaker. So what you will do is change the function declaration like this:
From

function cypher_latestposts($max_posts, $before='', $after='
')

to
function cypher_latestposts($max_posts, $before, $after)


When you call your function just insert what you want to separate the links with. Here are some examples:

<?php if (function_exists('cypher_latestposts')) cypher_latestposts('10','
  • ','
  • '); ?>
    <?php if (function_exists('cypher_latestposts')) cypher_latestposts('10','+','
    '); ?>


    Friday, August 18, 2006

    RTP 300 log in script is still flawed

    Tonight, while reconfiguring my network, I had to log into my Linksys RTP 300 router. If you remember, a while back I wrote about a security flaw I found in the log in script of that router. You can read my post here. Well, tonight while logging in I mistyped the last character of the router's password, which of course is still a digit. Guess what folks, I was able to log in without any problems.


    Last year, when I wrote my post, the firmware version was 1.00.55. The current firmware version is 1.00.62. Before I wrote my first post about this, I had contacted Linksys and informed them of the problem. The email I received from them pretty much told me: thanks for the info. we will look into it. Well, in a couple of months it will be one year since I told them and the security flaw has not been fixed. Apparently Linksys, a company owned by one of the biggest network hardware manufacturer (Cisco), priding itself on security, does NOT think that simple password security flaw is important enough to fix.


    Wonderful! With that kind of security/customer minds set, maybe we should look into switching to Netgear or D-Link.

    Back again

    Once again it has been a long while since I have had a posted. In the lapsed time I have gone through two jobs, started a project with my brother, called Jutia Group, as well as started working on few of mine. I have also demitted from the Grand Lodge of New York and I have become a brother in Illinois.

    I hope to have enough free time to write on all of this in the upcoming days.