Esempio n. 1
0
     $next_hour = strtotime(date("Y-m-d H:", strtotime("+1 Hour", $timestamp)) . "00:00");
     $increments = array();
     $differences = array();
     for ($i = $this_hour; $i <= $next_hour; $i += $increment) {
         if ($i > $timestamp) {
             return $i;
         }
     }
 }
 if ($expiretime != 0) {
     $expireappend = ' This ban will expire ' . date("Y-m-d @ H:i", ceilTime("60 minutes", $expiretime)) . '.';
 }
 if ($numrows != 0) {
     echo 'You have been banned from this pub.' . $expireappend;
 } else {
     if (gIsModerator($acc)) {
         $banlist = ' - <a href="index.php?page=kingdom&action=banlist">Banlist</a>';
     } else {
         $banlist = "";
     }
     if ($owntopics) {
         $owntopicstext = ' - <a href="index.php?page=kingdom&action=pub&type=' . $type . '&owntopics=0">All Topics</a>';
         $owntopicssql = ' AND a.id = ' . $acc["id"];
     } else {
         $owntopicstext = ' - <a href="index.php?page=kingdom&action=pub&type=' . $type . '&owntopics=1">Your Own Topics</a>';
         $owntopicssql = '';
     }
     echo '<center><a href="index.php?page=kingdom&action=newtopic&type=', $type, '">Post New Topic</a>', $owntopicstext, '', $banlist, '</center><br>';
     $pubmax = $gdPubMaximum + 1;
     $sql = "SELECT p.sticky, p.topic, p.private, p.id, a.name AS accountname, a.id AS accountid, pl.time AS pltime, p.time AS ptime, p.threadtime FROM (pubs AS p, accounts AS a) LEFT JOIN publogs AS pl ON pl.topic = p.id AND pl.account = '{$acc['id']}' WHERE p.kingdom = '{$kingdom}' AND p.account = a.id AND p.parent = '0' AND p.type = '{$type}' {$privatesql} {$owntopicssql} ORDER BY p.sticky DESC, p.threadtime DESC LIMIT {$offset}, {$pubmax}";
     $result = $db->query($sql);
Esempio n. 2
0
    }
}
if ($action == "deletereply") {
    $output .= '<a href="index.php?page=kingdom&action=deletereply2&type=' . $type . '&replyid=' . $replyid . '&offset=' . $offset . '">Are you sure you want to delete that?</a>';
}
if ($action == "deletereply2") {
    $no = 0;
    if (!gIsModerator($acc)) {
        $output .= 'You are not a leader here!<br>';
        $no = 1;
    }
    if (!$replyid) {
        $output .= 'Invalid data.<br>';
        $no = 1;
    } else {
        if (!$acc["admin"] && !gIsModerator($acc)) {
            $addon = "AND kingdom = '{$acc['kingdom']}'";
        } else {
            $addon = "";
        }
        $sql = "SELECT parent, type FROM pubs WHERE id = '{$replyid}' {$addon}";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows != 1) {
            $output .= 'Invalid data.<br>';
            $no = 1;
        }
    }
    if ($no == 0) {
        $row = $db->fetch_array($result);
        $parent = $row["parent"];