Fork me on GitHub

pe_pplog demo page

Main menu

backgrounds

No comments
Testing the new gallery/lightboxes script.

menu


use tab to browse

m_menu


a description

menu3

m_menu3

menu4

menu2

m_menu2




CLICK!

TEXT_BOX

this should be a text box write with bbcode just
like any post



BBcode

Picture: {box=/css/menu.jpg title=menu}{img}/css/menu.jpg {/img} use tab to browse{/box}
Text box: {box=. title=TEXT_BOX}{style=width:200px;}this should be a {b}text box {/b}write with {u}bbcode{/u} just like {i}any{/i} post{lol/} {/style}{/box}

Posted on - Categories: extras


An event calendar

No comments
This was supposed to be a post akin to the Social Share Buttons one, with a lot of different options, but I only found one JQuery calendar that was lightweight and easy to set up, FullCalendar.

My set up of it looked like this:
cal-monthcal-weekcal-day

I downloaded the files from the website and put them in the /js folder on my server home.
The I put this:
<link rel="stylesheet" type="text/css" href="/js/fullcalendar.css" />
<script type="text/javascript" src="/js/fullcalendar.js"></script>


in "our $config_customHTMLhead" and "our $config_customHTMLadmin"

Then I made a new entry with the following content:
cal-code

and checked "is HTML".

As you can see events are added in the initialization script, see the webpage for more options, such as google calendar integration.

As an extra I wrote a short script replacing the traditional archive with a calendar with click-able links:
cal-archive

replace "doArchive();" in pe_pplog.pl (around line 750) and/or pe_admin.pl (around line 910)
with the following:

print '<h1>'.$locale{$lang}->{archive}.'</h1><script>$(document).ready(function() {

$(\'#calendar\').fullCalendar({
events: [';
my @entries = getFiles($config_postsDatabaseFolder);
print $locale{$lang}->{noentries} if scalar(@entries) == 0;
# Split the data in the post so i have them in this format "13 Dic 2008, 24:11|0001|Entry title" date|fileName|entryTitle
my @dates = map { my @stuff = split(/¬/, $_); @stuff[2].'|'.@stuff[4].'|'.@stuff[0]; } @entries; #25.05.13 jamesbond
my $year;
my $month;
my %months = (Jan=>"01", Feb=>"02", Mar=>"03", Apr=>"04", May=>"05",
Jun=>"06", Jul=>"07", Aug=>"08", Sep=>"09", Oct=>"10", Nov=>"11", Dic=>"12"); #hash to change shots into numbers for events
my $day;
foreach(@dates)
{
my @date = split(/\|/, $_);
my @y = split(/\s/, $date[0]);
$y[2] =~ s/,//; #get rid of the comma!
$day = $y[0];
unless ($day =~ /\d\d/){$day = '0'.$day;} #day needs to be double digit 01 instead of 1
$month = $y[1];
$year = $y[2];
print "{title: '$date[2]', url: '?viewDetailed=$date[1]', start: '$year-$months{$month}-$day'},"; #writing the entries as calendar events
}
print ']
})
});</script><div id="calendar"></div>';


and add the javascript and css file as above


Language support

No comments
As you can see in the main menu it is possible to choose a language (cookies need to be enabled).
This is not going to be a feature, it is a way for me to test (and demonstrate) localisation of the blog. There will be a proper German and English version (with documentation being in either language) and Spanish localisation available, as well as an incomplete Greek one (taken from the translation of the original PPLOG done by koulaxizis.
There will also be the possibility to add a custom translation if one wishes so.

I'm still busy with spellchecking and correction of the Spanish translation. Please inform me of any mistakes you might find...

The localisation does not depend on any additional modules or programs, I quickly abandoned the idea of gettext and the like and relied instead on a simple hash in the pe_Config.pl file, such as:

our%locale;

$locale {"EN"} = {
menu => "Main Menu",
...
};
$locale {"DE"} = {
menu => "Hauptmenu",
...
}


setting the language with our $lang=...
This means I replaced all text in the blog with:
$locale{$lang}->{key}

I wonder what this says about me...

Anyway, here is what I threw together for the "set language" button and the "set style" button.
After the "do RSS section":

	my $style = cookie('style');

my $language = cookie ('lang');

$config_currentStyleSheet = $style if defined $style;
$lang = $language if defined $language;

if (r('style') ne ''){
my $style = r('style').".css";
my $cookie = cookie (-name => 'style', value => $style);
$config_currentStyleSheet = $style;
print header (-charset => qw(utf-8), -cookie => $cookie);
}
elsif (r('lang') ne ''){
$lang = r('lang');
my $cookie = cookie (-name => 'lang', value => $lang);
print header (-charset => qw(utf-8), -cookie => $cookie);
}
else {print header(-charset => qw(utf-8));}


Menu entries:
print '<ul class="menu"><li><a class="menu" href="#">Set Style »</a><ul class="drop">

<li><a href="?style=style">Default</a></li>
<li><a href="?style=darkgrey">Dark Grey</a></li>
</ul></li></ul>';

print '<ul class="menu"><li><a class="menu" href="#">Set Language »</a><ul class="drop">';
foreach (keys%locale){
print '<li><a href="?lang='.$_.'">'.$_.'</a></li>';
}
print '</ul></li></ul>';


fun!



Extra stuff

No comments

Diff files for features not included in the official version

Adding a choose style or choose language option

Archive in calendar form

Additional scripts

Perl script to convert posts from the original pup_pplog to work with the pe_pplog (run in terminal)

Script which I use as error pages. It shows a random picture from a folder and the error status and message. Works for 500 and 403. See here for an example.

Stand alone contact me page. Open in text editor and change

require "./blog/pe_Config.pl"; 

to the path to your pe_config file.

Use $config_contactAddress to add contact info.

Themes

darkgrey

plain


Posted on - Categories: extras


Pages: [1]