templates/base/scripts/BxBaseIndex.php
Find your function...this example classifieds on home page, edit for the following to limit or change the number of displayed on the homepage: just find function you are looking for and add/edit for your needs:
function getBlockCode_Classifieds() {
global $site;
$mode = $_REQUEST['classifieds_mode'];
if( $mode != 'rand' and $mode != 'latest' and $mode != 'top' )
$mode = 'latest';
$aDBTopMenu = array();
//$menu = '<div class="dbTopMenu">';
foreach( array( 'latest', 'top', 'rand' ) as $myMode ) {
switch( $myMode ) {
case 'top':
$sTabTitle = _t( '_Top' );
break;
case 'latest':
$sTabTitle = _t( '_Latest' );
break;
case 'rand':
$sTabTitle = _t( '_Random' );
break;
}
$aDBTopMenu[$sTabTitle] = array('href' => "{$_SERVER['PHP_SELF']}?classifieds_mode=$myMode", 'dynamic' => true, 'active' => ( $myMode == $mode ));
/*if( $mode == $myMode ) {
$menu .= "<div class=\"active\">$sTabTitle</div>";
} else {
$menu .= "
<div class=\"notActive\">
<a href=\"{$_SERVER['PHP_SELF']}?classifieds_mode=$myMode\" class=\"top_members_menu\" onclick=\"getHtmlData( 'show_classifieds', this.href+'&show_only=classifieds'); return false;\">$sTabTitle</a>
</div>";
}*/
}
/*$menu .= '
<div class="clear_both"></div>
</div>';*/
$iTotalNum = db_value( "SELECT COUNT(*) FROM `ClassifiedsAdvertisements`
WHERE DATE_ADD( `ClassifiedsAdvertisements`.`DateTime` , INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY ) > NOW( )
AND `ClassifiedsAdvertisements`.`Status` = 'active'
" );
$oClassifieds = new BxDolClassifieds();
$oClassifieds->UseDefaultCF();
if( $iTotalNum ) {
$iResPerPage = (int)getParam("max_blogs_on_home");
$iTotalPages = ceil( $iTotalNum / $iResPerPage );
$page = (int)$_REQUEST['classifieds_page'];
if( $page < 1 or $mode == 'rand' )
$page = 1;
if( $page > $iTotalPages )
$page = $iTotalPages;
$sqlLimitFrom = ( $page - 1 ) * $iResPerPage = 3;
$sBlocks = $oClassifieds->GenAnyBlockContent($mode, 0, "LIMIT $sqlLimitFrom, $iResPerPage");
$ret .= $sBlocks;
} else
$ret .= '<div class="no_result"><div>'._t("_No classifieds available").'</div></div>';
$aDBBottomMenu = array();
if( $iTotalPages > 1 ) {
//$ret .= '<div class="dbBottomMenu">';
if( $page > 1 ) {
$prevPage = $page - 1;
$aDBBottomMenu[ _t('_Back') ] = array( 'href' => "{$_SERVER['PHP_SELF']}?classifieds_mode={$mode}&classifieds_page={$prevPage}", 'dynamic' => true, 'class' => 'backMembers' );
//$sBackC = _t('_Back');
/*$retR .= <<<EOF
<a href="{$_SERVER['PHP_SELF']}?classifieds_mode={$mode}&classifieds_page={$prevPage}" class="backMembers" onclick="getHtmlData( 'show_classifieds', this.href+'&show_only=classifieds'); return false;">
{$sBackC}
</a>
EOF;*/
}
if( $page < $iTotalPages ) {
$nextPage = $page + 1;
$aDBBottomMenu[ _t('_Next') ] = array( 'href' => "{$_SERVER['PHP_SELF']}?classifieds_mode={$mode}&classifieds_page={$nextPage}", 'dynamic' => true, 'class' => 'moreMembers' );
/*$sNextC = _t('_Next');
$retR .= <<<EOF
<a href="{$_SERVER['PHP_SELF']}?classifieds_mode={$mode}&classifieds_page={$nextPage}" class="moreMembers" onclick="getHtmlData( 'show_classifieds', this.href+'&show_only=classifieds'); return false;">
{$sNextC}
</a>
EOF;*/
}
$sBMViewAllLink = ($oClassifieds->bUseFriendlyLinks) ? "{$site['url']}ads/" : "{$site['url']}classifieds.php?Browse=1";
$aDBBottomMenu[ _t('_View All') ] = array( 'href' => $sBMViewAllLink, 'dynamic' => false, 'class' => 'viewAllMembers' );
//$ret .= '<div class="clear_both"></div></div>';
}
//return $ret;
return array( $ret, $aDBTopMenu, $aDBBottomMenu );
}
Hope this helps and makes sense, if not let me know!!
gameutopia
http://www.dialme.com