vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   PayPal Donations For vBulletin 3.5.0 (https://vborg.vbsupport.ru/showthread.php?t=91567)

dizzine 10-24-2005 02:23 PM

how configurable is the donations goals/history page when viewed..
ie..can you specify what information is given to users regarding donation totals..etc

Lamby1973 10-25-2005 10:05 PM

Sorry I may have missed this along the way and it may be very easy to do. I was wanting to change the text in the Donations Goals, Your Donations are appreciated and A Special Thank You sections? Is there a way to do this. Also is it possible to have a donate butoon with a £ in instead of a $?

Cheers

mcasteel 10-26-2005 12:59 AM

Is this functional with 3.5 gold? I have 3.5 gold and installed, and everything looks okay in the admincp, but when I go to the forum index and main page, there are no paypal links and nothing in the navbar. Thanks. Sounds like a great hack. I hope it's just a mistake I made during installation.

PhotoMalaysia 10-26-2005 04:51 AM

I don't get it. I installed this with no errors, but now what? Nothing appears in vbadvanced or anywhere else. Going to donate.php simply has a Your donations will be used... message, but no link or button for anyone to actually *make* a donation.

davidw 10-26-2005 10:14 AM

Quote:

Originally Posted by mcasteel
Is this functional with 3.5 gold? I have 3.5 gold and installed, and everything looks okay in the admincp, but when I go to the forum index and main page, there are no paypal links and nothing in the navbar. Thanks. Sounds like a great hack. I hope it's just a mistake I made during installation.

The navbar is a manual hack - you place it yourself. Any other links as well. :)

davidw 10-26-2005 10:18 AM

Quote:

Originally Posted by PhotoMalaysia
I don't get it. I installed this with no errors, but now what? Nothing appears in vbadvanced or anywhere else. Going to donate.php simply has a Your donations will be used... message, but no link or button for anyone to actually *make* a donation.

As you can see here:
http://www.christianboards.org/donate.php
The donations need to be created in admincp - under Paypal Donations -
Add A New Goal
Add A New Donation Button
Add A New Donor

Citizen 10-26-2005 03:06 PM

Would someone be able to make a small modification so that the "top donors" table starts at the top left and all the other tables are on the right?

Reason is, that if I have more than 2 "top donors" it displays below everything else.

Here is the donate.php code:

Code:

<?
/*======================================================================*\
|| #################################################################### ||
|| # Paypal Donations for vBulletin 3.5 - Version 2.00                # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2005 The Noble Pagan, Inc. All Rights Reserved.      # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| # ---------------------------------------------------------------- # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'donations');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
        'ppdonations'
);

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array(
        'DONATIONS',
        'donations_bits',
        'donations_top_donor_bits',
        'donations_goal_bits',
        'donations_inactive',
        'donations_cancelled',
        'donations_complete'
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

if (empty($_REQUEST['do'])){
        $_REQUEST['do'] = 'start';
}

// ###### Do tests and perform script ######

if ($_REQUEST['do'] == 'start'){
        if($vbulletin->options['donationsactive'] == '1'){
                // ###### Show Donation Options ######
                $i = 1;
                $ip_address = $_SERVER['REMOTE_ADDR'];
                $query = $vbulletin->db->query_read("SELECT button.*, goal.title AS goal_title
                                                                                                                                                                FROM ".TABLE_PREFIX."donation_buttons AS button
                                                                                                                                                                LEFT JOIN ".TABLE_PREFIX."donation_goals AS goal ON(goal.id = button.goalid)
                                                                                                                                                                WHERE button.active = '1'");
                $num = $vbulletin->db->num_rows($query);
                while ($row = $vbulletin->db->fetch_array($query)){
                        // ###### Check Currency Costs ######
                        if ($vbulletin->options['showcurrencyselector'] == '1'){
                                $currency = $vbulletin->db->query_first("SELECT * FROM ".TABLE_PREFIX."donation_currency_exchange");
                                $amount = array();
                                foreach ($currency AS $key => $value){
                                        $amount[$key] = number_format(round($row['amount'] * $value, 2), 2);
                                        $amount['JPY'] = round($row['amount'] * $value, 0);
                                }
                        }
                       
                        $description = stripslashes($row['description']);
                        if ($i < $num){
                                $end = "</tr><tr align=\"center\">";
                                $i++;
                        } else {
                                $end = '';
                                unset($i, $num);
                        }
                        eval('$donationbits .= "' . fetch_template('donations_bits') . '";');
                }

                if ($vbulletin->options['showdonors'] == '1'){
                        // ###### Show Top/Last Donors ######
                        if ($vbulletin->options['toporlast'] == '1'){
                                $query = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."donation_donors WHERE userid != '0' ORDER BY total DESC LIMIT 0,".$vbulletin->options['topdonornumber']);
                        } else {
                                $query = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."donation_donors WHERE userid != '0' ORDER BY id DESC LIMIT 0,".$vbulletin->options['topdonornumber']);
                        }
                        $num = $vbulletin->db->num_rows($query);
                        $i = 1;
                        while ($row = $vbulletin->db->fetch_array($query)){
                                        $avatar_row = $vbulletin->db->query_first("SELECT user.showdonor, user.username, user.avatarid, user.avatarrevision, avatar.avatarpath, NOT ISNULL(customavatar.filedata) AS hascustomavatar, customavatar.dateline AS avatardateline
                                                                                                                                                                                                                FROM ".TABLE_PREFIX."user AS user
                                                                                                                                                                                                                LEFT JOIN ".TABLE_PREFIX."avatar AS avatar ON(avatar.avatarid = user.avatarid)
                                                                                                                                                                                                                LEFT JOIN ".TABLE_PREFIX."customavatar AS customavatar ON(customavatar.userid = user.userid)
                                                                                                                                                                                                                WHERE user.userid = '".$row['userid']."'");
                                        if ($avatar_row['avatarid']){
                                                $avatarurl = $avatar_row['avatarpath'];
                                        } else {
                                                if ($avatar_row['hascustomavatar']){
                                                        if ($vbulletin->options['usefileavatar']){
                                                                $avatarurl = $vbulletin->options['avatarurl']."/avatar".$row['userid']."_".$avatar_row['avatarrevision'].".gif";
                                                        } else {
                                                                $avatarurl = "image.php?".$session['sessionurl']."u=".$row['userid']."&amp;dateline=".$avatar_row['avatardateline'];
                                                        }
                                                } else {
                                                        $avatarurl = '';
                                                }
                                        }
                                $userid = $row['userid'];
                                $avatar = '<img src="'.$avatarurl.'" border="0">';
                                $username = stripslashes($avatar_row['username']);
                                $show_as_donor = $avatar_row['showdonor'];
                                $total = number_format($row['total'], 2, '.', ',');
                                if ($i < $num){
                                        $end = "</tr><tr align=\"center\">";
                                        $i++;
                                } else {
                                        $end = '';
                                        unset($i, $num);
                                }
                                eval('$topdonorbits .= "' . fetch_template('donations_top_donor_bits') . '";');
                        }
                }
       
                if($vbulletin->options['showgoals'] == '1'){
                        // ###### Show Goals ######
                        if ($vbulletin->options['showtotalcollected'] == '1'){
                                // ###### Show Total Contributed To Date ######
                                $query = $vbulletin->db->query_read("SELECT mc_gross, mc_fee FROM ".TABLE_PREFIX."donation_paypalipn WHERE valid = '1' AND test_ipn = '".$vbulletin->options['ipn_test']."' AND payment_status = 'Completed'");
                                while ($row = $vbulletin->db->fetch_array($query)){
                                        $mc_net = $row['mc_gross'] - $row['mc_fee'];
                                        $mc_total = $mc_net + $mc_total;
                                }
                        }       
                        $query = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."donation_goals WHERE active = '1'");
                        $num = $vbulletin->db->num_rows($query);
                        $i = 1;
                        while ($row = $vbulletin->db->fetch_array($query)){
                                $title = stripslashes($row['title']);
                                $description = stripslashes(nl2br($row['description']));
                                $amount = number_format($row['amount'], 2, '.', ',');
                                $total_donated = number_format($row['total_donated'], 2, '.', ',');
                                if ($row['amount'] > 0){
                                        $percentage = round(($row['total_donated']/$row['amount'])*100, 2);
                                } else {
                                        $percentage = '0';
                                }
                                if ($i < $num){
                                        $end = "</tr><tr align=\"center\">";
                                        $i++;
                                } else {
                                        $end = '';
                                        unset($i, $num);
                                }
                                eval('$donationgoalbits .= "' . fetch_template('donations_goal_bits') . '";');
                        }
                }
       
                // ###### Draw navbar ######
                $pagetitle = $vbulletin->options['bbtitle'].' Donations';
                $navbits = array(
                        "donate.php?$session[sessionurl]" => 'Donations',
                        '' => $pagetitle
                );
                $navbits = construct_navbits($navbits);
                eval('$navbar = "' . fetch_template('navbar') . '";');

                // ###### Output page ######
                eval('print_output("' . fetch_template('DONATIONS') . '");');
        } else {
                // ###### Draw navbar ######
                $pagetitle = $vbulletin->options['bbtitle'].' Donations';
                $navbits = array(
                        "donate.php?$session[sessionurl]" => 'Donations',
                        '' => $pagetitle
                );
                $navbits = construct_navbits($navbits);
                eval('$navbar = "' . fetch_template('navbar') . '";');

                // ###### Output page ######
                eval('print_output("' . fetch_template('donations_inactive') . '");');
        }

} elseif ($_REQUEST['do'] == 'thankyou'){
        // ###### User completed donation, THANK THEM! ######
        $vbulletin->input->clean_gpc('p', 'mc_gross', TYPE_NOCLEAN);
        $total = '$'.number_format($vbulletin->GPC['mc_gross'], 2, '.', ',');

        // ###### Draw navbar ######
        $pagetitle = $vbulletin->options['bbtitle'].' Donation Complete, THANK YOU!';
        $navbits = array(
                "donate.php?$session[sessionurl]" => ' Donation Complete, THANK YOU!',
                '' => $pagetitle
        );
        $navbits = construct_navbits($navbits);
        eval('$navbar = "' . fetch_template('navbar') . '";');

        // ###### Output page ######
        eval('print_output("' . fetch_template('donations_complete') . '");');
       
} elseif ($_REQUEST['do'] == 'canceled'){
        if ($_REQUEST['feedback'] == '1'){
                // ###### Do Feedback Send ######
                $vbulletin->input->clean_array_gpc('p', array(
                        'subject' => TYPE_STR,
                        'message' => TYPE_STR)
                );
                $subject = $vbulletin->GPC['subject'];
                $message = $vbulletin->GPC['message'];
                vbmail($vbulletin->options['webmasteremail'], $subject, $message);
       
                // ###### Draw navbar ######
                $pagetitle = $vbulletin->options['bbtitle'].' Donation Cancelled, Feedback Sent';
                $navbits = array(
                        "donate.php?$session[sessionurl]" => 'Donation Cancelled, Feedback Sent',
                        '' => $pagetitle
                );
                $navbits = construct_navbits($navbits);
                eval('$navbar = "' . fetch_template('navbar') . '";');

                // ###### Output page ######
                eval('print_output("' . fetch_template('donations_cancelled_feedback_sent') . '");');
        } else {
                // ###### Do Donate Cancel ######
               
                // ###### Draw navbar ######
                $pagetitle = $vbulletin->options['bbtitle'].' Donation Cancelled';
                $navbits = array(
                        "donate.php?$session[sessionurl]" => 'Donation Cancelled',
                        '' => $pagetitle
                );
                $navbits = construct_navbits($navbits);
                eval('$navbar = "' . fetch_template('navbar') . '";');

                // ###### Output page ######
                eval('print_output("' . fetch_template('donations_cancelled') . '");');
        }
}
/*======================================================================*\
|| #################################################################### ||
|| # donate -- Fileversion 2.01                                      # ||
|| # Date Version Finalized -- 03 July 2005                          # ||
|| #################################################################### ||
\*======================================================================*/
?>


Lamby1973 10-26-2005 11:52 PM

Everything seems to be working fine apart from the Donations section not show down the left in the ACP with all the other drop down menus. I can type the destination to the donate page which seems fine but need to edit it. I have tried and tried to install and uninstall then re install but to no avail. This may be something easy I have missed but can anyone help me get the Donations section to show in the ACP?

Cheers

Citizen 10-27-2005 02:24 PM

Would anyone be able to make that modification to the page? Shouldnt take more than a few seconds.

Rich 10-27-2005 07:36 PM

Hello,

If anyone needs it, here are instructions for adding links to your donations page.

It includes how to add a link to your navbar, quicklinks in navbar, and the footer.

See attachment for instructions.

If you have more ideas or want to know how to add links to other areas of the site, let me know via PM.


All times are GMT. The time now is 10:50 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.01943 seconds
  • Memory Usage 1,845KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)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