2012-07-11 14:02:31 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2012-09-20 08:46:21 +02:00
|
|
|
* Name: Blog
|
2013-01-23 15:55:59 +01:00
|
|
|
* Version: 0.5
|
2013-02-15 16:20:28 +01:00
|
|
|
* Description: Blog theme ported from <a href='http://wordpress.org/extend/themes/twentyeleven'>Twenty Eleven wordpress theme</a>, Licensed under <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU General Public License v2 or later</a>
|
2012-09-20 08:46:21 +02:00
|
|
|
* Author: Fabio <http://kirgroup.com/profile/fabrixxm>
|
|
|
|
* Maintainer: Fabio <http://kirgroup.com/profile/fabrixxm>
|
|
|
|
*/
|
|
|
|
|
2012-07-11 14:02:31 +02:00
|
|
|
|
|
|
|
function blog_init(&$a) {
|
|
|
|
|
2013-01-23 15:55:59 +01:00
|
|
|
$a->theme_info = array();
|
2013-04-23 09:49:05 +02:00
|
|
|
set_template_engine($a, 'smarty3');
|
2013-01-22 17:50:37 +01:00
|
|
|
}
|
|
|
|
|
2013-02-15 16:09:45 +01:00
|
|
|
function blog_install(&$a){
|
|
|
|
register_hook('display_item', 'view/theme/blog/theme.php','blogtheme_display_item');
|
|
|
|
logger("installed theme blog");
|
|
|
|
}
|
|
|
|
function blog_uninstall(&$a){
|
|
|
|
unregister_hook('display_item', 'view/theme/blog/theme.php','blogtheme_display_item');
|
|
|
|
logger("uninstalled theme blog");
|
|
|
|
}
|
|
|
|
|
2013-01-23 15:55:59 +01:00
|
|
|
function blogtheme_imgurl($headimg) {
|
|
|
|
$a = get_app();
|
|
|
|
if ($headimg[0]==".") return $a->get_baseurl().'/view/theme/blog/headers/'.substr($headimg,1);
|
|
|
|
if ($headimg == "~none~") return "";
|
|
|
|
return False;
|
2013-02-15 16:09:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function blogtheme_display_item(&$a, &$data){
|
|
|
|
if (!is_null($data)) {
|
|
|
|
$nick = $a->profile['nickname'];
|
|
|
|
if (is_null($nick)) $nick = $a->user['nickname'];
|
|
|
|
$data['output']['displaylink'] = $a->get_baseurl()."/display/".$nick."/".$data['item']['id'];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-11 14:02:31 +02:00
|
|
|
}
|