Announcement

#1 2011-05-11 16:40:11

jochen2011
Member
2011-02-28
20

Banner Ad System

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

 

#2 2011-05-11 19:16:57

flop25
Piwigo Team
2006-07-06
7037

Re: Banner Ad System

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/


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2011-05-12 09:15:22

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

Hi all, thank you very much for your fast reply.

I will try that right now.

Best regards, Jochen

Offline

 

#4 2011-05-12 09:52:55

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

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

 

#5 2011-05-12 10:31:03

flop25
Piwigo Team
2006-07-06
7037

Re: Banner Ad System

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)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#6 2011-05-12 11:04:56

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

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

 

#7 2011-05-12 11:16:53

flop25
Piwigo Team
2006-07-06
7037

Re: Banner Ad System

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...


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#8 2011-05-12 11:35:58

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

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

 

#9 2011-05-12 12:28:36

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

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

 

#10 2011-05-12 12:35:45

flop25
Piwigo Team
2006-07-06
7037

Re: Banner Ad System

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 ?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#11 2011-05-12 12:40:26

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

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

 

#12 2011-05-12 12:44:39

flop25
Piwigo Team
2006-07-06
7037

Re: Banner Ad System

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


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#13 2011-05-12 14:13:40

flop25
Piwigo Team
2006-07-06
7037

Re: Banner Ad System

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 :

Code:

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 ;)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#14 2011-05-12 15:01:16

jochen2011
Member
2011-02-28
20

Re: Banner Ad System

OK, thank you very much,

I will try this and notice you as soon as finished.

thank you very much, br, Jochen

Offline

 

#15 2012-03-17 22:53:00

Noman
Guest

Re: Banner Ad System

is there any simple way for adding ads on the gallery and in the hole gallery there is no plugin for ads why

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact