osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

MAX and Current Auction... anybody get this to work

This is a discussion on MAX and Current Auction... anybody get this to work within the osCMax v1.7 General Mods Discussion forums, part of the osCMax v1.7 Forums category; my client needs this mod that shows current auctions on his site but im have problems figuring out how to ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 General Mods Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 05-03-2004, 02:02 PM
Lurker
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
billz
Default MAX and Current Auction... anybody get this to work

my client needs this mod that shows current auctions on his site but im have problems figuring out how to make this work in max version. mod is very easy to install but when u click on auction link it works but changes look of site ( to osC layout i believe ) ... anybody know what changes i would need to make so that the auction page shows my template version??? any help at all would be appreciated... i fear i may have to drop max version and have to start with plain version and add a bunch of mods myself. could not get current auction working right in max with bts1, bts 1.2a or with simple template mod. understand the prob is in the current_auctions.php but lost on how or what to do.

http://www.oscommerce.com/community/...earch,auctions

<?php
/*
$Id: current_auctions.php,v 1.22 2003/06/05 23:26:22 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
##########################################
# php eBay List 1.2
# Grab and Display your eBay auctions on your web site
# --------------------------------------------------
# Many thanks to:
# Written by: Chrispian H. Burks
# email: chris@aeoninteractive.com
# website: http://www.aeoninteractive.net
# Please submit bugs to chris@aeoninteractive.com
# Modified by Joseph Smith for the OSC Community
# email: joe@smittys.pointclark.net
#
# Thanks to all the users who sent in feedback and to everyone at
# sitepoint.com for all their help and ideas.
# --------------------------------------------------
# This software is linkware! Please leave the link back
# to Aeon Interactive. Feel free to modify this script.
# If you do, send it to me and I'll include any cool
# mods in the next release.
# --------------------------------------------------
# Legal: This script is presented with no warranty, NOT ENDORSED BY EBAY
#
# THE NAMES MENTIONED ABOVE ARE NOT RESPONSIBLE FOR ANYTHING
#
##########################################



// Define our variables -----------------------------------------------------------------

// Your Ebay Member Name
$ebayid = "";

// Display Thumbnails?
$thumbs = "0"; // 1 = yes 0 = no

// Table Border Color
$table_border_color = "#FFFFFF";

// Table Header Row Color
$table_header_color = "#CCCCFF";

// Table Alt Color Row 1
$table_row1_color = "#FFFFFF";

// Table Alt Color Row 2
$table_row2_color = "#EFEFEF";

// Ebay uses Pacific time zone use this to add hours for your time zone
$timezone = "0";

// Display Ended Auctions (-1 = Current, 1 - 30 = Up to 30 Days in the past)
$since = "14";

//Sort By (Item Number = 1, Auction Start = 2, Auction End = 3, Current Price = 4, Newest First = 8,)
$sort = "8";

// Display how many per page - Set to a very high number like 999999 for all your listings
$limit = "100";

// End of our variables ---------------------------------------------------------------------

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CURRENT_AUCTIONS);

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CURRENT_AUCTIONS));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="main">
<?php

// Start our border table
echo "
<TABLE border=\"0\" cellPadding=\"0\" cellSpacing=\"0\" width=\"100%\">
<TR><TD bgcolor=\"$table_border_color\"><TABLE border=\"0\" cellPadding=\"2\" cellSpacing=\"1\" width=\"100%\">
<TR>
<tr bgcolor=\"$table_header_color\" valign=\"middle\">
<td align=\"center\" width=\"20%\"><u><b><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">Item #</font></b></u></td>
<td align=\"center\" width=\"20%\"><u><b><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">Start Date</font></b></u></td>
<td align=\"center\" width=\"20%\"><u><b><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">End Date</font></b></u></td>
<td align=\"center\" width=\"20%\"><u><b><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">Time Left</font></b></u></td>
<td align=\"center\" width=\"20%\"><u><b><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">Current Price</font></b></u></td>
<td align=\"center\" width=\"20%\"><u><b><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">High Bidder</font></b></u></td>
</TR>
";


// Build the ebay url
$URL = "http://cgi6.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=ViewListedItems& userid=$ebayid&since=$since&sort=$sort&amp ;rows=0";

// Where to Start grabbing and where to End grabbing
$Start = "Click on the column headers to sort";
// $End = "</p><SCRIPT SRC=\"http://include.ebay.com/aw/pics/js/stats/ss.js\"></SCRIPT><SCRIPT SRC=\"http://include.ebay.com/aw/pics/js/stats/ss2.js\"></SCRIPT><p>" or "indicates that auction has ended.";

// Open the file
$file = fopen("$URL", "r");

// Read the file
if (!function_exists('file_get_contents')) {
$r = fread($file, 80000);
}
else {
$r = file_get_contents($URL);
}

// Grab just the contents we want
$stuff = eregi("$Start(.*)$End", $r, $content);

// Get rid of some rubbish we don't need.
// And set things up to be split into lines and items.

$content[1] = ereg_replace("</a><table border=\"1\" cellpadding=\"3\".*</td><br></tr>","",$content[1]);
$content[1] = ereg_replace("<tr bgcolor=\"#CCCCFF\">.*High Bidder \/ Status","",$content[1]);
$content[1] = ereg_replace("<tr bgcolor=\"#CCCCFF\">.*High Bidder \/ Status","",$content[1]);
$content[1] = str_replace("</table>", "", $content[1]);
$content[1] = str_replace("</th>", "", $content[1]);
$content[1] = str_replace("\r\n", "", $content[1]);
$content[1] = str_replace("\n", "", $content[1]);
$content[1] = str_replace("\r", "", $content[1]);
$content[1] = str_replace("<td align=\"center\">", "", $content[1]);
$content[1] = str_replace("<td>", "", $content[1]);
$content[1] = str_replace("<td align=\"right\">", "", $content[1]);
$content[1] = str_replace("<font color=\"\">", "", $content[1]);
$content[1] = str_replace("</font>", "", $content[1]);
$content[1] = str_replace("<tr bgcolor=\"#ffffff\">", "", $content[1]);
$content[1] = str_replace("<tr bgcolor=\"#efefef\">", "", $content[1]);
$content[1] = str_replace("<tr bgcolor=\"#efefef\">", "", $content[1]);
$content[1] = str_replace("</td>", "[ITEMS]", $content[1]);
$content[1] = str_replace("</tr>", "[LINES]\n", $content[1]);


// Line used during debug
// echo "<hr>$content[1]<br><br> <hr>";


// Close the file
fclose($file);

$stuff = $content[1];

// Build our first array for EOF
$items = explode("[LINES]",$stuff);

// Loop through our lines

$count = "0";

foreach ($items as $listing) {
// Break apart each line into individual items

list($Item,$Start,$End,$Price,$Title,$HighBidder ) = explode("[ITEMS]",$listing);

// We want to get rid of the (*) from the High Bidder
$HighBidder = str_replace("(*)" , "" , $HighBidder);

//Use a countdown to get Time Left
//We need to break apart End and convert the months to numbers
$seperate = split('[- :]', $End);

$seperate[0] = str_replace("Jan", "1", $seperate[0]);
$seperate[0] = str_replace("Feb", "2", $seperate[0]);
$seperate[0] = str_replace("Mar", "3", $seperate[0]);
$seperate[0] = str_replace("Apr", "4", $seperate[0]);
$seperate[0] = str_replace("May", "5", $seperate[0]);
$seperate[0] = str_replace("Jun", "6", $seperate[0]);
$seperate[0] = str_replace("Jul", "7", $seperate[0]);
$seperate[0] = str_replace("Aug", "8", $seperate[0]);
$seperate[0] = str_replace("Sep", "9", $seperate[0]);
$seperate[0] = str_replace("Oct", "10", $seperate[0]);
$seperate[0] = str_replace("Nov", "11", $seperate[0]);
$seperate[0] = str_replace("Dec", "12", $seperate[0]);

$month = $seperate[0];
$day = $seperate[1];
$year = $seperate[2];
$hour = $seperate[3]+$timezone;
$minute = $seperate[4];
$second = $seperate[5];

// mktime is the marked time, and time() is the current time.
$target = mktime($hour,$minute,$second,$month,$day,$year);
$diff = $target - time();

$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days * 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours * 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;

// next we put it into a presentable format
$Time_Left = $days . "d" . " " . $hours . "h" . " " . $minutes . "m";

// and last we want to print auction ended when the auction has ended
if ($seconds <= 0) {
$TimeLeft = "Auction Ended";
}
else {
$TimeLeft = $Time_Left;
}

// Make sure we have content to print out and print it
if ($Start && $End && $Title && ($count < $limit)) {

$count++;

$colour = ( $colour == "$table_row1_color" ) ? "$table_row2_color" : "$table_row1_color";

$line = "<TR><TD bgcolor=\"$colour\">$Title</TD></TR>
<TR><TD bgcolor=\"$colour\" align=\"center\">$Item</TD>
<TD bgcolor=\"$colour\">$Start</TD>
<TD bgcolor=\"$colour\">$End</TD>
<TD bgcolor=\"$colour\">$TimeLeft</TD>
<TD bgcolor=\"$colour\">$Price</TD>
<TD bgcolor=\"$colour\">$HighBidder</TD></TR>\n";


preg_match('/item=([^"&]*)/', $line, $match);
$itemnum=$match[1];


// If Thumbnails are enabled show them
if ($thumbs == 1) {
echo "<tr bgcolor=\"$colour\">
<td align=\"left\" colspan=\"6\">
<font face=\"Arial, sans-serif\" size=\"2\">
<a href=\"http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=$itemnum\" target=\"_blank\">$Title</a></font></td></tr>
<TR><TD bgcolor=\"$colour\" align=\"center\"><a href=\"http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=$itemnum\" target=\"_blank\">
<img src=\"http://thumbs.ebay.com/pict/$itemnum.jpg\"></a><br><font face=\"Arial, sans-serif\" size=\"2\">$itemnum</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$Start</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$End</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\" color=\"#FF0000\">$TimeLeft</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><b><font face=\"Arial, sans-serif\" size=\"2\" color=\"#339933\">$Price</font></b></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$HighBidder</font></TD></TR>\n";
}

// Otherwise just show the Bid Now link
else {
echo "<tr bgcolor=\"$colour\">
<td align=\"left\" colspan=\"6\">
<font face=\"Arial, sans-serif\" size=\"2\">
<a href=\"http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=$itemnum\" target=\"_blank\">$Title</a></font></td></tr>
<TR><TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$itemnum</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$Start</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$End</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\" color=\"#FF0000\">$TimeLeft</font></TD>
<TD bgcolor=\"$colour\" align=\"center\"><b><font face=\"Arial, sans-serif\" size=\"2\" color=\"#339933\">$Price</font></b></TD>
<TD bgcolor=\"$colour\" align=\"center\"><font face=\"Arial, sans-serif\" size=\"2\">$HighBidder</font></TD></TR>\n";
}



}

}

// Wrap up the border table
echo "</TABLE></td></tr> </table>";
echo "<TABLE border=\"0\" cellPadding=\"2\" cellSpacing=\"1\" width=\"100%\">
<tr bgcolor=\"$table_header_color\" valign=\"middle\">
<TD align=\"center\"><font size=\"1\" face=\"Verdana, Arial, sans-serif\" color=\"#0000FF\">
<b>Powered By: <a href=\"http://www.aeoninteractive.net\" target=\"_blank\">Aeon Interactive</a></b></font></td>
</tr> </table>";

?>
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 05-04-2004, 08:20 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,808
Thanks: 5
Thanked 105 Times in 91 Posts
Rep Power: 12
jpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to all
Default

First of all this file has mostly inline style sheets (colors ect are hard coded/set in the file it self) ands is not using the common stylesheet file. You could change the color setting to match or use the CSS and modify the file.

As to move it to BTS - it would not be too hard - move all the HTML to a .tpl.php file then put the template place holder etc... Just as you would have to do for most contributions for BTS.

It should work fine - even without moving it to the BTS format. Just change the inline style colors to match your system.

Code:
// Table Border Color 
$table_border_color = "#FFFFFF"; 

// Table Header Row Color 
$table_header_color = "#CCCCFF"; 


// Table Alt Color Row 1 
$table_row1_color = "#FFFFFF"; 

// Table Alt Color Row 2 
$table_row2_color = "#EFEFEF";
Good Luck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 05-04-2004, 09:23 AM
Anonymous
Guest
 
Posts: n/a
Default

"Just as you would have to do for most contributions for BTS"

and there lies my problem and my solution.... need to search for some info on doing just this... very new at this as u might have suspected. in any case i do appreciate u taking the time to respond.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
How do I get rid of 'Current Parse Time'? Willum osCMax v2 Installation issues 3 09-12-2005 09:02 AM
Ebay Auction Sales Manager LSVF osCMax v1.7 General Mods Discussion 0 08-23-2004 03:08 PM
Will MS2-MAX overwrite my current shop? emikey osCMax v1.7 Installation 4 08-14-2004 06:17 PM
Current Download 1.5 Anonymous osCMax v1.7 Discussion 1 04-22-2004 10:12 AM
EBAY AUCTION CONTRIB brian6990 osCMax v1.7 General Mods Discussion 2 03-14-2004 02:11 PM


All times are GMT -8. The time now is 03:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax