Esempio n. 1
0
        echo '<div class="results">' . ((int) $p['results'] === 1 ? sprintf($LANG['result'], $p['results']) : sprintf($LANG['results'], $p['results']));
        if (!empty($_GET['search'])) {
            echo ' / <a href="?route=news.php&amp;action=list">' . $LANG['reset_view'] . '</a>';
        }
        echo '</div>';
        if ($p['results']) {
            echo '<form action="?route=news.php&amp;action=list" method="POST">

<ul class="elements-list">

<li class="head"><input type="checkbox" checkall /> ' . $LANG['name'] . '</li>

<div class="bulk_options">
  <button class="btn" name="delete" data-delete-msg="' . $LANG['delete_msg'] . '">' . $LANG['delete_all'] . '</button>
</div>';
            foreach (admin_query::while_news(array_merge(array('orderby' => isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'date desc'), $options)) as $item) {
                echo '<li>
  <input type="checkbox" name="id[' . $item->ID . ']" />
  <div class="info-div"><h2>' . $item->title . '</h2></div>
  <div class="options">
  <a href="' . $item->url . '" target="_blank">' . $LANG['news_read_view'] . '</a>';
                if ($GLOBALS['me']->is_admin) {
                    echo '<a href="?route=news.php&amp;action=delete&amp;id=' . $item->ID . '&amp;token=' . $csrf . '" data-delete-msg="' . $LANG['delete_msg'] . '">' . $LANG['delete'] . '</a>';
                }
                echo '</div>
  </li>';
            }
            echo '</ul>

<input type="hidden" name="csrf" value="' . $csrf . '" />
Esempio n. 2
0
</div>

</section>

<?php 
}
echo '<section class="el-row">

<h2>' . $LANG['news_title'] . ' <a href="#" class="updown" data-set="news">' . (isset($_SESSION['ses_set']['news']) && ($show_news = $_SESSION['ses_set']['news']) ? 'S' : 'R') . '</a></h2>

<div class="el-row-body"' . (!empty($show_news) ? ' style="display: none;"' : '') . '>

<ul class="elements-list">';
if ($news = admin_query::news() > 0) {
    foreach (admin_query::while_news(array('max' => 7, 'orderby' => 'date DESC')) as $item) {
        echo '<li><a href="' . $item->url . '" target="_blank">' . $item->title . '</a></li>';
    }
} else {
    echo '<li>' . $LANG['no_news_yet'] . '</li>';
}
echo '</ul>';
if ($news > 0) {
    echo '<div class="links">
  <a href="?route=news.php">' . $LANG['news_list'] . '</a>
</div>';
}
echo '</div>

</section>