joomla και admanager

Joomla! Extensions (Components, Modules, Plugins)

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
Άβαταρ μέλους
power22
Δημοσιεύσεις: 8
Εγγραφή: 24 Μάιος 2013 11:59
Επικοινωνία:

joomla και admanager

Δημοσίευση από power22 » 06 Ιουν 2013 11:33

Καλησπέρα

Χρησιμοποιώ joomla και admanager πως μπορώ να σκρολαρο της πρόσφατες αγγελίες (δες Φώτο)

Ευχαριστώ
Συνημμένα
2013-06-06_112623.png

Άβαταρ μέλους
power22
Δημοσιεύσεις: 8
Εγγραφή: 24 Μάιος 2013 11:59
Επικοινωνία:

joomla και admanager

Δημοσίευση από power22 » 14 Ιουν 2013 09:37

Να δώσω τον κώδικα μήπως βοηθήσει

Κώδικας: Επιλογή όλων

// Check to ensure this file is included in Joomla!

defined('_JEXEC') or die( 'Restricted access' );



jimport('joomla.application.component.view');

require_once(JPATH_BASE."/components/com_adsmanager/helpers/general.php");



/**

 * @package		Joomla

 * @subpackage	Contacts

 */  

class AdsmanagerViewFront extends TView

{

	function display($tpl = null)

	{

		jimport( 'joomla.session.session' );	

		$currentSession = JSession::getInstance('none',array());

		$currentSession->set("search_fields","");

		$currentSession->set("searchfieldscatid",0);

		$currentSession->set("searchfieldssql"," 1 ");

		$currentSession->set("tsearch","");

		

		$app	= JFactory::getApplication();

		$pathway = $app->getPathway();

		



		$user		= JFactory::getUser();

		

		$document	= JFactory::getDocument();

		

		$contentmodel	=$this->getModel( "content" );

		$catmodel	=$this->getModel( "category" );

		$configurationmodel	=$this->getModel( "configuration" );



		// Get the parameters of the active menu item

		$menus	= $app->getMenu();

		$menu    = $menus->getActive();

		

		$conf = $configurationmodel->getConfiguration();

		

		$cats = $catmodel->getCatTree(true,true,$nbcontents);

		$this->assignRef('cats',$cats);

		$this->assignRef('conf',$conf);

		

		$document->setTitle( JText::_('ADSMANAGER_PAGE_TITLE'));

		

		$general = new JHTMLAdsmanagerGeneral(0,$conf,$user);

		$this->assignRef('general',$general);

		

		$conf = $configurationmodel->getConfiguration();

		$nbimages = $conf->nb_images;

		if (function_exists("getMaxPaidSystemImages"))

		{

			$nbimages += getMaxPaidSystemImages();

		}

		$this->assignRef('nbimages',$nbimages);

		

		$nb_cols = $conf->nb_last_cols;

		$nb_rows = $conf->nb_last_rows;

		$contents = $contentmodel->getLatestContents($nb_cols*$nb_rows);

		$this->assignRef('contents',$contents);



		parent::display($tpl);

	}

	

	function recurseCategories( $id, $level, &$children) {

		

		if (@$children[$id]) {

			$i=0;$first=true;

			foreach ($children[$id] as $row) {

				$link = TRoute::_("index.php?option=com_adsmanager&view=list&catid=".$row->id);

				if ($level == 0)

				{

					if ($i==0)

					{

						echo '<tr align="center">';

					&#125;

					?>

					<td width="50%">

					<table width="100%" border="0" cellspacing="0" cellpadding="0">

					<tr> 

					  <td rowspan="2"><div align="center">

					  <?php

							echo '<a href="'.$link.'"><img class="imgcat" src="'.TTools&#58;&#58;getCatImageUrl&#40;$row->id&#41;.'" alt="'.htmlspecialchars&#40;$row->name&#41;.'" /></a>';

					  ?>

					  </div></td>

					  <td> 

						<h2 class="adsmanager_main_cat"><a href="<?php echo $link; ?>"  ><?php echo htmlspecialchars&#40;$row->name&#41;." &#40;".$row->num_ads."&#41;"; ?></a></h2>

					  </td>

					</tr>

					<tr>

					<td> 

					<h3 class="adsmanager_sub_cat">

					<?php

				&#125;

				else

				&#123;

					if &#40;$first == false&#41;

						echo ' - ';

					echo '<a href="'.$link.'">'.htmlspecialchars&#40;$row->name&#41;." &#40;".$row->num_ads."&#41;".'</a>';

					$first = false;

				&#125;

				if &#40;$level == 0&#41;

				&#123;

					$this->recurseCategories&#40; $row->id, $level+1, $children&#41;;

				&#125;

				if &#40;$level == 0&#41;

				&#123;

					?>

					</h3>

					</td>

					</tr>

					</table>

					</td>

					<?php

					if &#40;$i==1&#41;

					&#123;

						echo '</tr>';

					&#125;

				&#125;

				$i++;

				if &#40;$i == 2&#41; $i=0;

			&#125;

		&#125;

	&#125;

	

	function displayContents&#40;$contents,$nbimages&#41; &#123;

		$configurationmodel	=$this->getModel&#40; "configuration" &#41;;

		$conf = $configurationmodel->getConfiguration&#40;&#41;;

	?>

		<h1 class="contentheading"><?php echo JText&#58;&#58;_&#40;'ADSMANAGER_LAST_ADS'&#41;;?></h1>

		<div class='adsmanager_box_module' align="center">

			<table class='adsmanager_inner_box' width="100%">

			<?php

			$nb_cols = $conf->nb_last_cols;

			$col = 0;

			foreach&#40;$contents as $row&#41; &#123;

				if &#40;$col == 0&#41; 

					echo '<tr align="center">';

				$col++;

			?>

				<td>

				<?php	

				$linkTarget = TRoute&#58;&#58;_&#40;"index.php?option=com_adsmanager&view=details&id=".$row->id."&catid=".$row->catid&#41;;			

				if &#40;isset&#40;$row->images&#91;0&#93;&#41;&#41; &#123;

					echo "<div align='center'><a href='".$linkTarget."'><img src='".$this->get&#40;'baseurl'&#41;."/images/com_adsmanager/ads/".$row->images&#91;0&#93;->thumbnail."' alt='".htmlspecialchars&#40;$row->ad_headline&#41;."' border='0' /></a>";

				&#125; else if &#40;$conf->nb_images > 0&#41; &#123;

					echo "<div align='center'><a href='".$linkTarget."'><img src='".ADSMANAGER_NOPIC_IMG."' alt='nopic' border='0' /></a>"; 

				&#125; 	

					

				echo "<br /><a href='$linkTarget'>".$row->ad_markaklark.$row->ad_test.$row->ad_markatrakter.$row->ad_markaleoforeio.$row->ad_headline."</a>";

				 echo "<br /><a href='$linkTarget'>".$row->ad_tipos."</a>";

				 echo "<br /><a href='$linkTarget'> Τιμη ".$row->ad_price." € </a>";

				echo "<br /><span class=\"adsmanager_cat\">&#40;".htmlspecialchars&#40;$row->parent&#41;." / ".htmlspecialchars&#40;$row->cat&#41;."&#41;</span>";

				echo "<br />".$this->reorderDate&#40;$row->date_created&#41;;

				echo "</div>";

				?>

				</td>

			<?php

				if &#40;$col == $nb_cols&#41; &#123;

					echo "</tr>";

					$col = 0;	

				&#125;

			&#125;

			if &#40;$col != 0&#41; &#123;

				echo "</tr>";

			&#125;

			?>

			</table>

			</div>

	<br />

	<?php

	&#125;

	

	function reorderDate&#40; $date &#41;&#123;

		$format = JText&#58;&#58;_&#40;'ADSMANAGER_DATE_FORMAT_LC'&#41;;

		

		if &#40;$date && &#40;preg_match&#40;"/&#40;&#91;0-9&#93;&#123;4&#125;&#41;-&#40;&#91;0-9&#93;&#123;2&#125;&#41;-&#40;&#91;0-9&#93;&#123;2&#125;&#41;/",$date,$regs&#41;&#41;&#41; &#123;

			$date = mktime&#40; 0, 0, 0, $regs&#91;3&#93;, $regs&#91;2&#93;, $regs&#91;1&#93; &#41;;

			$date = $date > -1 ? strftime&#40; $format, $date&#41; &#58; '-';

		&#125;

		return $date;

	&#125;

&#125;

Απάντηση

Επιστροφή στο “Joomla! Extensions (Components, Modules, Plugins)”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 2 επισκέπτες