vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Cyb - PayPal Donate (https://vborg.vbsupport.ru/showthread.php?t=122997)

mfyvie 07-05-2007 08:08 PM

Quote:

Originally Posted by Dannyloski (Post 1283779)
Can anyone help me figure out what I need to do to make this work? I dont know much of this stuff, so I thought it would work with something like what I did here, but no. Cybernetec or anyone who knows, can you help me? I want to add the image for those who have donated.

That condition in the template should be a variable like $isdonator. If you set $isdonator = true, then your condition will fire.

But you'll need a plugin in order to set that variable up before the template is called (postbit). If you set the variable in your plugin, then when the template runs the conditional will trigger.

However, before you set the variable you'll need to decide whether to set the variable. You'll have to build a database query to check the database to see if a donation has been made by this user. If it has, set it to true, if not, set to false.

Note that this is a very quick and dirty method, and won't be very efficient. It will add a query for every post on the page. BUt if you don't have a really busy forum, it probably won't matter.

If this is your first plugin go to the tutorials section for the basics of creating a product and a plugin. There are also tutorials on building a database query.

Dannyloski 07-05-2007 08:46 PM

^ Thanks for the reply I appreciate it and I appreciated the help you provided me with before ... Ummm, is there any other way to do it that's not using another query?

mfyvie 07-05-2007 10:02 PM

Quote:

Originally Posted by Dannyloski (Post 1283839)
^ Thanks for the reply I appreciate it and I appreciated the help you provided me with before ... Ummm, is there any other way to do it that's not using another query?

Well there's always other ways, but I would say if this is your first attempt, don't get fancy, keep it simple. It might not be totally elegant, but it will work on your board and others. Once you understand more, you can work on improving it.

Dannyloski 07-06-2007 02:10 AM

ahhhhhh, I give up I read the tutorials and tried doing some stuff, but no luck (I've been sitting in this computer for hours, I haven't eaten anything yet, lol) - This php coding crap is just not for me, much props to all coders, I must say ... I'll just have to live without having an image displayed next to the member's username if they have donated. I'll stick to what I know (HTML, CSS, etc) ... PHP is not my thing hahah ...

I wonder if Cybernetec would consider this add-on as a feature in a new release of this Hack ... I'll cross my fingers.

wireless0ne 07-06-2007 03:43 AM

I know this has been asked numerous times, but i havent found an answer yet, i have installed this and upgraded to latest version, but i cannot get the donate link to appear in my navbar on my advanced cmps page and that is where i need it the most, how do i do this?

Dannyloski 07-06-2007 03:14 PM

wireless0ne, did you follow the instructions for the customized styles?

In the navbar Template (You have to do this for each of your Custom Styles that you want to show the "Donate" link) - This is what I did and it shows on my vBadvance CMPS page

FIND:
Code:

vbphrase[user_cp]</a></td>
AFTER IT ADD:
Code:

$cyb_paypal_donate_link

navjotjsingh 07-06-2007 06:02 PM

Quote:

Originally Posted by Dannyloski (Post 1284432)
wireless0ne, did you follow the instructions for the customized styles?

In the navbar Template (You have to do this for each of your Custom Styles that you want to show the "Donate" link) - This is what I did and it shows on my vBadvance CMPS page

FIND:
Code:

vbphrase[user_cp]</a></td>
AFTER IT ADD:
Code:

$cyb_paypal_donate_link

I have the same problem as wireless0ne, and I tried your method, but instead of adding it to the vbaCMPS page, it adds twice to the Forum main page.

Even i need solution to this problem.

Dannyloski 07-06-2007 08:19 PM

Alright guys try this instead ... If this doesn't work, then I dunno ...

In the navbar Template

FIND:
Code:

vbphrase[user_cp]</a></td>
AFTER IT ADD:
Code:

<td class="vbmenu_control"><a href="misc.php?do=donate">$vbphrase[cybpaypal_donate]</a></td>
Make sure that you have the Automatically add link to Donate page to NavBar option in the AdminCP set to No if you do the above, so that it doesn't show twice ...

wireless0ne 07-07-2007 11:50 AM

thank you, that worked.

mfyvie 07-07-2007 11:54 AM

Quote:

Originally Posted by Dannyloski (Post 1284024)
ahhhhhh, I give up I read the tutorials and tried doing some stuff, but no luck (I've been sitting in this computer for hours, I haven't eaten anything yet, lol) - This php coding crap is just not for me, much props to all coders, I must say ... I'll just have to live without having an image displayed next to the member's username if they have donated. I'll stick to what I know (HTML, CSS, etc) ... PHP is not my thing hahah ...

Danny - you probably know more than you think you do. The first time I read through all those tutorials it went over my head as well and I felt like it was too much. If you feel weak on php, then start out with some basic php tutorials and build some really simple little programs on your own PC. You'll see that it really is quite easy, and before long more and more of those tutorials will make sense. I've re-read many of them at different times, and at each stage of my own personal development I found I understood something new each time. I feel a lot more confident now than I did a month ago - that's for sure.

Don't give up!


All times are GMT. The time now is 12:39 AM.

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.01783 seconds
  • Memory Usage 1,751KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete