Jump to content
MakeWebGames

shoutbox function request


Nicholas

Recommended Posts

sorry about all the requests im asking for :S

but im wondering... i have tried converting it from this modification but had no luck...

Tonka's Mailbox Ignore System

i tried to convert that into a shoutbox function where players can ignore other players text on the shoutbox, so if say ID 6 ignores ID 15 on the shoutbox, all the messages ID 15 enters onto the shoutbox, ID 6 will not beable to see them until ID 6 un-ignores ID 15 from the list.

hopefully you understand what i mean... like i said i have tried creating it but well... it didnt work so i removed it completely...

and forgot what i put lol.

hope someone could help create this idea :)

Thanks, Nicholas.

Link to comment
Share on other sites

I use a method similar to the following i hope it helps

IE =>

$ql = $db->query('SELECT c.`text`, `id`, `user`,  u.`username` FROM `chat` LEFT JOIN `users` ON c.`user` = u.`userid` ORDER BY `id` DESC LIMIT 5 '); // this is a example you will need to edit this to your settings
   while ( $chat = $db->fetch_row($ql) ) { // grab query and loop

$grab_ignore = $db->fetch_row($db->query('SELECT COUNT(`id`) AS `ig_CNT` FROM `ignore` WHERE `blocked` IN('.$chat['user'].') AND `userid` = '.$userid])); // check if the grabbed user is in the blocked list of the viewing user

if ( empty($grab_ignore['ig_CNT']) ) { // if the viewing user does have the grabbed user in blocked list then do the following
# add something like echo 'ignored user spoke.';
} else { // if the viewing user doesn't have the grabbed user in blocked list then do the following
# echo text from chat...
} // end else
   } // end while

NOTE this is a example not for copy and paste (it won't work if you just copy and paste it) If you need further help just ask.

(This wasn't tested).

---

Off Topic

---

Why say your learning PHP security i mean it's just PHP i hate when people think PHP security and PHP are different things, if you learnt PHP then you should of had some good examples which were secure (don't tell me you learnt from MCC).

Link to comment
Share on other sites

---

Off Topic

---

Why say your learning PHP security i mean it's just PHP i hate when people think PHP security and PHP are different things, if you learnt PHP then you should of had some good examples which were secure (don't tell me you learnt from MCC).

changed it? happy? lol

no im not learning security from mccodes... you mad?

i learn differently than others, i dont learn by just reading, i learn by looking/reading. if thats understandable...

i paid someone to secure my site and i learnt from that... for example...

mysql_query("UPDATE users SET money=money+".abs(intval($rand['money']."));

$rand can be anything... $_GET, $_POST, $ir, $r, etc... lol.

im also learning security by looking at the mods on this forum that are created by everyone.

 

also that script you put up, is abit confusing for me lol, im not a professional...

Link to comment
Share on other sites

that's a simple solution... just MCC makes people a bit thick (no offence), i did explain it in the comments, just need to know if it worked or not.

 

mysql_query("UPDATE users SET money=money+".abs(intval($rand['money']."));

$rand can be anything... $_GET, $_POST, $ir, $r, etc... lol.

yes obviously $rand could be anything that's why you check what $rand is in the first place and considering if it's something like

$rand = rand(1,10);

then there is no need for abs intval in my eyes...

Link to comment
Share on other sites

Guest Drizzle

Nick, if you could give me a sample of what your shoutbox uses as far as table names and rows, im sure it'll be much easier to help you. Ill be glad to make it for you

Link to comment
Share on other sites

The answer is above... i hope i won't have to spoon feed you, this is a learning forum i suggest you do some. This is a bit harsh but when you say your learning i expect you to do at least some of the work, Considering you only have to use the method shown it shouldn't be so difficult really.

Drizzle thanks for the offer but people have to learn and Nicholas constantly posts requests so im sure if he does the work himself once he may not need to post another request next time and expect others to do his work for him plus im sure the feeling of accomplishment without being spoon fed will help him mature with PHP.

No offence intended there Nicholas but we can't do it all for you, Good luck.

Link to comment
Share on other sites

The answer is above... i hope i won't have to spoon feed you, this is a learning forum i suggest you do some. This is a bit harsh but when you say your learning i expect you to do at least some of the work, Considering you only have to use the method shown it shouldn't be so difficult really.

Drizzle thanks for the offer but people have to learn and Nicholas constantly posts requests so im sure if he does the work himself once he may not need to post another request next time and expect others to do his work for him plus im sure the feeling of accomplishment without being spoon fed will help him mature with PHP.

No offence intended there Nicholas but we can't do it all for you, Good luck.

yes i see what you mean, but before i even post these requests up, i do try it myself with research.

but if i get stuck or cant do it, i ask for a request to ask someone to create and sell it me or create and tell me the coding kindly. (hope didnt say this line werid lol)

also i am learning but im not a fast learner. nither am i a easy to teach lol.

im learning security bit by bit. probably not professionally but its still techically security lol.

i cant learn by just reading from sites like PHP.NET or whatever the site is...

i have to read/look at already made scripts to learn, im techically a copy and learn learner (if thats understandable, lol)

im also having stupid problems with the mailbox ignore list mod, the function doesnt work correctly...

ive even put up the working function someone posted but still dont work lol.

i posted up a request for 150% energy mod on here while ago, i figured out how to do that on my own

Link to comment
Share on other sites

$ql = $db->query('SELECT c.`text`, `id`, `user`,  u.`username` FROM `chat` LEFT JOIN `users` ON c.`user` = u.`userid` ORDER BY `id` DESC LIMIT 5 '); // this is a example you will need to edit this to your settings
   while ( $chat = $db->fetch_row($ql) ) { // grab query and loop

   $grab_ignore = $db->fetch_row($db->query('SELECT COUNT(`id`) AS `ig_CNT` FROM `ignore` WHERE `blocked` IN('.$chat['user'].') AND `userid` = '.$userid])); // check if the grabbed user is in the blocked list of the viewing user

if ( empty($grab_ignore['ig_CNT']) ) { // if the viewing user does have the grabbed user in blocked list then do the following
   # add something like echo 'ignored user spoke.';
} else { // if the viewing user doesn't have the grabbed user in blocked list then do the following
   # echo text from chat...
} // end else
   } // end while

what don't you understand in that, use php.net for looking up functions and so forth ie(while, empty) then use a mysql reference website ie(count or in clause).

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