cbTabHandler(); } function getDisplayTab($tab,$user,$ui) { global $database,$my,$mainframe,$mosConfig_live_site; $params = $this->params; $return="NULL"; $adsLimit = $params->get('adsLimit',''); $adDescription = $params->get('adDescription',''); $adTitle = $params->get('adTitle',''); $adDate = $params->get('adDate',''); $showTotal = $params->get('showTotal',''); $noAds = $params->get('noAds',''); $totalTitle = $params->get('totalTitle',''); // get language for marketplace if(file_exists($mainframe->getCfg('absolute_path').'/components/com_marketplace/language/'.$mainframe->getCfg('lang').'.php')) { require_once($mainframe->getCfg('absolute_path').'/components/com_marketplace/language/'.$mainframe->getCfg('lang').'.php'); } else { require_once($mainframe->getCfg('absolute_path').'/components/com_marketplace/language/english.php'); } $database->setQuery("select id from #__menu where link='index.php?option=com_marketplace' AND published=1"); $comitem=$database->loadResult() or die ('I cannot connect to the database because: ' . mysql_error());; $database->setQuery("SELECT id, user, userid, ad_type, ad_headline, ad_text, ad_image, ad_price, date_format(date_created, '%m/%d/%Y' ) as date_created, views FROM #__marketplace_ads WHERE userid=$user->id ORDER BY id DESC LIMIT $adsLimit"); $rows = $database->loadObjectList() or die ('I cannot connect to the database because: ' . mysql_error()); $nn = count($rows); if ($nn > 0) { $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; foreach($rows as $row) { $linkTarget = sefRelToAbs('index.php?option=com_marketplace&page=show_ad&catid='.$catid.'&adid='.$row->id); $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; } $content .="
   ".JOO_AD." ".JOO_VIEWS." ".JOO_PRICE." ".JOO_DATE."
"; $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; $content .=""; $content .="
"; if ( $row->ad_image > 0) { $a_pic_jpg = $mainframe->getCfg('absolute_path')."/components/com_marketplace/images/entries/".$row->id."a_t.jpg"; $a_pic_png = $mainframe->getCfg('absolute_path')."/components/com_marketplace/images/entries/".$row->id."a_t.png"; $a_pic_gif = $mainframe->getCfg('absolute_path')."/components/com_marketplace/images/entries/".$row->id."a_t.gif"; if ( file_exists( $a_pic_jpg)) { $a_piclink = $mainframe->getCfg('live_site')."/components/com_marketplace/images/entries/".$row->id."a.jpg"; $a_img = ImageCreateFromJpeg( $mainframe->getCfg('absolute_path')."/components/com_marketplace/images/entries/".$row->id."a.jpg"); $a_img_width = ImageSx( $a_img); $a_img_height = ImageSy( $a_img); $content .=""; $content .="id."a_t.jpg' align='center' border='0'>"; $content .=""; } elseif ( file_exists( $a_pic_png)) { $a_piclink = $mainframe->getCfg('live_site')."/components/com_marketplace/images/entries/".$row->id."a.png"; $a_img = ImageCreateFromPng( $mainframe->getCfg('absolute_path')."/components/com_marketplace/images/entries/".$row->id."a.png"); $a_img_width = ImageSx( $a_img); $a_img_height = ImageSy( $a_img); $content .=""; $content .="id."a_t.png' align='center' border='0'>"; $content .=""; } elseif ( file_exists( $a_pic_gif)) { $a_piclink = $mainframe->getCfg('live_site')."/components/com_marketplace/images/entries/".$row->id."a.gif"; $a_img = ImageCreateFromGif( $mainframe->getCfg('absolute_path')."/components/com_marketplace/images/entries/".$row->id."a.gif"); $a_img_width = ImageSx( $a_img); $a_img_height = ImageSy( $a_img); $content .=""; $content .="id."a_t.gif' align='center' border='0'>"; $content .=""; } else { $content .=""; } } $content .=""; $content .=" "; $content .=""; $content .="".$row->ad_headline."
"; $af_text = htmlspecialchars (substr($row->ad_text, 0, 210)."..."); $content.= $af_text; $content .="
"; $content .="
"; $content .="
"; $content .= $row->views; $content .="
"; $content .="
"; $content .= $row->ad_price; $content .="
"; $content .="
"; $content .= $row->date_created; $content .="
"; $content .= JOO_FROM; //$content .="".$row->user.""; $content .="".$row->user.""; $content .="
"; } else { $content .= ''; } return $content; } } ?>