↑ Return to Our Plugins

P09 AdsManager Light

r.karadjov Responsible
r.karadjov
My articles
Follow on:

Page no: P09

Page no: P09a

 

 

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.

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 footer - Click to enlarge

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

 

Step by Step Guide

 

1. Adverts list
2. Edit and Delete buttons edit and delete button
3. Editing a new advert Editing 2
4. Button Add a new advert Add new
 5. Add new – form  add new form

Test cases

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

 

1) Adding new global ad

Case 1, Adding new global ad

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.

CASE 2, 5 global ads added

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

 

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

Add one category advert for banner type one

Case 3, Adding a category add

Case 3, Adding a category add - Click to enlarge

 


Test Case No4: Add one global (default) and one on home page with banner type two

Add one global (default) and one on home page with banner type two

Test Case 4, Adding home advert

Test Case 5, Adding home advert - Click to enlarge



 

Test Case No5:  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 5, Page advert on Position 3

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

List all ads

List all ads

List all ads - Click to enlarge

 

 

See more for Plugins