Piwigo.org

You are not logged in. (Register / Login)

Announcement

Post a reply

Write your message and submit

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

Noman
2012-03-17 22:59:47

first of all thanks to Piwigo for nice gallery..
Sir, this is my page http://www.hdwallbase.com i want to put google ads on every page is there any plugin for this

Noman
2012-03-17 22:53:00

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

jochen2011
2011-05-12 15:01:16

OK, thank you very much,

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

thank you very much, br, Jochen

flop25
2011-05-12 14:13:40

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

flop25
2011-05-12 12:44:39

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

jochen2011
2011-05-12 12:40:26

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']);
}

flop25
2011-05-12 12:35:45

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 ?

jochen2011
2011-05-12 12:28:36

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

jochen2011
2011-05-12 11:35:58

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

flop25
2011-05-12 11:16:53

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

jochen2011
2011-05-12 11:04:56

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

flop25
2011-05-12 10:31:03

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

jochen2011
2011-05-12 09:52:55

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

jochen2011
2011-05-12 09:15:22

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

I will try that right now.

Best regards, Jochen

flop25
2011-05-11 19:16:57

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/

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013