Jump to content
MakeWebGames

jail/hosp shoutbox


seanybob

Recommended Posts

add to jail.php (somewhere where you want it to display)

You're unable to view this code.

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

 

 

create file jailshout.php

You're unable to view this code.

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

 

 

create a blank text file called jailshouts.txt

add to a daily cron

You're unable to view this code.

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

 

 

Basically, it adds a shoutbox to the bottom of your jail. People can post in it, it is stored in a text file (NOT DATABASE)... every day (if you added the cron) the file is reset to blank, so the shoutbox is cleared.

If anyone wants to edit this to make it so its posted to a database, feel free to add that here!

To make this work for hospital... do everything the same, just rename everything to hosp or hospital :)

Link to comment
Share on other sites

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Re: jail/hosp shoutbox

yeah it works good but i am not gonna stay with it.Nothing against Seanybob.But whats to stop people from psting adverts to other games.Unless there is something i have overlooked.I dont see an admin function to clear this.If i was to post www.somegamename.com right after the day cron passes it would be there till next day if i didnty change the cron.got any ideas on how to prevent this?Cause i do like the feature

Link to comment
Share on other sites

Re: jail/hosp shoutbox

 

yeah it works good but i am not gonna stay with it.Nothing against Seanybob.But whats to stop people from psting adverts to other games.Unless there is something i have overlooked.I dont see an admin function to clear this.If i was to post www.somegamename.com right after the day cron passes it would be there till next day if i didnty change the cron.got any ideas on how to prevent this?Cause i do like the feature

You... are hilarious ;P

if you want to stop them from adverting other games, just set up an eregi statement, or a search string or something that looks for www, com, net, etc...if it finds it, it sends ID 1 an event with the full text the user was trying, along with their ID number, if it doesnt, it posts it...

I'm not gonna do all your work for ya m8 :)

admin function to clear it? Aye caramba... you can either open up the text file and delete it, or run the cron manually (as boggl said), or make your own admin function :P

Link to comment
Share on other sites

Re: jail/hosp shoutbox

 

yeah it works good but i am not gonna stay with it.Nothing against Seanybob.But whats to stop people from psting adverts to other games.Unless there is something i have overlooked.I dont see an admin function to clear this.If i was to post www.somegamename.com right after the day cron passes it would be there till next day if i didnty change the cron.got any ideas on how to prevent this?Cause i do like the feature

In that i dont think i ever asked got you to do it now did i? :wink:

:-P

Link to comment
Share on other sites

Re: jail/hosp shoutbox

i copyed all files right and such i get this error

Warning: fopen(jailshouts.txt) [function.fopen]: failed to open stream: Permission denied in /home/deeznuts/public_html/jailshout.php on line 21

Warning: fwrite(): supplied argument is not a valid stream resource in /home/deeznuts/public_html/jailshout.php on line 28

Warning: fclose(): supplied argument is not a valid stream resource in /home/deeznuts/public_html/jailshout.php on line 29

 

Can anyone help?

Link to comment
Share on other sites

  • 4 months later...

Re: [mccode] jail/hosp shoutbox

 

ok got a small problem the mod works great love it but my problem is that know one can see it but staff..not sure why can any one help?

thank for the free mods

My best guess would be your variables in the database for jail time and hospital time have different names.

To check:

Open up phpmyadmin.

Browse the users table.

Search for the word jail.

Search for the word hospital.

You should find a couple fields that should be pretty simple to understand. One will say jailreason/jailtext(varchar 255) or something like that, the other will just be jail/jailtime (int 11)

Make sure you use the correct variable here

if($ir['jailtime']>0 || $ir['user_level']==2)

{include_once("jailshout.php");}

Link to comment
Share on other sites

  • 5 weeks later...

Re: [mccode] jail/hosp shoutbox

Well instead of putting it onto the jail.php I've put it on the index.php, and instead of

You're unable to view this code.

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

I've put

You're unable to view this code.

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

 

(I have called it shoutbox.php and changed the necessary things for it, yet when I post it still doesn't work :'-(

Link to comment
Share on other sites

Re: [mccode] jail/hosp shoutbox

Disregard last message...I got it working...My browser for some stupid reason doesn't accept the pressing of the ENTER key on the keyboard. When I press enter after typing in the shoutbox, it just refreshes the page O_o...Yet to figure out why!! :-P

Link to comment
Share on other sites

  • 1 month later...

Re: [mccode] jail/hosp shoutbox

or maybe you could even add a ban feature so you have some kind of control with abusive users in the jailshout. this is for any Noobs as i know the rest will already know how to do this.

open up jailshout.php look for this line of code

if ($message != "") then under that add

if($ir['userid'] == 0 || $ir['userid'] == 0)

{

die("<font color=red size=+1>Banned

 

You have been banned from chat for the folowing reasons

[*]Using black in your name

[*]Using a color that site owners dont like

[*]You were given a warning about your name

[*]Abusive language to others

[*]Flooding the chat with Marquees or similar content

[*]Advertising other games

 

 

 

Contact me ID 1 to get out of blocked</font>

 

");

}

just change the 0 in if($ir['userid'] == 0 to whatever id u want to ban. add as many extra || $ir['userid'] == 0) as u need remembering to just use ) once at the last bit of code.

hope that helps some of you.

:mrgreen:

Link to comment
Share on other sites

Re: [mccode] jail/hosp shoutbox

 

i'm not questioning seany's expertise but i just changed the $ir['user_level']==2)

to $ir['user_level'] > 0) to make everyone see the shout. just thought that might be easier for Noobs like me to follow. :-)

Silly ;P

If I remember correctly, the shoutbox is only visible to those in jail. The $ir['user_level']==2 means that in addition to those who are in jail, Admins can always see it (regardless of being in jail or not)

Link to comment
Share on other sites

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...