vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Adding an Image next to Username on Postbit (https://vborg.vbsupport.ru/showthread.php?t=150651)

Dannyloski 06-25-2007 10:48 PM

Adding an Image next to Username on Postbit
 
Hey Guys,

I wanna make an addon to the Cyb - PayPal Donate Hack (LINK). 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 ...

Code:

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

Code:

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

Quote:

Originally Posted by mfyvie
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


All times are GMT. The time now is 07:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00993 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete