Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: How can i put sponsors for different album/cats?  (Read 14728 times)

0 Members and 1 Guest are viewing this topic.

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« on: December 03, 2003, 08:37:30 am »

How can i put sponsors for different album/cats?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #1 on: December 03, 2003, 09:44:50 am »

you could use the anycontent.php block for this:
add some code like this into it:
Code: [Select]
if ($_REQUEST["album"] ==1){print 'This album was brought to you by foo bar';}
elseif ($_REQUEST["album"] ==2){print 'This album was brought to you by another sponsor';}
if ($_REQUEST["cat"] ==5){print 'This category can only be maintained in the future if you buy products from xyz company';}
You get the idea....

If you need a more sophisticated software to handle this, search hotscripts or some other script ressources page for "banner rotation".

GauGau
Logged

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
How can i put sponsors for different album/cats?
« Reply #2 on: December 03, 2003, 07:15:36 pm »

Well, how do you make "anycontent.php" appear only when that album is clicked?

It would be nice to see this as part of the gallery software(future plan perhaps?).  :D
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #3 on: December 03, 2003, 07:38:07 pm »

you seem not to have understood the concept:
anycontent is being included on each and every page - this is by design and is what you call "expected behaviour".
The file anycontent.php as it comes with the coppermine package doesn't do anything at all - it's empty.
If you put some code into it, it will be run on every page.

Solution: put some code into it that actually has conditions (see my above code example: "if"--> "then"). This mechanism is responsible to get something displayed under circumstances or not - it's up to you to code whatever you can think of.

Of course anycontent.php is meant to be used by people who know at least a little php...

GauGau
Logged

sbpoole

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 66
How can i put sponsors for different album/cats?
« Reply #4 on: December 03, 2003, 10:53:20 pm »

I use anycontent at the top of my website and anycontent2 at the bottom.  They only show up on the home (index.php) page.  No other page shows them except for the home page.  Am I missing something?  I would like them to show up on all pages if possible.  Thanks
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #5 on: December 04, 2003, 08:58:50 am »

well, looking into it I must confess you're right: anycontent does not show on all pages.
I started a tracker # 853886 on this.

GauGau
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
How can i put sponsors for different album/cats?
« Reply #6 on: December 04, 2003, 09:10:38 am »

anycontent was not meant to show up on pages other than index.php

If you want it to appear on everypage, in index.php find
Code: [Select]
case 'anycontent';
and remove the
Code: [Select]
if ($cat == 0){
after it, and the "}" after "include('anycontent.php');"

you will have to add code to thumbnails.php and displayimage.php too
but since for some reason I can't use my copy paste right now,
you'll have to wait until I restart my computer.  :)
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #7 on: December 04, 2003, 09:16:31 am »

@oasis: as you're already working on this, please take over the tracker (I originally assigend it to Tarique, since he was the author of anycontent). Please make up your mind if this can be turned into an admin settable option (anycontent on all pages or index only...).

Thanks

GauGau
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
How can i put sponsors for different album/cats?
« Reply #8 on: December 04, 2003, 10:53:44 am »

@gaugau: Sorry, I won't be able to make it an admin settable option to put it on every page, because the content on main page tag does not control "thumbnails.php" or "displayimages.php". This is just like the toprated blocks, random blocks, etc won't show up in thumbnail view or picture view.I can only make an admin settable option to put it on all "index.php" pages, that is mainpage, category view, and album view. To make them appear in when viewing thumbnails and individual pictures the will have to add the code manually.

@sbpoole: OK, let's continue now that I can copy paste again..
If you altered the code as I posted earlier, you will have the anycontent block appearing now on all pages called from index.php: Main page, Category Listing, Album Listings.

Now, if you want it to appear when you are INSIDE an album, do this:

1. If you want the block to appear at the TOP of the page:
thumbnails.php:
Find
Code: [Select]
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
add AFTER it:
Code: [Select]
$elements = preg_split("|/|", $CONFIG['main_page_layout'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($elements as $element){
        if (preg_match("/(\w+),*(\d+)*/", $element, $matches))        switch($matches[1]){
                case 'anycontent':
                include('anycontent.php');
                break;
}
}


2. If you want the block to appear at the BOTTOM of the page:
place the same code BEFORE:
Code: [Select]
pagefooter();
ob_end_flush();



if you want the block to appear when you are looking at an INDIVIDUAL PICTURE:

1. TOP of the page:
displayimage.php:
Find
Code: [Select]
pageheader($album_name.'/'.$picture_title, '', false);
add AFTER it:
Code: [Select]
$elements = preg_split("|/|", $CONFIG['main_page_layout'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($elements as $element){
        if (preg_match("/(\w+),*(\d+)*/", $element, $matches))        switch($matches[1]){
                case 'anycontent':
                include('anycontent.php');
                break;
}
}


2. If you want the block to appear at the BOTTOM of the page:
place the same code BEFORE:
Code: [Select]
pagefooter();
ob_end_flush();



OK thats all. Hope it works for you.
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« Reply #9 on: December 05, 2003, 05:13:29 am »

So how can i add

<script src="Banners/3SideBanner/bronze.js" type="text/javascript"></script>

into this:

if ($_REQUEST["album"] ==5){print 'This album was brought to you by foo bar';}
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #10 on: December 05, 2003, 09:47:18 am »

You should know a little HTML to make this work, of course like this:
Code: [Select]
if ($_REQUEST["album"] ==5){print '<script src="Banners/3SideBanner/bronze.js" type="text/javascript"></script>';}
Maybe you should get learn some basics first! Why don't you experiment a little before asking questions?

GauGau
Logged

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« Reply #11 on: December 05, 2003, 05:51:24 pm »

Never mind i got it to just the way i need thanks for all your help. :D
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #12 on: December 05, 2003, 10:15:47 pm »

@ojohn: OK, glad you got it working for yourself.

@All: For all others reading this thread and wondering how this can be done: if you just need some plain HTML (or JavaScript) to run on every page, there's no magic at all: simply insert the HTML code in /themes/yourtheme/template.html
No need to play around with anycontent.php at all!

GauGau
Logged

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« Reply #13 on: December 06, 2003, 08:28:40 am »

Hi

I edit the thumbnails page and the sposors don't show there like they should and not i the display image page too.

Any ideas?
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
How can i put sponsors for different album/cats?
« Reply #14 on: December 06, 2003, 10:34:29 am »

link?
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How can i put sponsors for different album/cats?
« Reply #15 on: December 06, 2003, 12:00:44 pm »

Quote from: "ojohn"
Hi

I edit the thumbnails page and the sposors don't show there like they should and not i the display image page too.

Any ideas?
You mustn't edit the php files of coppermine, read my above post: just edit template.html !

GauGau
Logged

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« Reply #16 on: December 07, 2003, 01:36:30 am »

@oasis: I try what you said i edit and added the code into my displayimage.php
and thumbnails.php and it doesn't show up in the displayimage.php and thumbnails.php.

And another question do i need to change anything in the anycontent, what i have in it is this:

Code: [Select]
if ($_REQUEST["cat"] == 3){print 'Baseball Sponsor Banner Test';}

But like i said it only show up in the index parts and not the displayimage or
thumbnails and yes i edit the index page.
Logged

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« Reply #17 on: December 10, 2003, 01:56:29 am »

@oasis: I did what you said on display the anycontent on everypage but what do i use in the anycontent?
Logged

ojohn

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
How can i put sponsors for different album/cats?
« Reply #18 on: December 21, 2003, 08:59:26 am »

oasis pls i need help
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
How can i put sponsors for different album/cats?
« Reply #19 on: December 21, 2003, 05:39:12 pm »

oh gosh, sorry I didn't notice your post. I've been having my finals lately.

Could you try anycontent without the if ($_REQUEST["cat"] == 3) first?
In other words, don't restrict it to categories yet, just see if it shows up at all. My guess is that you are going have to set $_REQUEST["album"] and not $_REQUEST["cat"] if you want it to appear in displayimages and thumbnails.php, because cat is read by index.php only. thumbnails.php and displayimages.php read the "album" variable.

By the way, you still haven't given me a link I asked you for. It would be much easier if I could see the page and not just imagine it.
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org
Pages: [1] 2   Go Up
 

Page created in 0.026 seconds with 18 queries.