| 1 |
--------
|
| 2 |
WARNING:
|
| 3 |
--------
|
| 4 |
In order to properly install and configure the banner module, you might need
|
| 5 |
some knowledge of PHP, the Drupal themeing system, and of using tools such as
|
| 6 |
patch. This module can be difficult to install.
|
| 7 |
|
| 8 |
The following document attempts to make the installation process more clear.
|
| 9 |
Please follow these steps carefully and exactly as written before filing a
|
| 10 |
support request. It is advised that you review this entire document before
|
| 11 |
you try and install this module.
|
| 12 |
|
| 13 |
|
| 14 |
-----------
|
| 15 |
Preparation:
|
| 16 |
-----------
|
| 17 |
|
| 18 |
0) Properly configure 'File system' support for your Drupal installation.
|
| 19 |
(Goto 'administer -> settings' then find 'File system settings')
|
| 20 |
Follow the directions on this page to set a proper 'File system path'
|
| 21 |
and 'Temporary directory'. When this is properly configured, you will
|
| 22 |
not see any errors.
|
| 23 |
|
| 24 |
|
| 25 |
------------
|
| 26 |
Installation:
|
| 27 |
------------
|
| 28 |
|
| 29 |
1) Copy the banner directory to your Drupal modules directory. The .install
|
| 30 |
file will automatically add the required tables to your database when the
|
| 31 |
module is activated.
|
| 32 |
|
| 33 |
2) Move 'banner_db.php' and 'banner_file.php' into your top level Drupal
|
| 34 |
directory. Give these files proper permissions so that they can be
|
| 35 |
read by the webserver.
|
| 36 |
|
| 37 |
These files are added for performance reasons. By using these files the
|
| 38 |
banner module can display different banners to different people even
|
| 39 |
on cached pages. The actual performance gain comes from not including
|
| 40 |
all of Drupal's include files each time a banner needs to be displayed.
|
| 41 |
|
| 42 |
3) Now you need to log in to your site and enable the new banner.module.
|
| 43 |
(Goto 'administer -> modules' then check 'banner')
|
| 44 |
|
| 45 |
|
| 46 |
-------------
|
| 47 |
Configuration:
|
| 48 |
-------------
|
| 49 |
|
| 50 |
4) Configure the banner module. At minimum, it is _HIGHLY_ recommended that
|
| 51 |
you enable the file caching mechanism built into this module. The rest
|
| 52 |
of the settings can be left at their defaults for now.
|
| 53 |
(Goto 'administer -> settings -> banner')
|
| 54 |
The file-caching mechanism used by this module greatly increases
|
| 55 |
banner-display performance. It is not required, but you will not get
|
| 56 |
very good performance from this module without it.
|
| 57 |
|
| 58 |
If you wish to be to configure which banners are displayed on certain pages
|
| 59 |
using taxonomy terms, you will need to select one or more vocabulary in the
|
| 60 |
Categories section.
|
| 61 |
|
| 62 |
5) Setup banner module permissions.
|
| 63 |
(Goto 'administer -> users -> configure -> permissions')
|
| 64 |
- Give 'show banners' permission to users that should see the banners.
|
| 65 |
- Give 'manage banners' permission to users that should be allowed to
|
| 66 |
track view/click statistics for their own banners.
|
| 67 |
- Give 'upload banners' permission to users that should be allowed to upload
|
| 68 |
new banners. (usually you would also give those users 'manage banners'
|
| 69 |
permission at the same time)
|
| 70 |
- Give 'administer banners' permission to users that should be allowed to
|
| 71 |
add/edit/delete all banners on your site.
|
| 72 |
|
| 73 |
|
| 74 |
---------------------------
|
| 75 |
Uploading graphical banners:
|
| 76 |
---------------------------
|
| 77 |
|
| 78 |
6) Upload a new banner via the administrative interface.
|
| 79 |
(Goto 'administer -> banners -> add')
|
| 80 |
- give the banner a descriptive title. (when you are managing lots of
|
| 81 |
banners, it becomes important that this title describe the banner)
|
| 82 |
- enter a URL where you want clicking on the banner to take you.
|
| 83 |
- set the status to 'enabled' so that the banner is displayed.
|
| 84 |
- scroll to the bottom of the page and click 'browse' to select a banner
|
| 85 |
image to upload. (it is important that the filename of your image
|
| 86 |
end in three characters indicating the filetype. Supported image types
|
| 87 |
are: jpg, jpeg, gif, png, bmp and tiff)
|
| 88 |
- click save. For now, we'll leave the rest of the options set to their
|
| 89 |
defaults. Once everything is confirmed to be working on your
|
| 90 |
installation, then you can worry about the more complicated configuration
|
| 91 |
options.
|
| 92 |
|
| 93 |
7) Preview the newly uploaded banner.
|
| 94 |
(Goto 'administer -> banners')
|
| 95 |
You should currently see a list of all the banners you've uploaded. Find
|
| 96 |
the name of the banner you just uploaded, and click 'view' in the options
|
| 97 |
column. You should now see your banner at the top of the page, along with
|
| 98 |
general information and statistics about the banner. If you don't see
|
| 99 |
the banner you just uploaded, something has gone wrong. If you're seeing
|
| 100 |
garbage text instead of the image, then the module failed to recoginze
|
| 101 |
the file type and is instead trying to display the image as text. Be sure
|
| 102 |
the file name is something like 'banner.jpg' or 'banner.png', specifically
|
| 103 |
including the three letters at the end appropriate to the file type.
|
| 104 |
|
| 105 |
You can see an example of banner ads in action at http://kerneltrap.org/
|
| 106 |
|
| 107 |
See http://drupal.org/node/50148 for information on how to use remotely hosted
|
| 108 |
images as banners.
|
| 109 |
|
| 110 |
|
| 111 |
-----------------------------
|
| 112 |
Uploading text advertisements:
|
| 113 |
-----------------------------
|
| 114 |
|
| 115 |
8) Prepare the text ad.
|
| 116 |
Text ads require a little extra manual effort. Specifically, you must
|
| 117 |
add a link within the the text of the ad that points to the banner's
|
| 118 |
appropriate link url. After the banner is created, you can find the
|
| 119 |
banner's id at 'administer -> banners'. (Yes, this means you will need
|
| 120 |
to upload the banner twice. The first time you upload the banner you
|
| 121 |
won't know the new banners id.)
|
| 122 |
|
| 123 |
Assuming the banner has an id of 13, you will need to include a link in
|
| 124 |
the banner's text to the URL '/banner/13'. For example:
|
| 125 |
<a href='http://mysite.com/banner/13'>banner text</a>
|
| 126 |
|
| 127 |
Note: Do NOT link directly to where the banner is actually taking you, or
|
| 128 |
the clicks will NOT be counted. When uploading the banner, you will be
|
| 129 |
able to set the end URL.
|
| 130 |
|
| 131 |
9) Upload a new banner via the administrative interface.
|
| 132 |
(Goto 'administer -> banners -> add')
|
| 133 |
- give the banner a descriptive title. (when you are managing lots of
|
| 134 |
banners, it becomes important that this title describe the banner)
|
| 135 |
- enter a URL where you want clicking on the text ad to take you.
|
| 136 |
- set the status to 'enabled' so that the text ad is displayed.
|
| 137 |
- scroll to the bottom of the page and click 'browse' to select the
|
| 138 |
text file to upload. (it is advised that the filename of your text
|
| 139 |
ad end in with '.txt'. If you do not do this, the banner module may
|
| 140 |
not recognize your ad as being text and it may not display properly.)
|
| 141 |
- click save. For now, we'll leave the rest of the options set to their
|
| 142 |
defaults. Once everything is confirmed to be working on your
|
| 143 |
installation, then you can worry about the more complicated configuration
|
| 144 |
options.
|
| 145 |
|
| 146 |
10) Preview the newly uploaded text ad.
|
| 147 |
(Goto 'administer -> banners')
|
| 148 |
You should currently see a list of all the ads you've uploaded. Find
|
| 149 |
the name of the text ad you just uploaded, and click 'view' in the options
|
| 150 |
column. You should now see your text ad at the top of the page, along with
|
| 151 |
general information and statistics about the ad. If you don't see
|
| 152 |
the text from the ad you just uploaded, something has gone wrong. Try
|
| 153 |
renaming the text file to end with '.txt' and uploading it again.
|
| 154 |
|
| 155 |
You can see an example of text ads in action at http://kerneltrap.org/
|
| 156 |
|
| 157 |
|
| 158 |
-------------------------------------------
|
| 159 |
Displaying banners and text ads from blocks:
|
| 160 |
-------------------------------------------
|
| 161 |
|
| 162 |
11) The easiest way to display banners and text ads on your site (easiest
|
| 163 |
because then you do not have to edit your theme) is to display them from
|
| 164 |
a Drupal block.
|
| 165 |
(Goto 'administer -> blocks -> add')
|
| 166 |
- set a title for the block, such as 'Advertisement'
|
| 167 |
- set the input format to 'PHP code'
|
| 168 |
- In the block body, enter the following:
|
| 169 |
<?php return banner_display(); ?>
|
| 170 |
- enter a block description
|
| 171 |
- click 'Save block'
|
| 172 |
- at 'administer -> blocks' enable your new block
|
| 173 |
|
| 174 |
|
| 175 |
-----------------------------------
|
| 176 |
Displaying multiple ads on one page:
|
| 177 |
-----------------------------------
|
| 178 |
|
| 179 |
12) The banner module currently supports up to ten different unique groups
|
| 180 |
of banners. The default display group is 0. You can also display banners
|
| 181 |
from groups 1 thorugh 9. This allows you to for example display banner
|
| 182 |
ads at the top of your page, and text ads in a block on the side.
|
| 183 |
The display group of a given ad is set when you add the banner, or later
|
| 184 |
by editing it. To display banners in a different group, you need to pass
|
| 185 |
in the group number when calling banner_display. For example, to display
|
| 186 |
banners from group 3 you would use the following call:
|
| 187 |
<?php return banner_display(3); ?>
|
| 188 |
|
| 189 |
|
| 190 |
-----------------------------------------------
|
| 191 |
Displaying banners and text ads from your theme:
|
| 192 |
-----------------------------------------------
|
| 193 |
|
| 194 |
13) To display a banner from your theme, you will need to modify the theme.
|
| 195 |
How this is done is different for each theme. Essentially though, you
|
| 196 |
need to add a call to banner_display() in the appropriate place.
|
| 197 |
(Finding the appropriate place is the challenge.)
|
| 198 |
|
| 199 |
For some simple examples, refer to the sample patches that come with
|
| 200 |
the banner.module. (The sample patches are in contributed/theme)
|
| 201 |
|
| 202 |
Sorry, I am unable to provide sample patches for all available themes.
|
| 203 |
Please refer to the provided sample patches to better understand how you
|
| 204 |
can patch your favorite themes yourself.
|
| 205 |
|
| 206 |
|
| 207 |
---
|
| 208 |
FAQ
|
| 209 |
---
|
| 210 |
Q. I don't see any images. What's wrong?
|
| 211 |
A. Be sure you installed 'banner_db_php' and 'banner_file.php', and
|
| 212 |
properly set the permissions on these files so they can be read
|
| 213 |
by your webserver. (See step 3 above)
|
| 214 |
s
|
| 215 |
Q. I did install the files correctly, but I still don't see any images.
|
| 216 |
What's wrong?
|
| 217 |
A. Try refreshing the banner cache. Go to:
|
| 218 |
administer -> banner -> refresh cache
|
| 219 |
|
| 220 |
Q. I've refreshed my cache, but I'm still not seeing images. What's wrong?
|
| 221 |
A. Edit the banner and be sure that the MIME type was properly detected. Go
|
| 222 |
to:
|
| 223 |
administer -> banner -> list
|
| 224 |
then click 'edit' next to problematic banner. At the bottom of the page
|
| 225 |
you can update the MIME type.
|
| 226 |
|
| 227 |
$Id: INSTALL,v 1.14 2006/04/13 15:14:48 wulff Exp $ |