Exemple #1
0
function ist_online($user)
{
    // Prüft ob User noch online ist
    // liefert 1 oder 0 zurück
    global $dbase, $timeout, $ist_online_raum, $conn, $whotext;
    $ist_online_raum = "";
    $user = mysql_real_escape_string($user);
    // sec
    $query = "SELECT o_id,r_name FROM online left join raum on r_id=o_raum " . "WHERE o_user={$user} " . "AND (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(o_aktiv)) <= {$timeout}";
    $result = mysql_query($query, $conn);
    if ($result && mysql_NumRows($result) > 0) {
        $ist_online_raum = mysql_result($result, 0, "r_name");
        if (!$ist_online_raum || $ist_online_raum == "NULL") {
            $ist_online_raum = "[" . $whotext[2] . "]";
        }
        @mysql_free_result($result);
        return 1;
    } else {
        @mysql_free_result($result);
        return 0;
    }
}
function announces_subsections($sess, $rub, $pri, $cs, $cs1)
{
    @($sqk = mysql_query("SELECT S.*,count(D.ann_id) FROM uniletim_subsections S \r\n\t    LEFT JOIN uniletim_announces D ON S.sub_id=D.ann_sub \r\n\t    WHERE S.sub_section='{$rub}' AND S.ul_group = '{$sess['4']}' GROUP BY S.sub_id ORDER BY S.sub_name"));
    $pocet = mysql_NumRows($sqk);
    ?>

	<div  class="content-subsections"><?php 
    $i = 0;
    while ($rok = mysql_fetch_row($sqk)) {
        if ($i != "0") {
            ?>
						&nbsp;|&nbsp;
					<?php 
        }
        if ($pri != $rok[0]) {
            ?>
						<a href="index.php?rub=<?php 
            echo "{$rub}";
            ?>
&pri=<?php 
            echo "{$rok['0']}";
            ?>
&tbp=<?php 
            echo "{$tbp}";
            ?>
"><?php 
            echo $rok[1];
            ?>
</a>&nbsp;(<?php 
        } else {
            echo "<b class=error>{$rok['1']}</b>&nbsp;(";
        }
        if ($sess[5] >= "2") {
            ?>
<a href="index.php?rub=<?php 
            echo "{$rub}";
            ?>
&pri=<?php 
            echo "{$rok['0']}";
            ?>
&view=admin"><?php 
            echo $rok[4];
            ?>
</a><?php 
        } else {
            echo $rok[4];
        }
        ?>
)<?php 
        $i++;
    }
    if ($tbp != "") {
        ?>
					<br><a href="index.php?rub=<?php 
        echo "{$rub}";
        ?>
&pri=all&tbp=<?php 
        echo "{$tbp}";
        ?>
"><?php 
        echo _ALL;
        ?>
</a>&nbsp;|&nbsp;
				<?php 
    } else {
        ?>
					<br><a href="index.php?rub=<?php 
        echo "{$rub}";
        ?>
&pri=all"><?php 
        echo _ALL;
        ?>
</a>	&nbsp;|&nbsp;
					<a href="index.php?rub=<?php 
        echo "{$rub}";
        ?>
&pri=<?php 
        echo "{$pri}";
        ?>
&action=print"><?php 
        echo _PRINT;
        ?>
</a>
				<?php 
    }
    if ($sess[5] >= "2") {
        ?>
					&nbsp;|&nbsp;
					<a href="r_pr_zmena.php?rub=<?php 
        echo "{$rub}";
        ?>
"><?php 
        echo _CHANGE;
        ?>
</a><?php 
    }
    ?>
	
	</div>
<?php 
}
Exemple #3
0
            echo "<P><B>Fehler:</B> Kann Logdatei '{$r_name}' nicht öffnen!</P>\n";
        }
        $loesche .= "{$row->c_id}";
        $raum_alt = $r_name;
        $i++;
    }
    mysql_free_result($result);
    // Chat-Zeilen löschen
    $query = "DELETE FROM chat WHERE c_id IN ({$loesche})";
    $result3 = mysql_query($query, $conn);
}
if ($expire_privat) {
    // Chat expire und Kopie in Log für alle privaten Zeilen, die älter als 15 Minuten sind
    $query = "SELECT SQL_BUFFER_RESULT * FROM chat " . "WHERE (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(c_zeit)) > 900 " . "AND c_typ='P' ORDER BY c_raum,c_id";
    $result = mysql_query($query, $conn);
    $rows = mysql_NumRows($result);
    if ($rows > 0) {
        $i = 0;
        while ($i < $rows) {
            set_time_limit(20);
            $row = @mysql_fetch_object($result);
            // Chat-Zeile in Log schreiben
            $r_name = $log . "/chat_privatnachrichten";
            // Ggf. Log routieren, falls > 100 MB
            if (filesize($r_name) > 100000000) {
                rename($r_name, $r_name . "_" . date("dmY"));
            }
            $handle = fopen($r_name, "a");
            if ($handle != -1) {
                $text = "[" . $row->c_zeit . "][" . $row->c_typ . "]";
                if (strlen($row->c_von_user) > 0) {