Reply
Old 05-22-2005, 08:12 PM PHP Help
Eightyeight's Avatar
Extreme Talker

Posts: 199
My website is Ads4Auction.com. On my index right before "Last created auctions" and the bar above it i want to write some text. Can anyone tell me how to do that with the code for it below?

PHP Code:
<?#//v.2.5.1 enhanced version
 
 /* index.php
 
 
 
    2005 - WEB2035.com revision  - COPYRIGHT 2004 Phpauction.org                  
 
    
 
    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 (version 2 or later).                                  
 
                                                                         
 
    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., 675 Mass Ave, Cambridge, MA 02139, USA.
 
    
 
 */
 
 
 
 
require('./includes/config.inc.php');
 
 require(
"./header.php");
 
 
 
 
 
 
#// Run cron according to SETTINGS
 
 
if($SETTINGS['cron'] == 2) {
 
     include_once 
"cron.php";
 
 }
 
 
$TIME mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y"));
 
 
$NOW date("YmdHis",$TIME);
 
 
$pic1 "nopicture.gif";
 
 
copy($pic1,$image_upload_path.$pic1);
 
 
 
 
/*
 
 prepare data for templates/template
 
 */
 
 
 
 /* prepare categories list for templates/template */
 
 # Prepare categories sorting
 
 
if($SETTINGS['catsorting'] == 'alpha') {
 
     
$catsorting " ORDER BY cat_name ASC";
 
 } else {
 
     
$catsorting " ORDER BY sub_counter DESC";
 
 }
 
 
$TPL_categories_value "";
 
 
$query "select * from PHPAUCTION_categories WHERE parent_id=0 $catsorting";
 
 
$result mysql_query($query);
 
 if(!
$result) {
 
     
MySQLError($query);
 
     exit;
 
 } else {
 
     
$num_cat mysql_num_rows($result);
 
     
$i 0;
 
     
$TPL_categories_value .= "<TABLE BORDER=0>\n";
 
     while(
$i $num_cat && $i 23) {
 
         
$cat_id mysql_result($result,$i,"cat_id");
 
         
$cat_name mysql_result($result,$i,"cat_name");
 
         
$sub_count intval(mysql_result($result$i"sub_counter"));
 
         
$cat_colour mysql_result($result$i"cat_colour");
 
         
$cat_image mysql_result($result$i"cat_image");
 
         
$cat_counter = (int)mysql_result($result$i"counter" );
 
         if (
$sub_count!=0$cat_counter "(".$sub_count.")";
 
         else {
 
             
$cat_counter "";
 
         }
 
         
$cat_url "./browse.php?id=$cat_id";
 
         
$TPL_categories_value .= "<TR>\n<TD>";
 
         if ( 
$cat_image != "") {
 
             
$TPL_categories_value .= "<A HREF=\"$cat_url\"><IMG SRC=\"$cat_image\" width=\"$cat_width\" border=0></A>";
 
         }
 
         
$TPL_categories_value .= "</TD>\n";
 
         if ( 
$cat_colour != "") {
 
             
$TPL_categories_value .= "<TD BGCOLOR=\"$cat_colour\">";
 
         } else {
 
             
$TPL_categories_value .= "<TD>";
 
         }
 
         
 
         
$TPL_categories_value .= $std_font."<A HREF=\"$cat_url\">$cat_name</A></FONT>".$std_font." $cat_counter"."</FONT></TD></TR>\n";
 
         
$i++;
 
     }
 
     
$TPL_categories_value .= "</TABLE>\n";
 
     
$TPL_categories_value .= $std_font."<A HREF=\"browse.php?id=0\">$MSG_277</FONT></A>";
 
 }
 
 
 
 
#// ####################################################################################################################
 
 
 /* get last created auctions */
 
 
$query "select id, title, pict_url, current_bid,starts from PHPAUCTION_auctions
 
                       WHERE
 
                                           closed='0' AND
 
                                           suspended=0 AND
 
                                           private='n' AND
 
                                           starts<="
.$NOW.
 
                                           ORDER BY starts DESC
 
                                           LIMIT "
.$SETTINGS['lastitemsnumber'];
 
                      
$result mysql_query($query);
 
                      if (
$result) {
 
                      
$num_auction mysql_num_rows($result);
 
                       }
 
                       else {
 
                      
$num_auction 0;
 
                       }
 
                       
 
                      
$i 0;
 
                      
$bgcolor "#ffffff";
 
                      
$TPL_last_auctions_value "";
 
                      while(
$i $num_auction) {
 
                          if(
$bgcolor == "#ffffff") {
 
                              
$bgcolor "$tablebg";
 
                          } else {
 
         
$bgcolor "#ffffff";
 
   }
 
     
$title mysql_result($result,$i,"title");
 
     
$id      mysql_result($result,$i,"id");
 
     
$date     mysql_result($result,$i,"starts");
 
     
$pict_url mysql_result($result$i"pict_url");
 
     
$current_bid mysql_result($result$i"current_bid");
 
     
$year substr($date,0,4);
 
     
$month substr($date,4,2);
 
     
$day substr($date,6,2);
 
     
$hours substr($date,8,2);
 
     
$minutes substr($date,10,2);
 
     
$seconds substr($date,12,2);
 
     
$pict "uploaded/$pict_url";
 
         
 
     
 
     if (
$pict_url != "") {
 
                 
$f_size getimagesize($pict);
 
             
 
                 
$width $f_size[0];
 
                 
$height $f_size[1];
 
                 
 
                 
$x_ratio $max $width;
 
                 
$y_ratio $max $height;
 
              if ((
$width <= $max) && ($height <= $max)) {
 
                   
$tn_width $width;
 
                   
$tn_height $height;
 
                 }
 
                 else if ((
$x_ratio $height) < $max) {
 
                   
$tn_height ceil($x_ratio $height);
 
                   
$tn_width $max;
 
                 }
 
                 else {
 
                   
$tn_width ceil($y_ratio $width);
 
                   
$tn_height $max;
 
                 }
 
                 
 
              
$thumbnail "<a href=\"item.php?id=$id\">"."<IMG SRC=\"uploaded/".$pict_url."\" width=\"$tn_width\" height=\"$tn_height\" border=\"0\" alt=\"See more details for $title\">"."</a>";
 
               }
 
               else {
 
              
$thumbnail "<img src=\"images/nopicture.gif\" width=$max>";
 
       }
 
             
 
             
 
             
 
             
 
             
 
         
 
         
//-- if ($pict_url != "") {    
 
         //--    $thumbnail = "<A HREF=\"item.php?id=$id\"><IMG SRC=\"uploaded/".$pict_url."\" WIDTH=".$SETTINGS['thumb_show']." BORDER=0></A>";
 
         //--    }
 
         //--      else {
 
         //--     $thumbnail = "<img src=\"images/nopicture.gif\" WIDTH=".$SETTINGS['thumb_show']." BORDER=0>";
 
         //--  }
 
     
 
         
$query "select bid from PHPAUCTION_bids where auction='$id'";
 
                 
$result_numbids mysql_query($query);
 
         
$num_bids mysql_num_rows($result_numbids);
 
     
 
     
//- deleted $TPL_last_auctions_value .="
 
         //- deleted<TR BGCOLOR=\"$bgcolor\">
 
         //- deleted    <TD WIDTH=\"50%\" VALIGN=top ALIGN=LEFT>$std_font".ArrangeDateNoCorrection($day,$month,$year,$hours,$minutes)."</FONT></TD>
 
         //- deleted    <TD WIDTH=\"50%\" VALIGN=top ALIGN=LEFT>$std_font<A HREF=\"./item.php?id=$id\">".stripslashes($title)."</A></FONT></TD></TR>";
 
         
 
         //-- Added start
 
         
 
         
$TPL_last_auctions_value .= "<tr bgcolor=\"$bgcolor\">".
 
          
"<td width=\"30%\" height=\"90\" valign=\"middle\" align=\"center\" background=\"\">"$thumbnail ."<b><br>"."$sml_font""Current Bid:"."<br></font></b>"."$sml_font"."$".print_money ($current_bid). "</font></td>".
 
           
 
           
"<td width=\"40%\" valign=\"middle\" align=\"center\" background=\"\">".
 
                 
 
          
"$std_font<b><a href=\"./item.php?id=$id\">".stripslashes($title). "</a></font></B><br>".
 
             
"</td>".
 
           
 
           
 
           
 
           
 
          
"<td width=\"30%\" valign=\"middle\" align=\"center\" background=\"\"><b>".
 
          
"$sml_font"."Created:"."</></b></font><br>"."$sml_font".
 
          
ArrangeDate($day$month$year$hours$minutes)."<p><b>"."Number of bids:"."</b><br>"."$sml_font".$num_bids.
 
           
"</font></td>".
 
           
 
           
"</tr>";
 
           
 
           
"<tr bgcolor=\"$bgcolor\">".
 
          
"<td width=\"100%\" valign=\"middle\" align=\"center\">"$thumbnail ."<b><br>"."$sml_font""Current Bid:"."<br></font></b>"."$sml_font"."$".print_money ($current_bid). "</font></td></tr>".
 
           
 
           
$query "select bid from PHPAUCTION_bids where auction='$id'";
 
                  
$result_numbids mysql_query($query);
 
                  
$num_bids mysql_num_rows($result_numbids);
 
         
 
           
$i++;
 
 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* get ending soon auctions */
 
 
$TPL_ending_soon_value "";
 
 
$now date("YmdHis",time());
 
 
$query "SELECT ends,id,title,pict_url,current_bid from PHPAUCTION_auctions
 
                      WHERE closed='0' AND
 
                      suspended='0' AND
 
                      private='n' AND
 
                      starts<="
.$NOW."
 
                      order by ends LIMIT "
.$SETTINGS['endingsoonnumber'];
 
 
$result mysql_query($query);
 
                      if (
$result) {
 
                      
$num_auction mysql_num_rows($result);
 
                       }
 
                       else {
 
                      
$num_auction 0;
 
                       }
 
 
 
 
$i 0;
 
                      
$bgcolor "#ffffff";
 
                      
$TPL_ending_soon_value "";
 
                      while(
$i $num_auction) {
 
                          if(
$bgcolor == "#ffffff") {
 
                              
$bgcolor "$tablebg";
 
                          } else {
 
         
$bgcolor "#ffffff";
 
   }
 
     
$title     mysql_result($result,$i,"title");
 
     
$id     mysql_result($result,$i,"id");
 
     
$ends     mysql_result($result,$i,"ends");
 
     
$pict_url mysql_result($result$i"pict_url");
 
     
$current_bid mysql_result($result$i"current_bid");
 
     
$pict "uploaded/$pict_url";
 
     
$nowt    $TIME;
 
     
$difference mktime(    substr ($ends82),
 
     
substr ($ends102),
 
     
substr ($ends122),
 
     
substr ($ends42),
 
     
substr ($ends62),
 
     
substr ($ends04))-$nowt;
 
     if (
$difference 0) {
 
         
$days_difference floor($difference 86400);
 
         
$difference $difference 86400;
 
         
$hours_difference floor($difference 3600);
 
         
$difference $difference 3600;
 
         
$minutes_difference floor($difference 60);
 
         
//--$seconds_difference = $difference % 60;
 
         
$ends_string sprintf("%d%s %02dh:%02dm:%02ds</FONT>",$days_difference,$MSG_126$hours_difference,$minutes_difference,$seconds_difference);
 
     } else {
 
         
$ends_string "$err_font $MSG_911</FONT>";
 
     }
 
     
 
 if (
$pict_url != "") {
 
                 
$f_size getimagesize($pict);
 
             
 
                 
$width $f_size[0];
 
                 
$height $f_size[1];
 
                 
 
                 
$x_ratio $max $width;
 
                 
$y_ratio $max $height;
 
              if ((
$width <= $max) && ($height <= $max)) {
 
                   
$tn_width $width;
 
                   
$tn_height $height;
 
                 }
 
                 else if ((
$x_ratio $height) < $max) {
 
                   
$tn_height ceil($x_ratio $height);
 
                   
$tn_width $max;
 
                 }
 
                 else {
 
                   
$tn_width ceil($y_ratio $width);
 
                   
$tn_height $max;
 
                 }
 
                 
 
              
$thumbnail "<a href=\"item.php?id=$id\">"."<IMG SRC=\"uploaded/".$pict_url."\" width=\"$tn_width\" height=\"$tn_height\" border=\"0\" alt=\"See more details for $title\">"."</a>";
 
               }
 
               else {
 
              
$thumbnail "<img src=\"images/nopicture.gif\" width=$max>";
 
       }
 
     
$query "select bid from PHPAUCTION_bids where auction='$id'";
 
       
$result_numbids mysql_query($query);
 
       
$num_bids mysql_num_rows($result_numbids);
 
 
 
     
 
     
 
     
$TPL_ending_soon_value .= "<tr bgcolor=\"$bgcolor\">".
 
              
"<td width=\"30%\" height=\"90\" valign=\"middle\" align=\"center\" background=\"\">"$thumbnail ."<b><br>"."$sml_font""Current Bid:"."<br></font></b>"."$sml_font"."$".print_money ($current_bid). "</font></td>".
 
               
 
              
"<td width=\"40%\" valign=\"middle\" align=\"center\" background=\"\">".
 
                   
 
              
"$std_font<b><a href=\"./item.php?id=$id\">".stripslashes($title). "</A></b></FONT><br>".
 
                 
"</td>".
 
                 
 
                 
 
                 
 
               
 
              
"<td width=\"30%\" valign=\"middle\" align=\"center\" background=\"\"><b>".
 
              
"$sml_font"."Ends in:"."</b></font><br>
 
              $sml_font $ends_string </font><p><b>"
.
 
              
"$sml_font"."Number of bids:"."</b></font><br>"."$sml_font".$num_bids.
 
               
"</font></td>".
 
               
 
               
"</tr>";
 
               
 
               
"<tr bgcolor=\"$bgcolor\">".
 
              
"<td width=\"100%\" valign=\"middle\" align=\"center\">"$thumbnail ."<b><br>"."$sml_font""Current Bid:"."<br></font></b>"."$sml_font"."$".print_money ($current_bid). "</font></td></tr>".
 
               
 
              
$query "select bid from PHPAUCTION_bids where auction='$id'";
 
                      
$result_numbids mysql_query($query);
 
                      
$num_bids mysql_num_rows($result_numbids);
 
             
 
               
$i++;
 
 }
 
     
 
     
 
 
 
 
/**
 
 * NOTE: get higher bids
 
 */
 
 
$TPL_activity_value "";
 
 
$query "select auction,max(bid) AS max_bid
 
                      FROM PHPAUCTION_bids GROUP BY bid,auction order by max_bid desc"
;
 
 
$result mysql_query($query);
 
 
 
 if (
$result$num_auction mysql_num_rows($result);
 
 else 
$num_auction 0;
 
 
 
 
$i 0
 
 
$j 0
 
 
$bgcolor "$tablebg";
 
 
$AU = array();
 
 
 
 while(
$i $num_auction && $j $SETTINGS['higherbidsnumber']) {
 
     
$max_bid  mysql_result($result,$i,"max_bid");
 
     
$auction  mysql_result($result,$i,"auction");
 
     
 
                                 
 
     
//-- Get auction data
 
     
 
     
$query "SELECT title,num_bids,closed,id from PHPAUCTION_auctions
 
                 WHERE id=\"$auction\" 
 
                 AND private='n'
 
                 AND    '"
.$NOW."'>=starts";
 
     
//print $query;
 
     
$result_bid mysql_query($query);
 
     if(
mysql_num_rows($result_bid) > 0) {
 
         
$title mysql_result($result_bid,0,"title");
 
         
$closed mysql_result($result_bid,0,"closed");
 
         
$num_bids mysql_result($result_bid,0,"num_bids");
 
         
$auc_id mysql_result($result_bid,0,"id");
 
     }
 
     
 
         
 
     if(
$closed == "0" && !in_array($auction,$AU)) {
 
         
#// Check bold and highlighted options
 
         
$TPL_activity_value .=
 
         
"<TR BGCOLOR=\"$bgcolor\">
 
         <TD WIDTH=\"30%\" VALIGN=top ALIGN=center>
 
          $std_font<A HREF=javascript:window_open('converter.php?AMOUNT=$max_bid','incre',650,200,30,30)>"
 
         
.print_money ($max_bid)."</FONT>
 
         </TD>
 
         
 
         <td width=\"30%\" valign=\"middle\" align=\"center\" background=\"\">
 
                     $std_font"
."Number of bids: "."</font><b>$std_font".$num_bids.
 
               
"</b></font></td>
 
         <TD ALIGN=center WIDTH=\"40%\">$std_font<b><A HREF=\"./item.php?id=$auc_id\">"
.stripslashes($title)."</A></b></FONT></TD>
 
         </TR>"
;
 
         
 
         
 
         
$AU[] = $auction;
 
         
$j++;
 
     }
 
     
$i++;
 
     
 
 }
 
 
// Build list of help topics
 
 
$query "SELECT * FROM PHPAUCTION_faqscategories";
 
 
$r_h = @mysql_query($query);
 
 if(!
$r_h) {
 
     
MySQLError($query);
 
     exit;
 
 }
 
 if(
mysql_num_rows($r_h) > 0) {
 
     while(
$faqscat mysql_fetch_array($r_h)) {
 
         
$faqscat['category']=stripslashes($faqscat['category']);
 
         
$TPL_helptopics .= "<A HREF=\"javascript: window_open('viewfaqs.php?cat=".$faqscat['id']."','faqs',500,400,20,20)\">".$faqscat['category']."</A><BR>";
 
     }
 
 } else {
 
     
$TPL_helptopics "&nbsp;";
 
 }
 
 
 
 
//-- Build news list
 
 
if($SETTINGS['newsbox'] == 1) {
 
     
$query "SELECT title,id,new_date from PHPAUCTION_news where suspended=0 order by new_date DESC limit ".$SETTINGS['newstoshow'];
 
     
$res mysql_query($query);
 
     if(!
$res) {
 
         
MySQLError($query);
 
         exit;
 
     }
 
     
$TPL_news_list "";
 
     while(
$new mysql_fetch_array($res)) {
 
         
$new['title'] = stripslashes($new['title']);
 
         
$new_date$new['new_date'];
 
         
$F_date FormatDate($new_date);
 
         
$TPL_news_list .= "&nbsp;";
 
         
$TPL_news_list .= "<IMG SRC=images/arrow2.gif WIDTH=4 HEIGHT=4>&nbsp;$sml_font<A HREF=\"viewnew.php?id=".$new['id']."\">".$new['title']."</A><BR>
 
     &nbsp;&nbsp;&nbsp;$F_date </font><BR>"
;
 
     }
 
 } else {
 
     
$TPL_news_list "&nbsp;";
 
 }
 
 
 
 require(
"./templates/template_index_php.html");
 
 require(
'./footer.php');
 
 
?>

Last edited by 0beron : 05-22-2005 at 08:17 PM.
Eightyeight is offline