root/trunk/admin/index.php

Revision 1731, 2.7 KB (checked in by jeena, 6 months ago)

Jlog does not need cookies to work in the admincenter anymore

Line 
1<?php
2 include_once('.'.DIRECTORY_SEPARATOR.'auth.php');
3 define("JLOG_ADMIN", true);
4 require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php');
5 require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php');
6
7 $get = strip($_GET);
8 $yl = new Year_Links($get['y'], JLOG_START_YEAR, add_session_id_to_url(JLOG_PATH."/admin/"), $l['admin']);
9
10    if(isset($get['show']) AND $get['show'] == 'page') {
11        $show_section = "<a href='".add_session_id_to_url("?show=weblog")."'>".$l['admin']['section_weblog']."</a> | <strong>".$l['admin']['section_page']."</strong>";
12        $where = "section = 'page'";
13    }
14    else {
15        $show_section = "<strong>".$l['admin']['section_weblog']."</strong> | <a href='".add_session_id_to_url("?show=page")."'>".$l['admin']['section_page']."</a>";
16        $where = "YEAR(date) = '".escape_for_mysql($yl->get_selected_year())
17                  ."' AND section = 'weblog'";
18        $year_menu = "  <p>".$yl->get_admin_linklist()."</p>\n";
19
20    }
21
22 
23
24 $c['meta']['title'] = $l['admin']['index_headline'];
25
26 $c['main'] .= output_admin_menu()."
27 <h2>".$l['admin']['admin_headline']."</h2>
28  <p><strong>&raquo;&raquo;</strong> <a href='".add_session_id_to_url("new.php")."'>".$l['admin']['new_post']."</a></p>
29  <p>".$l['admin']['section_show'].": ".$show_section."</p>".$year_menu."
30  <table>
31   <tr>
32    <th>".$l['admin']['change']."</th>
33    <th>".$l['admin']['delete']."</th>
34    <th>".$l['admin']['date']."</th>
35    <th>".$l['admin']['headline']."</th>
36   </tr>";
37
38    $sql = "SELECT
39                    id,
40                    date as mysql_date,
41                    UNIX_TIMESTAMP(date) AS date,
42                    topic
43              FROM ".JLOG_DB_CONTENT."
44              WHERE ".$where."
45              ORDER BY mysql_date DESC;";
46
47    $blog = new Query($sql);
48     if($blog->error()) {
49        echo "<pre>\n";
50        echo $blog->getError();
51        echo "</pre>\n";
52        die();
53     }
54
55    while ($daten = $blog->fetch()) {
56     $list = "
57    <tr>
58     <td><a href='".add_session_id_to_url("change.php?id=".$daten['id'])."'><img src='".JLOG_PATH."/img/JLOG_edit.png' alt='".$l['admin']['change']."' /></a></td>
59     <td><a href='".add_session_id_to_url("change.php?id=".$daten['id'])."&amp;action=trash'><img src='".JLOG_PATH."/img/JLOG_trash.png' alt='".$l['admin']['delete']."' /></a></td>
60     <td>".strftime(JLOG_DATE_SUBCURRENT, $daten['date'])."</td>
61     <td>".htmlspecialchars($daten['topic'], ENT_QUOTES)."</td>
62    </tr>";
63
64                ### Plugin Hook
65                $c['main'] .= $plugins->callHook('adminList', $list, $daten);
66    }
67   
68    $c['main'] .= "
69    </table>
70";
71
72require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php');
73echo $body;
74
75// eof
Note: See TracBrowser for help on using the browser.