Jump to content
MakeWebGames

Recommended Posts

Posted

Hello, Well i don't know if anyone els has put this on the forums but hey :P

This is a simple mod that put's any other id witch is not id 1who becomes admin in fed for 300 days ( you can change the day's to what you like )

And also stops id1 from getting put into fed.

So open up

cron_minute.php

and find

?>

then add this above it.

$db->query("UPDATE users SET fedjail=300 WHERE user_level=2");

$db->query("UPDATE users SET fedjail=0 WHERE userid=1");

 

I don't really care if this is noobish but it will help protect a site from auto admin hacks and what not........

Yes its not the best but it will help a new game owner :evil:

 

Or

Add this in your header.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Thanks to Joshua for showing us this and thanks to crimegame for making this. :love:

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Well it will auto fed admins that are not id 1 yes but if you need more admin's ( witch you only should have one )

Just add this to cron_min.php

$db->query("UPDATE users SET fedjail=0 WHERE userid=2");

just change the userid=2 to the other admins id.

Posted
That will fed them then unfed them if they are user 1.

 

That's the thing is dose not fed any id that's in this code below

$db->query("UPDATE users SET fedjail=0 WHERE userid=1");

 

Why not:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Hmm good point never thought of it that way, dose that way work?
Posted
kind of pointless cause i have 5admins and if it unjailed and fedded them every minute wouldn't that slow my game down?

It dose not fed them then unfed them

test it out it keeps the id's that you have in this bit of code out of fed

$db->query("UPDATE users SET fedjail=0 WHERE userid=1");

so lets say all your admins were id 1,2,3,4,5

just do this for each id

$db->query("UPDATE users SET fedjail=0 WHERE userid=1");

$db->query("UPDATE users SET fedjail=0 WHERE userid=2");

$db->query("UPDATE users SET fedjail=0 WHERE userid=3");

$db->query("UPDATE users SET fedjail=0 WHERE userid=4");

$db->query("UPDATE users SET fedjail=0 WHERE userid=5");

Also for the slowing of your game ermm tbh really it may or may not because you have so many admin's

Posted

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

As you can see, it will fed then un-fed userid 1 :)

Yes but........ if you test it out its dose not fed them....

 

it does that every minute tho all admins are user level to so it'll fed them then it'll unfed all that are aloud right

Same for you test it give feed back then tell me what you think.
Posted

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

As you can see, it will fed then un-fed userid 1 :)

Yes but........ if you test it out its dose not fed them....

 

it does that every minute tho all admins are user level to so it'll fed them then it'll unfed all that are aloud right

Same for you test it give feed back then tell me what you think.

Technically it does, but all of the queries must be done before the page can load (if i'm not mistaken) so before the page loads fully, you will be unfedded.

Posted
it does that every minute tho all admins are user level to so it'll fed them then it'll unfed all that are aloud right

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

As you can see, it will fed then un-fed userid 1 :)

Yes but........ if you test it out its dose not fed them....

 

it does that every minute tho all admins are user level to so it'll fed them then it'll unfed all that are aloud right

Same for you test it give feed back then tell me what you think.

Technically it does, but all of the queries must be done before the page can load (if i'm not mistaken) so before the page loads fully, you will be unfedded.

Meh that is correct but the admins will not know that they have been fedded then un-fedded >.<

Alright I'm still new at coding and learning :) I wanted to make sure about that. and would this slow your game down

Not really been tested with 6 admins now and i haven't seen my site get slower

Posted

Or just use an array system in header, why burn up crons?

 

$x = $ir['user_level'];

if($x = 2 && $ir['userid'] != 1)

{

$db->query("UPDATE `users` SET `fedjail`=300 WHERE `userid`=".$ir['userid']."");

}

 

Not to mention, if you stick it in header, you aren't waiting a full minute it's instant on page load. Someone in staff panel that knows what they are doing can do quite a bit of damage in 1 minute ;-)

 

Tho even that's pretty dumb ^ but better than using cron minute.

Easier to just use a seperate user_level system than the default mccodes and run an outside the "users" table check

Never did like the Mc user level set up.

Posted

LOL

so lets say all your admins were id 1,2,3,4,5

just do this for each id

$db->query("UPDATE users SET fedjail=0 WHERE userid=1");

$db->query("UPDATE users SET fedjail=0 WHERE userid=2");

$db->query("UPDATE users SET fedjail=0 WHERE userid=3");

$db->query("UPDATE users SET fedjail=0 WHERE userid=4");

$db->query("UPDATE users SET fedjail=0 WHERE userid=5");

Although the entire idea is pretty lame, that made me laugh ;)

$db->query("UPDATE `users` SET `fedjail`=0 WHERE `userid`=***in_array???***");

Better than using 5 differant queries when 1 can do the job.

Posted

@ Joshua

Well that's another way but meh am not that good ^_^

Like i said this is mostly for new game owners having trubble with copy + paste noob's >.<

Its not grate but it will help some people ( i hope )

Posted

heck, could even add this simple statement in header and it would work tho bleh

if($ir['user_level'] = 2 && $ir['userid'] != 1)

{

$db->query("fedjail stuff");

}

Posted
LOL
so lets say all your admins were id 1,2,3,4,5

just do this for each id

$db->query("UPDATE users SET fedjail=0 WHERE userid=1");

$db->query("UPDATE users SET fedjail=0 WHERE userid=2");

$db->query("UPDATE users SET fedjail=0 WHERE userid=3");

$db->query("UPDATE users SET fedjail=0 WHERE userid=4");

$db->query("UPDATE users SET fedjail=0 WHERE userid=5");

Although the entire idea is pretty lame, that made me laugh ;)

$db->query("UPDATE `users` SET `fedjail`=0 WHERE `userid`=***in_array???***");

Better than using 5 differant queries when 1 can do the job.

Ohh well i don't think like that ;) because i only have 1 admin ( me )

so when he asked a Q i had to come up with something :D

Posted

Zero posted a decent array set up you could use in header :p

 

if ( $ir['user_level'] > 1 && !in_array($userid, array(1,2,4,6,8)) ) { // the array could be set in settings so and edited simply when new staff are made/promoted.

{

$db->query("FED JAIL STUFF");

}

Simple, yet efficient

Posted

@ Anthony

The problem with your logic is you are now going to run 5 extra queries every minute.

This will not only slow down your site, and overload your server with uneccessary junk, but it's all about efficiency ;)

 

just stick a code in header that runs the check and does what needs to be done.

Posted

@ Joshua

i am only running 1 querie :P

But i could see the problem if someone has more than one admin :/

 

On well ill add that header code in the first post so lazy people can get to it faster >.<

Posted

The code you re-posted was actually a simple post CrimeGame added, so I can't take credit for it :)

 

I use something a bit differant but his works just as well and is faster than doing multiple queries.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...