function processImage(&$image, $width, $height) { if (!count($image)) { return; } $img = $image[1]; $img = str_replace(JURI::base(), '', $img); $imagesurl = file_exists(JPATH_SITE . '/' . $img) ? modJaNewsHelper::jaResize($img, $width, $height) : $img; return $imagesurl; }
$mainframe->triggerEvent('onAfterRender'); $jc =& new JConfig(); $database =& JFactory::getDBO(); $user =& JFactory::getUser(); $now = $mainframe->get('requestTime'); $access = !$mainframe->getCfg('shownoauth'); $nullDate = $database->getNullDate(); $total = JRequest::getInt('total'); $news = JRequest::getInt('news'); $query = "SELECT a.*, cc.title as cattitle," . "\n CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug," . "\n CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(':', cc.id, cc.alias) ELSE cc.id END as catslug" . "\n FROM #__content AS a" . "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n WHERE ( a.state = 1 AND a.sectionid > 0 " . "\n AND ( a.publish_up = '{$nullDate}' OR a.publish_up <= '{$now}' )" . "\n AND ( a.publish_down = '{$nullDate}' OR a.publish_down >= '{$now}' )" . ($access ? "\n AND a.access <= " . $user->get('aid', 0) . " AND cc.access <= " . $user->get('aid', 0) : '') . "\n AND cc.published = 1 )" . "\n ORDER BY f.ordering ASC limit " . ($news - 1) . ", 1"; $database->setQuery($query); $firstnew = $database->loadObject(); $bs = $mainframe->getBlogSectionCount(); $bc = $mainframe->getBlogCategoryCount(); $gbs = $mainframe->getGlobalBlogSectionCount(); $link = ContentHelperRoute::getArticleRoute($firstnew->slug, $firstnew->catslug, $firstnew->sectionid); //$image = modJaNewsHelper::replaceImage ($firstnew, '', 0, 0, 1); echo "<div class=\"ja-newscontent\">\n"; //echo $image. "\n"; echo "<a href=\"{$link}\" class=\"ja-newstitle\" title=\"" . modJaNewsHelper::textprocess($firstnew->title) . "\">" . modJaNewsHelper::textprocess($firstnew->title) . "</a>\n"; echo modJaNewsHelper::unhtmlentities(modJaNewsHelper::textprocess($firstnew->introtext)) . "\n</div>\n"; echo "<a href=\"{$link}\" class=\"readon\">" . modJaNewsHelper::textprocess('Read more') . "</a>"; echo "</div>"; $query = "SELECT a.title" . "\n FROM #__content AS a" . "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n WHERE ( a.state = 1 AND a.sectionid > 0 " . "\n AND ( a.publish_up = '{$nullDate}' OR a.publish_up <= '{$now}' )" . "\n AND ( a.publish_down = '{$nullDate}' OR a.publish_down >= '{$now}' )" . ($access ? "\n AND a.access <= " . $user->get('aid', 0) . " AND cc.access <= " . $user->get('aid', 0) : '') . "\n AND cc.published = 1 )" . "\n ORDER BY f.ordering ASC limit " . ($news < $total ? $news : 0) . ", 1"; $database->setQuery($query); $nexttitle = $database->loadResult(); $query = "SELECT a.title" . "\n FROM #__content AS a" . "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n WHERE ( a.state = 1 AND a.sectionid > 0 " . "\n AND ( a.publish_up = '{$nullDate}' OR a.publish_up <= '{$now}' )" . "\n AND ( a.publish_down = '{$nullDate}' OR a.publish_down >= '{$now}' )" . ($access ? "\n AND a.access <= " . $user->get('aid', 0) . " AND cc.access <= " . $user->get('aid', 0) : '') . "\n AND cc.published = 1 )" . "\n ORDER BY f.ordering ASC limit " . ($news > 1 ? $news - 2 : $total - 1) . ", 1"; $database->setQuery($query); $prevtitle = $database->loadResult(); echo $splitter . modJaNewsHelper::textprocess($nexttitle) . $splitter . modJaNewsHelper::textprocess($prevtitle);
$gbs = $mainObject->getGlobalBlogSectionCount(); // Output if ($l == 0) { //Begin a row echo "<div class=\"ja-newsblock clearfix\">\n"; $isrowopen = true; } //get Itemid of category $link = ContentHelperRoute::getArticleRoute($rows[0]->slug, $rows[0]->catslug, $rows[0]->sectionid); echo "<div class=\"ja-newsitem{$modStyle[$l]['class']}\" style=\"width: {$modStyle[$l]['width']};\"><div class=\"ja-newsitem-inner\" style=\"width:{$modStyle[$l]['subwidth']};\">\n"; echo "<a href=\"{$link}\" class=\"ja-newscat\" title=\"" . trim(htmlentities($rows[0]->catdesc)) . "\"><span>{$rows[0]->cattitle}</span></a>\n"; $hasul = true; for ($i = 0; $i < count($rows); $i++) { $row = $rows[$i]; $link = ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid); $image = modJaNewsHelper::replaceImage($row, $align, $autoresize, $maxchars, $showimage, $width, $height); if ($i == 0) { //Show the latest news echo "<div class=\"ja-newscontent\">\n"; echo $image . "\n"; echo "<a href=\"{$link}\" class=\"ja-newstitle\" title=\"" . ($showintro ? $row->title : $row->introtext1) . "\">{$row->title}</a>\n"; if ($showintro) { if ($maxchars) { echo "{$row->introtext1}\n"; } else { echo "{$row->introtext}\n"; } } echo "</div>\n"; if (count($rows) > 1) { echo "<ul class=\"ja-newslinks\">\n";
<li><img title="<?php echo $pauseplay; ?> " style="cursor: pointer;" id="jahl-switcher" onclick="jaNewsHL.toogle(); return false;" src="<?php echo modJaNewsHelper::getFile(strtolower($pauseplay) . '.png', 'modules/mod_janews_fp/ja.news/', 'templates/' . $mainframe->getTemplate() . '/images/'); ?> " alt="<?php echo $pauseplay; ?> " border="0" /></li> <li><img title="" style="cursor: pointer;" onclick="jaNewsHL.prev(); return false;" id="jahl-prev" src="<?php echo modJaNewsHelper::getFile('prev.png', 'modules/mod_janews_fp/ja.news/', 'templates/' . $mainframe->getTemplate() . '/images/'); ?> " alt="Previous" border="0" /></li> <li><img title="" style="cursor: pointer;" onclick="jaNewsHL.next(); return false;" id="jahl-next" src="<?php echo modJaNewsHelper::getFile('next.png', 'modules/mod_janews_fp/ja.news/', 'templates/' . $mainframe->getTemplate() . '/images/'); ?> " alt="Next" border="0" /></li> </ul> <span id="jahl-indicator">1/<?php echo $numberofheadlinenews; ?> </span> </div> <?php } ?> </div> <?php } ?>