Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 36

155.94.x.x news
178.255.x.x forum
216.244.x.x user
40.77.x.x download
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
54.36.x.x forum
54.36.x.x user
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x comment
54.36.x.x forum
54.36.x.x forum
54.36.x.x dilbertplus
54.36.x.x forum
54.36.x.x forum
54.83.x.x forum
77.75.x.x forum
91.242.x.x forum

Last Seen

mrstipfan Wed 19:48
Gagi2 Mon 16:30
EFiNST0RM Sun 15:39
85filip58 Sun 12:14
brlight Tue 04:18

Newest Members

Forums
Admin online LED
Xsfd (M.D.A)
Thu Nov 03 2011, 05:10PM

Posts: 90
Joined: Wed Aug 18 2010, 10:42AM
Registered Member #6225
how to make a "Admin is on the server" indicator from txt file?

until I thought of only to this:



$admin = file_get_contents("players/admin.txt", true); 
$admin = str_replace("\r", "", $admin); 
$admin = explode("\n", $admin);


           if (in_array($player['name'], $admin)) 
            {  $top1 .= " 
                  <img alt='' src='{$lgsl_url_path}/other/admin.png' style='position:absolute; z-index:3; left:0%; top:95px;' title='{$lgsl_config['text']['vsd']}' style='border:none; vertical-align:middle' />
           "; }



but not work((
--------------------
каким образом можно реализовать индикатор присутствия админов из txt файла?




Но это не работает((






Website
Elite_Marines
Fri Nov 04 2011, 05:17AM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872
I would use an array in the php file instead of a txt file if possible. You could do something like


$admins = array("admin1","admin2");

if(in_array .....

etc

If you really need to use the file method try something like this.

// This gets the file and creates an array with each line...
// If you get file not found errors try using a direct link with http://yoursite.com/.../.../players/admin.txt 
// Then remove the true flag
$admins = file("players/admin.txt",true);

if (in_array($player['name'], $admin))  
    {  
        $top1 .= "<img alt='' src='{$lgsl_url_path}/other/admin.png' style='position:absolute; z-index:3; left:0%; top:95px;' title='{$lgsl_config['text']['vsd']}' style='border:none; vertical-align:middle' />"; 
    
    } 

I have not tested this so I have no idea if it will work. This should work if your admins.txt file has this structure:

admin1
admin2
admin3
admin4

let me know if this works for you



Website
Randolph
Wed Apr 18 2012, 01:14AM
Posts: 1
Joined: Wed Apr 18 2012, 12:48AM
Registered Member #7198
Yes but you will need a little circuit smd 5050 to isolate the inputs. Basically 12v led lights a transistor that says if dome light switch closed (door open), then open circuit to music input and power through dome light switch. Conversely, led flexible if dome light switch is open (door closed), power through music system. It's easy and you can find schematics online for free.
Dodgeitorelse
Wed Apr 18 2012, 06:09PM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
ummm just a little off target Randolph


lack of effort on your part requires less effort on my part
Website
MadMakz
Thu Apr 19 2012, 12:01PM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
don't feed the bot!

anyway, plain text is easier to maintain. add/remove just goes a bit faster. ^^

OP: you definently don't want the ", true" in file_get_contents("players/admin.txt", true);
file_get_contents("players/admin.txt"); is all you need.

also remember that you'll have to put your txt file in lgsl_files/players/ folder since you're using a relative path and edit lgsl_details.php wich resides inside lgsl_files for example.


SpiffyTek
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org