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:
@@ -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,19 +119,25 @@ for($i = 1; $i <= 12; $i++)
|
|||||||
$newline = 1;
|
$newline = 1;
|
||||||
}
|
}
|
||||||
$archive .= "<td style='vertical-align:top'>";
|
$archive .= "<td style='vertical-align:top'>";
|
||||||
$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
|
|
||||||
|
if(!deftrue('BOOTSTRAP'))
|
||||||
// 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>";
|
|
||||||
}
|
$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
|
||||||
else
|
|
||||||
{
|
// href the current month regardless of newsposts or any month with news
|
||||||
$archive .= $marray[$i-1];
|
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))
|
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 ." $req_year", $archive);
|
$ns->tablerender(BLOGCAL_L2 ." $req_year", $archive);
|
||||||
|
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
|
@@ -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";
|
||||||
|
|
||||||
@@ -147,9 +147,7 @@ if(false === $cached)
|
|||||||
$months[$cur_year][$cur_month] = 1;
|
$months[$cur_year][$cur_month] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
// create and show calendar
|
// create and show calendar
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user