module with titr is below the img - Joomla! Forum - community, help and support
hi
i joomla 1.0 administrator
i persian dont know writing , speaking good, apologize if have mistake on writing...
i want module image linked content...
such titr linked content
the news flash module me because can chose want display titr on module on home page or not:
php:
xml:
can 1 me
i joomla 1.0 administrator
i persian dont know writing , speaking good, apologize if have mistake on writing...
i want module image linked content...
such titr linked content
the news flash module me because can chose want display titr on module on home page or not:
php:
code: select all
<?php
/**
* description.
*/
// no direct access
defined( '_valid_mos' ) or die( 'restricted access' );
require_once( $mainframe->getpath( 'front_html', 'com_content') );
if (!defined( '_mos_newsflash_module' )) {
/** ensure functions declared once */
define( '_mos_newsflash_module', 1 );
function output_newsflash( &$row, &$params, &$access ) {
global $mainframe;
$row->text = $row->introtext;
$row->groups = '';
$row->readmore = (trim( $row->fulltext ) != '');
$row->metadesc = '';
$row->metakey = '';
$row->access = '';
$row->created = '';
$row->modified = '';
html_content::show( $row, $params, $access, 0 );
}
}
global $my, $mosconfig_shownoauth, $mosconfig_offset, $mosconfig_link_titles, $acl;
// disable edit ability icon
$access = new stdclass();
$access->canedit = 0;
$access->caneditown = 0;
$access->canpublish = 0;
$now = _current_server_time;
$noauth = !$mainframe->getcfg( 'shownoauth' );
$nulldate = $database->getnulldate();
$catid = intval( $params->get( 'catid' ) );
$items = intval( $params->get( 'items', 0 ) );
$style = $params->get( 'style', 'flash' );
$moduleclass_sfx = $params->get( 'moduleclass_sfx' );
$link_titles = $params->get( 'link_titles', $mosconfig_link_titles );
$params->set( 'intro_only', 1 );
$params->set( 'hide_author', 1 );
$params->set( 'hide_createdate', 0 );
$params->set( 'hide_modifydate', 1 );
$params->set( 'link_titles', $link_titles );
// query determine article count
$query = "select a.id, a.introtext, a.fulltext , a.images, a.attribs, a.title, a.state"
."\n #__content a"
."\n inner join #__categories cc on cc.id = a.catid"
."\n inner join #__sections s on s.id = a.sectionid"
."\n a.state = 1"
. ( $noauth ? "\n , a.access <= " . (int) $my->gid . " , cc.access <= " . (int) $my->gid . " , s.access <= " . (int) $my->gid : '' )
."\n , (a.publish_up = " . $database->quote( $nulldate ) . " or a.publish_up <= " . $database->quote( $now ) . " ) "
."\n , (a.publish_down = " . $database->quote( $nulldate ) . " or a.publish_down >= " . $database->quote( $now ) . " )"
."\n , a.catid = " . (int) $catid
."\n , cc.published = 1"
."\n , s.published = 1"
."\n order a.ordering"
;
$database->setquery( $query, 0, $items );
$rows = $database->loadobjectlist();
$numrows = count( $rows );
// check if results returned
if ( $numrows ) {
switch ($style) {
case 'horiz':
echo '<table class="moduletable' . $moduleclass_sfx .'">';
echo '<tr>';
foreach ($rows $row) {
echo '<td>';
output_newsflash( $row, $params, $access );
echo '</td>';
}
echo '</tr></table>';
break;
case 'vert':
foreach ($rows $row) {
output_newsflash( $row, $params, $access );
}
break;
case 'flash':
default:
srand ((double) microtime() * 1000000);
$flashnum = rand( 0, $numrows-1 );
$row = $rows[$flashnum];
output_newsflash( $row, $params, $access );
break;
}
}
?>
xml:
code: select all
<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="module" version="1.0.0">
<name>news flash</name>
<creationdate>2009</creationdate>
<license>http://www.gnu.org/licenses/gpl-2.0.html gnu/gpl</license>
<version>1.0.0</version>
<description>the normal tasnim news.</description>
<files>
<filename module="mod_newsflash">mod_tasnim_normal_news.php</filename>
</files>
<params>
<param name="catid" type="mos_category" default="0" label="category" description="a content cateogry" />
<param name="style" type="list" default="random" label="style" description="the style display category">
<option value="random">randomly choose 1 @ time</option>
<option value="horiz">horizontal</option>
<option value="vert">vertical</option>
</param>
<param name="image" type="radio" default="0" label="show images" description="display content item images">
<option value="1">yes</option>
<option value="0">no</option>
</param>
<param name="link_titles" type="list" default="" label="linked titles" description="make item titles linkable">
<option value="">use global</option>
<option value="0">no</option>
<option value="1">yes</option>
</param>
<param name="readmore" type="radio" default="0" label="read more" description="show/hide read more button">
<option value="0">hide</option>
<option value="1">show</option>
</param>
<param name="item_title" type="list" default="0" label="item title" description="show item title">
<option value="0">no</option>
<option value="1">yes</option>
</param>
<param name="items" type="text" default="" label="no. of items" description="no of items display" />
<param name="cache" type="radio" default="0" label="enable cache" description="select whether cache content of module">
<option value="0">no</option>
<option value="1">yes</option>
</param>
<param name="moduleclass_sfx" type="text" default="" label="module class suffix" description="please dont change" />
</params>
</mosinstall>
can 1 me
Comments
Post a Comment