View Single Post
  #308  
Old 10-26-2005, 03:06 PM
Citizen Citizen is offline
 
Join Date: Sep 2005
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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                           # ||
|| #################################################################### ||
\*======================================================================*/
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01186 seconds
  • Memory Usage 1,827KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete