1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Blog calendar fixes (urls etc.)

This commit is contained in:
Cameron
2013-07-23 07:14:18 -07:00
parent 500ad596bc
commit ee6626ff94
3 changed files with 22 additions and 17 deletions

View File

@@ -29,7 +29,7 @@ require_once(HEADERF);
// initialize some cruft
// ---------------------
$bcSql = new db;
$prefix = e_PLUGIN."blogcalendar_menu";
$prefix = e_PLUGIN_ABS."blogcalendar_menu";
$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4,
BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8,
BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
@@ -119,19 +119,25 @@ for($i = 1; $i <= 12; $i++)
$newline = 1;
}
$archive .= "<td style='vertical-align:top'>";
$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
// href the current month regardless of newsposts or any month with news
if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i])
if(!deftrue('BOOTSTRAP'))
{
$archive .= "<a class='forumlink' href='".e107::getUrl()->create('news/list/month', 'id='.formatDate($req_year, $i))."'>".$marray[$i-1]."</a>";
}
else
{
$archive .= $marray[$i-1];
$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
// href the current month regardless of newsposts or any month with news
if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i])
{
$archive .= "<a class='forumlink' href='".e107::getUrl()->create('news/list/month', 'id='.formatDate($req_year, $i))."'>".$marray[$i-1]."</a>";
}
else
{
$archive .= $marray[$i-1];
}
$archive .= "</div>";
}
$archive .= "</div>";
if (($req_year == $cur_year) && ($i == $cur_month))
{
$req_day = $cur_day;
@@ -143,6 +149,7 @@ for($i = 1; $i <= 12; $i++)
$archive .= "<div>".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."</div></td>\n";
}
$archive .= "</tr></table></div>";
$ns->tablerender(BLOGCAL_L2 ."&nbsp;$req_year", $archive);
require_once(FOOTERF);

View File

@@ -33,7 +33,7 @@ if(false === $cached)
// ------------------------------
// initialization + fetch options
// ------------------------------
$prefix = e_PLUGIN."blogcalendar_menu";
$prefix = e_PLUGIN_ABS."blogcalendar_menu";
$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4, BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8, BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
$pref['blogcal_ws'] = "monday";
@@ -147,9 +147,7 @@ if(false === $cached)
$months[$cur_year][$cur_month] = 1;
}
// ------------------------
// create and show calendar
// ------------------------

View File

@@ -140,7 +140,7 @@ function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday"
if(deftrue('BOOTSTRAP'))
{
$active = date("n") == $req_month ? 'active' : '';
$active = date("n-Y") == ($req_month."-".$req_year) ? 'active' : '';
$text = "<div class='item {$active}'>";
$text .= "<h5>".$marray[$req_month]." ".$req_year."</h5>";
$text .= $calendar;