To help other, that's what I've done:
First, I've removed the mod code from index.php
REMOVE FROM INDEX.PHP
Code: Select all
// MOD :: CLASSIFIEDS MOD -- START
if (isset($config['enable_classifieds']))
{
if($config['enable_classifieds'] && $auth->acl_get('u_view_classifieds') && ( ($config['display_ads_on_index'] && $config['ad_num_display_on_index'] !='0') || ($config['display_rand_ads_on_index'] && $config['rand_ad_num_display_on_index'] !='0') ) )
{
include($phpbb_root_path . CL_DIRECTORY . '/includes/functions_buysell.' . $phpEx);
$user->setup('mods/classified');
if ($config['display_ads_on_index'])
{
display_recent_ads($config['ad_num_display_on_index']);
$template->assign_vars(array(
'S_DISPLAY_ADS_ON_INDEX' => true,
'S_RECENT_ADS_TOP' => ($config['recent_ads_place']) ? true : false,
));
}
if ($config['display_rand_ads_on_index'] )
{
display_random_ads($config['rand_ad_num_display_on_index']);
$template->assign_vars(array(
'S_DISPLAY_RAND_ADS_ON_INDEX' => true,
'S_RAND_ADS_TOP' => ($config['rand_ads_place']) ? true : false,
));
}
}
}
// MOD :: CLASSIFIEDS MOD -- END
After that, I've editted includes/functions.php
FOUND
ADDED AFTER
Code: Select all
// MOD :: CLASSIFIEDS MOD -- START
if (isset($config['enable_classifieds']))
{
if($config['enable_classifieds'] && $auth->acl_get('u_view_classifieds') && ( ($config['display_ads_on_index'] && $config['ad_num_display_on_index'] !='0') || ($config['display_rand_ads_on_index'] && $config['rand_ad_num_display_on_index'] !='0') ) )
{
if (!function_exists('resize_img'))
{
include($phpbb_root_path . CL_DIRECTORY . '/includes/functions_buysell.' . $phpEx);
}
$user->setup('mods/classified');
if ($config['display_ads_on_index'])
{
display_recent_ads($config['ad_num_display_on_index']);
$template->assign_vars(array(
'S_DISPLAY_ADS_ON_INDEX' => true,
'S_RECENT_ADS_TOP' => ($config['recent_ads_place']) ? true : false,
));
}
if ($config['display_rand_ads_on_index'] )
{
display_random_ads($config['rand_ad_num_display_on_index']);
$template->assign_vars(array(
'S_DISPLAY_RAND_ADS_ON_INDEX' => true,
'S_RAND_ADS_TOP' => ($config['rand_ads_place']) ? true : false,
));
}
}
}
// MOD :: CLASSIFIEDS MOD -- END
Inside this block of code, there is this entry
"resize_img". This is because I have this mod installed, and was getting errors because of this. It does no harm if you don't has this mod, keeping it on code.
Then, to add the code to topic pages:
Edit /styles/prosilver/template/viewtopic_body.html
FIND
Code: Select all
<!-- INCLUDE overall_header.html -->
ADD AFTER
Code: Select all
<!-- ENDIF -->
<!-- IF S_DISPLAY_ADS_ON_INDEX and S_RECENT_ADS_TOP -->
<!-- INCLUDE classifieds_recent_ads_block.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RAND_ADS_ON_INDEX and S_RAND_ADS_TOP -->
<!-- INCLUDE classifieds_random_ads_block.html -->
<!-- ENDIF -->
FIND
Code: Select all
<!-- INCLUDE overall_footer.html -->
ADD BEFORE
Code: Select all
<!-- IF S_DISPLAY_ADS_ON_INDEX and not S_RECENT_ADS_TOP -->
<!-- INCLUDE classifieds_recent_ads_block.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RAND_ADS_ON_INDEX and not S_RAND_ADS_TOP -->
<!-- INCLUDE classifieds_random_ads_block.html -->
<!-- ENDIF -->
Finally, to add to the board3 portal:
Edit the file styles/prosilver/template/portal/portal_body.html
FIND
Code: Select all
<!-- INCLUDE overall_header.html -->
ADD AFTER
Code: Select all
<!-- IF S_DISPLAY_ADS_ON_INDEX and S_RECENT_ADS_TOP -->
<!-- INCLUDE classifieds_recent_ads_block.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RAND_ADS_ON_INDEX and S_RAND_ADS_TOP -->
<!-- INCLUDE classifieds_random_ads_block.html -->
<!-- ENDIF -->
FIND
Code: Select all
<!--// board3 Portal by www.board3.de //-->
ADD BEFORE
Code: Select all
<!-- IF S_DISPLAY_ADS_ON_INDEX and not S_RECENT_ADS_TOP -->
<!-- INCLUDE classifieds_recent_ads_block.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_RAND_ADS_ON_INDEX and not S_RAND_ADS_TOP -->
<!-- INCLUDE classifieds_random_ads_block.html -->
<!-- ENDIF -->
If you want the ads to be seen by guests at board3 portal, you have to add permission to guest group to see ads, at ACP.