Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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.

Posted

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 ;)

Posted

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

Posted

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

Posted

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?

Posted

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 :-)

Posted

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.

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