-
Notifications
You must be signed in to change notification settings - Fork 0
/
links.php
65 lines (53 loc) · 1.71 KB
/
links.php
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
<?php
error_reporting(E_ALL & ~E_DEPRECATED);
session_start();
/* Classes importeren */
include_once('Classes/User.php');
include_once('Classes/Template.php');
/* Includes importeren */
include_once('Includes/connect.php');
include_once('Includes/slashes.php');
/* Classes initialiseren */
$cUser = new User();
$cTPL = new Template('Templates/main.tpl');
/* Verbinding met de database maken */
connectDB();
$cTPL->setPlace('TITEL', 'Link partners');
/* Controleren of je bent ingelogd en of je admin bent */
if (($cUser->checkSession()) || ($cUser->checkCookie())) {
$cTPL->setBlock('LOGIN', 'logout');
$cTPL->setBlock('FORUMLINKS', 'forumingelogd');
if (2047 & $cUser->m_iPermis) {
$cTPL->parse();
$cTPL->setBlock('ADMIN', 'admin');
$cTPL->setBlock('FORUMADMIN', 'forumadmin');
}
} else {
$cTPL->setBlock('LOGIN', 'login');
$cTPL->parse();
$cTPL->setPlace('THISPAGE', $_SERVER['PHP_SELF']);
$cTPL->setBlock('FORUMLINKS', 'forumnormaal');
}
/*De pagina zelf */
$cTPL->setFile('CONTENT', 'Templates/links.tpl');
$cTPL->parse();
$sQuery = "SELECT linkid, link, incomming, outcomming FROM links ORDER BY link;";
if ($cResult = mysql_query($sQuery)) {
$sBG = '';
while ($aData = mysql_fetch_assoc($cResult)) {
if ($sBG == '') {
$sBG = 'img/patroon.gif';
} else {
$sBG = '';
}
$cTPL->setBlock('LINK', 'link');
$cTPL->parse();
$cTPL->setPlace('ID', $aData['linkid']);
$cTPL->setPlace('LINKNAAM', $aData['link']);
$cTPL->setPlace('IN', $aData['incomming']);
$cTPL->setPlace('UIT', $aData['outcomming']);
$cTPL->setPlace('BG', $sBG);
$cTPL->parse();
}
}
$cTPL->show();