6 include
'../system/plugins/blog/classes/blog.php';
8 if (!isset(
$blog)) {
$blog = new \YAWK\PLUGINS\BLOG\blog(); }
10 if (!isset($language) || (!isset(
$lang)))
18 if (isset(
$_GET[
'blogid']))
32 if (isset(
$_GET[
'toggle']))
34 $published =
$_GET[
'published'];
35 if (isset(
$_GET[
'id']) && (!empty(
$_GET[
'id']) && (is_numeric(
$_GET[
'id']))))
45 if ($published ==
'1') {
47 $status =
"$lang[OFFLINE]";
51 $status =
"$lang[ONLINE]";
57 print alert::draw($color,
"$lang[PAGE] $lang[IS] $lang[NOW] $status",
"$lang[PAGE_TOGGLE] $lang[SUCCESSFUL]",
"", 800);
61 print alert::draw(
"danger",
"$lang[ERROR]",
"$lang[PAGE_TOGGLE_FAILED]",
"", 6800);
67 if (isset(
$_GET[
'copy']))
69 if (isset(
$_GET[
'blogid']) && (isset(
$_GET[
'itemid'])))
72 $page = new \YAWK\page();
73 $blog = new \YAWK\PLUGINS\BLOG\blog();
82 if(
$_GET[
'copy'] ===
"true")
86 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[BLOG] $lang[ITEM] ".
$_GET[
'itemid'].
" $lang[COPIED]",
"",
"2000");
90 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[BLOG] $lang[ITEM]",
"plugin=blog&pluginpage=blog-entries&blogid=$blog->id $lang[COPY] $lang[FAILED]",
"3800");
104 if (isset(
$_GET[
'itemid']))
108 alert::draw(
"danger",
"$lang[ERROR] $lang[ID] #$_GET[itemid] / $_GET[title]",
"$lang[PAGE_DEL_FAILED]",
"", 5800);
116 if (
$_GET[
'deletecomment'] ===
"true") {
118 if (isset(
$_GET[
'commentid']) && (isset(
$_GET[
'itemid']) && (isset(
$_GET[
'blogid'])))) {
120 alert::draw(
"success",
"$lang[SUCCESS] ",
"$lang[COMMENT] $lang[ID] " .
$_GET[
'id'] .
" $lang[DELETED]",
"",
"1200");
124 alert::draw(
"danger",
"$lang[ERROR] ",
"$lang[DELETE] $lang[COMMENT] $lang[ID] " .
$_GET[
'id'] .
" ",
"",
"3800");
132 <script
type=
"text/javascript">
133 $(document).
ready(
function () {
134 $(
'#table-sort').dataTable({
136 "bLengthChange":
false,
147 <!-- Content Wrapper. Contains page content -->
148 <div class=\"content-wrapper\" id=\"content-FX\">
149 <!-- Content Header (Page header) -->
150 <section class=\"content-header\">";
152 \YAWK\PLUGINS\BLOG\blog::getBlogTitle(
$blog->name,
$lang[
'MANAGE'],
$blog->icon);
153 echo
"<ol class=\"breadcrumb\">
154 <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
155 <li><a href=\"index.php?page=plugins\" title=\"$lang[PLUGINS]\"> $lang[PLUGINS]</a></li>
156 <li class=\"active\"><a href=\"index.php?plugin=blog\" title=\"$lang[BLOG]\"> $lang[BLOG]</a></li>
159 <!-- Main content -->
160 <section class=\"content\">";
163 <div
class=
"box box-default">
164 <div
class=
"box-body">
166 <
a class=
"btn btn-success" href=
"index.php?plugin=blog&pluginpage=blog-newitem&blogid=<?php echo $blog->id; ?>" style=
"float:right;">
167 <
i class=
"glyphicon glyphicon-plus"></
i> &
nbsp;<?php print
$lang[
'BLOG+']; ?></
a>
169 <
a class=
"btn btn-default" href=
"index.php?plugin=blog" style=
"float:right;">
170 <
i class=
"glyphicon glyphicon-backward"></
i> &
nbsp;<?php print
$lang[
'BACK']; ?></
a>
172 <table width=
"100%" cellpadding=
"4" cellspacing=
"0" border=
"0" class=
"table table-striped table-hover" id=
"table-sort">
175 <td width=
"3%"><strong>&
nbsp;</strong></td>
176 <td width=
"5%" class=
"text-center"><strong><?php print
$lang[
'ID']; ?></strong></td>
177 <td width=
"25%"><strong><?php print
$lang[
'TITLE']; ?></strong></td>
178 <td width=
"30%"><strong><?php print
$lang[
'SUBTITLE']; ?></strong></td>
179 <td width=
"5%" class=
"text-center"><strong><?php print
$lang[
'AUTHOR']; ?></strong></td>
180 <td width=
"5%" class=
"text-center"><strong><?php print
$lang[
'GROUP']; ?></strong></td>
181 <td width=
"10%" class=
"text-center"><strong><?php print
$lang[
'START_PUBLISH']; ?></strong></td>
182 <td width=
"7%" class=
"text-center"><strong><?php print
$lang[
'COMMENTS']; ?></strong></td>
183 <td width=
"10%" class=
"text-center"><strong><?php print
$lang[
'ACTIONS']; ?></strong></td>
189 if (
$res =
$db->query(
"SELECT ci.*, cu.username as username, cr.value as gid FROM {blog_items} as ci
190 INNER JOIN {users} as cu on ci.uid = cu.id
191 INNER JOIN {user_groups} as cr on ci.itemgid = cr.id
192 WHERE blogid = '" .
$blog->id .
"' ORDER BY date_publish"))
194 while ($row = mysqli_fetch_assoc(
$res))
196 $date_publish = $row[
'date_publish'];
197 $date_unpublish = $row[
'date_unpublish'];
198 $atm =
date(
"Y-m-d H:i:s");
201 switch ($row[
'published']) {
204 $pubtext =
"$lang[OFFLINE]";
208 $pubtext =
"$lang[ONLINE]";
213 switch ($row[
'itemgid']) {
225 if ($atm < $date_publish) {
227 $pubtext =
"$lang[IN_QUEUE]";
229 if (!is_null($date_unpublish)){
230 if ($atm >= $date_unpublish) {
232 $pubtext =
"$lang[EXPIRED]";
237 $i_comments = \YAWK\PLUGINS\BLOG\blog::countActiveComments(
$db,
$blog->id, $row[
'id']);
238 if ($i_comments !==
'0') {
239 $commentIcon =
"<a href=\"index.php?plugin=blog&pluginpage=blog-comments&itemid=".$row[
'id'].
"&blogid=".
$blog->id.
"\"><i class=\"fa fa-comments-o\"></i></a> ";
242 $commentIcon =
' ';
247 <td class=\"text-center\">
248 <a href=\"index.php?plugin=blog&pluginpage=blog-entries&toggle=1&published=" . $row[
'published'] .
"&blogid=" .
$blog->id .
"&id=" . $row[
'id'] .
"\">
249 <span class=\"label label-$pub\">$pubtext</span></a> </td>
250 <td class=\"text-center\">" . $row[
'id'] .
"</td>
251 <td><a href=\"index.php?plugin=blog&pluginpage=blog-edit&itemid=" . $row[
'id'] .
"&blogid=" .
$blog->id .
"\"><div style=\"width:100%\">" . $row[
'title'] .
"</div></a></td>
252 <td><a href=\"index.php?plugin=blog&pluginpage=blog-edit&itemid=" . $row[
'id'] .
"&blogid=" .
$blog->id .
"\" style=\"color: #7A7376;\"><div style=\"width:100%\">" . $row[
'subtitle'] .
"</div></a></td>
253 <td class=\"text-center\">" . $row[
'username'] .
"</td>
255 <td class=\"text-center\">
256 <a href=\"index.php?plugin=blog&pluginpage=blog-togglegroup&itemgid=" . $row[
'itemgid'] .
"&blogid=" .
$blog->id .
"&itemid=" . $row[
'id'] .
"\">
257 <span class=\"label label-$rcolor\">" . $row[
'gid'] .
"</span></a></td>
259 <td class=\"text-center\">" . $date_publish .
"</td>
260 <td class=\"text-center\">" . $i_comments .
"</td>
261 <td class=\"text-center\">
263 <a class=\"fa fa-copy\" title=\"" .
$lang[
'COPY'] .
": " . $row[
'title'] .
"\" href=\"index.php?plugin=blog&pluginpage=blog-entries©=true&itemgid=" . $row[
'itemgid'] .
"&itemid=".$row[
'id'].
"&blogid=" .
$blog->id .
"\"></a>
267 <a class=\"fa fa-edit\" title=\"" .
$lang[
'EDIT'] .
": " . $row[
'title'] .
"\" href=\"index.php?plugin=blog&pluginpage=blog-edit&itemid=" . $row[
'id'] .
"&blogid=" .
$blog->id .
"\"></a>
268 <a class=\"fa fa-trash-o\" role=\"dialog\" data-confirm=\"".$lang[
'ENTRY'].
" «" . $row[
'id'] .
" / " . $row[
'title'] .
"» ".$lang[
'BLOG_ITEM_DEL_REQUEST'].
"\"
269 title=\"" .
$lang[
'DEL'] .
"\" href=\"index.php?plugin=blog&pluginpage=blog-entries&title=".$row[
'title'].
"&pageid=" . $row[
'pageid'] .
"&itemid=" . $row[
'id'] .
"&blogid=" .
$blog->id .
"&delete=1\">
277 alert::draw(
"warning",
"$lang[WARNING] ",
"$lang[BLOG_ENTRY_DEL_FAILED]",
"",
"3800");
Throws a fancy Bootstrap Alert (success, info, warning or danger)
Mysqli database class; returns db connection object.
static inject(array $lang, string $pathToFile)
allow plugins to inject language tags to $lang array
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
document ready(function() { $('a[data-confirm]').click(function(ev) { modal='#dataConfirmModal';var href=$(this).attr('href');var title=$(this).attr('title');var icon=$(this).attr('data-icon');if(!icon) { icon='fa fa-trash-o';} if(!$(modal).length) { $('body').append('< div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true">< div class="modal-dialog">< div class="modal-content">< div class="modal-header">< button type="button" class="close" data-dismiss="modal" aria-hidden="true">< i class="fa fa-times"></i ></button >< br >< div class="col-md-1">< h3 class="modal-title">< i class="'+icon+'"></i ></h3 ></div >< div class="col-md-11">< h3 class="modal-title" id="dataConfirmLabel">'+title+'</h3 ></div ></h3 ></div >< div class="modal-body"></div >< div class="modal-footer">< button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">Abbrechen</button >< a type="button" class="btn btn-danger" id="dataConfirmOK">< i class="'+icon+'"></i > L öschen</a ></div ></div ></div ></div >');} $(modal).find('.modal-body').text($(this).attr('data-confirm'));$('#dataConfirmOK').attr('href', href);$(modal).modal({show:true});return false;});$('#terminateUser').click(function() { var terminate=window.confirm("ACHTUNG!\nDas wird Deinen Account permanent deaktivieren.\n"+"Bist Du Dir sicher, dass Du das tun willst?");if(terminate===true) { var terminateUser=window.confirm("Bist Du Dir wirklich ganz sicher?\n"+"Diese Aktion kann nicht rueckgaengig gemacht werden.");if(terminateUser===true) { $.get('system/templates/YaWK-bootstrap3/js/terminate-user.php', function(data) { if(data==="true") { setTimeout("window.location='logout.html'", 0);} else { alert("Fehler: "+data);} });} } });function dismissNotifications() { $.ajax({ url:'js/dismiss-notifications.php', type:'POST', success:function(data) { if(!data) { alert('Something went wrong!');return false;} } });$("#bell-label").fadeOut();$('#notification-header').html('You have 0 notifications');$('#notification-menu').fadeOut();} $("#dismiss").click(function() { dismissNotifications();});function disableButtons(delay) { $('#loginButton').removeClass().addClass('btn btn-success disabled').attr('id', 'LOGIN_FORBIDDEN');$('#resetPasswordButton').removeClass().addClass('btn btn-danger disabled');setTimeout(function() { $('#LOGIN_FORBIDDEN').attr('id', 'loginButton').removeClass().addClass('btn btn-success');$('#resetPasswordButton').removeClass().addClass('btn btn-danger');}, delay);} $("#loginButton").click(function(){ if($('#loginButton').length > 0) { if($('#loginButton').hasClass('btn') &&$('#loginButton').hasClass('btn-success') &&$('#loginButton').hasClass('disabled')) { } else { $("#loginForm").submit();disableButtons(10000);} } else if($('#LOGIN_FORBIDDEN').length > 0) { if($('#LOGIN_FORBIDDEN').hasClass('btn') &&$('#LOGIN_FORBIDDEN').hasClass('btn-success') &&$('#LOGIN_FORBIDDEN').hasClass('disabled')) { } else { } } });$("#blockedBtn").hover(function() { $("#blockedBtn").hide();$("#askBtn").fadeIn(820);});})