Jump to content
MakeWebGames

Donator


twist_killer

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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