PDA

View Full Version : Adding an Image next to Username on Postbit


Dannyloski
06-25-2007, 10:48 PM
Hey Guys,

I wanna make an addon to the Cyb - PayPal Donate Hack (LINK (https://vborg.vbsupport.ru/showthread.php?t=122997)). What I want my addon to do is to add an image next to a member's username in the postbit (postbit_legacy) template after their donation has been "confirmed" by the Admin.

Basically, its something similar to what the v3 Arcade Hack has done. On this hack after a user wins a Championship for a game, he/she will receive a trophy image next to their username in the postbit (postbit_legacy) template ... So bascally I wanna do this, but instead make it so that it adds the image after a user's donation is "confirmed" ... Is this possible?

So far I have this ...

<!-- Donation Hack Image Addon -->
<if condition="DONT_KNOW_WHAT_TO_PUT_HERE"><a class="bigusername" href="misc.php?do=donlist"><img src="images/donate.gif" align="absmiddle" alt="User Has Donated!" border="0" /></a></if>
<!-- /Donation Hack Image Addon -->


I would place the above code after this line in postbit or postbit_legacy template (depending on which I'm using) ...

<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>

This is what I'm thinking, but I'm not sure if it would work as I would need to figure out which "condition" to place in the <if> statement ...

After speaking with mfyvie I was adviced ...

There are no conditionals which are accesible which will give you this answer. You'd need to set a variable in the plugin code before the template is called, then you can test for it with a conditional inside the template.

In order to set that variable you'll have to first figure out if the current user is a donator, and for that you'd have to see if they appear in the database as a donator. You'd have to query the database for that info - the table in the database is "cybppdonate" if you look at the contents of this table you'll see how it is setup, querying it should be straightforward.

Note - you'll find examples of existing queries to this same table inside the plugin code itself.

--------------------------------------------

... the easiest way to check for a donator is to see if there are records which are confirmed which match the current userid. In other words - does that table (cybppdonate) in the database have records where the userid in the table matches the current userid of the user. If yes - set a variable before the template is called and then check the conditional in the template ...


Well luckily the table (cybppdonate) has a "userid" field and the information inside the field there matches the current userid of the members. So now, I'm stuck and need your help. For one, I do not know how to create a variable or add one before a template. Also, how do I check a conditional on a template? How do I make a conditional? I dont have much knowledge of this stuff at all, that why I am seeking help, hopefully you all can help me.

Thanks,
Danny