name : default.php
<?php
/**
* J51_FlexGallery
* Version		: 1.0
* Created by	: Joomla51
* Email			: [email protected]
* URL			: www.joomla51.com
* License GPLv2.0 - http://www.gnu.org/licenses/gpl-2.0.html
*/

// no direct access
defined('_JEXEC') or die('Restricted access');
$list = ModAwNewsHelper::getList($params);
$baseurl = JURI::base();
$countcol = $params->get('countcol', 2);
$show_img = $params->get('show_img', 1);
$show_date = $params->get('show_date', 1);
$show_text = $params->get('show_text', 1);
$show_tags = $params->get('show_tags', 1);
$show_button = $params->get('show_button', 1);
$length_text = $params->get('length_text', 300);
$date_format = $params->get('date_format','d.m.Y');
$columns= $params->get('columns', 100);
$item_margin_x = $params->get('item_margin_x', 10);
$item_margin_y = $params->get('item_margin_y', 10);
$item_button = $params->get('item_button');
$columns_tabl	= $params->get( 'columns_tabl', 3);
$columns_tabp	= $params->get( 'columns_tabp', 2);
$columns_mobl	= $params->get( 'columns_mobl', 1);
$columns_mobp	= $params->get( 'columns_mobp', 1);
$max_width	= $params->get( 'max_width');
$j51_moduleid = $module->id;

// Load CSS/JS
$document = JFactory::getDocument();
$document->addStyleSheet (JURI::base() . 'modules/mod_j51news/css/style.css' );

// Styling from module parameters
$document->addStyleDeclaration('
.j51news'.$j51_moduleid.' .j51news_inside {
	margin: 0 -'.($item_margin_x / 2).'px;
}
.j51news'.$j51_moduleid.' .newsitem {
	width:'.$columns.'%;
	padding-top: '.($item_margin_y / 2).'px;
	padding-bottom: '.($item_margin_y / 2).'px;
	padding-left: '.($item_margin_x / 2).'px;
	padding-right: '.($item_margin_x / 2).'px;
}
@media only screen and (min-width: 960px) and (max-width: 1280px) {
.j51news'.$j51_moduleid.' .newsitem {width:'.$columns_tabl.'%;}
}
@media only screen and (min-width: 768px) and (max-width: 959px) {
.j51news'.$j51_moduleid.' .newsitem {width:'.$columns_tabp.'%;}
}
@media only screen and ( max-width: 767px ) {
.j51news'.$j51_moduleid.' .newsitem {width:'.$columns_mobl.'%;}
}
@media only screen and (max-width: 440px) {
.j51news'.$j51_moduleid.' .newsitem {width:'.$columns_mobp.'%;}
}
');

?>

<div class="j51news j51news<?php echo $j51_moduleid; ?>" <?php  if ($max_width != '') { ?>style="max-width: <?php echo $max_width ?>px;" <?php } ?>>
	<div class="j51news_inside">
		<?php $i=1; foreach ($list as $item) :  ?><div class="newsitem ter-<?php  echo $i; ?>" itemscope itemtype="http://schema.org/Article">
			<figure>
				<?php  if ($show_img == 1) : ?>	
				<div class="newsimg">
					<?php $images = json_decode($item->images); ?>
					<a href="<?php echo $item->link; ?>">
					<img src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>" />
					</a>
				</div>
				<?php endif; ?>
				<figcaption>
					<?php  if ($show_tags==1) : ?>
					<?php $item->tagLayout = new JLayoutFile('joomla.content.tags'); echo $item->tagLayout->render($item->tags->itemTags); ?>
					<?php endif; ?>
					<h3 itemprop="name">
						<?php echo $item->title; ?>
					</h3>
					<?php  if ($show_date==1) : ?>
						<div class="newsdate"><?php echo JHTML::_('date', $item->displayDate, $date_format) ?></div>
					<?php endif; ?>
					<?php if ($show_text == 1) : ?>
					<p class="newstext"><?php
					$introb = strip_tags($item->introtext);
					$intro = JHtml::_('string.truncate', $introb, $length_text);
					echo $intro; ?></p>
					<?php endif; ?>
					<?php  if ($show_button == 1) { ?>
						<a class="btn" href="<?php echo $item->link; ?>" itemprop="url"><?php echo $item_button; ?></a>
					<?php } ?>
				</figcaption>
				<?php  if ($show_button == 0) { ?>
					<a class="newslink" href="<?php echo $item->link; ?>" itemprop="url"></a>
				<?php } ?>
			</figure>
		</div><?php $i++; endforeach; ?>
	</div>
</div>

© 2025 Cubjrnet7