-
Posts
2,210 -
Joined
-
Last visited
-
Days Won
47
Content Type
Profiles
Forums
Events
Everything posted by sniko
-
Try something like this: /* All the mail stuff - body - from - headers - subject */ if( mail( [parameters] ) ) echo 'sent'; else echo 'failed';
-
Set up the e-mail that you'll be using in your script, again, I may be wrong.
-
I believe, and I may be wrong, that you need to set it up, so they can talk to eachother :?
-
You mean avast, right? I'm with Avast - no problems here :)
-
Have you created [email protected] an actual e-mail on your server? Have you got the mail() function installed? Can you send a blank e-mail using PHP to your e-mail?
-
I don't believe that is an error on my part
-
What part "doesn't seem to work"
-
Untested. Change array, line 70. <?php require "globals.php"; if ($_GET['time']) { $time=$_GET['time']; } else { $time=15; } $cn=0; $lk=mysql_query("SELECT * FROM users WHERE laston>unix_timestamp()-1440*60"); $aa=mysql_num_rows($lk); $ll=mysql_query("SELECT * FROM users WHERE laston>unix_timestamp()-60*60"); $ab=mysql_num_rows($ll); $lm=mysql_query("SELECT `userid`,`gang`,`username`,`user_level`,`donator_days`,`last_login` FROM users WHERE laston>unix_timestamp()-45*60"); $ac=mysql_num_rows($lm); $ln=mysql_query("SELECT `userid`,`gang`,`username`,`user_level`,`donator_days`,`last_login` FROM users WHERE laston>unix_timestamp()-30*60"); $ad=mysql_num_rows($ln); $lo=mysql_query("SELECT `userid`,`gang`,`username`,`user_level`,`donator_days`,`last_login` FROM users WHERE laston>unix_timestamp()-15*60"); $ae=mysql_num_rows($lo); $he=mysql_query("SELECT `userid`,`gang`,`username`,`user_level`,`donator_days`,`last_login` FROM users WHERE laston>unix_timestamp()-1*60"); $hu=mysql_num_rows($he); $q=mysql_query("SELECT `userid`,`gang`,`username`,`user_level`,`donator_days`,`last_login` FROM users WHERE laston>unix_timestamp()-{$time}*60 ORDER BY laston DESC"); ?> <table width=30% cellpading='1' cellspacing='0' border=0 align=left> <tr> <td> <b>Time Selector</b> </td></tr> <td> <a href='usersonline.php?time=1'>(1 Min)</a> <a href='usersonline.php?time=15'>(15 Mins)</a> <a href='usersonline.php?time=30'>(30 Mins)</a> <a href='usersonline.php?time=45'>(45 Mins)</a> <a href='usersonline.php?time=60'">(60 Mins)</a> <a href='usersonline.php?time=1440'>(24 Hours)</a> </td> </tr> <table width=50% cellpading='1' cellspacing='0' border=0 align=left> <tr> <td class=table> <h3></h3> <td class=table> <b>Gang</b> </td> <td class=table> <b><center>User</center></b> </td> <td> <td class=table> <b>Time Online</b> </td> <td class=table> <b>Action</b> </td> </tr> <?php $donator = null; $owner = null; $staff = null; $colours = array(); /* Yeah, I'm english. This is how we spell it */ /* Change the values, add more if need be */ $colours[1] = '#000000'; $colours[2] = '#000000'; $colours[3] = '#000000'; $colours[4] = '#000000'; while($r=mysql_fetch_assoc($q)) { $la=time()-$r['laston']; $unit="secs"; if($la >= 60) { $la=(int) ($la/60); $unit="mins"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; } } $cn++; $name=$r['username']; $gangtag=$r['yourgangPREF']; if($r['donatordays'] > 0) { $donator="<img src='donator.gif' width='9%' height='9%' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; } if($r['user_level'] == 2) { /* staff is anyone with user_level > 1, perhaps change == */ $staff="<img src='staff.gif' width='8%' height='8%' alt='Game Staff' title='Staff' />"; } if($r['userid']==1) { $owner="OWNER"; /* put something for owner here */ } $r['username']="<a href='viewuser.php?u={$r['userid']}'><span style='color: {$colours[$r['user_level']]};'>$name</span> $owner $donator $staff</a>"; print "<tr> <td class=table> $cn. </td> <td class=table >"; if ($r['gang'] > 0) { print" <a href='gangs.php?action=view&ID={$r['gang']}'><small>[View]</small></a> </td>"; } else { print" <small>No Gang</small> </td>"; } print" <td class=table> {$r['username']} </td> <td class=table> ($la $unit) </td> <td class=table>"; $lb=time()-$r['last_login']; $units="secs"; if($lb >= 60) { $lb=(int) ($lb/60); $units="mins"; } if($lb >= 60) { $lb=(int) ($lb/60); $units="hours"; if($lb >= 24) { $lb=(int) ($lb/24); $units="days"; } } if($r['laston'] <= time()-15*15) { $lb="offline"; $unit=""; } print "{$lb} {$units}</td>"; if($r['hospital'] > 0) { print"<td><small>Hospital</small></td>"; } if($r['jail'] > 0) { print"<td><small>Jail</small></td>"; } if($r['hospital'] == 0 AND $r['jail'] == 0) { print"<td><small>[<a href='attack.php?uid={$r['userid']}'>Attack</a>]</td>"; } print"</tr>"; } ?> </td> </tr> </table> <table width=30% class='colortd' cellpading='1' cellspacing='0' border=0 align=left> <tr> <td class=table> <b>Statistics</b> Users online in the last minute: <?php print"{$hu}"; ?> Users online in the last 15 minutes: <?php print"{$ae}"; ?> Users online in the last 30 minutes: <?php print"{$ad}"; ?> Users online in the last 45 minutes: <?php print"{$ac}"; ?> Users online in the last hour: <?php print"{$ab}"; ?> Users online in the last 24 hours: <?php print"{$aa}"; ?> </td> <tr> </table> <table width=30% class='colortd' cellpading='1' cellspacing='0' border=0 align=left> <tr> <td class=table> <b>Legend</b> Admins = <font color=gold>Gold</font> Secretaries = <font color=blue>Blue</font> Assistants = <font color=purple>Purple</font> Members = <font color=silver>Silver</font> Staff = <img src='staff.gif'></img> Donators = <img src='donator.gif'></img> </td> <tr> </table> <?php $h->endpage(); ?>
-
Following on from this, I created this little thing to test the data-type of something, which you could integrate into your source <html> <head> <title>Try (throw) catch</title> <style type="text/css"> #error { background: #A85858; padding: 5px; border: 1px solid #804242; width: 30%; } #success { background: #458042; padding: 5px; border: 1px solid #4B8042; width: 30%; } </style> </head> <body> <?php /* * A bit of error handling - Using ttc (try throw catch) -- sniko -- 10 September 2012 */ function ttc( $pass ) { try { if( !is_array($pass) ) { throw new Exception('Please pass an array.'); } else { foreach($pass as $data_type => $value) { if( $data_type == 'int' ) { if( !is_int($value) ) { throw new Exception('Wrong data type. (int)'); } } if( $data_type == 'string' ) { if( !is_string($value) ) { throw new Exception('Wrong data type. (string)'); } } if( $data_type == 'bool' ) { if( !is_bool($value) ) { throw new Exception('Wrong data type. (bool)'); } } } } } catch(Exception $e) { return "<div id=\"error\">". $e->getMessage() ."</div>"; } } $array = array( 'int' => 3, 'string' => 'foobar', 'bool' => FALSE ); if( ttc($array) ) { echo ttc($array); } else { echo "<div id=\"success\">Success!</div> <br /> Data types are correct!"; } ?> </body> </html>
-
Yeah, but ticking ALL PRIVILEGES opens the horizons and flood gates to the dark eternity, of what we call Hell. Sorry, I went a bit epic there :p
-
True Octarine, thanks for having my 6 ;) ModernMafia, no need. Just click your user in MySQL Databases.
-
Select, Insert, Update, Delete These are the common commands used in McCodes
-
[MCcode v2] Advanced spying script [$10 USD]
sniko replied to radio_active's topic in Paid Modifications
All I can say is, time is money. It's up to the author whether they release it for free or not -
Although, it would help if you thought about the privileges you gave to the database user.
-
Just a suggestion, indent your code ;)
-
... just like a . (First thing that popped into my head when I read that ;)) @tprice88 - Looks good! Has some potential! I hope it goes well for you
-
Mind pasting the source of the process of login?
-
Ahaha! -tooshort-
-
...and peter just summed up my views in one small paragraph
-
The universe is finite, meaning it has an end. The universe is expanding, and will soon end. I don't believe the world is going to end, but I believe the universe will soon end - for sure, not in our lifetime.
-
There's quite a lot of content in the articles here.
-
It's off-topic, perhaps make a new topic? Also, there is no such thing as 'unlimited'. The universe isn't even unlimited.