static function createLinks(&$auction) { $task = JRequest::getVar('task'); $ItemIdList = array(); $ItemIdList['listauctions'] = BidsHelperTools::getMenuItemId(array("task" => "listauctions")); // List Auctions, Auction Details $ItemIdList['newauction'] = BidsHelperTools::getMenuItemId(array("task" => "newauction", "task" => "form")); // New Auctions $links = array(); $links['otherauctions'] = JRoute::_('index.php?option=com_bids&task=listauctions&users=' . $auction->userid . '&Itemid=' . $ItemIdList['listauctions']); $links['auctiondetails'] = self::auctionDetailsURL($auction); $links['bids'] = self::auctionDetailsURL($auction) . '#bid'; $links['bid_list'] = self::auctionDetailsURL($auction) . '#bid_list'; $links['messages'] = self::auctionDetailsURL($auction) . '#messages'; $links['rate_auction'] = self::auctionDetailsURL($auction) . '#bid_list'; $links['edit'] = JRoute::_('index.php?option=com_bids&task=editauction&id=' . $auction->id . '&Itemid=' . $ItemIdList['listauctions']); $links['cancel'] = JRoute::_('index.php?option=com_bids&task=cancelauction&id=' . $auction->id); $links['publish'] = JRoute::_('index.php?option=com_bids&task=publish&id=' . $auction->id); $links['filter_cat'] = JRoute::_("index.php?option=com_bids&task=listauctions&cat={$auction->cat}&Itemid={$ItemIdList['listauctions']}"); $links['republish'] = JRoute::_('index.php?option=com_bids&task=republish&id=' . $auction->id); $links['add_to_watchlist'] = JRoute::_('index.php?option=com_bids&task=watchlist&id=' . $auction->id); $links['del_from_watchlist'] = JRoute::_('index.php?option=com_bids&task=delwatch&id=' . $auction->id); $links['pagelinks'] = JRoute::_('index.php?option=com_bids&task=' . $task . '&Itemid=' . $ItemIdList['listauctions']); $links['auctioneer_profile'] = JRoute::_('index.php?option=com_bids&task=userdetails&id=' . $auction->userid); $links['auctioneer_ratings'] = JRoute::_('index.php?option=com_bids&task=userratings&userid=' . $auction->userid); $links['report'] = JRoute::_('index.php?option=com_bids&task=report_auction&id=' . $auction->id); $links['bin'] = JRoute::_('index.php?option=com_bids&task=bin&id=' . $auction->id . '&Itemid=' . $ItemIdList['listauctions']); $links['new_auction'] = JRoute::_('index.php?option=com_bids&task=newauction&Itemid=' . $ItemIdList['newauction']); $links['bulkimport'] = JRoute::_('index.php?option=com_bids&task=bulkimport'); $links['terms'] = JRoute::_('index.php?option=com_bids&task=terms_and_conditions&tmpl=component'); $links['tags'] = self::taglinks($auction); return $links; }
JFactory::getLanguage()->load('com_bids'); jimport('joomla.html.parameter'); $jdoc = JFactory::getDocument(); $js = " var days='".JText::_('COM_BIDS_DAYS').",'; var expired='".JText::_('COM_BIDS_EXPIRED')."'; window.addEvent('domready', function() { if ((typeof moduleSetTimeLeft =='function')) moduleSetTimeLeft('modulebidstime{$mid}_',".count($rows)."); }); "; $jdoc->addScriptDeclaration( $js ); $Itemid = BidsHelperTools::getMenuItemId( array("task" => "listauctions") , 1 ); ?> <table width="100%" class="mod_bids_table_vertical" cellpadding="0" cellspacing="0" border="0"> <?php $i=1; foreach($rows as $row) { $overlib_str = $row->title.'::'; $overlib_str .= JText::_("By")." ".$row->by_user."<br />"; if($row->auction_type == 1){ $overlib_str .= JText::_("Start Bid").": ".BidsHelperAuction::formatPrice($row->initial_price)." ".$row->currency; } if( $i%2 == 0 ){
static function getItemid($needles=null) { require_once('tools.php'); $Itemid=JRequest::getInt('Itemid'); if (!$Itemid) $Itemid=BidsHelperTools::getMenuItemId($needles); if ($Itemid) return "&Itemid=".$Itemid; return ""; }
/** * Newsfeeds Search method * * The sql must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav * @param string Target search string * @param string mathcing option, exact|any|all * @param string ordering option, newest|oldest|popular|alpha|category * @param mixed An array if the search it to be restricted to areas, null if search all */ function onContentSearch($text, $phrase='', $ordering='', $areas=null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $searchText = $text; $limit = $this->params->get( 'search_limit', 50 ); $text = trim( $db->escape($text) ); if ($text == '') { return array(); } $section = JText::_( 'Auction Factory' ); $wheres = array(); switch ($phrase) { case 'exact': $text = $db->Quote( '%'.$db->getEscaped( $text, true ).'%', false ); $wheres2 = array(); $wheres2[] = 'a.shortdescription LIKE '.$text; $wheres2[] = 'a.title LIKE '.$text; $where = '(' . implode( ') OR (', $wheres2 ) . ')'; break; case 'all': case 'any': default: $words = explode( ' ', $text ); $wheres = array(); foreach ($words as $word) { $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false ); $wheres2 = array(); $wheres2[] = 'a.shortdescription LIKE '.$word; $wheres2[] = 'a.title LIKE '.$word; $wheres[] = implode( ' OR ', $wheres2 ); } $where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')'; break; } switch ( $ordering ) { case 'alpha': $order = 'title ASC'; break; case 'category': $order = 'catname ASC, title ASC'; break; case 'oldest': $order = 'start_date ASC, title ASC'; break; case 'newest': $order = 'start_date DESC, title ASC'; break; case 'popular': default: $order = 'hits DESC'; } require_once (JPATH_ROOT.DS.'components'.DS.'com_bids'.DS.'helpers'.DS.'tools.php'); $tmp_id = BidsHelperTools::getMenuItemId(array("task"=>"listauctions")); $query = "SELECT a.title," . "\n start_date AS created," . "\n shortdescription AS text," . "\n concat('Cat: ',b.title) AS section," . "\n CONCAT( 'index.php?option=com_bids&task=viewbids&Itemid={$tmp_id}&id=', a.id, ':', a.title ) AS href," . "\n '1' AS browsernav" . "\n FROM #__bid_auctions a " . "\n LEFT JOIN #__categories AS b ON b.id = a.cat" . "\n WHERE ( $where )" . "\n AND a.published = 1 and a.start_date<=UTC_TIMESTAMP()" . "\n ORDER BY $order" ; $db->setQuery( $query, 0, $limit ); $rows = $db->loadObjectList(); $return = array(); foreach($rows AS $key => $weblink) { if(searchHelper::checkNoHTML($weblink, $searchText, array('url', 'text', 'title'))) { $return[] = $weblink; } } return $return; }