1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +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 // initialize some cruft
// --------------------- // ---------------------
$bcSql = new db; $bcSql = new db;
$prefix = e_PLUGIN."blogcalendar_menu"; $prefix = e_PLUGIN_ABS."blogcalendar_menu";
$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4, $marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4,
BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8, BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8,
BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12); BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
@@ -119,6 +119,10 @@ for($i = 1; $i <= 12; $i++)
$newline = 1; $newline = 1;
} }
$archive .= "<td style='vertical-align:top'>"; $archive .= "<td style='vertical-align:top'>";
if(!deftrue('BOOTSTRAP'))
{
$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>"; $archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
// href the current month regardless of newsposts or any month with news // href the current month regardless of newsposts or any month with news
@@ -132,6 +136,8 @@ for($i = 1; $i <= 12; $i++)
} }
$archive .= "</div>"; $archive .= "</div>";
}
if (($req_year == $cur_year) && ($i == $cur_month)) if (($req_year == $cur_year) && ($i == $cur_month))
{ {
$req_day = $cur_day; $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 .= "<div>".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."</div></td>\n";
} }
$archive .= "</tr></table></div>"; $archive .= "</tr></table></div>";
$ns->tablerender(BLOGCAL_L2 ."&nbsp;$req_year", $archive); $ns->tablerender(BLOGCAL_L2 ."&nbsp;$req_year", $archive);
require_once(FOOTERF); require_once(FOOTERF);

View File

@@ -33,7 +33,7 @@ if(false === $cached)
// ------------------------------ // ------------------------------
// initialization + fetch options // 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); $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"; $pref['blogcal_ws'] = "monday";
@@ -148,8 +148,6 @@ if(false === $cached)
} }
// ------------------------ // ------------------------
// create and show calendar // 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')) if(deftrue('BOOTSTRAP'))
{ {
$active = date("n") == $req_month ? 'active' : ''; $active = date("n-Y") == ($req_month."-".$req_year) ? 'active' : '';
$text = "<div class='item {$active}'>"; $text = "<div class='item {$active}'>";
$text .= "<h5>".$marray[$req_month]." ".$req_year."</h5>"; $text .= "<h5>".$marray[$req_month]." ".$req_year."</h5>";
$text .= $calendar; $text .= $calendar;