Is there a banner ad module available, which can display banners by category ?
To example: If I open the category Vietnam , I will see all Vietnam-Thumbnails and above those Thumbnails I would like to see banners from Vietnam Hotels, or Vietnam Companies.
I just went through all extensions and plugins, but I did not find a module that can exactly do this.
Or is it possible to modify the category-index pages ? Where are those index-files located in the system ?
Anyone an idea ?
Thanks in advance, Jochen
Offline
hello
you can your ad by many way :
-template extension -easiest way-: see thumbnails.tpl and mainpage_categories.tpl and index.tpl : you can place your ad at the bottom of thumbnails.tpl and mainpage_categories.tpl or in index.tpl
you edit tpl without overwriting the original one by using localfile editor->tab template
then apply you tpl in config->template-extension->set your tpl file as a replacement for the original tpl file
-plugin : I prefer you finished to see exactly where you will put your ad by the previous method, and after I'll tell how to be more compliant.
in all case you need to have a basic knowledge of html and css
the weird markers are from Smarty http://www.smarty.net/docsv2/en/
Offline
Hi all, thank you very much for your fast reply.
I will try that right now.
Best regards, Jochen
Offline
Hello again, I just tryed that, but this way the same banner will show up generally on the thumbs page.
I would need it like this:
If I open the category Vietnam , I will see all Vietnam-Thumbnails and above those thumbnails I would like to see banners from Vietnam Hotels, or Vietnam Companies.
If I open the category Cambodia, I will see all Cambodia-Thumbnails and above those thumbnails I would like to see banners from Cambodia Hotels, or Cambodia Companies.
So the banners shall fit to the called categories.
How to realise this ?
Anyone an idea ?
Thanks in advance, Jochen
Offline
well ... to display ad you need to use a platform which provides ads. if you want to customize the ads, see your ads provider
If you want to get the name of the current category :
-in a plugin perso (via localfile) or in your custom theme add :
add_event_handler('loc_after_page_header', 'dynamic_tab', 20);
function dynamic_tab() {
global $page, $template;
$template->assign('cat_name', $page['category']['name']);
}
then use {$cat_name} in tpl files
Last edited by flop25 (2011-05-12 10:31:33)
Offline
Hi Flop, thank you for taking your time !
On my site I intend to offer banner space, so that i.e. hotels want me to display their banner on my piwigo gallery.
So I also have folders next to my piwigo-installation - i.e. one called "banner". This folder contains subfolders. Each subfolder has the name of a country. So i.e. one subfolder is named Cambodia (this folder will contain banners from hotels in Cambodia) , another subfolder is named Vietnam (this folder will contain banners from hotels in Vietnam) and so on........
My piwigo gallery has the categories, one named Cambodia (containing Cambodia pictures) and another category named Vietnam (containing Vietnam Pictures).
Now everytime someone clicks in my piwigo gallery on the category Cambodia he should see (above the Cambodia thumbnails) one or two banners from the Cambodia banner folder.
Everytime someone clicks in my piwigo gallery on the category Vietnam he should see (above the Vietnam thumbnails) one or two banners from the Vietnam banner folder.
To my distress I am not a coder but as far as I can modify something I will do it.
Anyway I really wonder, that I shall be the first one asking for a category related bannerad system ?
Hmmm ? I will try and work around with your previous advices now,
thank you so far, best regards, Jochen
Offline
it seems easy if you exactly the url of your banner :
just in your tpl : <img src="http://yoursite.my/where_it_is/{$cat_name}/hottel.jpeg" alt="banner" title="{$cat_name} hotel">
if you want a bit of randomness : {"1"|mt_rand:5} will show an integer between 1 and 5 randomly
Is it online ? my girl friend is Vietnamese so...
Offline
Thank you very much, if finished, I will notice you again.
I will try your advise on a different domain, but you surely can already see all the pictures at:
http://www.travelphotos24.com
br, Jochen
Last edited by jochen2011 (2011-05-12 11:36:40)
Offline
I just tryed it, but the file cambodia.gif is also displayed in all other Countries.
To see what I mean, please go here
http://www.travel-photolibrary.com/gall … tegory/264
I put the piwigo-script into the folder gallery
http://www.travel-photolibrary.com/gallery
The file cambodia.gif is in
http://www.travel-photolibrary.com/gall … mbodia.gif
in thumbnails.tpl I added:
<center><a href="http://www.yahoo.com" target="_blank">
<img src="http://travel-photolibrary.com/gallery/banner/Cambodia/{$cat_name}/cambodia.gif" alt="banner" title="{$cat_name} hotel"></a></center><br>
Do you have an idea ?
br, Jochen
Offline
flop25 wrote:
well ... to display ad you need to use a platform which provides ads. if you want to customize the ads, see your ads provider
If you want to get the name of the current category :
-in a plugin perso (via localfile) or in your custom theme add :
add_event_handler('loc_after_page_header', 'dynamic_tab', 20);
function dynamic_tab() {
global $page, $template;
$template->assign('cat_name', $page['category']['name']);
}
then use {$cat_name} in tpl files
did you do that ?
Offline
not yet
I use the flop_mauve theme, -- in which file shall I add
add_event_handler('loc_after_page_header', 'dynamic_tab', 20);
function dynamic_tab() {
global $page, $template;
$template->assign('cat_name', $page['category']['name']);
}
Offline
this is not a custom theme : if I upgrade my theme flop_mauve and you do the update, you will loose your changes
So please use LocalFile Editor
Offline
well by taking a look at your gallery I was thinking the problem is harder : you use a more complex hierarchy ...
But I'm good today and I'll give you a full code for your personnal plugin :
add_event_handler('loc_after_page_header', 'mybanner'); function mybanner() { global $page, $template; $cat_name=array('one country','one more','one more','one more etc');//change Value here !!!!!!!!! if (isset($page['category'])) { if (isset($page['category']['upper_names']) ) { $upper_names=array(); foreach ($page['category']['upper_names'] as $upper) { $upper_names[]=$upper['name']; } foreach ($cat_name as $pays) { if (in_array($pays, $upper_names )) { $template->assign('cat_name', $pays); } } } else { $template->assign('cat_name', $page['category']['name']); } } }
this search in the upper category the terms 'one country','one more','one more' and 'one more etc' -it will be your country- and assign the term found to the tpl variable {$cat_name}
Well if you want more programming please learn or pay a specialist .. but if you have bugs with it I'm still here ;)
Offline
OK, thank you very much,
I will try this and notice you as soon as finished.
thank you very much, br, Jochen
Offline
is there any simple way for adding ads on the gallery and in the hole gallery there is no plugin for ads why