twist_killer Posted March 17, 2007 Share Posted March 17, 2007 This is similar to the other topic but i need to know how to show links and stuff only to donators. e.g on a players profile, u've got send cash, send mail, attack etc...so if u r a donator..it also shows add friends add enemy on thier profile...but if ur not a donator, it dosn't show. can someone plz show me how? Quote Link to comment Share on other sites More sharing options...
vinyl Posted March 17, 2007 Share Posted March 17, 2007 Re: Donator IF I understand your question as being 'why does it show'?? then it's the 'donatordays' field being greater than 0 like.... if($ir['donatordays'] > 0) { print " [[url='friendslist.php?action=add&ID={$r[']Add Friends[/url]] [[url='blacklist.php?action=add&ID={$r[']Add Enemies[/url]] [[url='mailblock.php?action=add&ID={$r[']Add Mail Block[/url]] "; } the if donatordays being the key, comment out the IF and braces, or remove, or move one of the a href's out of the IF I hope that's the answer to what I think you're asking. Quote Link to comment Share on other sites More sharing options...
lem0n Posted March 17, 2007 Share Posted March 17, 2007 Re: Donator if you want it so all members can access the friends and enemies list remove if($ir['donatordays'] > 0) { print " and that should do the trick ;) Quote Link to comment Share on other sites More sharing options...
twist_killer Posted March 17, 2007 Author Share Posted March 17, 2007 Re: Donator why did u put a <0 or whatever it is..what does it mean what if u put a <1 or >1? will this only show to donators?....if non-donators will not be able to see it then yes..thats the answer to my Q Quote Link to comment Share on other sites More sharing options...
vinyl Posted March 17, 2007 Share Posted March 17, 2007 Re: Donator lemon's answer works fine, I think that's what I had said(but remove the closing brace as well from the section I was mentioning that he pasted) the donator days are stored in that field of the user's table, like 30 days, etc, they go down by one each day, via a cron. so IF you are a donor, your donator days are more than ZERO. therfore, in the original scripts, those links won't print without the field being MORE THAN 0 in the case of friends and enemies lists...wel the scripts associated, you'd need to remove some additional code which checks to see if they are donors IF those two are wanted to be available to all. I was simply trying to explain why it shows, hence my statement"IF I understand what you're asking" in friendslist.php it also has: if($ir['donatordays'] == 0) { die("This feature is for donators only."); } so, if this script is to be used by all, that needs to go as well. http://www.w3schools.com/php/php_operators.asp check that link for help with php Quote Link to comment Share on other sites More sharing options...
twist_killer Posted March 17, 2007 Author Share Posted March 17, 2007 Re: Donator so basically...if its greater than zero...those links would come up..if its less or equal than 0 those links wont come up? dats how i want it..i guesss its bieng posted but am just asking..am i right? Quote Link to comment Share on other sites More sharing options...
vinyl Posted March 17, 2007 Share Posted March 17, 2007 Re: Donator correct, the links only get "printed" IF the user's donator days are GREATER than 0 (as originally scripted) Quote Link to comment Share on other sites More sharing options...
twist_killer Posted March 18, 2007 Author Share Posted March 18, 2007 Re: Donator thanks! Quote Link to comment Share on other sites More sharing options...
WiCkeD Posted March 19, 2007 Share Posted March 19, 2007 Re: Donator Any works, Simple really, PHP is a very techniqued format and very good :) if($ir['donatordays'] =< 0) { } OR if(!$ir['donatordays']) { } because ! stands for if its 0 (zero) on a INT format on the database, otherwise if its VARCHAR it'll choose ! if its blank. You need to know this, We wont be here forever! Well i wont anyway :-) Quote Link to comment Share on other sites More sharing options...
Vorlen Posted March 19, 2007 Share Posted March 19, 2007 Re: Donator ! means NOT directly translated. Simple as that, none of this BS about "in int format blah blah" Just say it means NOT. SO if (NOT donatordays) shorter is if(!donatordays) Hence the ease of typing. 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.