Fork me on GitHub

pe_pplog demo page

Main menu

finally fixed the bug #10

No comments
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 "/"?
Posted on - Categories: bugs


Some issues

2 Comments
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

    Posted on - Categories: bugs changes


    reverse proxies

    1 Comment
    if you are using a reverse proxy, the registered ip address from users visiting your site will always seem to be localhost (127.0.0.1), which affects the following features:

    Users online is always 1 or 0

    Banning is simply not possible

    The login cookie being ip dependent is simply redundant

    all of this will be fixed in the upcoming bugfixed version


    Hiawatha

    No comments
    Dromeno was nice enough to bring some problems the pe_pplog had when running in the Hiawatha web-server to my attention. These have been fixed now, hence I released a bug-fixed version of the blog (v1.1b).
    See download page.

    Bug fixes: login for pe_admin.pl changed to set the header properly (it set two before)

    archive bugfix from jamesbond (thank you!)

    permissions for pe_admin.pl and pe_pplog.pl changed to make them executable (not really a bugfix, but takes out one step in installation...)

    I really need one more computer as testing between lampp and hiawatha with one computer is annoying

    Posted on - Categories: bugs


    Pages: [1]