PDA

View Full Version : new user group


Darkwolf
01-03-2003, 12:19 PM
how to make a new user group to be able to bold and italic like an admin..

anybody ?

Xenon
01-03-2003, 08:39 PM
just create a new usergroup and then in index.php (or online.php depends on where you want to have it)

find:if ($loggedin['usergroupid'] == 6 and $highlightadmin) {
$username = "<b><i>$loggedin[username]</i></b>";
and change to:
if (in_array($loggedin['usergroupid'], array(6,XX)) and $highlightadmin) {
$username = "<b><i>$loggedin[username]</i></b>";
replace xx with the new usergroupid

TECK
01-04-2003, 04:58 PM
You like that in_array thingie Stefan. :)
Me to, is a tip from Chen I got... saves alot of code to be written.

Xenon
01-04-2003, 09:45 PM
hehe yes Floren, and also it looks much better and is much easier to update :)

The first time i saw it in my small PHP-book i knew i'd use it as much as possible :)

DrkFusion
01-04-2003, 09:53 PM
Where can I learn the uses of in_array and other stuff :) I want to increase my php:)

Please and Thanks

Xenon
01-04-2003, 10:01 PM
well, learning by doing ;)

just look into hacks and coding parts of other good coders to learn from them.

That's what i did, when new codes from PPN, Chen or Flore for example came up :)

also php.net can help sometimes ;)

DrkFusion
01-04-2003, 10:07 PM
See this code
if (in_array($loggedin['usergroupid'], array(6,XX)) and $highlightadmin) {
$username = "<b><i>$loggedin[username]</i></b>";

Can I change to
if (in_array($loggedin['usergroupid'], array(6,$var)) and $highlightadmin) {
$username = "<b><i>$loggedin[username]</i></b>";
and
$var is 12,23?
If so, then I got a new hack coming up :-p
*Copyright, registered, patent & pending :p*

NTLDR
01-04-2003, 10:09 PM
I couldn't agree more with what Xenon said, its supprising how much you can pickup and learn from installing hacks and just by playing with code to make even minor changes :)

Xenon
01-04-2003, 10:11 PM
:) NTLDR

@Arunan:
Nope, as i know this would genererate an array with two entries, one has the entry "6" and the other one has the entry "12,23"
it will handle the $var as a string ...

for usch things use the explode function look for systax in php.net or in some vb-files ;)

DrkFusion
01-04-2003, 10:12 PM
You are right, but sometimes it takes more then usual to figure out the EXACT (bold, and underline) function of anything, by just looking at the code.

Darkwolf
01-05-2003, 01:42 PM
Xenon i can't find the code that u gave me

if ($loggedin['usergroupid'] == 6 and $highlightadmin) {
$username = "<b><i>$loggedin[username]</i></b>";

Xenon
01-06-2003, 07:37 AM
in online.php it's this code to search for:
if ($user['usergroupid'] == 6 and $highlightadmin) {
$userinfo["$key"]['username'] = "<b><i>$user[username]</i></b>";

Darkwolf
01-06-2003, 07:57 AM
and replace with the code u gave to me?

Xenon
01-06-2003, 09:37 AM
yeah, just change the varnames:
if (in_array($user['usergroupid'],array(6,XX)) and $highlightadmin) {
$userinfo["$key"]['username'] = "<b><i>$user[username]</i></b>";