Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Bei sovielen User, die gleichzeitig Bewegungen ausführen, würde ich dir in jedem Fall empfehlen, eine Datenbank zu benutzen. Das sollte wesentlich performanter sein.Ich habe gerade jeden Tag ca. 5000 User auf der Seite mit 20000 reg. User.
function user($besuchteSeite, $Benutzer)
{
mysql_query("INSERT INTO `Benutzer_Log` SET `Datum` = NOW(), `Seite` = ".mysql_real_escape_string($besuchteSeite).", `Benutzer` = ".mysql_real_escape_string($Benutzer).";");
}
KristophS hat gesagt.:Solltest du dich für diese Möglichkeit entscheiden, empfehle ich dir, dir ein
Mysql-Tutorial anzusehen
hmm wo finde ich das denn?
function get_seite($site) {
if(!file_exists($site)) {
return "error: Fehler $site kann nicht geladen werden";
} else {
include ("global.php");
$a = @file_get_contents($site);
//preg_replace("","",$a) - echo und print durch $rueckgabe;
//eben so exit durch return ' ';
eval($a);
return $rueckgabe;
}
}
<?php exit; ?>
<?
//Quellcode
?>
Riesige Speicherplatz- und Rechenzeitverschwendung, wenn man sowas im Produktivbetrieb einsetzt...Lukasz hat gesagt.:Was hält ihr davon?
Was hat der Coprozessor (falls du den meintest) mit PHP zu tun?(index.php)
technisches
ermitteln der seite Z.B
-> $naviagtion - laden der Navigationen durch die Funktion (Coprozässer)
-> $seintenihnalt - laden der eigentlichen Seite (Coprozässor)
Zusammenfassen der Daten ($ausgabe durch $navigation und $seinteninhalt)
Ausgabe. echo $ausgabe
Was daran einfacher sein soll, geht mir nicht in den Sinn... und schneller ist es auf keinen Fall (wie sollte es auch?).Ich kann versichern, diese Methode macht gar keine Probleme. Läuft sauber zu stande. Ausch Objekte machen 0 faxen. Neben bei ist es A einfacher und B schneller.
Andersrum wird ein Schuh draus - durch verwenden externer Javascriptdateien wird die Ladezeit bei nachfolgenden Seitenaufrufen verringert, da der Browser sich selbige einfach aus seinem lokalen Cache fischt.Vorteil - keine Externe Javascriptdatei (Ladezeit) und immer nur der Script der aktuell gebraucht wird.
Das geht auch einfacher...Noch ein Vorteil lassen wir alle PHP Seiten die durch die Funktion gehen mit einem
beginnen.PHP:<?php exit; ?> <? //Quellcode ?>
ein Abrufen dieser Seite ist so unerwünscht unmöglich. Wir können aber in der Funktion get_site den ersten exit; Befehl löschen bzw. durch nichts ersetzen.
// eingebundene Datei
if (!defined('IN_MYAPP')) die ('Nothing to see here.');
// einbindende Datei
define('IN_MYAPP', 1);
include('foo.php');
<?
include("forum/object.php");
//#####################################################################
//## Objekt (C R Lukasz Cglarski) forum erzeugen und berechnen! ##
//#####################################################################
$forum = new forum;
//#####################################################################
//## Verarbeitung nach Daten ##
//#####################################################################
$aaction = $_POST['aaction'];
if (!isset($aaction) or strlen($aaction) == 0){ $aaction = $_GET['aaction']; }
$forum->forumkopf(); // jedes mal zeigen
echo $forum->Forumkopf;
echo "<br>";
//======================================================
if ($aaction == "forum") {
if (!isset($forum->GetSeiteTh)) { $forum->GetSeiteTh(); }
echo $forum->GetSeiteTh;
if (!isset($forum->Thlist)) { $forum->Thlist(); }
echo $forum->Thlist;
echo "<br>";
echo $forum->GetSeiteTh;
echo "<br>";
}
elseif ($aaction =="newthread") {
$forum->forum_wright();
if ($forum->forum_wright > $_SESSION['user_rang']) { $fehler_kopf = "Kein Recht um in das Forum zu schreiben."; $fehler_msg="Sie verfügen nicht über die notwendigen Schreibrechte, um in dieses Forum schreiben zu können. Vermutlich sind Sie nicht eingeloggt, oder das Forum ist nicht für das Schreiben mit ihrem Mitgliederrang bestimmt."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else { $smileys = getsmileys('smiley_useinforum'); $bbcodes = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("bbcodes")); echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/new_thread"))."<br>"; }
}
elseif ($aaction =="newthreadenter") {
$forum->forum_wright();
if ($forum->forum_wright > $_SESSION['user_rang']) { $fehler_kopf = "Kein Recht um in das Forum zu schreiben."; $fehler_msg="Sie verfügen nicht über die notwendigen Schreibrechte, um in dieses Forum schreiben zu können. Vermutlich sind Sie nicht eingeloggt, oder das Forum ist nicht für das Schreiben mit ihrem Mitgliederrang bestimmt."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else {
$forum->pruf_titel_text();
if ($forum->pruf_titel_text != 1) { $textarea = stripslashes($_POST['textarea']); $thread_name = stripslashes($_POST['thread_name']); $fehler_kopf = "Flasche oder fehlende Angaben."; $fehler_msg=" Sie haben vergessen entweder ein Feld auszufüllen!."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; $smileys = getsmileys('smiley_useinforum'); $bbcodes = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("bbcodes")); echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/new_thread"))."<br>"; }
else {
ignore_user_abort();
$forum->insert_newthread_todb();
}
}
}
elseif ($aaction == "thread") {
$forum->Getthreadicon();
$forum->GetSeitePo();
$forum->OutPo();
echo $forum->GetSeitePo;
echo "<br>";
echo $forum->OutPo;
echo "<br>";
}
elseif ($aaction == "answer") {
$forum->Getthreadicon();
$forum->AnswerTh_info();
if ($forum->Answer_status == 0 or $forum->Answer_status == 3) { $fehler_kopf = "Thread Status gestattet keine neuen Beiträge."; $fehler_msg="Vermutlich ist der Thread geschlossen oder fixiert geschlossen. Threads die den Status geschlossen tragen sind nur zum lesen bestimmt."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else {
if ($forum->Answer_wright > $_SESSION['user_rang']) { $fehler_kopf = "Kein Recht um Beitrag zu schreiben."; $fehler_msg="Sie haben nicht die notwendigen Rechte um in diesem Thread einen Beitrag zu schreiben. Vermutlich müssen Sie sich erst registrieren!"; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else {
$quote = stripslashes($_POST['quote']); $smileys = getsmileys('smiley_useinforum'); $bbcodes = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("bbcodes")); echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/answer_thread"))."<br>";
}
}
}
elseif ($aaction == "insertanswer") {
$forum->Getthreadicon();
$forum->AnswerTh_info();
if ($forum->Answer_status == 0 or $forum->Answer_status == 3) { $fehler_kopf = "Thread Status gestattet keine neuen Beiträge."; $fehler_msg="Vermutlich ist der Thread geschlossen oder fixiert geschlossen. Threads die den Status geschlossen tragen sind nur zum lesen bestimmt."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else {
if ($forum->Answer_wright > $_SESSION['user_rang']) { $fehler_kopf = "Kein Recht um Beitrag zu schreiben."; $fehler_msg="Sie haben nicht die notwendigen Rechte um in diesem Thread einen Beitrag zu schreiben. Vermutlich müssen Sie sich erst registrieren!"; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
elseif (strlen($_POST['textarea']) < 10) { $fehler_kopf = "Zu wenig Text!"; $fehler_msg="Sie sollten schon ein wenig Text schreiben, damit der Beitrag gespeichert werden kann!"; $textarea = stripslashes($_POST['textarea']); echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; $smileys = getsmileys('smiley_useinforum'); $bbcodes = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("bbcodes")); echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/answer_thread"))."<br>"; }
else {
$forum->Po_neu();
}
}
}
elseif ($aaction == "gotopost") {
$forum->gotopost();
}
elseif ($aaction == "editpost") {
$forum->caneditpost();
if (eregi("Gast",$_SESSION['user_name'])) { $fehler_kopf = "Funktion nicht für Gäste!"; $fehler_msg="Diese Funktion kann nur von registrierten Mitgliedern genutzt werden."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else {
if ($forum->is_postautor == 0) { $fehler_kopf = "Änderung am Beitrag nur vom Verfasser möglich!"; $fehler_msg="Sie sind nicht der Verfasser dieses Beitrags und können daher keine Änderung vornehmen."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
elseif ($forum->is_editablestatus == 0) { $fehler_kopf = "Ändern auf Grund Threadstatus nicht möglich!"; $fehler_msg="Der Thread ist entweder geschlossen oder fixiert geschlossen, und lässt daher keine Änderung von Beiträgen zu!"; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
elseif ($forum->is_editablewr == 0) { $fehler_kopf = "Kein Schreibrecht!"; $fehler_msg="Sie haben für dieses Forum kein Schreibrecht! Vermutlich wurde das Schreibrecht nachträglich geändert."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else { echo $forum->editpost_text; }
}
}
elseif ($aaction == "inserteditpost") {
$forum->caneditpost();
if (eregi("Gast",$_SESSION['user_name'])) { $fehler_kopf = "Funktion nicht für Gäste!"; $fehler_msg="Diese Funktion kann nur von registrierten Mitgliedern genutzt werden."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
else {
if ($forum->is_postautor == 0) { $fehler_kopf = "Änderung am Beitrag nur vom Verfasser möglich!"; $fehler_msg="Sie sind nicht der Verfasser dieses Beitrags und können daher keine Änderung vornehmen."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
elseif ($forum->is_editablestatus == 0) { $fehler_kopf = "Ändern auf Grund Threadstatus nicht möglich!"; $fehler_msg="Der Thread ist entweder geschlossen oder fixiert geschlossen, und lässt daher keine Änderung von Beiträgen zu!"; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
elseif ($forum->is_editablewr == 0) { $fehler_kopf = "Kein Schreibrecht!"; $fehler_msg="Sie haben für dieses Forum kein Schreibrecht! Vermutlich wurde das Schreibrecht nachträglich geändert."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; }
elseif ($forum->canedit_insert == 0) { $fehler_kopf = "Zu wenig Text!"; $fehler_msg="Mindestens wenige Worte sollten Sie schon verfassen, damit es sich lohnt ein Beitrag zu speichern."; echo preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("error"))."<br>"; echo $forum->editpost_text; }
else { $forum->inserteditpost(); }
}
}
elseif ($aaction == "adminthread") {
$forum->adminthread();
echo $forum->adminthread;
echo "<br>";
}
elseif ($aaction == "setadminthread") {
$forum->setadminthread();
}
elseif ($aaction == "adminpost") {
$forum->adminpost();
echo $forum->adminpost;
echo "<br>";
}
elseif ($aaction == "insertadminpost") {
$forum->insertadminpost();
}
elseif ($aaction == "suche") {
$forum->suche();
echo $forum->suche;
echo "<br>";
}
elseif ($aaction == "runsuche") {
$forum->runsuche();
}
elseif ($aaction == "showsuche") {
$forum->showsuche();
echo $forum->showsuche;
echo "<br>";
}
else {
$forum->forumdaten();
echo $forum->Forumdaten;
echo "<br>";
}
//============================================================
$forum->letzteaktionen(); //jedes mal zeigen
echo $forum->Letzte_Aktionen;
echo "<br>";
?>
//#######################################################################
//## Objekt (C R Lukasz Cglarski) forum: ##
//#######################################################################
class forum
{
var $Forumkopf;
var $Forumdaten;
var $AnzForen;
var $Letzte_Aktionen;
var $Getforum;
var $AnzThreads;
var $GetSeiteTh;
var $ThStartlimiter;
var $ThMaxproseite;
var $Thlist;
var $forum_wright;
var $pruf_titel_text;
var $Getthread;
var $Getthreadicon;
var $PoStartlimiter;
var $PoMaxproseite;
var $GetSeitePo;
var $OutPo;
var $Answer_rright;
var $Answer_wright;
var $Answer_mright;
var $Answer_status;
var $Answer_Thname;
var $Answer_Thforumid;
var $GetPost;
var $is_postautor;
var $is_editablestatus;
var $editpost_text;
var $is_editablewr;
var $adminthread;
var $adminpost;
var $suche;
var $runsuche;
var $showsuche;
function forumkopf(){
include("key/global.inc.php");
if(is_numeric($_GET['forum'])) { $forum_id = $_GET['forum']; }
if(is_numeric($_GET['thread'])) { $thread_id = $_GET['thread']; }
if (isset($forum_id)) {
$result=mysql_query("SELECT forum_name FROM lgckit_forum WHERE forum_id = '$forum_id' AND forum_rright <= '".$_SESSION['user_name']."' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
$indexleiste = "<a href=\"$lgckit_domainpath/index.php?modul=forum&aaction=forum&forum=$forum_id\" class=\"$lgckit_style_tablefont_ukopf\"><img src=\"$lgckit_style_path/forumicons/forum.gif\" border=\"0\" align=\"absmiddle\"> ".$row['forum_name']."</a>";
global $lgckit_metatitel;
$lgckit_metatitel = $row['forum_name']." - ".$lgckit_domainpath;
}
}
elseif(isset($thread_id)){
global $lgckit_metatitel;
$result = mysql_query("SELECT thread_status,thread_forumid,thread_name FROM lgckit_thread WHERE thread_id = '$thread_id' AND thread_rright <= '".$_SESSION['user_name']."' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
if($row['thread_status'] == 0) { $indexleiste = " - <a href=\"$lgckit_domainpath/index.php?modul=forum&aaction=thread&thread=$thread_id\" class=\"$lgckit_style_tablefont_ukopf\"><img src=\"$lgckit_style_path/forumicons/thread_close.gif\" border=\"0\" align=\"absmiddle\"> ".$row['thread_name']."</a>"; }
elseif($row['thread_status'] == 1) { $indexleiste = " - <a href=\"$lgckit_domainpath/index.php?modul=forum&aaction=thread&thread=$thread_id\" class=\"$lgckit_style_tablefont_ukopf\"><img src=\"$lgckit_style_path/forumicons/thread.gif\" border=\"0\" align=\"absmiddle\"> ".$row['thread_name']."</a>"; }
elseif($row['thread_status'] == 2) { $indexleiste = " - <a href=\"$lgckit_domainpath/index.php?modul=forum&aaction=thread&thread=$thread_id\" class=\"$lgckit_style_tablefont_ukopf\"><img src=\"$lgckit_style_path/forumicons/thread_fix.gif\" border=\"0\" align=\"absmiddle\"> ".$row['thread_name']."</a>"; }
else { $indexleiste = " - <a href=\"$lgckit_domainpath/index.php?modul=forum&aaction=thread&thread=$thread_id\" class=\"$lgckit_style_tablefont_ukopf\"><img src=\"$lgckit_style_path/forumicons/thread_fixclose.gif\" border=\"0\" align=\"absmiddle\"> ".$row['thread_name']."</a>"; }
$forum_id = $row['thread_forumid'];
$lgckit_metatitel = $row['thread_name']." - ";
}
$result=mysql_query("SELECT forum_name FROM lgckit_forum WHERE forum_id = '$forum_id' AND forum_rright <= '".$_SESSION['user_name']."' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
$indexleiste = "<a href=\"$lgckit_domainpath/index.php?modul=forum&aaction=forum&forum=$forum_id\" class=\"$lgckit_style_tablefont_ukopf\"><img src=\"$lgckit_style_path/forumicons/forum.gif\" border=\"0\" align=\"absmiddle\"> ".$row['forum_name']."</a>".$indexleiste;
$lgckit_metatitel .= $row['forum_name']." - ".$lgckit_domainpath;
}
}
$this->Forumkopf = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/kopf"));
}
function anzforen(){
$result = mysql_query("SELECT COUNT(*) FROM lgckit_forum WHERE forum_rright <= '".$_SESSION['user_rang']."'");
while($row = mysql_fetch_array($result)){
$this->AnzForen = $row[0];
unset($row);
}
unset($result);
}
function forumdaten(){
include("key/global.inc.php");
if (!isset($this->AnzForen)) { $this->anzforen(); }
if($this->AnzForen > 0) {
$result = mysql_query("SELECT forum_id,forum_name,forum_info,forum_countthemes,forum_countposts,forum_lastpostid,forum_lastautor,forum_lastthidname,forum_lastwtime FROM lgckit_forum WHERE forum_rright <= '".$_SESSION['user_rang']."' ORDER BY forum_name ASC");
while($row=mysql_fetch_assoc($result)){
$row['forum_lastwtime'] = recallsqldatumausgabe($row['forum_lastwtime']);
$this->Forumdaten .= preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/forenlisting"));
unset($row);
}
global $lgckit_metatitel;
$lgckit_metatitel = "Forum Index- ".$lgckit_domainpath;
$forenlisting = $this->Forumdaten;
$this->Forumdaten = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/main"));
} else { $this->Forumdaten = "Keine Daten Nach Leserecht"; }
}
function letzteaktionen(){
include("key/global.inc.php");
$result = mysql_query("SELECT post_time,post_id,post_threadname FROM lgckit_post WHERE post_rright <= '".$_SESSION['user_rang']."' ORDER BY post_time DESC LIMIT 5");
while($row=mysql_fetch_assoc($result)){
$row['post_time'] = recallsqldatumausgabe($row['post_time']);
$this->Letzte_Aktionen .= preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/neubeitr_spalte"));
unset($row);
}
$inhalt_neu = $this->Letzte_Aktionen;
$this->Letzte_Aktionen = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/neubeitr_main"));
}
function getforum(){
include("key/global.inc.php");
$this->Getforum = $_GET['forum'];
if (!isset($this->Getforum) or eregi("[[:alpha:]]",$this->Getforum) or eregi("[[:punct:]]",$this->Getforum)) { unset($this->Getforum); header("Location: $lgckit_domainpath/index.php?modul=forum&action=main"); exit;}
}
function anzthreads(){
if (!isset($this->Getforum)){ $this->getforum(); }
$result = mysql_query("SELECT COUNT(*) FROM lgckit_thread WHERE thread_forumid = '".$this->Getforum."' AND thread_rright <= '".$_SESSION[user_rang]."'");
while($row=mysql_fetch_array($result)){
$this->AnzThreads = $row['0'];
}
}
function GetSeiteTh(){
include("key/global.inc.php");
if (!isset($this->AnzThreads)){ $this->anzthreads(); }
$seite = $_GET['seite'];
if (!isset($seite)) { $seite = 1; }
if (eregi("[[:alpha:][:punct:][:cntrl:][:blank:][:space:]$]",$seite)) { $seite = 1; }
$this->ThMaxproseite = 20;
if ($this->AnzThreads != 0) { $maxseite = ceil($this->AnzThreads / $this->ThMaxproseite); } else { $maxseite = 1; }
$this->ThStartlimiter = ($seite - 1) * $this->ThMaxproseite;
if ($seite < 1) { $seite = 1; }
elseif ($seite > $maxseite) { $seite = $maxseite; }
$url = "$lgckit_domainpath/index.php?modul=forum&aaction=forum&forum=".$_GET['forum']."&seite=";
$seitenleiste = createpagenav($seite,1,$maxseite,$url);
$this->GetSeiteTh = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/seitenleiste_newth"));
}
function Thlist(){
include("key/global.inc.php");
if (!isset($this->Getforum)) { $this->getforum(); }
if (!isset($this->GetSeiteTh)) { $this->GetSeiteTh(); }
$result = mysql_query("SELECT thread_id,thread_status,thread_name,thread_lastwtime,thread_createtime,thread_lastautor,thread_autor,thread_countthemes,thread_views FROM lgckit_thread WHERE thread_forumid = '".$this->Getforum."' AND thread_rright <= '".$_SESSION['user_rang']."' ORDER BY (thread_status = '3' OR thread_status = '2') DESC, thread_lastwtime DESC LIMIT ".$this->ThStartlimiter.",".$this->ThMaxproseite."");
while($row=mysql_fetch_assoc($result)){
if ($row['thread_status'] == 0) { $thread_status_imagesrc = "$lgckit_style_path/forumicons/thread_close.gif"; }
elseif ($row['thread_status'] == 1) { $thread_status_imagesrc = "$lgckit_style_path/forumicons/thread.gif"; }
elseif ($row['thread_status'] == 2) { $thread_status_imagesrc = "$lgckit_style_path/forumicons/thread_fix.gif"; }
elseif ($row['thread_status'] == 3) { $thread_status_imagesrc = "$lgckit_style_path/forumicons/thread_fixclose.gif"; }
$row['thread_lastwtime'] = recallsqldatumausgabe($row['thread_lastwtime']);
$row['thread_createtime'] = recallsqldatumausgabe($row['thread_createtime']);
$outthread .= preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/listthread"));
unset($row,$thread_status_imagesrc);
}
$this->Thlist = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/outthread"));
}
//gelich gehts weiter
<?
function forum_wright(){
include("key/global.inc.php");
if (!isset($this->Getforum)){ $this->getforum(); }
$result = mysql_query("SELECT COUNT(*) FROM lgckit_forum WHERE forum_id = '".$this->Getforum."' LIMIT 1");
$is_forum = 0;
while($row=mysql_fetch_array($result)){
if ($row['0'] > 0) { $is_forum = 1; }
}
if ($is_forum == 0) { header("Location: $lgckit_domainpath/index.php?modul=forum&action=main"); exit; }
$result = mysql_query("SELECT forum_wright FROM lgckit_forum WHERE forum_id ='".$this->Getforum."' LIMIT 1");
$wright = 7; // Sichehrheit!
while($row=mysql_fetch_assoc($result)){
$wright = $row['forum_wright'];
}
$this->forum_wright = $wright; // Wichtig! diese Zeile muss hier stehen!
}
function pruf_titel_text(){
$titel = $_POST['thread_name'];
$text = $_POST['textarea'];
if (strlen($titel) < 1 or strlen($text) < 1) { $this->pruf_titel_text = 0; }
else { $this->pruf_titel_text = 1; }
}
function insert_newthread_todb(){
include("key/global.inc.php");
$now = sqldatetime(time());
$result = mysql_query("SELECT forum_rright,forum_wright,forum_mright FROM lgckit_forum WHERE forum_id = '".$_GET['forum']."' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
$rright = $row['forum_rright'];
$wright = $row['forum_wright'];
$mright = $row['forum_mright'];
}
mysql_query("INSERT INTO lgckit_thread (thread_forumid,thread_name,thread_rright,thread_wright,thread_mright,thread_lastwtime,thread_createtime,thread_lastautor,thread_autor) VALUES ('".$_GET['forum']."','".dumpfordb($_POST['thread_name'])."','$rright','$wright','$mright','$now','$now','".$_SESSION['user_name']."','".$_SESSION['user_name']."')");
$thread_id = mysql_insert_id();
mysql_query("INSERT INTO lgckit_post (post_time,post_threadid,post_forumid,post_threadname,post_rright,post_wright,post_mright,post_autor,post_text) VALUES ('$now','$thread_id','".$_GET['forum']."','".dumpfordb($_POST['thread_name'])."','$rright','$wright','$mright','".$_SESSION['user_name']."','".dumpfordb($_POST['textarea'])."')");
$post_id = mysql_insert_id();
mysql_query("UPDATE lgckit_forum SET forum_lastwtime = '$now', forum_lastautor = '".$_SESSION['user_name']."',forum_countthemes = forum_countthemes + 1, forum_countposts = forum_countposts + 1, forum_lastthid = '$thread_id', forum_lastpostid = '$post_id', forum_lastthidname = '".dumpfordb($_POST['thread_name'])."' WHERE forum_id = '".$_GET['forum']."' LIMIT 1");
header("Location: $lgckit_domainpath/index.php?modul=forum&aaction=gotopost&post=$post_id"); exit;
}
function Getthread(){
include("key/global.inc.php");
$this_thread = $_GET['thread'];
if (!isset($this_thread) or eregi("[[:alpha:]]",$this_thread) or eregi("[[:punct:]]",$this_thread)) { header("Location: $lgckit_domainpath/index.php?modul=forum"); exit; }
$this->Getthread = $this_thread;
}
function Getthreadicon(){
include("key/global.inc.php");
if (!isset($this->Getthread)){ $this->Getthread(); }
$result = mysql_query("SELECT * FROM lgckit_thread WHERE thread_id = '".$this->Getthread."' Limit 1");
while($row=mysql_fetch_assoc($result)){
$thread_status = $row['thread_status'];
if ($thread_status == 0) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread_close.gif"; }
elseif ($thread_status == 1) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread.gif"; }
elseif ($thread_status == 2) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread_fix.gif"; }
elseif ($thread_status == 3) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread_fixclose.gif"; }
}
}
function GetSeitePo(){
include("key/global.inc.php");
if (!isset($this->Getthread)){ $this->Getthread(); }
$result = mysql_query("SELECT COUNT(*) FROM lgckit_post WHERE post_threadid = '".$this->Getthread."' AND post_rright <= '".$_SESSION['user_rang']."'");
while($row=mysql_fetch_array($result)){
$anz = $row['0'];
}
if (!isset($anz)) { $anz = 0; }
$seite = $_GET['seite'];
if (!isset($seite)) { $seite = 1; }
if (eregi("[[:alpha:][:punct:][:cntrl:][:blank:][:space:]$]",$seite)) { $seite = 1; }
$maxproseite = 10;
if ($anz != 0) { $maxseite = ceil($anz / $maxproseite); } else { $maxseite = 1; }
if ($seite < 1) { $seite = 1; }
elseif($seite > $maxseite) { $seite = $maxseite; }
$startlimiter = ($seite - 1) * $maxproseite;
$url = "$lgckit_domainpath/index.php?modul=forum&aaction=thread&thread=".$_GET['thread']."&seite=";
$this->GetSeitePo = createpagenav($seite,1,$maxseite,$url);
$this->PoStartlimiter = $startlimiter;
$this->PoMaxproseite = $maxproseite;
}
function OutPo(){
include("key/global.inc.php");
if (!isset($this->Getthread)){ $this->Getthread(); }
if (!isset($this->PoStartlimiter)){ $this->GetSeitePo(); }
if (!isset($this->PoMaxproseite)){ $this->GetSeitePo(); }
$result = mysql_query("SELECT * FROM lgckit_post WHERE post_threadid = '".$this->Getthread."' AND post_rright <= '".$_SESSION['user_rang']."' ORDER BY post_time ASC LIMIT ".$this->PoStartlimiter.",".$this->PoMaxproseite."");
while($row=mysql_fetch_assoc($result)){
$post_id = $row['post_id'];
$post_threadname = $row['post_threadname'];
$metatitel = $post_threadname;
$post_time = recallsqldatumausgabe($row['post_time']);
$post_autor = $row['post_autor'];
$post_text = unbbcode($row['post_text']);
$quote = "Original geschrieben von: ".$row['post_autor']."[br]".$row['post_text'];
$post_wright = $row['post_wright'];
$post_mright = $row['post_mright'];
$userinfo = getuserinformation($post_autor);
if ($row['post_autor'] != "Gast") {
$forum_rang_ver = explode('#',getforumrang($row['post_autor']));
}
$postleiste = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/postleiste"));
$outposts .= preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/postkopf"))."<br>";
unset($forum_rang_ver,$quote,$postleiste,$post_mright,$post_wright,$post_id,$post_threadname,$post_autor,$post_time,$post_text,$userinfo);
}
@mysql_query("UPDATE lgckit_thread SET thread_views = thread_views + 1 WHERE thread_id = '".$this->Getthread."' AND thread_rright <= '".$_SESSION[user_rang]."' LIMIT 1");
$this->OutPo = $outposts;
}
function AnswerTh_info(){
include("key/global.inc.php");
if (!isset($this->Getthread)){ $this->Getthread(); }
$result = mysql_query("SELECT * FROM lgckit_thread WHERE thread_id = '".$this->Getthread."' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
$this->Answer_status = $row['thread_status'];
$this->Answer_Thname = $row['thread_name'];
$this->Answer_rright = $row['thread_rright'];
$this->Answer_wright = $row['thread_wright'];
$this->Answer_mright = $row['thread_mright'];
$this->Answer_Thforumid = $row['thread_forumid'];
$thread_status = $row['thread_status'];
if ($thread_status == 0) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread_close.gif"; }
elseif ($thread_status == 1) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread.gif"; }
elseif ($thread_status == 2) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread_fix.gif"; }
elseif ($thread_status == 3) { $this->Getthreadicon = "$lgckit_style_path/forumicons/thread_fixclose.gif"; }
}
}
function Po_neu(){
include("key/global.inc.php");
if (!isset($this->Getthread)){ $this->Getthread(); }
if (!isset($this->Answer_Thforumid)){ $this->AnswerTh_info(); }
$now = sqldatetime(time());
@mysql_query("INSERT INTO lgckit_post (post_time,post_threadid,post_forumid,post_threadname,post_rright,post_wright,post_mright,post_autor,post_text) VALUES ('$now','".$this->Getthread."','".$this->Answer_Thforumid."','".$this->Answer_Thname."','".$this->Answer_rright."','".$this->Answer_wright."','".$this->Answer_mright."','".$_SESSION['user_name']."','".dumpfordb($_POST['textarea'])."')");
$post_id = mysql_insert_id();
@mysql_query("UPDATE lgckit_thread SET thread_lastwtime = '$now', thread_lastautor = '".$_SESSION['user_name']."', thread_countthemes = thread_countthemes + 1 WHERE thread_id = '".$this->Getthread."' LIMIT 1");
@mysql_query("UPDATE lgckit_forum SET forum_lastwtime = '$now', forum_lastautor = '".$_SESSION['user_name']."', forum_countposts = forum_countposts + 1, forum_lastthid = '".$this->Getthread."', forum_lastpostid = '$post_id', forum_lastthidname = '".$this->Answer_Thname."' WHERE forum_id = '".$this->Answer_Thforumid."' LIMIT 1");
header("Location: $lgckit_domainpath/index.php?modul=forum&aaction=gotopost&thread=".$this->Getthread."&post=$post_id"); exit;
}
function gotopost(){
include("key/global.inc.php");
$post = $_GET['post'];
$thread = $_GET['thread'];
if (!isset($post) or eregi("[[:alpha:]]",$post) or eregi("[[:punct:]]",$post)) { header("Location: $lgckit_domainpath/index.php?modul=forum"); exit; }
if (!isset($thread) or eregi("[[:alpha:]]",$thread) or eregi("[[:punct:]]",$thread)) {
$result=mysql_query("SELECT * FROM lgckit_post WHERE post_id = '".$post."' LIMIT 1");
while($row = mysql_fetch_assoc($result)){
$thread = $row['post_threadid'];
}
}
$a = 0;
$socket = 0;
$result = mysql_query("SELECT post_id FROM lgckit_post WHERE post_threadid = '".$thread."' ORDER BY post_time ASC");
while($row=mysql_fetch_assoc($result)){
if ($row['post_id'] == $post && $socket == 0) { $a++; $socket = 1;}
elseif ($socket == 0) { $a++; }
}
if ($a > 0) { $seite = ceil($a / 10); }
else { $seite = 1; }
header("Location: $lgckit_domainpath/index.php?modul=forum&aaction=thread&thread=$thread&seite=$seite#post$post"); exit;
}
function GetPost(){
include("key/global.inc.php");
$this->GetPost = $_GET['post'];
if (!isset($this->GetPost) or eregi("[[:alpha:]]",$this->GetPost) or eregi("[[:punct:]]",$this->GetPost)) { header("Location: $lgckit_domainpath/index.php?modul=forum"); exit; }
$anz = 0;
$result = mysql_query("SELECT COUNT(*) FROM lgckit_post WHERE post_id = '".$this->GetPost."' LIMIT 1");
while($row=mysql_fetch_array($result)){
$anz = $row['0'];
}
if ($anz == 0) { header("Location: $lgckit_domainpath/index.php?modul=forum"); exit; }
}
function caneditpost(){
include("key/global.inc.php");
if (!isset($this->GetPost)){ $this->GetPost(); }
$result = mysql_query("SELECT post_threadid,post_threadname,post_wright,post_autor,post_text FROM lgckit_post WHERE post_id = '".$this->GetPost."' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
$thid = $row['post_threadid'];
$wr = $row['post_wright'];
$autor = $row['post_autor'];
$textarea = dumpfromdb($row['post_text']);
$thname = $row['post_threadname'];
}
unset($row);
$result = mysql_query("SELECT thread_status FROM lgckit_thread WHERE thread_id = '$thid' LIMIT 1");
while($row=mysql_fetch_assoc($result)){
$status = $row['thread_status'];
}
unset($row);
if ($status == 1) { $image = "thread.gif"; }
if ($status == 2) { $image = "thread_fix.gif"; }
$smileys = getsmileys('smiley_useinforum');
$bbcodes = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("bbcodes"));
if ($autor == $_SESSION['user_name']) { $this->is_postautor = 1; } else { $this->is_postautor = 0; }
if ($status == 1 or $status == 2) { $this->is_editablestatus = 1; } else { $this->is_editablestatus = 0; }
if ($wr <= $_SESSION['user_rang']) { $this->is_editablewr = 1; } else { $this->is_editablewr = 0; }
if (isset($_POST['textarea'])) { $textarea = stripslashes($_POST['textarea']); }
$this->editpost_text = preg_replace("/\\$(.*)#/Ue","".recalltemplate('\\1')."",calltemplate("forum/edit_thread"))."<br>";
if (strlen($_POST['textare']) < 10) { $this->canedit_insert = 1; } else { $this->canedit_insert = 0; }
$this->Getthread = $thid;
}
//usw... sonst wird es zu lang!
?>
<?
if (!isset($this->GetPost)){ $this->GetPost(); }
?>