Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Nuke Treasury
Author Message
Unit1
Worker
Worker



Joined: Oct 26, 2004
Posts: 134
Location: Boston

PostPosted: Fri Mar 03, 2006 11:52 am Reply with quote

Currently its only possible to see the current months donators/donations. in the Once a month has gone by, the only way to see them is to look in the database. Would it be possible to have a section on the donations page to all of the past donations are listed? I did try the old code from sourceforge.net for this and this did not work. Thanks for any info on this
Code:
Take the original block, and comment out 

2 areas, and add one line...
 
you comment out by adding a "/* "
stuff you wanted commented out, and end with
"*/"
 
comment out
 
/* $swingd = $tr_config[swing_day];
if(!($swingd > 0 AND $swingd < 32)) */
 
add this below the unused code
$swingd = 90;
 
and comment out this whole else clause
 
/* } else
{
$query_Recordset1 = ' SELECT business, COUNT( mc_gross ) AS count, SUM( mc_gross ) AS gross, SUM( mc_gross - mc_fee ) AS net, DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
. ' DAY ) , \'%M\' ) AS mon, \'Now!\' AS due_by, DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
. ' DAY ) , \'%b\' ) AS mon_short'
. ' FROM transactions'
. ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
. ' DAY ) , \'%Y-%m-' . $swingd . '\' )'
. ' GROUP BY business ';
 
$query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';
$query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
$query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
$query_Recordset3 .= ' FROM transactions'
. ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
. ' DAY ) , \'%Y-%m-' . $swingd . '\' ) '
. ' GROUP BY txn_id ORDER BY payment_date DESC';
} */
 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Fri Mar 03, 2006 8:56 pm Reply with quote

Be careful with that..if you have lots of donations, it could be a drag on your system! Of course, it would be shocking if that happened, but it could over several decades...

What happened when you tried this?

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
Unit1







PostPosted: Fri Mar 03, 2006 10:44 pm Reply with quote

In where the block was is said no data base query but no block and seeing that I just started useing this one i dont have many in the data base right now but would like to at least show in time who gave in the past 3 months on the donations page
 
kguske







PostPosted: Fri Mar 03, 2006 10:51 pm Reply with quote

A little confused...do you know if the unmodified block works? If so, it should be a simple modification to change the range of dates included.
 
Unit1







PostPosted: Sat Mar 04, 2006 6:02 am Reply with quote

yes it does kguske every thing works fine as it is now I just would like to show the some of the past donations insted of them clearing at the end of the month on the donations page so it shows who gave in the past 90 days under the new donations for this month
 
kguske







PostPosted: Sat Mar 04, 2006 10:08 am Reply with quote

If you are comfortable editing code, look for the SQL in the block that limits the data to the last month and modify it according. If you are familiar with SQL, post it here and we'll adjust.
 
Unit1







PostPosted: Sat Mar 04, 2006 11:02 am Reply with quote

Here is the code of the block I am still a little new to the code Embarassed
Code:
<?php

/************************************************************************/
/* NukeTreasury - Financial management for PHP-Nuke                      */
/* Copyright (c) 2004 by Dave Lawrence AKA Thrash                       */
/*                       thrash@fragnastika.com                         */
/*                       thrashn8r@hotmail.com                          */
/*                                                                      */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/* This program is distributed in the hope that it will be useful, but  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     */
/* General Public License for more details.                             */
/*                                                                      */
/* You should have received a copy of the GNU General Public License    */
/* along with this program; if not, write to the Free Software          */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  */
/* USA                                                                  */
/* Upgraded and cleaned up by Telli http://codezwiz.com                 */
/************************************************************************/

if (eregi("block-Donat_o_Meter.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

include("modules/Donations/config.php");

   $swingd = $tr_config[swing_day];
   if(!($swingd > 0 AND $swingd < 32))
      $swingd = 6;
   
   $dmshowdate = $tr_config[dm_show_date];
   $dmshowamt = $tr_config[dm_show_amt];
   $DM_TITLE = $tr_config[dm_title];
   
   if(!$DM_TITLE)
      $DM_TITLE = "Help keep us going!";
      
   if(is_numeric($tr_config[dm_num_don]) && $tr_config[dm_num_don] > 0 )
      $dmlen = $tr_config[dm_num_don];
   else if (is_numeric($dmlen) && $dmlen ==0)
      $dmlen = -1;
   else
      $dmlen = 10;
      
   // Check the current day against the swing day to execute the proper query
   if( date('d') >= $swingd )
   {
      $query_Recordset1 = ' SELECT business, COUNT( mc_gross ) AS count, SUM( mc_gross ) AS gross, SUM( mc_gross - mc_fee ) AS net, DATE_FORMAT( NOW( ) , \'%M\' ) AS mon, '
         . ' DATE_FORMAT( SUBDATE( DATE_FORMAT( ADDDATE( NOW( ) , INTERVAL 1 MONTH ) , \'%Y-%c-1\' ) , INTERVAL 1 DAY ) , \' %b %e\' ) AS due_by, '
         . ' DATE_FORMAT( NOW( ) , \'%b\' ) AS mon_short'
         . ' FROM transactions'
         . ' WHERE ( transactions.payment_date >= DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) '
         . ' GROUP BY business';
   
      $query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';
      $query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
      $query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
      $query_Recordset3 .= ' FROM transactions'
         . ' WHERE ( transactions.payment_date >= DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) '
         . ' GROUP BY txn_id ORDER BY payment_date DESC';
   } else
   {
      $query_Recordset1 = ' SELECT business, COUNT( mc_gross ) AS count, SUM( mc_gross ) AS gross, SUM( mc_gross - mc_fee ) AS net, DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
         . ' DAY ) , \'%M\' ) AS mon, \'Now!\' AS due_by, DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
         . ' DAY ) , \'%b\' ) AS mon_short'
         . ' FROM transactions'
         . ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
         . ' DAY ) , \'%Y-%m-' . $swingd . '\' )'
         . ' GROUP BY business ';
   
      $query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';
      $query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
      $query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
      $query_Recordset3 .= ' FROM transactions'
         . ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
         . ' DAY ) , \'%Y-%m-' . $swingd . '\' ) '
         . ' GROUP BY txn_id ORDER BY payment_date DESC';
   }
   
   // Get the donation totals
   $Recordset1 = mysql_query($query_Recordset1, $ipnppd) or die(mysql_error());
   $row_Recordset1 = mysql_fetch_assoc($Recordset1);
   //If there are not records, then get "null" data
   if( !$row_Recordset1 )
   {
      $query_Recordset1 = ' SELECT \'\' AS business, \'0\' AS count, \'0\' AS gross, \'0\' AS net, DATE_FORMAT( NOW( ) , \'%M\' ) AS mon, DATE_FORMAT( SUBDATE( DATE_FORMAT( ADDDATE( NOW( ) , INTERVAL 1 '
         . ' MONTH ) , \'%Y-%c-1\' ) , INTERVAL 1 '
         . ' DAY ) , \' %b %e\' ) AS due_by, DATE_FORMAT( NOW( ) , \'%b\' ) AS mon_short'; 
      $Recordset1 = mysql_query($query_Recordset1, $ipnppd) or die(mysql_error());
      $row_Recordset1 = mysql_fetch_assoc($Recordset1);
   }
   
   // Get the goal
   $query_Recordset2 = $sql = 'SELECT * FROM config WHERE name=\'goal\' AND subtype=\'' . $row_Recordset1['mon_short'] . '\'';
   $Recordset2= mysql_query($query_Recordset2, $ipnppd) or die(mysql_error());
   $row_Recordset2 = mysql_fetch_assoc($Recordset2);
   
   // Set our remaining template vars
   $DM_MON = $row_Recordset1[mon];
   $DM_GOAL = sprintf('$%.02f', $row_Recordset2['value']);
   $DM_DUE = $row_Recordset1['due_by'];
   $DM_NUM = $row_Recordset1['count'];
   $DM_GROSS = sprintf('$%.02f',$row_Recordset1['gross']);
   $DM_NET = sprintf('$%.02f',$row_Recordset1['net']);
   $DM_LEFT = sprintf('$%.02f', $row_Recordset2['value'] - $row_Recordset1['net']);
   $DM_BUTTON = $tr_config[dm_button];
   $DM_BUTT_DIMS = '';
   if( is_numeric($tr_config[dm_img_width]) )
   $DM_BUTT_DIMS .= "width=\"$tr_config[dm_img_width]\" ";
   if( is_numeric($tr_config[dm_img_height]) )
   $DM_BUTT_DIMS .= "height=\"$tr_config[dm_img_height]\" ";


      // Load the template
   $tmpl_file = "modules/Donations/Donatometer.html";
   $thefile = implode("", file($tmpl_file));
   $thefile = addslashes($thefile);
   $thefile = "\$r_file=\"".$thefile."\";";
   eval($thefile);
   $content = $r_file;

   // Do we want to display the donators?
   if(is_numeric($dmlen) && $dmlen >= 0 )
   {
      // Get the list of donators
      $Recordset3= mysql_query($query_Recordset3, $ipnppd) or die(mysql_error());
   
         $content .= "<br><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"
               . "<tr><td align=\"center\" colspan=\"2\"><u>Donations</u></td></tr>"
                  . "<tr><td>"
                     . "<div align=\"right\"><a href=\"javascript:openwindow5()\">&copy;</a></div></td></tr>";

      // List all the donators
      $l = 0;
      while ( ($row_Recordset3 = mysql_fetch_assoc($Recordset3)) && ($i != $tr_config[dm_num_don]) )
      {
         // Refunded transactions will show up with $0 amount
         if( $row_Recordset3['amt'] > "$0" )
         {
            // Observe the user's wish regarding revealing their name
            if( strcmp($row_Recordset3['showname'],"Yes") == 0)
               $name = $row_Recordset3['name'];
            else
               $name = "Anonymous";
            
            if( !$dmshowamt && !$dmshowdate )
               $dmalign = "center";
            else
               $dmalign = "left";
            $content .= "<tr><td width=\"100%\" align=\"$dmalign\" colspan=\"2\">";
            $content .=  $name;
            if( $dmshowamt )
               $content .= " $row_Recordset3[amt]";
            if( $dmshowdate )
               $content .= " $row_Recordset3[date]";
            $content .= "</td></tr>";
                         
         }
         $l++;

      } 
      $content .= "</table>";
}
   
?>


And here is the sql file
Code:
# phpMyAdmin SQL Dump

# version 2.5.4
# http://www.phpmyadmin.net
#
# Host: localhost
# Generation Time: Jan 20, 2004 at 09:26 AM
# Server version: 4.0.15
# PHP Version: 4.3.3
#
# Database : `ipnppd`
#

# --------------------------------------------------------

#
# Table structure for table `config`
#

CREATE TABLE `config` (
  `name` varchar(25) NOT NULL default '',
  `subtype` varchar(20) NOT NULL default '',
  `value` varchar(200) NOT NULL default '0',
  `text` text NOT NULL
) TYPE=MyISAM;

#
# Dumping data for table `config`
#

INSERT INTO `config` VALUES ('receiver_email', '', 'donations@mysite.com', '!!!!!!VERY IMPORTANT!!!!!!!\r\nThis is the email address registered\r\nin your PayPal account that you receive\r\nmoney on.  NOTE: Create an email address\r\nspecifically and only for receiving\r\ndonations, i.e. donations@yoursite.com.\r\nThe Donatometer will list any payments\r\nto the email you list here, whether they\r\ncome from this module or not.\r\n');
INSERT INTO `config` VALUES ('goal', 'Jan', '160', 'Enter the dollar amounts for each month\'s\r\ndonation goal.');
INSERT INTO `config` VALUES ('goal', 'Feb', '110', '');
INSERT INTO `config` VALUES ('goal', 'Mar', '100', '');
INSERT INTO `config` VALUES ('goal', 'Apr', '100', '');
INSERT INTO `config` VALUES ('goal', 'May', '100', '');
INSERT INTO `config` VALUES ('goal', 'Jun', '100', '');
INSERT INTO `config` VALUES ('goal', 'Jul', '100', '');
INSERT INTO `config` VALUES ('goal', 'Aug', '100', '');
INSERT INTO `config` VALUES ('goal', 'Sep', '100', '');
INSERT INTO `config` VALUES ('goal', 'Oct', '100', '');
INSERT INTO `config` VALUES ('goal', 'Nov', '100', '');
INSERT INTO `config` VALUES ('goal', 'Dec', '100', '');
INSERT INTO `config` VALUES ('swing_day', '', '6', 'The Swing Day determines when the\r\nDonatometer will switch to show the\r\nnext month.  The previous month\'s\r\nstats will no longer be displayed.');
INSERT INTO `config` VALUES ('dm_title', '', '<b>HELP KEEP OUR SERVERS ONLINE!</b>', 'Enter a customized title for your\r\nDonatometer.  NOTE: This is not the\r\nNuke Block title.  You can change that\r\nin the Nuke Blocks Admin.');
INSERT INTO `config` VALUES ('ty_url', '', '', 'You can enter a URL here for a web page\r\nthat users will be taken to when they\r\ncomplete a donation.  This is useful for\r\ntaking the user back to your site and\r\ndisplaying a "Thank You".  NOTE: PayPal\r\nwill use this link for cancelled payments\r\nas well. If you use the feature, also\r\ncreate a second web page with appropriate\r\ntext for a cancelled payment.  TIP: Use\r\nNukeWrap to bring your users back into the\r\nNuke site.');
INSERT INTO `config` VALUES ('pp_itemname', '', 'Donation', 'Enter the IPN item name used for your\r\ndonations. This feature is currently\r\nnot used.');
INSERT INTO `config` VALUES ('dm_num_don', '', '10', 'Enter the number of donators that\r\nshould be listed in the Donatometer.\r\n-1 = Don\'t list any\r\n 0 = Unlimited\r\n # = The max number to list\r\nDonators are always listed from newest\r\nto oldest from the top down.\r\n');
INSERT INTO `config` VALUES ('dm_show_amt', '', '1', 'Should the Donatometer display the\r\nAmount of each donation?');
INSERT INTO `config` VALUES ('dm_show_date', '', '1', 'Should the Donatometer display the\r\ndate that each donation was made?');
INSERT INTO `config` VALUES ('dm_button', '', 'https://www.paypal.com/en_US/i/btn/x-click-but21.gif', 'Enter a complete URL for the image used\r\nin the Donatometer block');
INSERT INTO `config` VALUES ('don_button_submit', '', 'https://www.paypal.com/en_US/i/btn/x-click-but04.gif', 'Enter a complete URL for the image to use\r\nfor at the bottom of the Donations module\r\nto submit a donation.');
INSERT INTO `config` VALUES ('don_button_top', '', 'https://www.paypal.com/en_US/i/btn/x-click-but21.gif', 'Enter a complete URL for the image to use\r\nfor at the top of the Donations module.');
INSERT INTO `config` VALUES ('pp_image_url', '', '', 'You can have a custom image displayed at\r\nthe top of the PayPal screen when your\r\nusers are donating.  Enter the URL for\r\nthe image to display here.  NOTE: You\r\nshould not enter a non HTTPS:// URL. If\r\nyou enter a URL from a non-secure server\r\nyour users will continually be warned that\r\nthey are about to display secure and\r\nnon-secure information.');
INSERT INTO `config` VALUES ('pp_cancel_url', '', '', 'Enter a URL here for a web page that users\r\nwill be taken to when they cancel their\r\npayment.  You should use this feature if\r\nyou have filled in a "Thank You" URL.\r\nTIP: Use NukeWrap to bring your users back\r\ninto the Nuke site.');
INSERT INTO `config` VALUES ('pp_get_addr', '', '0', 'Would you like PayPal to gather the user\'s\r\nshipping address?  Users can opt out of\r\nthis.  This could be useful if you wanted\r\nto send them holiday cards or something.');
INSERT INTO `config` VALUES ('don_amount', '1', '10', 'The Donations module provides a list\r\nof suggested donations amounts.  You\r\ncan customize this list below.  ');
INSERT INTO `config` VALUES ('don_amount', '2', '15', '');
INSERT INTO `config` VALUES ('don_amount', '3', '20', '');
INSERT INTO `config` VALUES ('don_amount', '5', '', '');
INSERT INTO `config` VALUES ('don_amount', '4', '30', '');
INSERT INTO `config` VALUES ('don_amount', '6', '0', '');
INSERT INTO `config` VALUES ('don_amount', '8', '0', '');
INSERT INTO `config` VALUES ('don_amt_checked', '', '1', 'The Donations module provides a list\r\nof suggested donations amounts.  You\r\ncan customize this list below.  In this\r\nbox, specify which of the amounts listed\r\nbelow should be checked by default.');
INSERT INTO `config` VALUES ('pp_item_num', '', '110', 'Enter the IPN item number used for your\r\ndonations. This feature is currently\r\nnot used.');
INSERT INTO `config` VALUES ('dm_img_width', '', '', 'Restrict the dimensions for the above\r\nimage.  To use the image\'s native size\r\nleave both boxes blank.');
INSERT INTO `config` VALUES ('dm_img_height', '', '', '');
INSERT INTO `config` VALUES ('don_top_img_width', '', '', 'Restrict the dimensions for the above\r\nimage.  To use the image\'s native size\r\nleave both boxes blank.');
INSERT INTO `config` VALUES ('don_top_img_height', '', '', '');
INSERT INTO `config` VALUES ('don_sub_img_width', '', '', 'Restrict the dimensions for the above\r\nimage.  To use the image\'s native size\r\nleave both boxes blank.');
INSERT INTO `config` VALUES ('don_sub_img_height', '', '', '');
INSERT INTO `config` VALUES ('don_text', 'rawtext', '0', 'We are a non-profit organization completely supported by you, the members.  Many organizations have web sites, servers and Internet bandwidth donated by it\'s members.  We pride ourselves on being run and owned as a community, and not by a few power-hungry members.  This means that we need you to be a part of that community.  We encourage every member to contribute to the community in any way that they can.  Since we do not have our servers or bandwidth donated, we have pay our bills every month to keep things going.  For those of you who can, we ask that you make a monetary contribution in whatever denomination you\'d like.  Every little bit counts.<br>');
INSERT INTO `config` VALUES ('don_show_amt', '', '0', 'Should the Donations module reveal the\r\namount of each donation?');
INSERT INTO `config` VALUES ('don_show_date', '', '0', 'Should the Donations module reveal the\r\ndate of each donation?');
INSERT INTO `config` VALUES ('don_name_prompt', '', 'Do you want your username revealed with your donation?', 'Enter the text for the prompt asking a\r\nuser if they want their name revealed.');
INSERT INTO `config` VALUES ('don_name_yes', '', 'Yes! - Tell the world I gave my hard-earned cash!', 'Enter the text for a "YES" selection');
INSERT INTO `config` VALUES ('don_name_no', '', 'No - List my donation as Anonymous', 'Enter the text for a "NO" selection');
INSERT INTO `config` VALUES ('ipn_dbg_lvl', '', '2', 'There is an IPN logging feature which has\r\nthree log levels:\r\n1) OFF\r\n2) Log only Errors\r\n3) Log everything\r\nThis log is stored in the "translog" table.');
INSERT INTO `config` VALUES ('ipn_log_entries', '', '20', '\r\nEnter the maximum number of log entries to\r\nkeep in the log table.');

# --------------------------------------------------------

#
# Table structure for table `financial`
#

CREATE TABLE `financial` (
  `id` int(11) NOT NULL auto_increment,
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `num` varchar(16) NOT NULL default '',
  `name` varchar(128) NOT NULL default '',
  `descr` varchar(128) NOT NULL default '',
  `amount` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=33 ;

#
# Dumping data for table `financial`
#

INSERT INTO `financial` VALUES (2, '2003-08-28 00:00:00', '', 'hostmenow', 'Web hosting for 1 year', '-59.4');
INSERT INTO `financial` VALUES (3, '2003-08-29 00:00:00', '', 'GameServHost', 'Game server colo', '-200');
INSERT INTO `financial` VALUES (5, '2003-09-01 00:00:00', '', 'PayPal IPN', 'Auto reconcile', '267.94');
# --------------------------------------------------------

#
# Table structure for table `transactions`
#

CREATE TABLE `transactions` (
  `id` int(8) unsigned NOT NULL auto_increment,
  `business` varchar(50) NOT NULL default '',
  `txn_id` varchar(20) NOT NULL default '',
  `item_name` varchar(60) NOT NULL default '',
  `item_number` varchar(40) NOT NULL default '',
  `quantity` varchar(6) NOT NULL default '',
  `invoice` varchar(40) NOT NULL default '',
  `custom` varchar(127) NOT NULL default '',
  `tax` varchar(10) NOT NULL default '',
  `option_name1` varchar(60) NOT NULL default '',
  `option_selection1` varchar(127) NOT NULL default '',
  `option_name2` varchar(60) NOT NULL default '',
  `option_selection2` varchar(127) NOT NULL default '',
  `memo` text NOT NULL,
  `payment_status` varchar(15) NOT NULL default '',
  `payment_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `txn_type` varchar(15) NOT NULL default '',
  `mc_gross` varchar(10) NOT NULL default '',
  `mc_fee` varchar(10) NOT NULL default '',
  `mc_currency` varchar(5) NOT NULL default '',
  `settle_amount` varchar(12) NOT NULL default '',
  `exchange_rate` varchar(10) NOT NULL default '',
  `first_name` varchar(127) NOT NULL default '',
  `last_name` varchar(127) NOT NULL default '',
  `address_street` varchar(127) NOT NULL default '',
  `address_city` varchar(127) NOT NULL default '',
  `address_state` varchar(127) NOT NULL default '',
  `address_zip` varchar(20) NOT NULL default '',
  `address_country` varchar(127) NOT NULL default '',
  `address_status` varchar(15) NOT NULL default '',
  `payer_email` varchar(127) NOT NULL default '',
  `payer_status` varchar(15) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=65 ;


# --------------------------------------------------------

#
# Table structure for table `translog`
#

CREATE TABLE `translog` (
  `id` int(11) NOT NULL auto_increment,
  `log_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `payment_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `logentry` text NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=63 ;
 
kguske







PostPosted: Sat Mar 04, 2006 7:56 pm Reply with quote

The code in the block file you want to change is in $query_Recordset3. Just comment out the WHERE clause in both places where $query_Recordset3 is set.

Change:
Code:
      $query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';

      $query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
      $query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
      $query_Recordset3 .= ' FROM transactions'
         . ' WHERE ( transactions.payment_date >= DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) '
         . ' GROUP BY txn_id ORDER BY payment_date DESC';

to:
Code:
      $query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';

      $query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
      $query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
      $query_Recordset3 .= ' FROM transactions'
#         . ' WHERE ( transactions.payment_date >= DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) '
         . ' GROUP BY txn_id ORDER BY payment_date DESC';

and change:
Code:
      $query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';

      $query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
      $query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
      $query_Recordset3 .= ' FROM transactions'
         . ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
         . ' DAY ) , \'%Y-%m-' . $swingd . '\' ) '
         . ' GROUP BY txn_id ORDER BY payment_date DESC';

to:
Code:
      $query_Recordset3 = 'SELECT custom AS name, option_selection1 as showname, ';

      $query_Recordset3 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
      $query_Recordset3 .= 'CONCAT(\'$\',SUM(mc_gross)) AS amt ';
      $query_Recordset3 .= ' FROM transactions'
#         . ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
#         . ' DAY ) , \'%Y-%m-' . $swingd . '\' ) '
         . ' GROUP BY txn_id ORDER BY payment_date DESC';
 
kguske







PostPosted: Sat Mar 04, 2006 7:58 pm Reply with quote

You might also want to make a similar change to the module index page, since the transactions are also shown there.
 
Unit1







PostPosted: Sat Mar 04, 2006 8:17 pm Reply with quote

Thank you kguske will try it now RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Nuke Treasury

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©