risestar
Tue 9th May '00, 2:34am
I am trying to get phpads installed and working in the footer template and it keeps giving me a error in global.php
This is the documentation for php ads.
What would the syntax be to put the call into the footer?
Thanks
------------------------
Local Mode
This is the tradtional style of a including a banner within a PHP3-powered website. On every page you want to have a banner, you have to
include config.inc.php3, view.inc.php3 and acl.inc.php3. These files are in your phpAds-installation-directory. Banner are displayed using the
view()-function. This function has the following syntax:
int view (mixed what [, int clientID [, string target [, bool withText = 0[, array context]]]]);
The argument "what" is currently one of the following:
[int]: Display the banner with this bannerID. Example: view(1);
"[width]x[height]: Display a randomly selected banner with this width/height. Example: view("468x60");
"html": Display a randomly selected HTML-banner
"[keyword]": Display a randomly selected banner with this keyword associated to it. Example: view("maingroup");
Note: Banners with the special keyword "global" associated to them, are also considered when using this syntax.
The optional argument clientID allows you to retrieve only banners by a specific client. Specify "" to view banners from all clients (in
case you need the third or fourth argument, else don't specify it at all).
Example: view("468x60", 1).
The optional argument "target" allows you to specify a frame target (may be one of "[framename]", "_blank", "_parent" and "_top").
Example: view("maingroup", 0, "_blank");
The optional argument withText allows you to show a banner with its associated line of text below it (for example, "Suport our
sponsor" is a common line of text).
Example: view("maingroup", 0, "", 1);
The optional argument "context" is an array specifying banners to limit the search to or/and banners to be excluded from the search. It
is an array containing as many associative arrays as you want. The key of the entries must either be "==" to denote a banner to which
the search is limited to or "!=" to denote a banner to be excluded from the search. The value of an entry is a banner ID. For example, to
show the same randomly selected banner on the top and bottom of a page, you could use the following:
// Top of the page:
$id = view("main", 5);
// Bottom of the page
$arr = array(
array("==" => $id)
);
view("main", 0, "", 0, $arr);
To make sure that the page does not the same banner two times, you could use this:
// Top of the page:
$id = view("main", 5);
// Bottom of the page
$arr = array(
array("!=" => $id)
);
view("main", 0, "", 0, $arr);
Some examples:
view(1); - Displays the banner with the bannerID of 1.
view("html"); - Displays a randomly selected HTML banner
view("468x60", 0, "_blank"); - Displays a randomly selected banner with a width of 468 pixels and a height of 60 pixels. If user clicks on
it, the target destination will be opened in a new window.
view("Websites/Business/New_Media/"); - Displays a randomly selected banner from the group "Websites/Business/New_Media/"
(in other words: with that keyword).
A sample HTML file could look like this:
<?
require("/usr/local/etc/phpAds/config.inc.php3");
require("/usr/local/etc/phpAds/view.inc.php3");
require("/usr/local/etc/phpAds/acl.inc.php3");
?>
<html>
<head>
<title>phpAds demo</title>
</head>
<body>
<?
view("468x60");
?>
</body>
</html>
This is the documentation for php ads.
What would the syntax be to put the call into the footer?
Thanks
------------------------
Local Mode
This is the tradtional style of a including a banner within a PHP3-powered website. On every page you want to have a banner, you have to
include config.inc.php3, view.inc.php3 and acl.inc.php3. These files are in your phpAds-installation-directory. Banner are displayed using the
view()-function. This function has the following syntax:
int view (mixed what [, int clientID [, string target [, bool withText = 0[, array context]]]]);
The argument "what" is currently one of the following:
[int]: Display the banner with this bannerID. Example: view(1);
"[width]x[height]: Display a randomly selected banner with this width/height. Example: view("468x60");
"html": Display a randomly selected HTML-banner
"[keyword]": Display a randomly selected banner with this keyword associated to it. Example: view("maingroup");
Note: Banners with the special keyword "global" associated to them, are also considered when using this syntax.
The optional argument clientID allows you to retrieve only banners by a specific client. Specify "" to view banners from all clients (in
case you need the third or fourth argument, else don't specify it at all).
Example: view("468x60", 1).
The optional argument "target" allows you to specify a frame target (may be one of "[framename]", "_blank", "_parent" and "_top").
Example: view("maingroup", 0, "_blank");
The optional argument withText allows you to show a banner with its associated line of text below it (for example, "Suport our
sponsor" is a common line of text).
Example: view("maingroup", 0, "", 1);
The optional argument "context" is an array specifying banners to limit the search to or/and banners to be excluded from the search. It
is an array containing as many associative arrays as you want. The key of the entries must either be "==" to denote a banner to which
the search is limited to or "!=" to denote a banner to be excluded from the search. The value of an entry is a banner ID. For example, to
show the same randomly selected banner on the top and bottom of a page, you could use the following:
// Top of the page:
$id = view("main", 5);
// Bottom of the page
$arr = array(
array("==" => $id)
);
view("main", 0, "", 0, $arr);
To make sure that the page does not the same banner two times, you could use this:
// Top of the page:
$id = view("main", 5);
// Bottom of the page
$arr = array(
array("!=" => $id)
);
view("main", 0, "", 0, $arr);
Some examples:
view(1); - Displays the banner with the bannerID of 1.
view("html"); - Displays a randomly selected HTML banner
view("468x60", 0, "_blank"); - Displays a randomly selected banner with a width of 468 pixels and a height of 60 pixels. If user clicks on
it, the target destination will be opened in a new window.
view("Websites/Business/New_Media/"); - Displays a randomly selected banner from the group "Websites/Business/New_Media/"
(in other words: with that keyword).
A sample HTML file could look like this:
<?
require("/usr/local/etc/phpAds/config.inc.php3");
require("/usr/local/etc/phpAds/view.inc.php3");
require("/usr/local/etc/phpAds/acl.inc.php3");
?>
<html>
<head>
<title>phpAds demo</title>
</head>
<body>
<?
view("468x60");
?>
</body>
</html>