Admin kleur met phpmylogon
hoe kan ik met phpmylogon in memberlist.php de admin een andere kleur geven dan de rest?
Code (php)
1
2
3
4
5
2
3
4
5
<table border='1'>
<tr>
<td><b>Status:</b></td>
<td><b><?= $memberlist_username ?>:</b></td>
</tr>
<tr>
<td><b>Status:</b></td>
<td><b><?= $memberlist_username ?>:</b></td>
</tr>
Code (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
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
<?php
$sql = "SELECT name,active,state FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
// print the output
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
$state = htmlspecialchars($row->state);
$number = $number + 1;
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"red\">NOT ACTIVE</font></td>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"blue\">ADMIN!</font></td>\n"; // deze
echo "<td><font color=\"blue\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><font color=\"green\">ACTIVE</font></td>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}
}
?>
$sql = "SELECT name,active,state FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
// print the output
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
$state = htmlspecialchars($row->state);
$number = $number + 1;
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"red\">NOT ACTIVE</font></td>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"blue\">ADMIN!</font></td>\n"; // deze
echo "<td><font color=\"blue\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td><font color=\"green\">ACTIVE</font></td>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}
}
?>
Gewijzigd op 01/01/1970 01:00:00 door GaMer B
edit: hij pakt hem niet:S
Code (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
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
<?php
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Page for viewing all members
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
echo "<html><head>";
echo "<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">";
echo "</head><body>";
?>
<table>
<tr>
<d><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"Red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"orange\">ADMIN!</font></td>\n"; // deze
echo "<td><font color=\"orange\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?
include("htmlbottom.php");
?>
###################################
## PHPMYLOGON: A LOGIN SYSTEM ##
## (c) 2006 Jorik Berkepas ##
## Under the GNU GPL license ##
## [email protected] ##
###################################
// Page for viewing all members
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
echo "<html><head>";
echo "<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">";
echo "</head><body>";
?>
<table>
<tr>
<d><b><?= $memberlist_username ?></b></td>
</tr>
<?
$sql = "SELECT name,active FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"Red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"orange\">ADMIN!</font></td>\n"; // deze
echo "<td><font color=\"orange\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}
}
?>
</table>
<p />
<small><?= $memberlist_deactusernote ?></small>
<?
include("htmlbottom.php");
?>
Gewijzigd op 01/01/1970 01:00:00 door Remco van Lent
waar staat trouwens de while loop??
Edit:
Een tijd geleden heb ik heel php my logon is doorgenomen en verbeterd op punten waar ik vond dat het nodig was, en ik heb deze code in mijn memberlist.php
Een tijd geleden heb ik heel php my logon is doorgenomen en verbeterd op punten waar ik vond dat het nodig was, en ik heb deze code in mijn memberlist.php
Code (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
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
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Deze pagina genereerd een overzicht van alle leden
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
?>
<b>Ledenlijst</b><br />
<br />
<?php
$sql = "SELECT name,active,state FROM ".$db_tbl." ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query))
{
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if(htmlspecialchars($row->state) == 5)
{
$rang = 'Admin';
}
elseif(htmlspecialchars($row->state) == 1)
{
$rang = 'Moderator';
}
else
{
$rang = 'Member';
}
if($active == 0)
{
echo '<font color="gray">'.$name.' ('.$rang.')</font>';
}
else
{
echo $name.' ('.$rang.')';
}
echo "<br />\n";
}
?>
<p />
<small>Leden die in het grijs zijn weergeven, zijn momenteel gedeactiveerd</small>
<?
include("htmlbottom.php");
?>
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Deze pagina genereerd een overzicht van alle leden
include_once("config.php");
include_once("lang/lang_".$lang.".php");
$pml_title = $site_name;
include("htmltop.php");
include_once("connect.php");
?>
<b>Ledenlijst</b><br />
<br />
<?php
$sql = "SELECT name,active,state FROM ".$db_tbl." ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query))
{
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
if(htmlspecialchars($row->state) == 5)
{
$rang = 'Admin';
}
elseif(htmlspecialchars($row->state) == 1)
{
$rang = 'Moderator';
}
else
{
$rang = 'Member';
}
if($active == 0)
{
echo '<font color="gray">'.$name.' ('.$rang.')</font>';
}
else
{
echo $name.' ('.$rang.')';
}
echo "<br />\n";
}
?>
<p />
<small>Leden die in het grijs zijn weergeven, zijn momenteel gedeactiveerd</small>
<?
include("htmlbottom.php");
?>
Om de admin een kleurtje te geven zou je dus dit kunnen doen:
Code (php)
Gewijzigd op 01/01/1970 01:00:00 door PHP Newbie
is het misschien mogelijk dat jij je herschreven versie online zet dat ik en ook andere er gebruik van kunnen maken?
Waarom? Je kunt toch gewoon PHPMyLogon gebruiken?
EN je moet wel de state uit de database halen (zit bij phpmylogon)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$sql = "SELECT name,active,state FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
$state = htmlspecialchars($row->state);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"Red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"orange\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}
}
?>
$sql = "SELECT name,active,state FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
$state = htmlspecialchars($row->state);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"Red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"orange\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}
}
?>
Nu zou het moeten werken.
Gewijzigd op 01/01/1970 01:00:00 door GaMer B
edit: het werkt nog niet:S
Code (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
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
<?php
echo "<html><head>";
echo "<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">";
echo "</head><body>";
$sql = "SELECT name,active,state FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
$state = htmlspecialchars($row->state);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"Red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"orange\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}
}
?>
echo "<html><head>";
echo "<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">";
echo "</head><body>";
$sql = "SELECT name,active,state FROM `".$db_tbl."` ORDER BY name ASC";
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$name = htmlspecialchars($row->name);
$active = htmlspecialchars($row->active);
$state = htmlspecialchars($row->state);
if($active == 0) {
echo "<tr>\n";
echo "<td><font color=\"Red\">".$name."</font></td>\n";
echo "</tr>\n";
}else{
echo "<tr>\n";
echo "<td>".$name."</td>\n";
echo "</tr>\n";
}elseif ($state == 1){
echo "<tr>\n";
echo "<td><font color=\"orange\">".$name."</font></td>\n"; // of deze
echo "</tr>\n";
}
}
?>
Gewijzigd op 01/01/1970 01:00:00 door Remco van Lent