↑ Return to P90 Sales Plugins

PRIV P96 AdsManager Light

Responsible
r.karadjov
My articles
Follow on:

Page no: P96

Implementation and plugin transformation

All the functionality will move into a independent plugin.

Our plugin folder is called adsmanager. The plugin contains self-installer, which do all of the work for us. The plugin contains 3 different files. The core file is adsmanager.php. All our php code is there. The code for UI and for calling into the template. The style file (CSS) is into our styles folder. Our css file is called am.css. We also have readme.txt file located in the core plugin folder. The text file contains all the information about the plugin and installation.

AdManager plugin structure - Click to enlarge

Installation

The installation of the plugin is very simple process. We don’t have to add any css code or to make any complicated installation. We have one basic function – am_get_ad(). You need to specify the position of the ad. We have three different position which can be located everywhere. The code for position will look like am_get_ad(1). The same for position 2 and 3. The code need to be added into php open and close tags.

Calling adManager plugin on position 3 in footer - Click to enlarge

The whole code for banner position one is:

<?php am_get_ad(1); ?>

 

The whole code for banner position two is:

<?php am_get_ad(2); ?>

 

The whole code for banner position three is:

<?php am_get_ad(3); ?>

Calling adManager plugin on position 3 in header.php - Click to enlarge

Test cases

Test Case No1:  New one global advert with banner type one

Case 1, Adding new global ad - Click to enlarge

 

Test Case No2:  Add 5 global (default) adverts with banner type one

The adverts must show randomly on pages that do not have a specific advert.

TEST CASE 2, 5 global ads added - Click to enlarge

Test Case No3: Add one category advert for banner type one

Case 3, Adding a category add - Click to enlarge

Test Case No4: Add 5 on category adverts for banner type one
Test Case No5: Add one global (default) and one on home page with banner type two

Test Case 5, Adding home advert - Click to enlarge

Test Case No6:  Add one global and one on page on position three

We can define pages or posts via their slug. We need to change global or home with the slug (url) of the post or page.

Test case 6, Page advert on Position 3 - Click to enlarge

List all ads - Click to enlarge

 

Tags: ,

See more for P9x Sales Plugins