<?php
/**
 * pragmaMx  Content Management System
 * Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * $Source: /home/www/dps3311/home/cvsroot/pragmamx/pragmamx_01/blocks/block-AdminNews.php,v $
 * $Revision: 1.10 $
 * $Author: tora60 $
 * $Date: 2006/12/27 23:37:22 $
 */
global $prefix, $user_prefix, $multilingual;
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

$mxblockcache = true;
// #################################################################################################################
$thisfile = basename(__file__);

if (MX_IS_ADMIN) {
    extract(mxGetAdminSession());

    $blockfiletitle = "" . _AB_TITLEBAR . "";

    $arrow = mxCreateImage('images/menu/oarrow.gif', '') . '&nbsp;';
    $content1 = "";

    $content = "\n<!-- $thisfile output start -->\n";
    if ($GLOBALS['vkpUserregoption'] == 2 || $GLOBALS['vkpUserregoption'] == 4) {
        list($num) = sql_fetch_row(sql_query("select count(uid) from ${user_prefix}_users WHERE user_stat=0"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=mod_users\">" . _AB_NEWUSERS . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Submit_News")) {
        list($num) = sql_fetch_row(sql_query("select count(qid) from ${prefix}_queue"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=submissions\">" . _AB_SUBMISSIONS . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Reviews")) {
        list($num) = sql_fetch_row(sql_query("select count(id) from ${prefix}_reviews WHERE active='0';"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=reviews\">" . _WREVIEWS . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Web_Links")) {
        list($num) = sql_fetch_row(sql_query("select count(lid) from ${prefix}_links_newlink;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=Links\">" . _AB_WLINKS . "</a><br>";
        $num = 0;
        list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_links_modrequest where brokenlink=0;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=LinksListModRequests\">" . _AB_MODREQLINKS . "</a><br>";
        $num = 0;
        list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_links_modrequest where brokenlink=1;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=LinksListBroken\">" . _AB_BROKENLINKS . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Downloads")) {
        list($num) = sql_fetch_row(sql_query("select count(lid) from ${prefix}_downloads_newdownload"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=Downloads\">" . _AB_UDOWNLOADS . "</a><br>";
        $num = 0;
        list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_downloads_modrequest where brokendownload=0;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=DownloadsListModRequests\">" . _AB_MODREQDOWN . "</a><br>";
        $num = 0;
        list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_downloads_modrequest where brokendownload=1;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=DownloadsListBroken\">" . _AB_BROKENDOWN . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("My_eGallery")) {
        list($num) = sql_fetch_row(sql_query("select count(pid) from ${prefix}_gallery_pictures_newpicture;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=GallAdmin\">" . _AB_PICTURES . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("FAQ")) {
        list($num) = sql_fetch_row(sql_query("select count(faq_id) from ${prefix}_faqnew;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=FaqAnswerNew\">" . "FAQ's" . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Guestbook")) {
        list($num) = sql_fetch_row(sql_query("select count(id) from ${prefix}_nukebook_queue;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=GuestBookAdmin\">" . _GUESTBOOK . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Kalender")) {
        list($num) = sql_fetch_row(sql_query("SELECT Count(eid) FROM ${prefix}_events WHERE activ=0;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"admin.php?op=CalendarAdmin\">" . _AB_EVENTS . "</a><br>";
        $num = 0;
    } 
    if (mxModuleAllowed("Webring")) {
        list($num) = sql_fetch_row(sql_query("select count(ringid) from ${prefix}_webring where activ=0;"));
        if (!empty($num)) $content1 .= $arrow . "<b>$num</b>&nbsp;<a href=\"modules.php?name=Webring&amp;ring=1&amp;mode=adminNewentry\">" . _AB_WEBRING . "</a><br>";
        $num = 0;
    } 

    if (!empty($content1)) {
        $content .= "$content1<br>";
    } 
    $content .= mxCreateImage('images/menu/sarrow.gif', '') . "&nbsp;<a href=\"admin.php\">" . _AB_TITLEBAR . "</a><br>\n";
    $content .= mxCreateImage('images/menu/barrow.gif', '') . "&nbsp;<a href=\"admin.php?op=adminStory\">" . _SUBMITNEWS . "</a><br>\n";
    $content .= mxCreateImage('images/menu/barrow.gif', '') . "&nbsp;<a href=\"admin.php?op=Content\">Inhaltsmanager</a><br>\n"; //Link zum Inhaltsmanager hinzugefügt
    $content .= mxCreateImage('images/menu/barrow.gif', '') . "&nbsp;<a href=\"admin.php?op=messages\">" . _AB_MESSAGE . "</a><br>\n";
    $content .= mxCreateImage('images/menu/barrow.gif', '') . "&nbsp;<a href=\"admin.php?op=Configure\">" . _AB_SETTINGS . "</a><br>\n";
    $content .= mxCreateImage('images/menu/sarrow.gif', '') . "&nbsp;<a href=\"admin.php?op=resetBlockCache\">" . _AB_RESETBCACHE . "</a><br>\n";
    $content .= mxCreateImage('images/menu/rarrow.gif', '') . "&nbsp;<a href=\"admin.php?op=logout\">" . _AB_LOGOUT . "</a><br>\n";

    if (empty($content1)) $content .= "<br><b>" . _AB_NOWAITINGCONT . "</b><br>";

    $content .= "\n<!-- $thisfile output end -->\n";
} else if (MX_IS_USER) {
    $udata = mxGetUserSession();
    if (list($aid) = sql_fetch_row(sql_query("SELECT aid FROM ${prefix}_authors WHERE user_uid=" . intval($udata[0])))) {
        $content = mxCreateImage('images/menu/rarrow.gif', '') . '&nbsp;<a href="admin.php">' . _AB_TITLEBAR . '</a>';
    } 
} 
// / coppermine ???
/* 
function xxxxxx_cpg_get_pending_approvals()
{
    global $CONFIG;
    $result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'NO'");
    if (mysql_num_rows($result) == 0) return 0;
    $row = mysql_fetch_array($result);
    mysql_free_result($result);
    return $row[0];
}
 */

?>
