help adding block

i would like to add this page block with functioning links from the ads module to my index page can anyone help me or guide me in doing so?

Quote · 14 Nov 2012

Does no answer mean that it can not be done?

Quote · 17 Nov 2012

Hello

It can be done, but you need to do a custom modification in PHP code of Ads module. You'll need to create a service method in modules/boonex/ads/classes/BxAdsModule.php file which will return the block with categories. It should look like the following.

 

function serviceGetAdsCategories() {
if(!$this->isAllowedBrowse())
return "";

bx_import('PageHome', $this->_aModule);
        $oAdsPageHome = new BxAdsPageHome($this);
        return $oAdsPageHome->getBlockCode_categories();
}

 

Then you need to create a block for index page which will call this service method. MySQL query should look like the following 

 

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES
('index', '1140px', 'Show Ads Categories', '_bx_ads_Categories', 1, 0, 'PHP', 'return BxDolService::call('ads', 'get_ads_categories');', 1, 71.9, 'non,memb', 0);

 

Then move the block in necessary position via admin panel -> builders -> pages builder -> homepage.

That's all. I think it should work :)

 

 

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 17 Nov 2012

When running the sql query i got the following error

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ads', 'get_ads_categories');', 1, 71.9, 'non,memb', 0)' at line 2

Quote · 17 Nov 2012

i manually created the page block in the MySql but when i moved the block into position with page builder nothing shows up on the index page after clearing the cache

Quote · 17 Nov 2012

Try this

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES ('index', '1140px', 'Show Ads Categories', '_bx_ads_Categories', 1, 0, 'PHP', 'return BxDolService::call(''ads'', ''get_ads_categories'');', 1, 71.9, 'non,memb', 0);

Good luck

so much to do....
Quote · 17 Nov 2012

 

Try this

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES ('index', '1140px', 'Show Ads Categories', '_bx_ads_Categories', 1, 0, 'PHP', 'return BxDolService::call(''ads'', ''get_ads_categories'');', 1, 71.9, 'non,memb', 0);

Good luck

 

 

Error

 

SQL query:

 

< p class = "code" > INSERT INTO `sys_page_compose` ( `Page` , `PageWidth` , `Desc` , `Caption` , `Column` , `Order` , `Func` , `Content` , `DesignBox` , `ColWidth` , `Visible` , `MinWidth` )
VALUES < br > ( 'index', '1140px', 'Show Ads Categories', '_bx_ads_Categories', 1, 0, 'PHP', 'return BxDolService::call(''ads'', ''get_ads_categories'');', 1, 71.9, 'non,memb', 0 ) ;

 

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<p class="code">INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Ca' at line 1

Quote · 17 Nov 2012

Hello 

The problem appears because you are copping MySQL query with unnecessary HTML tags at the beginning

< p class = "code" >

The query shoul start with INSERT and with ; 

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 19 Nov 2012

i have tried it with and with out the p class code and same result- i was able to set the sql table up but the box does not show on the index page

Quote · 21 Nov 2012

any other idea's to make this work?>

Quote · 29 Nov 2012

Use Prashanks method!

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES ('index', '1140px', 'Show Ads Categories', '_bx_ads_Categories', 1, 0, 'PHP', 'return BxDolService::call(''ads'', ''get_ads_categories'');', 1, 71.9, 'non,memb', 0);

I couldn't get Alex's to work.

After that this mod worked perfect for me.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 29 Nov 2012

 it created the block in page builders but it still does not show up on the index page

Use Prashanks method!

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES ('index', '1140px', 'Show Ads Categories', '_bx_ads_Categories', 1, 0, 'PHP', 'return BxDolService::call(''ads'', ''get_ads_categories'');', 1, 71.9, 'non,memb', 0);

I couldn't get Alex's to work.

After that this mod worked perfect for me.

 

Quote · 29 Nov 2012
 
 
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.