Difference between revisions of "Gallery Builder Module"
m |
|||
Line 28: | Line 28: | ||
When affiliates select between Set1 and Set2, <?=$_GET['content']?> is replaced by the content | When affiliates select between Set1 and Set2, <?=$_GET['content']?> is replaced by the content | ||
set they picked. The picture reference would then be <img src="/mycontent/Set1/1.jpg">. | set they picked. The picture reference would then be <img src="/mycontent/Set1/1.jpg">. | ||
+ | |||
+ | == Set a default content directory == | ||
+ | To ensure the page displays correctly to surfers with a missing or bad content field set, you can set a default. Continuing our previous example, we will make Set1 our default content set. This will be used if the content set is unspecified or does not exist in /mycontent/. | ||
+ | |||
+ | <pre> | ||
+ | if(!$_GET['content'] || !is_dir('/mycontent/'.$_GET['content'])){ | ||
+ | $_GET['content']='Set1'; | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | This will be at the top of the page, and your picture reference would remain unchanged. | ||
== Use the Gallery Builder in NATS's Ad Tools == | == Use the Gallery Builder in NATS's Ad Tools == |
Latest revision as of 15:26, 28 June 2009
For NATS4, please see the NATS4 Gallery Builder Module article
Set up Gallery Builder Content
Create a new directory on your web directory on your server. (It doesn't have to be your NATS server) Inside the directory, create a folder for each content set and inside each content set folder, add content using a naming convention. For example: both content1 and content2 will have a thumb1.jpg, a 1.jpg, a thumb2.jpg, a 2.jpg, etc.
Set up Gallery Builder Templates
On the server, create a template. This template must be PHP parsable and web accessible. In the template, reference your images using the full path to the content set and replacing the name of the content set with the following PHP code: <?=$_GET['content']?>.
For example:
- your content folder is: /mycontent
- your content sets are Set1 and Set2
- your naming convention is thumb1.jpg, 1.jpg, thumb2.jpg, 2.jpg, etc.
- your picture reference becomes <img src="/mycontnet/<?=$_GET['content']?>/1.jpg">
When affiliates select between Set1 and Set2, <?=$_GET['content']?> is replaced by the content set they picked. The picture reference would then be <img src="/mycontent/Set1/1.jpg">.
Set a default content directory
To ensure the page displays correctly to surfers with a missing or bad content field set, you can set a default. Continuing our previous example, we will make Set1 our default content set. This will be used if the content set is unspecified or does not exist in /mycontent/.
if(!$_GET['content'] || !is_dir('/mycontent/'.$_GET['content'])){ $_GET['content']='Set1'; }
This will be at the top of the page, and your picture reference would remain unchanged.
Use the Gallery Builder in NATS's Ad Tools
After you setup Gallery Builder, new options appear on the Ad Tools Administration page. Gallery Builder (GB) Content appears in the Ad Tools drop down and two GB templates (type) appears in the hosted ad tools section. Templates are added via hosted ad tools. Select Hosted Ad Tools, a site, and click 'go'. Add a new template the same way you usually do, select the Gallery Builder template, fill in the rest of the information, and save.
Add the content set options. Select Gallery Builder Content, a site, and click go. Using the input and browse boxes, give the content the name you gave it on the server. Select the type, upload a thumbnail, select or create a group, and click add. The content will appear under the headings in a shaded line along with edit and delete icons.
Affiliate Gallery Access
Affiliates can now access the galleries using the members Ad Tools section. After they select the program they want and click Show Ad Tools, all sites are listed. Each site's ad types are listed on its line.
Gallery builder templates can be found under Hosted Ad Tools as either pictures or movies. Selecting one lists all Gallery Builder templated galleries of that type Click Chose Content. Available content sets appear with check boxes underneath them. Check the boxes of the content you want and click Get Linking Codes. The link codes are then displayed in a textbox.
To use the our example templates, unzip the attached file and place the GBExample folder and GBExample.php on the server in a web accessible folder. Edit the paths in GBExample.php to reflect where you can access GBExample via the web and set up as above.
Gallery Builder Template Groups
Gallery Builder's content and template grouping lets you restrict which content can be used on particular templates. After clicking the Choose Content link, only content from the same group as the template shows up in the NATS Ad Tools Admin.
On the Gallery Builder configuration page, click ADTOOLS_GB_TEMPLATE_UNFILTERED to disable grouping.