1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
|
<?php
class wiw extends useronline {
var $boardid = "";
var $modcache = "";
var $name = "";
var $postid = "";
var $threadid = "";
var $urlend = "";
var $userid = "";
var $boardcache = array();
var $permissioncache = array();
var $result = array();
var $threadcache = array();
var $useronlinecache = array();
function cut($result) {
$url=explode("?", $result['request_uri']);
$this->urlend=$url[0];
if($this->urlend=="board.php" || $this->urlend=="newthread.php") $this->boardid = $result['boardid'];
else if($this->urlend=="addreply.php" || $this->urlend=="attachments.php" || $this->urlend=="thread.php") $this->threadid = $result['threadid'];
else if($this->urlend=="editpost.php" || $this->urlend=="misc.php" || $this->urlend=="profile.php") {
$url=explode("=", $result['request_uri']);
$url=explode("&", $url[1]);
if($this->urlend=="editpost.php") $this->postid = $url[0];
else if($this->urlend=="misc.php") $this->postid = $url[0];
else if($this->urlend=="profile.php") $this->userid = $url[0];
}
$this->result = $result;
}
function cache() {
global $db, $n, $wbbuserdata;
if($this->boardid!=0 || $this->postid!=0 || $this->threadid!=0 || $this->userid!=0) {
$this->useronlinecache = $db->query_first("SELECT p.boardpermission, b.invisible FROM bb".$n."_permissions p LEFT JOIN bb".$n."_boards b ON (b.boardid='".$this->result['boardid']."') WHERE p.boardid='".$this->result['boardid']."' AND p.groupid='".$wbbuserdata['groupid']."'");
if($this->result['userid']==0) $default_group = $db->query_first("SELECT groupid FROM bb".$n."_groups WHERE default_group=1");
else $default_group = $db->query_first("SELECT groupid FROM bb".$n."_users WHERE userid='".$this->result['userid']."'");
if($this->urlend=="addreply.php" || $this->urlend=="editpost.php") {
if($this->result['boardid']!=0 && $this->result['userid']!=0) $modcache = $db->query_first("SELECT userid FROM bb".$n."_moderators WHERE userid='".$this->result['userid']."' AND boardid='".$this->result['boardid']."'");
if($modcache['userid']!="" && $modcache['userid']==$this->result['userid']) $this->modcache=1;
else $this->modcache=0;
}
if($this->urlend=="addreply.php") {
$this->permissioncache = $db->query_first("SELECT p.replypermission, g.canreplyowntopic, g.canreplytopic, g.canuseacp, g.issupermod, t.topic, t.starterid, t.closed FROM bb".$n."_permissions p LEFT JOIN bb".$n."_groups g ON (g.groupid=p.groupid) LEFT JOIN bb".$n."_threads t ON (t.threadid='$this->threadid') WHERE p.boardid='".$this->result['boardid']."' AND p.groupid='".$default_group['groupid']."'");
$this->boardcache = $db->query_first("SELECT password, closed FROM bb".$n."_boards WHERE boardid='".$this->result['boardid']."'");
if($this->permissioncache['starterid']==$this->result['userid']) $this->userid = "$this->permissioncache['canreplyowntopic']==1";
else $this->userid = "$this->permissioncache['canreplytopic']==1";
}
else if($this->urlend=="board.php") {
$this->permissioncache = $db->query_first("SELECT boardpermission FROM bb".$n."_permissions WHERE boardid='$this->boardid' AND groupid='".$default_group['groupid']."'");
$this->boardcache = $db->query_first("SELECT title FROM bb".$n."_boards WHERE boardid='$this->boardid'");
}
else if($this->urlend=="calender.php") {
$this->permissioncache = $db->query_first("SELECT canviewcalender FROM bb".$n."_groups WHERE groupid='".$default_group['groupid']."'");
}
else if($this->urlend=="editpost.php") {
$this->permissioncache = $db->query_first("SELECT g.groupid, g.caneditownpost, g.canuseacp, g.issupermod, p.threadid, t.boardid, t.closed, b.password FROM bb".$n."_groups g LEFT JOIN bb".$n."_posts p ON (p.postid='$this->postid') LEFT JOIN bb".$n."_threads t ON (t.threadid=p.threadid) LEFT JOIN bb".$n."_boards b ON (b.boardid=t.boardid) WHERE g.groupid='".$default_group['groupid']."'");
$info = $db->query_first("SELECT userid, posttopic, message FROM bb".$n."_posts WHERE postid='$this->postid'");
if($info['posttopic']=="") {
$this->name = substr($info['message'],0,100);
}
else $this->name= $info['posttopic'];
if($info['userid']==$this->result['userid']) $this->userid=1;
else $this->userid=0;
}
else if($this->urlend=="newthread.php") {
$this->permissioncache = $db->query_first("SELECT p.startpermission, g.canstarttopic FROM bb".$n."_permissions p LEFT JOIN bb".$n."_groups g ON (g.groupid=p.groupid) WHERE p.boardid='$this->boardid' AND p.groupid='".$default_group['groupid']."'");
$this->boardcache = $db->query_first("SELECT title, closed FROM bb".$n."_boards WHERE boardid='$this->boardid'");
}
else if($this->urlend=="profile.php") {
$this->permissioncache = $db->query_first("SELECT canviewprofile FROM bb".$n."_groups WHERE groupid='".$default_group['groupid']."'");
$info = $db->query_first("SELECT username FROM bb".$n."_users WHERE userid='$this->userid'");
$this->name = $info['username'];
}
else if($this->urlend=="thread.php" || $this->urlend=="attachments.php") {
$this->permissioncache = $db->query_first("SELECT p.boardid, p.boardpermission, b.password FROM bb".$n."_permissions p LEFT JOIN bb".$n."_boards b ON (b.boardid=p.boardid) WHERE p.boardid='".$this->result['boardid']."' AND p.groupid='".$default_group['groupid']."'");
$this->threadcache = $db->query_first("SELECT topic FROM bb".$n."_threads WHERE threadid='$this->threadid'");
}
}
}
function getlocation() {
global $session, $wbbuserdata;
switch($this->urlend) {
CASE "addreply.php":
if(($this->useronlinecache['boardpermission']==1 && $this->permissioncache['replypermission']==1 && $this->boardcache['password']=="" && $this->boardcache['closed']==0 && $this->userid) && ($this->permissioncache['closed']==0 || ($this->permissioncache['canuseacp']==1 || $this->permissioncache['issupermod']==1 || $this->modcache==1))) {
$this->name=$this->permissioncache['topic'];
$location = "Antwort zu <a href="./thread.php?threadid=$this->threadid&sid=$session[hash]" target="_blank">$this->name</a> erstellen";
}
else $location = "Sonstiges";
break;
CASE "attachments.php":
if($this->useronlinecache['boardpermission']==1 && $this->permissioncache['boardpermission']==1 && $this->permissioncache['password']=="") {
$this->name=$this->threadcache['topic'];
$location = "Thema: <a href="./thread.php?threadid=$this->threadid&sid=$session[hash]" target="_blank">$this->name</a>";
}
else $location = "Sonstiges";
break;
CASE "board.php":
if((($this->useronlinecache['boardpermission']==0 && $this->useronlinecache['invisible']==0) || $this->useronlinecache['boardpermission']==1) && $this->permissioncache['boardpermission']==1) {
$this->name=$this->boardcache['title'];
$location = "Forum: <a href="./board.php?boardid=$this->boardid&sid=$session[hash]" target="_blank">$this->name</a>";
}
else $location = "Sonstiges";
break;
CASE "calender.php":
if($wbbuserdata['canviewcalender']==1 && $this->permissioncache['canviewcalender']==1) {
$location = "<a href="calender.php?sid=$session[hash]" target="_blank">Kalender</a>";
}
else $location = "Sonstiges";
break;
CASE "editpost.php":
if($this->useronlinecache['boardpermission']==1 && $this->permissioncache['password']=="" && (($this->userid==1 && $this->permissioncache['caneditownpost']==1 && $this->permissioncache['closed']==0) || ($this->permissioncache['canuseacp']==1 || $this->permissioncache['issupermod']==1 || $this->modcache==1))) {
$location = "Beitrag <a href="./thread.php?sid=$session[hash]&postid=$this->postid#post$this->postid" target="_blank">$this->name</a> editieren";
}
else $location = "Sonstiges";
break;
CASE "index.php":
$location = "<a href="index.php?sid=$session[hash]" target="_blank">Hauptseite</a>";
break;
CASE "login.php":
$location = "Anmelden";
break;
CASE "logout.php":
$location = "Abmelden";
break;
CASE "memberslist.php":
$location = "<a href="memberslist.php?sid=$session[hash]" target="_blank">Mitgliederliste</a>";
break;
CASE "misc.php":
if($this->postid=="faq" || $this->postid=="faq1" || $this->postid=="faq2" || $this->postid=="faq3") {
$location = "<a href="misc.php?action=faq&sid=$session[hash]" target="_blank">Foren FAQs</a>";
}
else $location = "Sonstiges";
break;
CASE "newthread.php":
if((($this->useronlinecache['boardpermission']==0 && $this->useronlinecache['invisible']==0) || $this->useronlinecache['boardpermission']==1) && $this->permissioncache['startpermission']==1 && $this->permissioncache['canstarttopic']==1 && $this->boardcache['closed']==0) {
$this->name=$this->boardcache['title'];
$location = "Neues Thema in <a href="./board.php?boardid=$this->boardid&sid=$session[hash]" target="_blank">$this->name</a> erstellen";
}
else $location = "Sonstiges";
break;
CASE "pms.php":
$location = "<a href="pms.php?sid=$session[hash]" target="_blank">Private Nachrichten</a>";
break;
CASE "portal.php":
$location = "<a href="portal.php?sid=$session[hash]" target="_blank">Portal</a>";
break;
CASE "profile.php":
if($wbbuserdata['canviewprofile']==1 && $this->permissioncache['canviewprofile']==1) {
$location = "<a href="profile.php?userid=$this->userid&sid=$session[hash]" target="_blank">Userprofil von $this->name</a>";
}
else $location = "Sonstiges";
break;
CASE "register.php":
$location = "<a href="register.php?sid=$session[hash]" target="_blank">Registrierung</a>";
break;
CASE "search.php":
$location = "<a href="search.php?sid=$session[hash]" target="_blank">Suche</a>";
break;
CASE "team.php":
$location = "<a href="team.php?sid=$session[hash]" target="_blank">Team</a>";
break;
CASE "thread.php":
if($this->useronlinecache['boardpermission']==1 && $this->permissioncache['boardpermission']==1 && $this->permissioncache['password']=="") {
$this->name=$this->threadcache['topic'];
$location = "Thema: <a href="./thread.php?threadid=$this->threadid&sid=$session[hash]" target="_blank">$this->name</a>";
}
else $location = "Sonstiges";
break;
CASE "usercp.php":
$location = "<a href="usercp.php?sid=$session[hash]" target="_blank">Profil bearbeiten</a>";
break;
CASE "wiw.php":
$location = "<a href="wiw.php?sid=$session[hash]" target="_blank">Wer ist wo online?</a>";
break;
DEFAULT:
$location = "Sonstiges";
break;
}
return $location;
}
}
?> |