Numbers of events And groups on home page

Hello,

Is there a way to control the Maximum number of Events And Groups to show on homepage? . In Blogs settings you can do that, I can't seem to find the way for groups and events. Thanks.

Quote · 2 Aug 2008

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+'&amp;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}&amp;classifieds_page={$prevPage}", 'dynamic' => true, 'class' => 'backMembers' );
//$sBackC = _t('_Back');
/*$retR .= <<<EOF
<a href="{$_SERVER['PHP_SELF']}?classifieds_mode={$mode}&amp;classifieds_page={$prevPage}" class="backMembers" onclick="getHtmlData( 'show_classifieds', this.href+'&amp;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}&amp;classifieds_page={$nextPage}", 'dynamic' => true, 'class' => 'moreMembers' );
/*$sNextC = _t('_Next');
$retR .= <<<EOF
<a href="{$_SERVER['PHP_SELF']}?classifieds_mode={$mode}&amp;classifieds_page={$nextPage}" class="moreMembers" onclick="getHtmlData( 'show_classifieds', this.href+'&amp;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

DialMe.com - Your One and Only Source For Boonex Dolphin Tutorials and Resources
Quote · 2 Aug 2008

gameutopia, thank you, exactly what I was looking for, work perfectly!

Quote · 4 Aug 2008

Dolphin version 6.1.3

To limit the maximum number of events and groups to show on the homepage just set the "Maximum number of Blogs to show on homepage" to any number in blog settings, under admin panel.

I have set it to 1, to show only one event, group, blog etc... on the homepage (www.mallusworld.com)

Quote · 26 Aug 2008

Only bad part is in admin panel if you set some of them to a specific number depending on what you set or are after but if you set certain areas to say 5 you will get 5 blogs, 5 events, 5 classifieds etc.

If you want 5 of one 3 of another and 1 of another it doesn't work so well. You may need to edit some code and/or the database if you want specific numbers to display.

By editing the code you can set different numbers of display for each.

gameutopia

DialMe.com - Your One and Only Source For Boonex Dolphin Tutorials and Resources
Quote · 26 Aug 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.