<?php
/**
- * Shaarli v0.6.1 - Shaare your links...
+ * Shaarli v0.6.2 - Shaare your links...
*
* The personal, minimalist, super-fast, no-database Delicious clone.
*
/*
* PHP configuration
*/
-define('shaarli_version', '0.6.1');
+define('shaarli_version', '0.6.2');
// http://server.com/x/shaarli --> /shaarli/
define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0)));
exit;
}
-// "Daily" page.
-function showDaily()
+/**
+ * Show the 'Daily' page.
+ *
+ * @param PageBuilder $pageBuilder Template engine wrapper.
+ */
+function showDaily($pageBuilder)
{
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
array_push($columns[$index],$link); // Put entry in this column.
$fill[$index]+=$length;
}
- $PAGE = new pageBuilder;
+
$data = array(
'linksToDisplay' => $linksToDisplay,
'linkcount' => count($LINKSDB),
$pluginManager->executeHooks('render_daily', $data, array('loggedin' => isLoggedIn()));
foreach ($data as $key => $value) {
- $PAGE->assign($key, $value);
+ $pageBuilder->assign($key, $value);
}
- $PAGE->renderPage('daily');
+ $pageBuilder->renderPage('daily');
exit;
}
exit;
}
+ // Daily page.
+ if ($targetPage == Router::$PAGE_DAILY) {
+ showDaily($PAGE);
+ }
+
// Display openseach plugin (XML)
if ($targetPage == Router::$PAGE_OPENSEARCH) {
header('Content-Type: application/xml; charset=utf-8');
'links' => $linkDisp,
'tags' => $LINKSDB->allTags(),
);
+ // FIXME! temporary fix - see #399.
+ if (!empty($GLOBALS['pagetitle']) && count($linkDisp) == 1) {
+ $data['pagetitle'] = $GLOBALS['pagetitle'];
+ }
$pluginManager = PluginManager::getInstance();
$pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn()));
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=rss')) { showRSS(); exit; }
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; }
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=dailyrss')) { showDailyRSS(); exit; }
-if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=daily')) { showDaily(); exit; }
if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE'];
renderPage();
?>