Example #1
0
function last20($bgcolor1, $bgcolor2, $bgcolor3, $username)
{
    global $prefix, $user_prefix, $db, $module_name;
    OpenTable();
    echo "<div align=\"center\" class=title>" . _20ACTIVE . "</div><br>";
    echo "<table align=center border=1 cellpadding=0 cellspacing=0>";
    echo "<tr>";
    echo "<td bgcolor={$bgcolor1} width=150>&nbsp;<strong>" . _MEMBER . "</strong> " . _CLICKTOVIEW . "</td>";
    echo "<td bgcolor={$bgcolor1} width=70 align=center><strong>" . _VIEWJOURNAL . "</strong></td>";
    echo "<td bgcolor={$bgcolor1} width=70 align=center><strong>" . _MEMBERPROFILE . "</strong></td>";
    if (empty($username)) {
        echo "<td bgcolor={$bgcolor1} width=70 align=center><strong>" . _CREATEACCOUNT2 . "</strong></td>";
    } else {
        if (is_active("Private_Messages")) {
            echo "<td bgcolor={$bgcolor1} width=70 align=center><strong>" . _PRIVMSGJ . "</strong></td>";
        }
    }
    echo "</tr>";
    $sql = "SELECT j.id, j.joid, j.nop, j.ldp, j.ltp, j.micro, u.user_id, u.username FROM " . $prefix . "_journal_stats j, " . $user_prefix . "_users u where u.username=j.joid ORDER BY 'ldp' DESC";
    $result = $db->sql_query($sql);
    $dcount = 1;
    while ($row = $db->sql_fetchrow($result)) {
        $row['id'] = intval($row['id']);
        $row['joid'] = filter($row['joid'], "nohtml");
        $row['nop'] = filter($row['nop'], "nohtml");
        $row['ldp'] = filter($row['ldp'], "nohtml");
        $row['ltp'] = filter($row['ltp'], "nohtml");
        $row['micro'] = filter($row['micro'], "nohtml");
        $row['user_id'] = filter($row['user_id'], "nohtml");
        if ($dcount >= 21) {
            echo "</table>";
            CloseTable();
            journalfoot();
            die;
        } else {
            $dcount = $dcount + 1;
            print "<tr>";
            printf("<td bgcolor={$bgcolor2}>&nbsp;&nbsp;<a href=\"modules.php?name={$module_name}&file=search&bywhat=aid&exact=1&forwhat=%s\">%s</a></td>", $row['joid'], $row['joid']);
            printf("<td bgcolor={$bgcolor2} align=center><div class=title><a href=\"modules.php?name={$module_name}&file=search&bywhat=aid&exact=1&forwhat=%s\"><img src=\"modules/{$module_name}/images/binocs.gif\" border=0 alt=\"" . _VIEWJOURNAL2 . "\" title=\"" . _VIEWJOURNAL2 . "\"></a></td>", $row['joid'], $row['joid']);
            printf("<td bgcolor={$bgcolor2} align=center><a href=\"modules.php?name=Your_Account&op=userinfo&username=%s\"><img src=\"modules/{$module_name}/images/nuke.gif\" alt=\"" . _USERPROFILE2 . "\" title=\"" . _USERPROFILE2 . "\" border=0></a></td>", $row['joid'], $row['joid'], $row['joid']);
            if (empty($username)) {
                print "<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name=Your_Account&op=new_user\"><img src=\"modules/{$module_name}/images/folder.gif\" border=0 alt=\"" . _CREATEACCOUNT . "\" title=\"" . _CREATEACCOUNT . "\"></a></td>";
            } else {
                if (is_active("Private_Messages")) {
                    printf("<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name=Private_Messages&mode=post&u=" . $row['user_id'] . "\"><img src='modules/{$module_name}/images/chat.gif' border='0' alt='" . _PRIVMSGJ2 . "'></a></td>", $row['joid'], $row['joid']);
                }
            }
            echo "</tr>";
        }
    }
    echo "</table>";
    CloseTable();
}
/* 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();
Example #3
0
 function list20($username, $bgcolor1, $bgcolor2, $bgcolor3)
 {
     global $prefix, $user_prefix, $db, $module_name;
     openTable();
     echo "<div align=\"center\" class=title>" . _LAST20FOR . " {$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> " . _CLICKTOVIEW . "</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 = 1;
     while ($row = $db->sql_fetchrow($result)) {
         if ($dcount >= 21) {
             echo "</tr></table>";
             closeTable();
             echo "<br>";
             journalfoot();
             die;
         } else {
             $dcount = $dcount + 1;
             print "<tr>";
             $jid = intval($row['jid']);
             $title = filter($row['title'], "nohtml");
             $jaid = filter($row['aid'], "nohtml");
             $pdate = filter($row['pdate'], "nohtml");
             $ptime = filter($row['ptime'], "nohtml");
             printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\">%s</div></td>", $pdate);
             printf("<td align=center bgcolor={$bgcolor2}><div align=\"center\">%s</div></td>", $ptime);
             printf("<td align=left bgcolor={$bgcolor2}>&nbsp;<a href=\"modules.php?name={$module_name}&file=display&jid=%s\">%s</a>", $jid, $title);
             $sqlscnd = "SELECT cid from " . $prefix . "_journal_comments where rid='{$jaid}'";
             $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>");
             }
             if ($row['status'] == "yes") {
                 $row['status'] = _YES;
             } else {
                 $row['status'] = _NO;
             }
             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 . "\" title=\"" . _EDIT . "\"></a></div></td>", $jid, $title);
             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 . "\" title=\"" . _DELETE . "\"></a></div></td>", $jid, $title);
             print "</tr>";
         }
     }
     echo "</table>";
     closeTable();
 }