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']."&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 # ||
|| #################################################################### ||
\*======================================================================*/
?>
|