Fork me on GitHub

pe_pplog demo page

Hauptmenü

finally fixed the bug #10

Keine Kommentare
when editing a newly submitted post or note the pplog used to write "notes" or "posts" instead of the entry number.

I was dumbfounded by the bug, see if you can spot it:



my $fileName = r('viewDetailed');
$fileName = "posts/".$fileName if $fileName =~ /^(\d\d\d)/; #if there is no folder indication it is assumed to be a post
my @split= split (/\//, $fileName);
my $fileNum = $split[1];

if(r('process') eq 'doEntry')
{
# new or edit entry
my $title = r('title');
my $content=bbcode(r('content'));
my $category = r('category');
my $isHTML = r('isHTML'); #Efia HTML checkbox
my $isPage = r('isPage');

$content = basic_r('content') if($isHTML == 1);

if($title eq '' || $content eq '' || $category eq '') #check if everything is filled out
{
print $locale{$lang}->{necessary};
last;
}
if (r('Submit') eq $locale{$lang}->{newnote} || r('Submit') eq $locale{$lang}->{subentry})
{
my $dir = '/posts'; #according to submit button
$dir = '/notes' if (r('Submit') eq $locale{$lang}->{newnote}); #for Notes
my @files = getFiles($config_DatabaseFolder.$dir);
my @lastOne = split(/,/, $files[0]);

if($lastOne[4] eq '') #new file with latest number
{
$fileNum = sprintf("%05d",0);
}
else
{
$fileNum = sprintf("%05d",$lastOne[4]+1);
}
$fileName = "$dir/$fileNum";
}

open(FILE, ">$config_DatabaseFolder.$fileName.$config_dbFilesExtension");
print FILE;
close FILE;


the problem was the additional "/" at $dir = "posts"

it is fixed now, but leaves me with the question what are the standard coding practices of path names, trailing "/" no trailing "/"?
Erstellt am - Kategorien: bugs


heartbleed

Keine Kommentare
Just a reminder to everyone who is running this blog on a server with openssl check their version and see if they are affected by the heartbleed bug. Info here.
If you do not have SSL enabled and set as required in the config file, you really should!
Erstellt am - Kategorien: security


Redesigning forms

Keine Kommentare
The forms in the pplog were in table format. This is actually bad design practice as it means a lot of unused white space and forms resizing badly to smaller screens.
See this example:


I redesigned them using the <legend>, <p> and <label> tags, which does not onlz have the advantage of using the space more efficiently and resizing nicely


but also makes the forms accessible for people using screen readers. I decided to get rid of the captcha, as it was easy for a spambot to circumvent and decided to give the possibility to prompt for random questions instead. I also added a honeypot to fool spambots. These measures should be effective against robots, the only thing helping against trolls is using the security question as a password.

While I was at it I added some bells and whistles to the new/edit entry forms:


Now when checking and unchecking "isHTML" the bbcode buttons disappear and reappear and existing categories are in a select box



Some issues

2 Kommentare
The notes plugin and it's implementation have a few issues:

  • When writing a new note it did not show the note after submitting, but the entry with the same file number.

  • When deleting a note the comments belonging for the post with the same file name also got deleted


  • Comments issue

  • Sometimes comments get posted twice


  • Other things

  • The bbcode is in an unusual form, needs standardization

  • The code is messy, lot's of duplicated code


  • I'm at the moment working on the above and even adding some more enhancements, such as comment preview, having galleries created via bbcode instead of relying on an extra plugin and maybe offering other options (such as markup) instead of bbcode. Also some css/html changes to allow for more different themes.
    Look at http://github.com/efiabruni to see the latest developments

    Erstellt am - Kategorien: bugs changes


    Blog version 2.1b release

    Keine Kommentare
    This is the bugfix version of pe_pplog 2.1.

    Major changes include css based lightboxes, different options for emails, drafts/notes, and comments preview.

    Changelog

    Download


    Seiten: [1] [2] [3] [4] [5] ...