PHPfox Tip -Make Ads in a Block to Keep Them from Disappearing

There’s been an annoying bug in the PHPfox ad system for years. With PHPfox V4 Neutron, that has been removed as the ads are now done in blocks in AdminCP for the admin created ads. However, for those running PHPfox V3, this annoying bug has ads disappearing unless we clear cache. After having cleared cache several times yesterday, I got fed up so here’s how to make ads in a block and also how to hide them from specific areas.

Make a block

V3 Nebula: AdminCP >> CMS >> Block >> Add New Block

Product: phpfox

Module: user

Title: put a good title so that you will know what this is

Type: PHP Code

Controller: None (sitewide)

Placement: We chose Block 3

Now for the code in the PHP/HTML block put:

The above is an example of how to do the ad. An explanation:

If you want to hide the ad from entire modules of the site like we did, just add or remove from our first line of code “aNotInTheseModules” anything you need to like our examples. Where you see we have added ‘admincp’, ‘forum’ that is telling the script not to show this ad in the admincp and in the entire forum modules.

If you want to hide the ad from pages of the site (maybe core.index-visitor which is the visitor home page, you see the second line “arrayDoNotLoadHere”. Just add the specific pages of the site you don’t want to show this on. The controller can be seen in the block controller list if you are not sure.

OR

V4 Neutron: AdminCP >> Blocks and click Add Block

Title: put a good title so that you will know what this is

Type: PHP Code

Controller: None (sitewide)

Placement: We chose Block 3

PHP/HTML code:

Note the above for V4 does not have a way to hide it from various places on the site as we can’t get that to work yet. V4 has some changes to it and this appears to be one of them. If you don’t want it to show all over, for now you’ll want to just manually make the block where you want it which will be a bit of work to do.

 

 

Content Protection by DMCA.com