Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Change 'Powered by CPG' link to target=_blank ?  (Read 85950 times)

0 Members and 1 Guest are viewing this topic.

gaplayer26

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Change 'Powered by CPG' link to target=_blank ?
« on: December 27, 2005, 12:19:48 pm »

Hello,

I am using CPG1.4 with mambo 4.5.3 and CPG is displayed by Mambo's wrapper component.

Everything works great, except clicking the 'Powered by Coppermine' link opens up coppermine.sourceforge.net within my site, (within the inline wrapper component) which does not look good at all (squashed etc.) - can I change the CPG credit link target to be '_blank' so it opens up in a new window instead of the wrapper component without infringing the CPG licence?  If so, how can I achieve this?

I know how to make changes to the footer class in the style CSS, but I am not sure if you could change the target frame there as well?

PS - I have read the following http://coppermine.sourceforge.net/faq.php#editCopyrights
« Last Edit: June 14, 2006, 09:44:58 pm by Paver »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

gaplayer26

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #2 on: December 27, 2005, 04:21:03 pm »

Excellent - thanks for the link - works great!   :)

Here is the solution I used:

1.  Create a new file called 'external.js' and place the following code inside:
Code: [Select]
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") == "http://coppermine.sourceforge.net/")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

Place it in the root of your coppermine installation (i.e. The same location as the 'scripts.js' file).


2.  Now edit the 'template.html' file for the theme you are using and add the follwing below the <HEAD> section:

Code: [Select]
<script type="text/javascript" src="external.js"></script>



As an example, here is my entire <HEAD> section:

Code: [Select]
<head>
<title>{TITLE}</title>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
{META}
<link rel="stylesheet" href="themes/classic/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<script type="text/javascript" src="external.js"></script>
<!-- $Id: template.html,v 1.18 2005/10/25 01:16:24 gaugau Exp $ -->
</head>

 :)
Logged

IamDeirdre

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #3 on: January 10, 2006, 07:00:34 pm »

Thanks so much! That worked perfectly!  :D
Logged
Deirdre

littlemacv

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #4 on: May 13, 2006, 04:46:51 am »

Hello,

I'm looking for similar functionality on my site, however, I'd like any bbcode link to a specific root url to open in a new window.  For example, any url that starts with www.suffolkaeromodelers.org/TheGallery should open in a new window.  Can this IF statement "if (anchor.getAttribute("href") == "http://www.suffolkaeromodelers.org/TheGallery")" be made to examine only the first 39 characters? 

note, I'm a newbie to javascript.

Thanks,
Doug
   
Logged

dutchable

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #5 on: May 29, 2006, 10:38:21 am »

Can this IF statement "if (anchor.getAttribute("href") == "http://www.suffolkaeromodelers.org/TheGallery")" be made to examine only the first 39 characters? 

It can, this is what i use:

Code: [Select]

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   var path= anchor.getAttribute("href") ;
   var subpath=path.substring(0, 31);
   if (anchor.getAttribute("href") && subpath!="http://www.dare-architecture.nl"
       && anchor.getAttribute("rel") == "external")
     anchor.target = "_blank"; 
 }
}
window.onload = externalLinks;


this way it doesn't open the link in a new window when the first 32 characters of the href are those of my own site.
hopefuly this works for you too!
Logged

adam625

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 28
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #6 on: August 12, 2006, 01:11:31 am »

I am trying to get the Coppermine link to open in a new window. I have done everything gaplayer26 instructed, too, but its still not working. Attached is the zip file that includes by templete.html and external.js. Any help would be great!
Logged

Nibbler

  • Guest
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #7 on: August 12, 2006, 01:29:53 am »

Your external.js reads

Code: [Select]
ĐĎॹá
That might be the reason it doesn't work.
Logged

adam625

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 28
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #8 on: August 12, 2006, 01:42:52 am »

I'm not sure why its doing that! When I open the original I made before zipping it up, its just fine! I even tried uploading that one again and it did not work. Is it possible for you to attach an external.js file with the correct coding?
Logged

adam625

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 28
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #9 on: August 12, 2006, 01:44:38 am »

Never mind! I just got it to work! Thanks! :)
Logged

franco7777

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #10 on: August 13, 2006, 07:50:08 am »

These are things you can do with the Powered By Coppermine Photo gallery:

How to handle the "Powered By Coppermine Photo Gallery" without violating anyone´s rights:.
1.- Go to to the directory coppermine/themes and pick the directory you are using: Example: Classic, eyeball, fruity, etc.
lets suppose you are using classic. Go inside that directory and open template.html.
Do this:
a.- Insteat of <a href = "index.php">.....
     write: <a href = "http://www.mysite.com">
Comments: When a user clicks the Coppermine Logo on top-left corner, it will send the user to a        website of your choice.
b.- Where you find {GALLERY} all alone.
     Replace with this : <a href = "http://www.mysite.com"> {GALLERY}
Comments: If a user clicks on "powered by", he or she will be sent to the website of your choice.
                 However, when clicking on "Coppermine Photo Gallery", it will go to            httt://coppermine.sourceforge.net.
Comments2: If you want to send the whole copyright notice a couple of inches below, just put the same           code right above the last two</table>
c.- Three lines below the {CUSTOM_HEADER}, there is a table and it has color code #FFFFFF
     change it to #000000. It is the only one with color code #FFFFFF.
Comments : This will make the table, where the powered by Coppermine Photo gallery is, color black
                   So technically it is not there anymore and has two links one next to the other, one link            belongs to you the other link is to satisfy the developers. However, you will be able to see           the powered by and all header links color dark blue. You will not be able to see the           Coppermine Photo Gallery words.

Now Go inside same directory and open style.css
Do this:
a.- At the start of the file, you will see the codes for black color and White color.
     where you see h1 { color code #000000, change it to #FFFFFF, this is to make visible the Name Of   your Gallery in color white (background black).
b.- where you see a { , a:hover { , .bblink a { , .bblink a:hover { , , instead of #0033CC change it to #FFFFFF. Now you will see all links in color White.
FINAL: You can play around with colors.
Regards To All
Franco
P.S. Next step is to change the Coppermine Logo.gif.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #11 on: August 13, 2006, 08:42:10 am »

This is all wrong and not related to this thread.
The target of the logo can be changed at will, it's not the subject of this thread. Plain HTML knowledge is all it takes. You can't wrap the {GALLERY} token placeholder into an <a> tag. If a theme contains color codes entirely depends on the theme.
As I suggested above: your remarks are irrelevant (not related to this thread) or simply, plainly wrong. This is a sticky thread, don't hijack it. Don't force us to lock each and every sticky thread because users keep on hijacking it. Simply stay out of this thread and start your own one.
Logged

franco7777

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #12 on: August 17, 2006, 05:42:52 am »

Gau Gau:
I am honestly sorry for what I have caused.
I did not mean to cause any trouble.
Regards
Franco
P.S. I truly think that Coppermine is the best Gallery there is!.
Logged

lordfrikk

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #13 on: September 21, 2006, 06:17:17 pm »

Am I wrong If i say that I CAN remove the Powered by Coppermine link? If I'm not mistaken CPG is open-source, which allows me to edit any part of it to my liking. I know it is stated in the FAQ, that it's kinda deal, but still...?
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #14 on: September 22, 2006, 06:22:42 am »

@lordfrikk: If you remove the "Powered by Coppermine" link, you are violating Coppermine's license.  You can read the license on your site in the file "COPYING" or here: http://coppermine-gallery.net/demo/cpg14x/COPYING

The specific section you violate by removing this link is section 2c, which is - in its entirety:
Quote
If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.  (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)

As the FAQ says, if you violate Coppermine's license, we will not provide support to you on this board.

You can style the link however you like and put it wherever you like on your site.  I'm sure you can find some way to give credit where credit is due, that fits with your site's design.

A note about "open source" - it does not mean that you can do whatever you like.  Most "open source" applications have a license which you must read to understand the rights.  Here's a good page discussing such issues: http://www.gnu.org/copyleft/
Logged

agentsmithjones

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #15 on: October 18, 2006, 09:37:39 pm »

Hello how are you, i´m new on coppermine and joomla, which is the kind of site i have integrated to the gallery..

What about if I remove/hide the 'powered by' link of coppermine gallery at bottom of every gallery-page, and I resolve to give credits in another way.. like put a relevant link on link section of the portal, specifying that Coppermine is the company that made my gallery at all.

thank you for your opinion.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #16 on: October 19, 2006, 12:44:02 am »

agentsmithjones: Since web page browsing is inherently state-less (ignoring cookies and sessions and the like), I believe that the Coppermine license - as quoted above - requires a copyright notice on every page generated by Coppermine code.  Moving it to a links page is not sufficient, from my point of view. 

That's the way I read it, but other dev team members with more open-source experience may know better.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #17 on: October 19, 2006, 08:43:27 am »

Paver is right - moving the notice just to one single "about" page is not enough. The FAQ clearly say that we're not even ready to discuss this. This sticky thread deals about something else (link opening in same window or new window), it doesn't deal with removal or changing the tag. Locking.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #18 on: August 04, 2007, 01:01:42 pm »

Please note that the link now points to coppermine-gallery.net instead of coppermine.sf.net!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Change 'Powered by CPG' link to target=_blank ?
« Reply #19 on: March 29, 2009, 03:53:39 pm »

There is a new plugin that will do the things discussed in this thread without the need to fiddle with the core code. You just need to use the plugin manager to install the small plugin "Link Target" for cpg1.4.x that opens external links in new windows.
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.