LiveInternetMail.ru
Форум русской поддержки Joomla!® CMS
02.09.2014, 15:30:32 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
   
   Начало   Поиск Joomla 3.0 FAQ Joomla 2.5 FAQ Joomla 1.5 FAQ Правила форума Новости Joomla Войти Регистрация Помощь  
Страниц: [1]   Вниз
  Добавить закладку  |  Печать  
Автор Тема: Reverse Auctions  (Прочитано 7174 раз)
0 Пользователей и 1 Гость смотрят эту тему.
Aspik
Завсегдатай
*****

Репутация: +57/-2
Offline Offline

Пол: Мужской
Сообщений: 558

В личку не писать, не отвечу.


« : 22.07.2009, 11:30:23 »

компонент Reverse Auctions

выдает ошибку:
Warning: implode() [function.implode]: Bad arguments. in P:\home\localhost\www\auction\components\com_rbids\rbids.html.php on line 41
 Angry
<?php


Код:
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
require_once( $mosConfig_absolute_path."/components/com_rbids/gallery/gl_lytebox.php");

class HTML_Auction {
  
/**
     * AuctionDetails
     *
     * @param $auction
     * @param $lists
     * @param $bid_user
     * @param $bid_user_details
     * @param $bids_list
     * @param $currency
     * @param $messages
     * @date (07/24/2008)
     */
function AuctionDetails( &$auction,&$lists,&$bid_user,&$bid_user_details,&$bids_list,$currency,$messages )
{
/* @var $smarty Smarty*/
/* @var $auction mosrBidOffers */
/* @var $bid_user mosUser */
/* @var $max_price int */
/* @var $bid_list array */
/* @var $count_bidders int */
/* @var $currency int */
global $database, $my, $Itemid, $cb_fieldmap, $mosConfig_live_site, $mainframe;

$smarty=HTML_Auction_helper::LoadSmarty();
        
/* Page tagging */
$tags= new mosrBidTags($database);
        $auction->tags=$tags->getAuctionTags($auction->id);
        $mainframe->setPageTitle($auction->title);
        $mainframe->addMetaTag('description',strip_tags($auction->shortdescription));
        $mainframe->addMetaTag('abstract',strip_tags($auction->description));
       [u][i] [b]$mainframe->appendMetaTag('keywords',strip_tags(implode($auction->tags,',')));[/b][/i][/u]
$gallery = null;
if( bid_opt_disable_images!="1" ){
$gallery = new gl_lytebox($database, AUCTION_PICTURES);
$gallery->getGalleryForAuction($auction);
if( count($gallery->imagelist)>0 ){
$gallery->writeJS();
}
}

// ===> if logged
        if ( $my->id ){
$database->setQuery("select count(*) from #__rbid_messages where userid2='$my->id' and auction_id='$auction->id' and wasread!=1");
$auction->nr_new_messages = $database->loadResult();

if ($auction->userid==$my->id)
$auction->is_my_auction=1;
if (!$auction->is_my_auction && !$auction->close_offer) {
$database->setQuery("SELECT count(*) from #__rbid_watchlist WHERE userid='$my->id' AND auction_id='$auction->id' ");
if($database->loadResult())
    $auction->del_from_watchlist=1;
else
$auction->add_to_watchlist=1;
}

$mybid=new mosrBids($database);
if (!$mybid->LoadBidForUser($auction->id,$my->id)) $mybid=null;
$auction->mybid =$mybid;
}

$database->setQuery("SELECT sum(rating)/count(*) from #__rbid_rate where user_rated='$auction->userid' and rate_type='auctioneer'");
$auction->rating_auctioneer = $database->loadResult();

$database->setQuery("SELECT sum(rating)/count(*) from #__rbid_rate where user_rated='$auction->userid' and rate_type='bidder'");
$auction->rating_bidder = $database->loadResult();

$database->setQuery("SELECT sum(rating)/count(*) from #__rbid_rate where user_rated='$auction->userid' ");
$auction->rating_overall = $database->loadResult();

if ($auction->is_my_auction || ($auction->auction_type==AUCTION_TYPE_PUBLIC && $auction->show_bidder_nr)){
$database->setQuery("SELECT count(distinct userid) from #__rbids where auction_id=$auction->id");
$auction->nr_bidders = $database->loadResult();
}
if ($auction->is_my_auction || ($auction->auction_type==AUCTION_TYPE_PUBLIC && $auction->show_best_bid)){
$database->setQuery("SELECT b.bid_price,b.userid from #__rbids b where auction_id='$auction->id'  and accept = 1");
$winbid = $database->loadRow();

if ($winbid){
   $auction->winning_bid=$winbid[0];
   if($winbid[1]==$my->id && $my->id)
         $auction->i_am_winner=1;

}
else{
$database->setQuery("SELECT min(bid_price) from #__rbids where auction_id=$auction->id");
$max_bid = $database->loadResult();
if ($max_bid) $auction->highest_bid=$max_bid;

}
}elseif ($auction->close_offer){
$database->setQuery("SELECT b.bid_price from #__rbids b where auction_id='$auction->id'  and accept = 1 and userid='$my->id'");
$winbid = $database->loadRow();
if ($winbid){
   $auction->winning_bid=$winbid[0];
       $auction->i_am_winner=1;
}
}

if (bid_opt_allow_paypal ){
   if (CB_DETECT){
       $database->setQuery("select ".$cb_fieldmap['paypalemail']." from #__comprofiler where user_id='$auction->userid' ");
   }else{
       $database->setQuery("select paypalemail from #__rbid_users where userid='$auction->userid' ");
   }
   $paypalemail=$database->loadResult();
   $auction->paypalemail=$paypalemail;
}

if (bid_opt_enable_countdown){
        $expiredate=strtotime($auction->end_date);
        $diff=$expiredate-time();
           if ($diff>0){
               $s=sprintf("%02d",$diff%60);
               $diff=intval($diff/60);
               $m=sprintf("%02d",$diff%60);
               $diff=intval($diff/60);
               $h=sprintf("%02d",$diff%24);
               $d=intval($diff/24);

               if ($d>0) $auction->countdown="$d ".bid_days.", $h:$m:$s";
               else $auction->countdown="$h:$m:$s";

           }else{
               $auction->countdown=bid_expired;
           }
}

if(strtotime($auction->end_date) <= time()){
   $auction->expired=true;
}

   $auction->start_date_text=date(bid_opt_date_format,strtotime($auction->start_date));
if($auction->end_date && $auction->end_date!='0000-00-00 00:00:00' ) {
if(bid_opt_enable_hour){
        $dateformat=bid_opt_date_format." H:i";
}else $dateformat=bid_opt_date_format;
$auction->end_date_text=date($dateformat,strtotime($auction->end_date));
}

        if ($auction->close_offer && $my->id && ($auction->is_my_auction || $auction->i_am_winner)){
$query = "select count(id) from #__rbid_rate where (voter = '$my->id' and auction_id = '$auction->id')";
$database->setQuery($query);
if ($database->loadResult()==0)
$auction->must_rate=1;
        }
        
     $auction->links=HTML_Auction_helper::_CreateLinksArray($auction);


     if(bid_opt_disable_images!="1"){
    $auction->thumbnail=$gallery->getThumb(0,0);
    $auction->gallery=$gallery->getGallery();
}

$auction->currency_name=$currency;
$auction->catname=$auction->GetCategory();

$auction->username=$bid_user->username;
$auction->verified_auctioneer = mosrBidACL::_isVerified($auction->userid);

$auction->description=mosStripslashes($auction->description);
$auction->catname=mosStripslashes($auction->catname);

$smarty->assign('auction',$auction);
$smarty->assign('auctioneer',$bid_user);
$smarty->assign('auctioneer_details', $bid_user_details);
$smarty->assign('bid_list',$bids_list);
$smarty->assign('message_list',$messages);
$smarty->assign('lists',$lists);

// ===> if bidding process began: NDA file uploaded
if(isset($_SESSION["uploaded_NDA"]) && $_SESSION["uploaded_NDA"]=="1"){
$smarty->assign('uploaded_NDA', "1");
}
/* PLUGINS */
        $database->setQuery("select * from #__rbid_pricing where enabled=1 order by ordering");
        $pp=$database->loadObjectList();
        $pricing_plugins=array();
        if($pp)
            foreach ($pp as $p){$pricing_plugins[$p->itemname]=$p;}

$smarty->assign('pricing_plugins',$pricing_plugins);

/* PLUGINS */
$terms=new mosrBidMails($database);
if ($terms->load('terms_and_conditions') )
if ($terms->content!=='') $smarty->assign('terms_and_conditions','1');

$smarty->display('t_auctiondetails.tpl');
if (bid_opt_enable_countdown) { ?>
<script type="text/javascript" src="<?php echo $mosConfig_live_site."/components/com_rbids/js/countdown.js";?>"></script>
<script type="text/javascript">
var days='<?php echo  bid_days;?>,';
var expired='<?php echo  bid_expired;?>';
                var nrcounters=1;
</script>
<?php }
}
// <=== end AuctionDetails
  
    /**
     * HTML method: list auction
     *
     * @param $rows
     * @param $lists (html selects, filters, ..)
     * @param $pageNav
     * @param $sfilters (selected filters)
     */
function listAuctions( &$rows,  &$lists, $pageNav, $sfilters = null) {
global $Itemid, $mosConfig_live_site,  $my,$database,$task,$cb_fieldmap;
/*@var $pageNav mosPageNav*/
$gallery = null;
if(bid_opt_disable_images!=1) $gallery = new gl_lytebox($database,AUCTION_PICTURES);
/*@var $smarty Smarty*/
$smarty = HTML_Auction_helper::LoadSmarty();
if (bid_opt_enable_countdown) {
?>
<script type="text/javascript" src="<?php echo $mosConfig_live_site,"/components/com_rbids/js/countdown.js"?>"></script>
<?php } ?>
<?php
$k = 0; $count = count($rows); $auction_rows=array();

$tags= new mosrBidTags($database);
for($i=0;$i<$count;$i++){
 
/*@var $row mosrBidOffers*/
$row = $rows[$i];
$row->tags=$tags->getAuctionTags($row->id);

$links=HTML_Auction_helper::_CreateLinksArray($row);
if(bid_opt_disable_images!=1){$gallery->clearImages();$gallery->addImage($row->picture);}
$row->rownr=$i+1;
// ===> if logged
if ($my->id){

$database->setQuery("select count(*) from #__rbid_messages where userid2='$my->id' and auction_id='$row->id' and wasread!=1");
$row->nr_new_messages = $database->loadResult();

// to do : suff only one check : if task == myauctions
if ($row->userid==$my->id) $row->is_my_auction=1;
if (!$row->is_my_auction && !$row->close_offer) {
$database->setQuery("SELECT count(*) from #__rbid_watchlist WHERE userid='$my->id' AND auction_id='$row->id' ");
if($database->loadResult()) $row->del_from_watchlist=1; else $row->add_to_watchlist=1;
}

if (!$row->is_my_auction && $row->close_offer) {
$database->setQuery("SELECT b.bid_price from #__rbids b where auction_id='$row->id'  and accept = 1 and userid='$my->id'");
$winbid = $database->loadRow();
if ($winbid){ $row->winning_bid=$winbid[0]; $row->i_am_winner=1;}
}

if ($task=='mybids'){ $row->mybid =$row->bid_price; }
if ($row->close_offer && $my->id && ($row->is_my_auction || $row->i_am_winner)){
$database->setQuery("select count(id) from #__rbid_rate where (voter = '$my->id' and auction_id = '$row->id')");
if ($database->loadResult()==0) $row->must_rate=1;
}

}
// <=== if logged

if ($task!='myauctions'){
$database->setQuery("SELECT sum(rating)/count(*) from #__rbid_rate where user_rated='$row->userid' and rate_type='auctioneer'");
$row->rating_auctioneer= $database->loadResult();

$database->setQuery("SELECT sum(rating)/count(*) from #__rbid_rate where user_rated='$row->userid' and rate_type='bidder'");
$row->rating_bidder= $database->loadResult();

$database->setQuery("SELECT sum(rating)/count(*) from #__rbid_rate where user_rated='$row->userid' ");
$row->rating_overall= $database->loadResult();
}

if ($task=='myauctions' || ($row->auction_type==AUCTION_TYPE_PUBLIC && $row->show_best_bid)){
$database->setQuery("SELECT count(distinct userid) from #__rbids where auction_id=$row->id");
$row->nr_bidders = $database->loadResult();

$database->setQuery("SELECT b.bid_price from #__rbids b where auction_id=$row->id  and accept = 1");
$winbid = $database->loadResult();

if ($winbid) $row->winning_bid=$winbid;
else{
$database->setQuery("SELECT min(bid_price) from #__rbids where auction_id=$row->id");
$min_bid = $database->loadResult();
if ($min_bid) $row->highest_bid=$min_bid;
}
}

if ($task=='mywonbids' && bid_opt_allowpaypal){
if (CB_DETECT){
$database->setQuery("select ".$cb_fieldmap['paymentparam']." from #__comprofiler where user_id='$row->userid' ");
}else{
   $database->setQuery("select paypalemail from #__rbid_users where userid='$row->userid' ");
}
$paypalemail=$database->loadResult();
$row->paypalemail=$paypalemail;
}

if (bid_opt_enable_countdown){
$expiredate=strtotime($row->end_date);
$diff=$expiredate-time();
if ($diff>0){
   $s=sprintf("%02d",$diff%60);
   $diff=intval($diff/60);
   $m=sprintf("%02d",$diff%60);
   $diff=intval($diff/60);
   $h=sprintf("%02d",$diff%24);
   $d=intval($diff/24);

   if ($d>0) $row->countdown="$d ".bid_days.", $h:$m:$s";
   else $row->countdown="$h:$m:$s";
}else{
   $row->countdown=bid_expired;
}
}

if(strtotime($row->end_date) <= time()){ $row->expired=true; } else $row->expired=false;

$row->start_date_text=date(bid_opt_date_format,strtotime($row->start_date));
if($row->end_date && $row->end_date!='0000-00-00 00:00:00' ) {
if(bid_opt_enable_hour){ $dateformat=bid_opt_date_format." H:i"; } else $dateformat=bid_opt_date_format;
$row->end_date_text=date($dateformat,strtotime($row->end_date));
}

$u = new mosrBidUsers($database);
$u->load($row->userid);
$bid_user_details = $u->getUserDetails($row->userid);
$row->auctioneer=$u;
$row->auctioneer_details=$bid_user_details;

$row->verified_auctioneer=mosrBidACL::_isVerified($row->userid);

$row->links=$links;
if(bid_opt_disable_images!=1) $row->thumbnail=$gallery->getThumb();

$row->description=mosStripslashes($row->description);
$row->catname=mosStripslashes($row->catname);

$auction_rows[]=$row;
 }
 
          $smarty->assign('lists',$lists);
          $smarty->assign('auction_rows',$auction_rows);

          $link_page = "index.php?option=com_rbids&task=$task&Itemid=$Itemid";
          $smarty->assign('paging_pagelinks',$pageNav->writePagesLinks($link_page));
          $smarty->assign('paging_pagecounter',$pageNav->writePagesCounter());
          $smarty->assign('paging_limitbox',$pageNav->getLimitBox($link_page));

          $smarty->assign('sfilters',$sfilters);
          $smarty->assign('filters',HTML_Auction_helper::makeFilterArry($sfilters));

 $smarty->display("t_$task.tpl");
 ?>
 
        <?php if (bid_opt_enable_countdown) { ?>
            <script type="text/javascript">
                var days='<?php echo  bid_days;?>,';
                var expired='<?php echo  bid_expired;?>';
                var nrcounters=<?php echo count($auction_rows);?>;
            </script>
        <?php }
}
//<=== end listAuctions


    /**
     * HTML: list users
     *
     * @param $rows
     * @param $lists (html selects, filters, ..)
     * @param $pageNav
     * @param $sfilters (selected filters)
     */
function listSearchUsers( &$rows,  &$lists, $pageNav, $sfilters = null) {
global $Itemid, $mosConfig_live_site,  $my,$database,$task,$cb_fieldmap;
        /*@var $pageNav mosPageNav*/

        /*@var $smarty Smarty*/
        $smarty=HTML_Auction_helper::LoadSmarty();
        
$k = 0;
$count = count($rows);
$user_rows=array();

for($i=0; $i<$count; $i++){
$row = $rows[$i];
$row["rownr"]=$i+1;
if(CB_DETECT){
$row["city"] = $row[$cb_fieldmap["city"]];
$row["country_name"] = $row[$cb_fieldmap["country"]];
$row["YM"] = $row[$cb_fieldmap["YM"]];
$row["AreasOfExpertise"] = $row[$cb_fieldmap["AreaOfExpertise"]];

$row["user_link"]= sefRelToAbs( 'index.php?option=com_comprofiler&amp;task=userProfile&amp;user='. $row["id"] .'&amp;Itemid='. $Itemid );
}else{
$row["user_link"]= sefRelToAbs( 'index.php?option=com_rbids&amp;task=ViewDetails&amp;id='. $row["userid"] .'&amp;Itemid='. $Itemid );
}
                
$user_rows[]=$row;
}
$smarty->assign('lists',$lists);
$smarty->assign('user_rows',$user_rows);

$link_page = "index.php?option=com_rbids&task=$task&Itemid=$Itemid";
$smarty->assign('paging_pagelinks', $pageNav->writePagesLinks($link_page));
$smarty->assign('paging_pagecounter', $pageNav->writePagesCounter());
$smarty->assign('paging_limitbox', $pageNav->getLimitBox($link_page));

$smarty->assign('sfilters',$sfilters);
$smarty->assign('filters',HTML_Auction_helper::makeFilterArry($sfilters));
      
$smarty->display("t_showSearchUsersResults.tpl");
}
//<=== end listUsers


/**
*
* HTML: editAuctions
*
* @param $auction
* @param $option
* @param $lists
* @param $id
*/
function editAuction( &$auction, $option, $lists,$pictures,$id=null){
global $mosConfig_live_site, $Itemid, $my, $task, $database, $mainframe;
/*@var $auction mosrBidOffers */
/**  editor issues **/
$mainframe->loadEditor=true;
     initEditor();
    
if(rbidsVersionCheck()=="1")
mosCommonHTML::loadCalendar();
else { ?>
<script type="text/javascript" src="<?php echo JURI::root(true);?>/includes/js/calendar/calendar.js"></script>
<link rel="stylesheet" href="<?php echo JURI::root(true);?>/media/system/css/calendar-jos.css" type="text/css"  title="green"  media="all" />
<script type="text/javascript" src="<?php echo JURI::root(true);?>/includes/js/calendar/lang/calendar-en-GB.js"></script> <?php
}
// used to hide "Reset Hits" when hits = 0
mosMakeHtmlSafe( $auction, ENT_QUOTES );
/*@var $smarty Smarty*/
        $smarty=HTML_Auction_helper::LoadSmarty();
    
        // ======================>
        /** Gallery issues **/
     $gallery = null;
    
     if(bid_opt_disable_images!="1"){
    $gallery=new gl_lytebox($database,AUCTION_PICTURES);
    $gallery->getGalleryForAuction($row);
     }
    
if ($task=='republish'){
$old_auction=new mosrBidOffers($database);

$old_auction->load($id);
if(bid_opt_disable_images!="1")
$gallery->getGalleryForAuction($old_auction);
}else
    if(bid_opt_disable_images!="1")
$gallery->getGalleryForAuction($auction);

if(bid_opt_disable_images!="1"){
if ( (count($gallery->imagelist)>0  || $auction->picture) )
        $gallery->writeJS();

       $auction->imagelist=array();
       if (count($gallery->imagelist)>1){
for($i=0;$i<count($gallery->imagelist);$i++){
$obj=new stdClass();
$obj->thumbnail=$gallery->getThumb($i+1,0);
$obj->id=$gallery->imagelist_ids[$i+1];
if ($obj->id) $auction->imagelist[]=$obj;
}
       }
}
        /** Gallery issues **/
        // <====================

        $auction->is_my_auction = 1;
   $auction->expired = false;
   
if(isset($auction->start_date) && $auction->start_date!='0000-00-00 00:00:00' ) {
        $auction->start_date_text=date(bid_opt_date_format,strtotime($auction->start_date));

}
if(isset($auction->end_date) && $auction->end_date!='0000-00-00 00:00:00' ) {
if(bid_opt_enable_hour){
        $dateformat=bid_opt_date_format." H:i";
}else $dateformat=bid_opt_date_format;
$auction->end_date_text=date($dateformat,strtotime($auction->end_date));
}
        if($auction->id){
         $auction->links=HTML_Auction_helper::_CreateLinksArray($auction);
        }

if(bid_opt_disable_images!="1"){
$auction->thumbnail=$gallery->getThumb(0,0);
     $auction->gallery=$gallery->getGallery();
}

if($auction->id){
    $database->setQuery("select name from #__rbid_currency where id='$auction->currency'");
    $auction->currency_name=$database->loadResult();

    $database->setQuery("select name from #__rbid_payment where id=$auction->payment");
    $auction->payment_name=$database->loadResult();
}

        $auction->username=$my->username;
        $auction->description=mosStripslashes($auction->description);

        $smarty->assign('old_id',$id);
        $smarty->assign('lists',$lists);
        $smarty->assign('auction',$auction);
?>
        <script type="text/javascript" src="<?php echo "$gallery->_pathToJS/jquery.js"; ?>"></script>
        <script type="text/javascript" src="<?php echo "$gallery->_pathToJS/thickbox/thickbox.js"; ?>"></script>
        <link rel="stylesheet" href="<?php echo "$gallery->_pathToJS/thickbox/thickbox.css"; ?>" type="text/css" media="screen" />
        <script type="text/javascript">
        function getEditor()
        {
<?php
getEditorContents( 'description', 'description' );
?>
        }
        </script>
<form action="index.php" method="post" name="auctionForm" enctype="multipart/form-data" onsubmit="getEditor();return validateForm(this);">
<?php if($task=="republish"){?>
<input type="hidden" name="oldid" value="<?php echo $id; ?>">
<input type="hidden" name="oldppic" value="<?php echo $row->picture;?>">
<?php }?>
        <input type="hidden" name="id" value="<?php echo $auction->id; ?>">
        <input type="hidden" name="option" value="<?php echo $option; ?>">
        <input type="hidden" name="task" value="saveauction">
        <input type="hidden" name="Itemid" value="<?php echo $Itemid;?>">
<?php
$smarty->display('t_editauction.tpl');
?>
   </form>
<?php
}
// <== end editAuction



}
// <=== End class HTML_Auction


/**
 * Class HTML_UserDetails
 *
*/
class HTML_UserDetails {
    function viewUser(&$user,&$lists)
    {
        $smarty=HTML_Auction_helper::LoadSmarty();

$smarty->assign('user',$user);
$smarty->assign('lists',$lists);

$smarty->assign('ratings',$lists['ratings']);

        $smarty->display("t_userdetails.tpl");

    }
    function editUser(&$user,&$lists)
    {
        $smarty=HTML_Auction_helper::LoadSmarty();
        
$smarty->assign('user',$user);
$smarty->assign('lists',$lists);

$smarty->assign('ratings',$lists['ratings']);

        $smarty->display("t_myuserdetails.tpl");

    }
function myRatings(&$myratings){
        $smarty=HTML_Auction_helper::LoadSmarty();
$smarty->assign('myratings',$myratings);
        $smarty->display("t_myratings.tpl");
}
}
// <=== End class HTML_UserDetails


class HTML_actions{
function reportAuction($id){
   global $database;
   $auction=new mosrBidOffers($database);
   $auction->load($id);

$smarty=HTML_Auction_helper::LoadSmarty();
$smarty->assign("auction",$auction);
   $smarty->display("t_reportauction.tpl");
}
function searchAuction(&$lists){
/*@var $smarty Smarty*/
if(rbidsVersionCheck()=="1")
mosCommonHTML::loadCalendar();
else { ?>
<script type="text/javascript" src="<?php echo JURI::root(true);?>/includes/js/calendar/calendar.js"></script>
<link rel="stylesheet" href="<?php echo JURI::root(true);?>/media/system/css/calendar-jos.css" type="text/css"  title="green"  media="all" />
<script type="text/javascript" src="<?php echo JURI::root(true);?>/includes/js/calendar/lang/calendar-en-GB.js"></script> <?php
}
$smarty=HTML_Auction_helper::LoadSmarty();
$smarty->assign("lists",$lists);
   $smarty->display("t_search.tpl");
}
function searchUsers(&$lists){
/*@var $smarty Smarty*/
$smarty=HTML_Auction_helper::LoadSmarty();
$smarty->assign("lists",$lists);
   $smarty->display("t_searchUsers.tpl");
}
function listCategories(&$rows){
/*@var $smarty Smarty*/
        $smarty=HTML_Auction_helper::LoadSmarty();
$smarty->assign('categories',$rows);
        $smarty->display("t_categories.tpl");
}

}

/**
 * HTML utilities
 *
 */
class HTML_Auction_helper{
    function LoadSmarty()
    {
global $Itemid,$task,$option,$mosConfig_live_site,$my;
// set path to Smarty directory *nix style
if (!defined('SMARTY_DIR')) define('SMARTY_DIR', BIDS_COMPONENT_PATH.'/smarty/libs/');
        // include the smarty class Note 'S' is upper case
        require_once(SMARTY_DIR . 'Smarty.class.php');
        require_once(BIDS_COMPONENT_PATH .'/tabbedview.php');
        require_once(BIDS_COMPONENT_PATH .'/rbids.smarty.plugins.php');
        require_once(BIDS_COMPONENT_PATH .'/rbids.smarty.php');

        $smarty=new RauctionSmarty();
        $smarty->template_dir=BIDS_COMPONENT_PATH.'/templates/';
        $smarty->compile_dir=BIDS_COMPONENT_PATH.'/templates/cache/';
        //$smarty->debugging = true;

        $smarty->register_function('set_css','smarty_set_css');
        $smarty->register_function('infobullet','smarty_infobullet');
        $smarty->register_function('printdate','smarty_printdate');
        $smarty->register_function('createtab','smarty_createtab');
        $smarty->register_function('startpane','smarty_startpane');
        $smarty->register_function('endpane','smarty_endpane');
        $smarty->register_function('starttab','smarty_starttab');
        $smarty->register_function('endtab','smarty_endtab');
$smarty->register_modifier('stripslashes', 'stripslashes');

$smarty->assign('new_auction_link', sefRelToAbs( 'index.php?option=com_rbids&amp;task=newauction&amp;Itemid='. $Itemid ));
$smarty->assign('mosConfig_live_site',$mosConfig_live_site);
$smarty->assign('Itemid',$Itemid);
   $smarty->assign('task',$task);
        $smarty->assign('option',$option);
        $smarty->assign('is_logged_in',($my->id)?"1":"0");
        $smarty->assign('userid',$my->id);

        return $smarty;
}
function makeFilterArry($filters){
global $mosConfig_live_site,$database;

        $searchstrings=array();
if(isset($filters['keyword'])&& $filters['keyword']){
       $searchstrings[search_keyword_text]=$filters['keyword'];
}

   if(isset($filters['users'])&& $filters['users']){
       $database->setQuery("select username from #__users where id in (".$filters['users'].") and block=0");
       $results = $database->loadResultArray();
       if (is_array($results)){
           $usernames=join(',',$results);
           $searchstrings[search_usernames_text]=$usernames;
       }
     }
   if(isset($filters['cat'])&& $filters['cat']){
       $database->setQuery("select catname from #__rbid_categories where id='".$filters['cat']."'");
       $catname = $database->loadResult();
       $searchstrings[bid_category]=$catname;
     }
if(isset($filters['sdate']) && $filters['sdate']){
if(date('Y',strtotime($filters['sdate']))>'1970'){
    $searchstrings[bid_start_date]= date(bid_opt_date_format,strtotime($filters['sdate']));
}
}
if(isset($filters['bdate']) && $filters['bdate']){
if(date('Y',strtotime($filters['bdate']))>'1970'){
    $searchstrings[bid_end_date]= date(bid_opt_date_format,strtotime($filters['bdate']));
}
}
if (isset($filters['tag'])&& $filters['tag']){
 $searchstrings[bid_tags]= $filters['tag'];
}
if (isset($filters['auction_nr']) && $filters['auction_nr']){
 $searchstrings[bid_auction_number]= $filters['auction_nr'];
}
if (isset($filters['inarch']) && $filters['inarch']){
 if($filters['inarch']==1)
     $searchstrings[bid_filter_archive]= bid_yes;
 else
     $searchstrings[bid_filter_watchlist]= bid_yes;
}
if (isset($filters['filter_rated'])&&$filters['filter_rated']){
   $searchstrings[bid_filter_rated]= bid_unrated;
}
if (isset($filters['country'])&&$filters['country']){
   $searchstrings[bid_country]= $filters['country'];
}
if (isset($filters['city'])&&$filters['city']){
   $searchstrings[bid_city]= $filters['city'];
}
if (isset($filters['area'])&&$filters['area']){
   $searchstrings[bid_area]= $filters['area'];
}
return $searchstrings;
}
    function _CreateLinksArray(&$auction)
    {
        /*@var $auction mosrBidAuction*/
        global $Itemid,$task;

        $links=array();

        $links['otherauctions']=sefRelToAbs( 'index.php?option=com_rbids&amp;task=listauctions&amp;userid='. $auction->userid .'&amp;Itemid='. $Itemid );
        $links['bids'] = sefRelToAbs( 'index.php?option=com_rbids&task=viewbids&id='. $auction->id .'&Itemid='. $Itemid ).'#bid';
        $links['bid_list'] = sefRelToAbs( 'index.php?option=com_rbids&task=viewbids&id='. $auction->id .'&Itemid='. $Itemid ).'#bid_list';
  $links['edit'] = sefRelToAbs( 'index.php?option=com_rbids&amp;task=editauction&amp;id='.$auction->id.'&amp;Itemid='. $Itemid );
  $links['cancel'] = sefRelToAbs( 'index.php?option=com_rbids&amp;task=cancelauction&amp;id='.$auction->id.'&amp;Itemid='. $Itemid );
  $links['publish'] = sefRelToAbs('index.php?option=com_rbids&amp;task=publish&amp;Itemid='.$Itemid.'&amp;id='.$auction->id);
  $links['filter_cat'] = sefRelToAbs("index.php?option=com_rbids&task=listauctions&cat=$auction->cat&Itemid=$Itemid");
$links['republish'] = sefRelToAbs('index.php?option=com_rbids&amp;task=republish&amp;Itemid='.$Itemid.'&amp;id='.$auction->id);
$links['messages'] = sefRelToAbs('index.php?option=com_rbids&amp;task=viewbids&amp;Itemid='.$Itemid.'&amp;id='.$auction->id).'#messages';
$links['rate_auction'] = sefRelToAbs('index.php?option=com_rbids&amp;task=viewbids&amp;Itemid='.$Itemid.'&amp;id='.$auction->id).'#bid_list';
$links['add_to_watchlist'] = sefRelToAbs('index.php?option=com_rbids&amp;task=watchlist&amp;Itemid='.$Itemid.'&amp;id='.$auction->id);
$links['del_from_watchlist'] = sefRelToAbs('index.php?option=com_rbids&amp;task=delwatch&amp;Itemid='.$Itemid.'&amp;id='.$auction->id);
        $links['pagelinks'] = sefRelToAbs('index.php?option=com_rbids&amp;task='.$task.'&amp;Itemid='.$Itemid);
        $links['auctioneer_profile'] = sefRelToAbs( 'index.php?option=com_rbids&amp;task=ViewDetails&amp;id='. $auction->userid .'&amp;Itemid='. $Itemid );

        $links['report'] = sefRelToAbs('index.php?option=com_rbids&amp;task=report_auction&amp;id='.$auction->id.'&amp;Itemid='. $Itemid);
$links['bin'] = sefRelToAbs( 'index.php?option=com_rbids&amp;task=bin&amp;id='.$auction->id.'&amp;Itemid='. $Itemid );

        $links['new_auction'] = sefRelToAbs( 'index.php?option=com_rbids&amp;task=newauction&amp;Itemid='. $Itemid );
$links['bulkimport'] = sefRelToAbs( 'index.php?option=com_rbids&amp;task=bulkimport&amp;Itemid='.$Itemid );
$links['terms'] = sefRelToAbs( 'index.php?option=com_rbids&task=terms_and_conditions' );

$links['download_file'] = sefRelToAbs( 'index.php?option=com_rbids&task=downloadfile&file=attach&id='.$auction->id );
$links['download_nda'] = sefRelToAbs( 'index.php?option=com_rbids&task=downloadfile&file=nda&id='.$auction->id );
$links['deletefile_file'] = sefRelToAbs( 'index.php?option=com_rbids&task=deletefile&file=attach&id='.$auction->id );
$links['deletefile_nda'] = sefRelToAbs( 'index.php?option=com_rbids&task=deletefile&file=nda&id='.$auction->id );

$links['tags'] = '';
for($i=0;$i<count($auction->tags);$i++){
   if ($auction->tags[$i]){
        $href=sefRelToAbs('index.php?option=com_rbids&amp;task=tags&amp;Itemid='.$Itemid.'&amp;tag='.$auction->tags[$i]);
        $links['tags'] .= "<span id='auction_tag'><a href='$href'>".$auction->tags[$i]."</a>".(($i+1<count($auction->tags))?",":"")."</span>";
   }
}

return $links;
    }
function Payment_Thank_You()
{
   global $database;

        $smarty=HTML_Auction_helper::LoadSmarty();

        $itemname=mosGetParam($_REQUEST,'itemname','');
        $itemamount=mosGetParam($_REQUEST,'itemamount',1);

        $price_classname="price_$itemname";
        @include_once(BIDS_COMPONENT_PATH."/plugins/pricing/$price_classname.php");

        $price_class=new $price_classname($database );
        $item_description=$price_class->getDescription();

        $smarty->assign('itemname',$itemname);
        $smarty->assign('itemamount',$itemamount);
        $smarty->assign('itemdescription',$item_description);

        $smarty->display('t_payment_return.tpl');
}
    function Payment_Cancel()
    {
        /*@var $smarty Smarty*/
        $smarty=HTML_Auction_helper::LoadSmarty();
        $smarty->display('t_payment_cancel.tpl');
 }
    
    
}
// <=== End class HTML_Auction_helper
?>
« Последнее редактирование: 22.07.2009, 11:55:39 от Aspik » Записан
boston
Joostina
*****

Репутация: +222/-3
Offline Offline

Пол: Мужской
Сообщений: 499



« Ответ #1 : 22.07.2009, 11:38:44 »

Клёвый листинг, 41 первую строку самим считать? Это это она жирным выделена?
Что за расширение вообще?
Может как-нить будь более подробнее суть проблемы опишешь?
Записан
vagkrsk
Завсегдатай
*****

Репутация: +124/-0
Offline Offline

Пол: Мужской
Сообщений: 773

Дорогу осилит идущий


« Ответ #2 : 22.07.2009, 11:47:12 »

Сверни код (текст) при помощи [ spoiler title= Код такого-то компонента] Далее вставляем текст [ /spoiler]
Внимание! Перед использованием убери пробел внутри скобок.
Получаем следующую картину:
Код такого-то компонента

Из-за "обилия" кода теряется смысл вопроса, и смотрится очень некрасиво.
« Последнее редактирование: 22.07.2009, 12:00:05 от vagkrsk » Записан
boston
Joostina
*****

Репутация: +222/-3
Offline Offline

Пол: Мужской
Сообщений: 499



« Ответ #3 : 22.07.2009, 11:49:05 »

Еще подсветить можно через [ php ] [ / php], будет:
<?php phpinfo(); ?>
Записан
Aspik
Завсегдатай
*****

Репутация: +57/-2
Offline Offline

Пол: Мужской
Сообщений: 558

В личку не писать, не отвечу.


« Ответ #4 : 22.07.2009, 11:56:33 »

свернул Smiley
Записан
Aspik
Завсегдатай
*****

Репутация: +57/-2
Offline Offline

Пол: Мужской
Сообщений: 558

В личку не писать, не отвечу.


« Ответ #5 : 22.07.2009, 11:57:53 »

Клёвый листинг, 41 первую строку самим считать? Это это она жирным выделена?
Что за расширение вообще?
Может как-нить будь более подробнее суть проблемы опишешь?
все написано)
Записан
moninfo
Захожу иногда
**

Репутация: +0/-0
Offline Offline

Сообщений: 10


« Ответ #6 : 12.03.2010, 16:27:27 »

Всем привет. Есть у кого-нибудь перевод?
Записан
Страниц: [1]   Вверх
  Добавить закладку  |  Печать  
 
Перейти в:  

Рейтинг@Mail.ru Rambler Top100 Powered by SMF 1.1.19 | SMF © 2006, Simple Machines

Joomlaforum.ru is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters
the trademark holder in the United States and other countries.

LiveInternet