-
Notifications
You must be signed in to change notification settings - Fork 2
/
module.php
696 lines (642 loc) · 28.3 KB
/
module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
<?php
if (!defined('EMLOG_ROOT')) {
exit('error!');
}
function printBackground($url, $show)
{
echo '<div ';
if ($url == '') echo 'class="shape shape-style-1 shape-primary"';
else echo 'class="shape shape-style-1 shape-image" style="background-image: url(' . "$url" . ')"';
echo '>';
if ($show)
echo '<span class="span-150"></span>
<span class="span-50"></span>
<span class="span-50"></span>
<span class="span-75"></span>
<span class="span-100"></span>
<span class="span-75"></span>
<span class="span-50"></span>
<span class="span-100"></span>
<span class="span-50"></span>
<span class="span-100"></span>';
echo '</div>';
}
function getRandomImage($str)
{
if ($str == '') return '';
$arr = explode(PHP_EOL, $str);
return $arr[rand(0, sizeof($arr) - 1)];
}
function printAricle($value, $flag)
{
?>
<?php if (!empty($value['log_cover'])) { ?>
<a class="card shadow content-card list-image-card <?php if ($flag): ?>content-card-head<?php endif; ?>"
href="<?= $value['log_url'] ?>">
<div class="list-card-bg" data-src="<?= $value['log_cover'] ?>"></div>
<object class="list-image-card-section">
<div class="container">
<div class="content list-card-content">
<h1><?= $value['log_title'] ?><?php topflg($value['top'], $value['sortop'], isset($sortid) ? $sortid : '') ?></h1>
<div class="list-object">
<span class="list-tag"><i class="fa fa-calendar-o" aria-hidden="true"></i> <time
datetime="<?= date('c', $value['date']) ?>"><?= date('Y-n-j', $value['date']) ?></time></span>
<span class="list-tag"><i class="fa fa-comments-o"
aria-hidden="true"></i> <?= $value['comnum'] ?> 条评论</span>
<?php printCategory($value['sortid'], 1); ?>
<?php printTag($value['logid'], 1); ?>
<span class="list-tag"><i class="fa fa-user-o"
aria-hidden="true"></i> <?php blog_author($value['author']); ?></span>
</div>
<?= _g('subContent') ? subContent($value['log_description'], _g('subContentLen') ?: 200, 1) : $value['log_description'] ?>
</div>
</div>
</object>
</a>
<?php } else { ?>
<a class="card shadow content-card list-card <?php if ($flag): ?>content-card-head<?php endif; ?>"
href="<?= $value['log_url'] ?>">
<object class="section">
<div class="container">
<div class="content list-card-content">
<h1><?= $value['log_title'] ?><?php topflg($value['top'], $value['sortop'], isset($sortid) ? $sortid : '') ?></h1>
<div class="list-object">
<span class="list-tag"><i class="fa fa-calendar-o" aria-hidden="true"></i> <time
datetime="<?= date('c', $value['date']) ?>"><?= date('Y-n-j', $value['date']) ?></time></span>
<span class="list-tag"><i class="fa fa-comments-o"
aria-hidden="true"></i> <?= $value['comnum'] ?> 条评论</span>
<?php printCategory($value['sortid'], 1); ?>
<?php printTag($value['logid'], 1); ?>
<span class="list-tag"><i class="fa fa-user-o"
aria-hidden="true"></i> <?php blog_author($value['author']); ?></span>
</div>
<?= _g('subContent') ? subContent($value['log_description'], _g('subContentLen') ?: 200, 1) : $value['log_description'] ?>
</div>
</div>
</object>
</a>
<?php }
}
function printCategory($sortID, $icon = 0)
{
$Sort_Model = new Sort_Model();
$r = $Sort_Model->getOneSortById($sortID);
$sortName = isset($r['sortname']) ? $r['sortname'] : '';
?>
<span class="list-tag">
<?php if ($icon) { ?><i class="fa fa-folder-o" aria-hidden="true"></i><?php } ?>
<?php if (!empty($sortName)): ?>
<a href="<?= Url::sort($sortID) ?>" class="badge badge-info badge-pill"><?= $sortName ?></a>
<?php else: ?>
<a onclick="return false;" class="badge badge-info badge-pill text-white">未分类</a>
<?php endif; ?>
</span>
<?php }
function printTag($blogid, $icon = 0)
{
$tag_model = new Tag_Model();
$tag_ids = $tag_model->getTagIdsFromBlogId($blogid);
$tag_names = $tag_model->getNamesFromIds($tag_ids);
?>
<span class="list-tag">
<?php if ($icon) { ?><i class="fa fa-tags" aria-hidden="true"></i><?php } ?>
<?php if (!empty($tag_names)): ?>
<?php foreach ($tag_names as $tags): ?>
<a href="<?= Url::tag(rawurlencode($tags)) ?>" class="badge badge-success badge-pill"><?= $tags ?></a>
<?php endforeach; ?>
<?php else: ?>
<a onclick="return false;" class="badge badge-default badge-pill text-white">无标签</a>
<?php endif; ?>
</span>
<?php }
function pageList($inputString)
{
$inputString = preg_replace('/<a/', '<li><a', $inputString);
$inputString = preg_replace('/a>/', 'a></li>', $inputString);
$inputString = str_replace('<em>', '<li><a>', $inputString);
$inputString = str_replace('</em>', '</a></li>', $inputString);
$inputString = str_replace('<span>', '<li class="active"><a href onclick="return false;">', $inputString);
$inputString = str_replace('</span>', '</a></li>', $inputString);
echo $inputString;
}
function blog_author($uid)
{
$user_info = getUser($uid);
$author = $user_info['nickname'];
echo '<a class="badge badge-warning badge-pill" href="' . Url::author($uid) . '">' . $author . '</a>';
}
function getUser($uid)
{
$User_Model = new User_Model();
return $User_Model->getOneUser($uid);
}
function getCatalog(&$obj)
{
global $catalog;
global $catalog_count;
$catalog = [];
$catalog_count = 0;
$obj = preg_replace_callback('/<h([1-6])(.*?)>(.*?)<\/h\1>/i', function ($obj) {
global $catalog;
global $catalog_count;
$catalog_count++;
$catalog[] = array('text' => trim(strip_tags($obj[3])), 'depth' => $obj[1], 'count' => $catalog_count);
return '<h' . $obj[1] . $obj[2] . '><a name="cl-' . $catalog_count . '"></a>' . $obj[3] . '</h' . $obj[1] . '>';
}, $obj);
$index = '';
if ($catalog) {
$index = '<ul>' . "\n";
$prev_depth = '';
$to_depth = 0;
foreach ($catalog as $catalog_item) {
$catalog_depth = $catalog_item['depth'];
if ($prev_depth) {
if ($catalog_depth == $prev_depth) {
$index .= '</li>' . "\n";
} elseif ($catalog_depth > $prev_depth) {
$to_depth++;
$index .= '<ul>' . "\n";
} else {
$to_depth2 = ($to_depth > ($prev_depth - $catalog_depth)) ? ($prev_depth - $catalog_depth) : $to_depth;
if ($to_depth2) {
for ($i = 0; $i < $to_depth2; $i++) {
$index .= '</li>' . "\n" . '</ul>' . "\n";
$to_depth--;
}
}
$index .= '</li>';
}
}
$index .= '<li><a name="dl-' . $catalog_item['count'] . '" href="javascript:jumpto(' . $catalog_item['count'] . ')">' . $catalog_item['text'] . '</a>';
$prev_depth = $catalog_item['depth'];
}
$index .= str_repeat('</li>' . "\n" . '</ul>' . "\n", $to_depth + 1);
}
echo $index;
}
function blog_navi()
{
global $CACHE;
$navi_cache = $CACHE->readCache('navi');
foreach ($navi_cache as $value):
if ($value['pid'] != 0) {
continue;
}
if ($value['url'] == 'admin' && ISLOGIN):
?>
<li class="nav-item"><a href="admin" class="nav-link">管理</a></li>
<li class="nav-item"><a href="admin/account.php?action=logout" class="nav-link">退出</a></li>
<?php
continue;
endif;
$newtab = $value['newtab'] == 'y' ? 'target="_blank"' : '';
$value['url'] = $value['isdefault'] == 'y' ? BLOG_URL . $value['url'] : trim($value['url'], '/');
$current_tab = BLOG_URL . trim(Dispatcher::setPath(), '/') == $value['url'] ? 'active' : '';
?>
<?php if (!empty($value['children']) || !empty($value['childnavi'])) : ?>
<?php if (!empty($value['children'])): ?>
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" id="nav_link"
href="<?= $value['url'] ?>" <?= $newtab ?>><?= $value['naviname'] ?></a>
<div class="dropdown-menu">
<?php foreach ($value['children'] as $row) {
echo '<a class="dropdown-item" href="' . Url::sort($row['sid']) . '">' . $row['sortname'] . '</a>';
} ?>
</div>
</li>
<?php endif ?>
<?php if (!empty($value['childnavi'])) : ?>
<li class="nav-item dropdown">
<a class='nav-link' data-toggle="dropdown" id="nav_link" <?= $newtab ?> ><?= $value['naviname'] ?></a>
<div class="dropdown-menu">
<?php foreach ($value['childnavi'] as $row) {
$newtab = $row['newtab'] == 'y' ? 'target="_blank"' : '';
echo '<a class="dropdown-item" href="' . $row['url'] . "\" $newtab >" . $row['naviname'] . '</a>';
} ?>
</div>
<?php endif ?>
</li>
<?php else: ?>
<li class="nav-item"><a class="nav-link"
href="<?= $value['url'] ?>" <?= $newtab ?>><?= $value['naviname'] ?></a></li>
<?php endif ?>
<?php endforeach ?>
<?php }
function blog_tool_ishome()
{
if (str_replace('?_pjax=%23pjax-container', '', trim(Dispatcher::setPath(), '/')) == '') {
return true;
} else {
return FALSE;
}
}
function threadedComments($comments, $children)
{
?>
<ol class="comment-list">
<?php
foreach ($children as $cid) {
$comment = $comments[$cid];
$indent = true;
if ($comment['level'] == 0)
$indent = false;
?>
<li id="li-comment-<?= $comment['cid'] ?>" class="<?= $indent ? 'comment-child-indent' : '' ?>">
<div id="comment-<?= $comment['cid'] ?>">
<div class="comment-item">
<div class="<?php
if ($comment['level'] > 0) {
echo 'comment-child';
} else {
echo 'comment-parent';
}
?>">
<img class="avatar" alt="<?= $comment['poster'] ?>"
src="<?= getGravatar($comment['mail'], 80) ?>">
</div>
<div class="comment-body">
<div class="comment-head">
<h5><?php if ($comment['url']) { ?><a target="_blank" rel="external nofollow"
href="<?= $comment['url'] ?>"><?= $comment['poster'] ?></a><?php } else { ?><?= $comment['poster'] ?><?php } ?>
· <small><?= $comment['date'] ?></small>
</h5>
</div>
<?= $comment['content'] ?>
<div style="float: right;">
<a href rel="nofollow"
onclick="return EmComment.reply('comment-<?= $comment['cid'] ?>', <?= $comment['cid'] ?>);"><i
class="fa fa-reply" aria-hidden="true"></i> 回复</a>
</div>
</div>
</div>
</div>
<?php if ($comment['children']) { ?>
<div class="comment-children">
<?php threadedComments($comments, $comment['children']); ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ol>
<?php
}
function viewComment($comnum, $comments, $logid, $ckname, $ckmail, $ckurl, $verifyCode, $allow_remark)
{
extract($comments);
$isNeedChinese = Option::get('comment_needchinese');
?>
<section class="section">
<div class="container" id="comments">
<div class="content">
<div class="row align-items-center justify-content-center">
<h3><?= $comnum ?>条评论</h3>
</div>
<?php if ($commentStacks): ?>
<?php threadedComments($comments, $commentStacks) ?>
<div class="row align-items-center justify-content-center">
<nav class="page-nav">
<ul class="pagination">
<?php pageList($commentPageUrl); ?>
</ul>
</nav>
</div>
<?php endif; ?>
<div class="comment-card">
<?php if ($allow_remark == 'y'): ?>
<div id="respond-post" class="comment-reply">
<div class="row align-items-center justify-content-center">
<h3 id="response">发表评论</h3>
</div>
<div class="row align-items-center justify-content-center">
<a href id="cancel-comment-reply-link" rel="nofollow" style="display: none;"
onclick="return EmComment.cancelReply();">取消回复</a>
</div>
<br/>
<form method="post" name="commentform" class="container"
action="?action=addcom" id="comment-form"
is-chinese="<?= $isNeedChinese ?>" style="overflow: auto; zoom: 1;"
onsubmit="return myBlog.comSubmitTip()"
onblur="myBlog.comSubmitTip('judge')"
>
<input type="hidden" name="gid" value="<?= $logid ?>"/>
<?php if (ISLOGIN): ?>
<p>已登录为 <a no-pjax href="/admin"><?= getUser(UID)['nickname'] ?></a> | <a
href="/admin/account.php?action=logout" title="Logout">注销?</a></p>
<?php else: ?>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<div class="input-group mb-4">
<div class="input-group-prepend">
<span class="input-group-text" style="padding: 0 .5rem;">
<div id="author-head" class="icon-shape rounded-circle text-white"
style="width: 2rem;height: 2rem;background-image: url(//cravatar.cn/avatar/);background-position: center;background-size: cover;background-repeat: no-repeat;"></div>
</span>
</div>
<input type="text" name="comname" id="author" class="form-control"
placeholder="名称"
value="<?= $ckname ?>"
required/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="input-group mb-4">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-envelope-o"
aria-hidden="true"></i></span>
</div>
<input type="email" name="commail" id="mail" class="form-control"
placeholder="邮箱"
value="<?= $ckmail ?>"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="input-group mb-4">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-globe"
aria-hidden="true"></i></span>
</div>
<input type="url" name="comurl" id="url" class="form-control"
placeholder="网站"
value="<?= $ckurl ?>"/>
</div>
</div>
</div>
</div>
<?php endif; ?>
<p>
<textarea rows="8" cols="50" name="comment" id="textarea" class="form-control"
required></textarea>
</p>
<?php if ($verifyCode): ?>
<div class="input-group">
<img src="include/lib/checkcode.php" id="captcha" alt="验证码"
onclick="myBlog.captchaRefresh($(this))">
<input type="text" name="imgcode" class="form-control"
maxlength="5"
placeholder="验证码"
required/>
</div>
<?php endif; ?>
<p>
<button type="submit"
class="btn btn-outline-success" id="add-comment-button"
style="float: right;">提交评论
</button>
</p>
<input type="hidden" name="pid" id="comment-pid" value="0" tabindex="1"/>
</form>
</div>
</div>
<?php else: ?>
<div class="row align-items-center justify-content-center">
<h3 id="response">评论已关闭</h3>
</div>
<?php endif; ?>
</div>
</div>
</section>
<script>
window.EmComment = {
dom: function (id) {
return document.getElementById(id);
},
create: function (tag, attr) {
let el = document.createElement(tag);
for (let key in attr) {
el.setAttribute(key, attr[key]);
}
return el;
},
reply: function (cid, coid) {
let comment = this.dom(cid),
response = this.dom('respond-post'), input = this.dom('comment-parent'),
form = 'form' === response.tagName ? response : response.getElementsByTagName('form')[0],
textarea = response.getElementsByTagName('textarea')[0];
if (null == input) {
input = this.create('input', {
'type': 'hidden',
'name': 'parent',
'id': 'comment-parent'
});
form.appendChild(input);
}
input.setAttribute('value', coid);
if (null == this.dom('comment-form-place-holder')) {
let holder = this.create('div', {
'id': 'comment-form-place-holder'
});
response.parentNode.insertBefore(holder, response);
}
comment.appendChild(response);
this.dom('cancel-comment-reply-link').style.display = '';
if (null != textarea && 'text' === textarea.name) {
textarea.focus();
}
$("#comment-pid").attr("value", $('#respond-post').parent().attr("id").replace("comment-", ""));
return false;
},
cancelReply: function () {
$("#comment-pid").attr("value", 0);
let response = this.dom('respond-post'),
holder = this.dom('comment-form-place-holder'), input = this.dom('comment-parent');
if (null != input) {
input.parentNode.removeChild(input);
}
if (null == holder) {
return true;
}
this.dom('cancel-comment-reply-link').style.display = 'none';
holder.parentNode.insertBefore(response, holder);
return false;
}
};
$("#mail").on('blur', function () {
let url = "//cravatar.cn/avatar/" + md5($(this).val()) + "?s=40&d=";
$("#author-head").css('background-image', 'url(' + url + ')');
})
let myBlog = {
/**
* 提交评论前对表单的验证
*/
comTip: '', comSubmitTip: function (value) {
if (value === 'judge') {
let cnReg = /[\u4e00-\u9fa5]/
let mailReg = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
let urlReg = /[^\s]*\.+[^\s]/
let isCn = $('#comment-form').attr('is-chinese')
let comContent = $('#textarea').val()
let mail = $('#mail').val()
let url = $('#url').val()
if (isCn === 'y' && !cnReg.test(comContent)) {
this.comTip = "评论内容需要包含中文!"
} else if (typeof mail !== "undefined" && mail !== '' && !mailReg.test(mail)) {
this.comTip = "邮箱格式错误!"
} else if (typeof url !== "undefined" && url !== '' && !urlReg.test(url)) {
this.comTip = "网址格式错误!"
} else {
this.comTip = ''
}
} else {
if (this.comTip !== '') {
alert(this.comTip)
return false
} else {
return true
}
}
},
/**
* 点击刷新验证码
*/
captchaRefresh: function ($t) {
let timestamp = new Date().getTime();
$t.attr("src", "include/lib/checkcode.php?" + timestamp)
},
};
</script>
<?php }
function widget_newcomm($title)
{
global $CACHE;
$com_cache = $CACHE->readCache('comment');
?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul>
<?php
foreach ($com_cache as $value):
$url = Url::comment($value['gid'], $value['page'], $value['cid']);
?>
<li>
<a href="<?= $url ?>" class="footer-link">
<b><?= $value['name'] ?>: </b><?= $value['content'] ?>
</a>
</li>
<?php endforeach ?>
</ul>
</div>
<?php }
function widget_newlog($title)
{
global $CACHE;
$newLogs_cache = $CACHE->readCache('newlog');
?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul>
<?php foreach ($newLogs_cache as $value): ?>
<li>
<a href="<?= Url::log($value['gid']) ?>" class="footer-link">
<?= $value['title'] ?>
</a>
</li>
<?php endforeach ?>
</ul>
</div>
<?php }
function widget_hotlog($title)
{
$index_hotlognum = Option::get('index_hotlognum');
$Log_Model = new Log_Model();
$hotLogs = $Log_Model->getHotLog($index_hotlognum) ?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul>
<?php foreach ($hotLogs as $value): ?>
<li>
<a href="<?= Url::log($value['gid']) ?>" class="footer-link">
<?= $value['title'] ?>
</a>
</li>
<?php endforeach ?>
</ul>
</div>
<?php }
function widget_archive($title)
{
global $CACHE;
$record_cache = $CACHE->readCache('record');
?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul>
<?php foreach ($record_cache as $value): ?>
<li>
<a href="<?= Url::record($value['date']) ?>" class="footer-link">
<?= $value['record'] ?> (<?= $value['lognum'] ?>)
</a>
</li>
<?php endforeach ?>
</ul>
</div>
<?php }
function widget_link($title)
{
global $CACHE;
$link_cache = $CACHE->readCache('link');
?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul>
<?php foreach ($link_cache as $value): ?>
<a href="<?= $value['url'] ?>" title="<?= $value['des'] ?>" target="_blank"
style="white-space: nowrap;" class="badge badge-secondary footer-link">
<?= $value['link'] ?>
</a>
<?php endforeach ?>
</ul>
</div>
<?php }
function widget_tag($title)
{
global $CACHE;
$tag_cache = $CACHE->readCache('tags') ?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul>
<?php foreach ($tag_cache as $value): ?>
<a href="<?= Url::tag($value['tagurl']) ?>" title="<?= $value['usenum'] ?> 篇文章" class="badge badge-secondary footer-link"
style="white-space: nowrap;">
<?= $value['tagname'] ?>(<?= $value['usenum'] ?>)
</a>
<?php endforeach ?>
</ul>
</div>
<?php }
function widget_custom_text($title, $content)
{ ?>
<div class="col-md-4 widget">
<h5><?= $title ?></h5>
<ul><?= $content ?></ul>
</div>
<?php }
function topflg($top, $sortop = 'n', $sortid = null)
{
$ishome_flg = ' <small><i class="fa fa-bookmark"></i></small>';
$issort_flg = ' <small><i class="fa fa-bookmark"></i></small>';
if (blog_tool_ishome()) {
echo $top == 'y' ? $ishome_flg : '';
} elseif ($sortid) {
echo $sortop == 'y' ? $issort_flg : '';
}
}
function editflg($logid, $author)
{
if (User::haveEditPermission() || $author == UID) {
$editflg = BLOG_URL . 'admin/article.php?action=edit&gid=' . $logid;
?>
<a href="<?= $editflg ?>">
<button id="adminbtn" class="btn btn-icon-only rounded-circle btn-primary admin-btn">
<span class="btn-inner--icon"><i class="fa fa-pencil" aria-hidden="true"></i></span>
</button>
</a>
<?php
return true;
}
return false;
}