Ejemplo n.º 1
0
/* 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.       */
/************************************************************************/
/* Additional security checking code 2003 by chatserv                   */
/* http://www.nukefixes.com -- http://www.nukeresources.com             */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
require_once "mainfile.php";
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- " . _USERSJOURNAL . "";
include "header.php";
include "modules/{$module_name}/functions.php";
cookiedecode($user);
$username = $cookie[1];
if ($debug == "true") {
    echo "UserName:{$username}<br>SiteName: {$sitename}";
}
startjournal($sitename, $user);
$onwhat = intval($onwhat);
$sql = "DELETE FROM " . $prefix . "_journal_comments WHERE cid = '{$onwhat}'";
$db->sql_query($sql);
echo "<br>";
openTable();
echo "<div align=center>" . _COMMENTDELETED . "<br><br>";
echo "[ <a href=\"modules.php?name={$module_name}&file=display&jid={$ref}\">" . _RETURNJOURNAL . "</a> ]</div>";
closeTable();
journalfoot();
Ejemplo n.º 2
0
 function listall($username, $bgcolor1, $bgcolor2, $bgcolor3, $sitename)
 {
     global $prefix, $user_prefix, $db, $module_name;
     openTable();
     echo "<div align=\"center\" class=title>" . _COMPLETELIST . " {$username}</div><br>";
     echo "<table align=center border=1 width=\"90%\">";
     echo "<tr>";
     echo "<td align=center bgcolor={$bgcolor1} width=70><strong><div align=\"center\">" . _DATE . "</div></strong></td>";
     echo "<td align=center bgcolor={$bgcolor1} width=70><strong><div align=\"center\">" . _TIME . "</div></strong></td>";
     echo "<td align=center bgcolor={$bgcolor1}><strong>" . _TITLE . "</strong></td>";
     echo "<td align=center bgcolor={$bgcolor1} width=\"5%\"><strong><div align=\"center\">" . _PUBLIC . "</div></strong></td>";
     echo "<td align=center bgcolor={$bgcolor1} width=\"5%\"><strong><div align=\"center\">" . _EDIT . "</div></strong></td>";
     echo "<td align=center bgcolor={$bgcolor1} width=\"5%\"><strong><div align=\"center\">" . _DELETE . "</div></strong></td>";
     echo "</tr>";
     $sql = "SELECT jid, aid, title, pdate, ptime, mdate, mtime, status, mood FROM " . $prefix . "_journal WHERE aid='{$username}' order by 'jid' DESC";
     $result = $db->sql_query($sql);
     $dcount = 0;
     $pubcount = 0;
     $prvcount = 0;
     while ($row = $db->sql_fetchrow($result)) {
         $jid = intval($row['jid']);
         $title = filter($row['title'], "nohtml");
         $jaid = filter($row['aid'], "nohtml");
         $pdate = filter($row['pdate'], "nohtml");
         $ptime = filter($row['ptime'], "nohtml");
         $dcount = $dcount + 1;
         if ($row['status'] == "yes") {
             $pubcount = $pubcount + 1;
             $row['status'] = _YES;
         } else {
             $prvcount = $prvcount + 1;
             $row['status'] = _NO;
         }
         print "<tr>";
         printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\">%s</div></td>", $row['pdate']);
         printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\">%s</div></td>", $row['ptime']);
         printf("<td align=left bgcolor={$bgcolor2}><a href=\"modules.php?name={$module_name}&file=display&jid=%s\">%s</a>", $jid, $title);
         $sqlscnd = "SELECT cid from " . $user_prefix . "_journal_comments where rid=" . intval($row['jid']);
         $rstscnd = $db->sql_query($sqlscnd);
         $scndcount = 0;
         while ($rowscnd = $db->sql_fetchrow($rstscnd)) {
             $scndcount = $scndcount + 1;
         }
         if ($scndcount == 1) {
             printf(" &#151;&#151; {$scndcount} " . _COMMENT . "</td>");
         } else {
             printf(" &#151;&#151; {$scndcount} " . _COMMENTS . "</td>");
         }
         printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\">%s</div></td>", $row['status']);
         printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\"><a href=\"modules.php?name={$module_name}&file=modify&jid=%s\"><img src='modules/{$module_name}/images/edit.gif' border='0' alt='" . _EDIT . "'></a></div></td>", $row['jid']);
         printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\"><a href=\"modules.php?name={$module_name}&file=delete&jid=%s\"><img src='modules/{$module_name}/images/trash.gif' border='0' alt='" . _DELETE . "'></a></div></td>", $row['jid']);
         print "</tr>";
     }
     echo "</table>";
     if ($prvcount == "") {
         $prvcount = 0;
     }
     if ($pubcount == "") {
         $pubcount = 0;
     }
     if ($dcount == "") {
         $dcount = 0;
     }
     echo "<br><div align=center>{$pubcount} " . _PUBLICENTRIES . " - " . "{$prvcount} " . _PRIVATEENTRIES . " - " . "{$dcount} " . _TOTALENTRIES . "</div>";
     closeTable();
 }