Newbie Posted February 4, 2014 Share Posted February 4, 2014 (edited) add this into classes You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and add this where you want it to show You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. sql You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. announcement.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited February 4, 2014 by Newbie Quote Link to comment Share on other sites More sharing options...
Raven1992 Posted February 4, 2014 Share Posted February 4, 2014 test this out looks good Quote Link to comment Share on other sites More sharing options...
SRB Posted February 4, 2014 Share Posted February 4, 2014 I wonder about the logic on this, slightly. You only test for 1 or 0, then display 0 if you have non, or 1 if you have 1... or 2... or 3... see where I'm going with this? Surely, the code for the menu link should look like this (Keeping your tags in place) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. The above will display how many announcements you have, which means an edit to the posting announcement part too; From: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. To: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Vaz Posted February 4, 2014 Share Posted February 4, 2014 Absolutely nothing wrong with the logic, it checks if there are new announcements (1) or if there aren't (0) The only thing is that if there are new announcements it might be an idea to use "[new]" rather than "[1]" But there's nothing wrong with the logic Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted February 4, 2014 Share Posted February 4, 2014 Absolutely nothing wrong with the logic, it checks if there are new announcements (1) or if there aren't (0) The only thing is that if there are new announcements it might be an idea to use "[new]" rather than "[1]" But there's nothing wrong with the logic Well I see exactly where guest is coming from. Why only set the announcements to 1 when you can display how many they actually have? What if they dont log in for a week or two? Quote Link to comment Share on other sites More sharing options...
Vaz Posted February 4, 2014 Share Posted February 4, 2014 Well I see exactly where guest is coming from. Why only set the announcements to 1 when you can display how many they actually have? What if they dont log in for a week or two? Still going to be notified of the new announcement(s), like I said, Announcements [new] or [##] is probably more appropriate than Announcements [1], but there is nothing wrong with the logic Quote Link to comment Share on other sites More sharing options...
SRB Posted February 4, 2014 Share Posted February 4, 2014 (edited) Still going to be notified of the new announcement(s), like I said, Announcements [new] or [##] is probably more appropriate than Announcements [1], but there is nothing wrong with the logic Then your logic in itself is quite flawed. Imagine a Math problem, where you need to equate the value of X, where; You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. X, in this case 1, should never be reflective of multiple occurrences. Of course, you pointed something out - if they chose "new" instead of "1", then it would be valid, but the second you enter a number, you are telling the user it's a numeric count, which this is not. So as you said, either something to the effect of "new" is required, or as I said, the logic is wrong and if you're showing numberic, show the value. If the logic is not wrong, do we assume that; * if you have 21 new messages, we should just use "Messages [1]"? * if you have 325 events, "Events [1]", is therefore a valid output, that seems logical? No, it seems illogical all of a sudden? Yeah, I thought it would. Edited February 4, 2014 by Guest Quote Link to comment Share on other sites More sharing options...
Newbie Posted February 4, 2014 Author Share Posted February 4, 2014 thank you guest for pointing that out. I have updated original post so you have used the code then please update new code Quote Link to comment Share on other sites More sharing options...
Vaz Posted February 4, 2014 Share Posted February 4, 2014 Keep your hair on friend Quote Link to comment Share on other sites More sharing options...
SRB Posted February 5, 2014 Share Posted February 5, 2014 Keep your hair on friend My hair is very firmly connected to my head, Sir. I just feel the need to correct people who try to shoot holes in MY logic, with their own, which doesn't fit in line with how the internet standards have been set. Imagine loading gmail and seeing "Inbox (1)", but having 200+ emails in there, unread. How long until you move to another provider, such as outlook, where 200 messages shows as "Inbox (200)"? Quote Link to comment Share on other sites More sharing options...
Vaz Posted February 5, 2014 Share Posted February 5, 2014 All I meant with my original post was that it seems to have been intended simply to notify users of new announcements, not necessarily how many, in which case however, [new] would have been more appropriate than [1], but there's no point in crying over spilt milk No need to get so worked up about it, it's frightfully ungentlemanly Quote Link to comment Share on other sites More sharing options...
SRB Posted February 5, 2014 Share Posted February 5, 2014 it's frightfully ungentlemanly I'm female and currently on "the rag" - it could be forgiven for not being man-like, I guess ;P Quote Link to comment Share on other sites More sharing options...
Vaz Posted February 5, 2014 Share Posted February 5, 2014 Lol, a plausible explanation Quote Link to comment Share on other sites More sharing options...
Zettieee Posted March 16, 2014 Share Posted March 16, 2014 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Should be: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
DAMINK Posted October 15, 2014 Share Posted October 15, 2014 if($user_class->announcement > 0) { $update = mysql_query("UPDATE `grpgusers` SET `announcement` = 0 WHERE `id` = '".$user_class->id."'"); } Im curious. Given you do not include the sql to create the column announcement in the grpgusers table is that assumed? What i mean is, does grpg come out standard with that column? If it doesnt then i am confused as to how this would actually work correctly. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted October 15, 2014 Share Posted October 15, 2014 Im curious. Given you do not include the sql to create the column announcement in the grpgusers table is that assumed? What i mean is, does grpg come out standard with that column? If it doesnt then i am confused as to how this would actually work correctly. Hmm not too sure. What you can do is use some magic in the user class with __set and __get Quote Link to comment Share on other sites More sharing options...
DAMINK Posted October 15, 2014 Share Posted October 15, 2014 I was just wondering incase someone else uses this and finds it does not work. Making the column is how i got this to work so i guess i was suggesting to the OP that this should be included in the sqls. Unless ofcourse the column is supposed to be in the default gRPG table and i was unaware. Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted October 15, 2014 Share Posted October 15, 2014 this is my old mod and yea you are right i forgot to add the sql part You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.