mirror of
https://github.com/danpros/htmly.git
synced 2026-04-21 21:16:23 +05:30
Added views.counter in the Config File
This commit is contained in:
parent
8ea2611323
commit
452cf9212d
5 changed files with 52 additions and 18 deletions
|
|
@ -347,7 +347,9 @@ function get_recent_posts() {
|
|||
$posts = get_profile($_SESSION[config("site.url")]['user'], 1, 5);
|
||||
if(!empty($posts)) {
|
||||
echo '<table class="post-list">';
|
||||
echo '<tr class="head"><th>Title</th><th>Published</th><th>Views</th><th>Tag</th><th>Operations</th></tr>';
|
||||
echo '<tr class="head"><th>Title</th><th>Published</th>';
|
||||
if(config("views.counter") == "true") echo '<th>Views</th>';
|
||||
echo '<th>Tag</th><th>Operations</th></tr>';
|
||||
$i = 0; $len = count($posts);
|
||||
foreach($posts as $p) {
|
||||
if ($i == 0) {
|
||||
|
|
@ -363,7 +365,7 @@ function get_recent_posts() {
|
|||
echo '<tr class="' . $class . '">';
|
||||
echo '<td><a target="_blank" href="' . $p->url . '">' . $p->title . '</a></td>';
|
||||
echo '<td>' . date('d F Y', $p->date) . '</td>';
|
||||
echo '<td>' . $p->views . '</td>';
|
||||
if(config("views.counter") == "true") echo '<td>' . $p->views . '</td>';
|
||||
echo '<td>' . $p->tag . '</td>';
|
||||
echo '<td><a href="' . $p->url . '/edit?destination=admin">Edit</a> <a href="' . $p->url . '/delete?destination=admin">Delete</a></td>';
|
||||
echo '</tr>';
|
||||
|
|
@ -380,7 +382,9 @@ function get_recent_pages() {
|
|||
if(!empty($posts)) {
|
||||
krsort($posts);
|
||||
echo '<table class="post-list">';
|
||||
echo '<tr class="head"><th>Title</th><th>Views</th><th>Operations</th></tr>';
|
||||
echo '<tr class="head"><th>Title</th>';
|
||||
if(config("views.counter") == "true") echo '<th>Views</th>';
|
||||
echo '<th>Operations</th></tr>';
|
||||
$i = 0; $len = count($posts);
|
||||
foreach($posts as $p) {
|
||||
if ($i == 0) {
|
||||
|
|
@ -395,7 +399,7 @@ function get_recent_pages() {
|
|||
$i++;
|
||||
echo '<tr class="' . $class . '">';
|
||||
echo '<td><a target="_blank" href="' . $p->url . '">' . $p->title . '</a></td>';
|
||||
echo '<td>' . $p->views . '</td>';
|
||||
if(config("views.counter") == "true") echo '<td>' . $p->views . '</td>';
|
||||
echo '<td><a href="' . $p->url . '/edit?destination=admin">Edit</a> <a href="' . $p->url . '/delete?destination=admin">Delete</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue