Change 'Powered by CPG' link to target=_blank ? Change 'Powered by CPG' link to target=_blank ?
 

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

Main Menu

Change 'Powered by CPG' link to target=_blank ?

Started by gaplayer26, December 27, 2005, 12:19:48 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

gaplayer26

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

Joachim Müller


gaplayer26

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

<script type="text/javascript" src="external.js"></script>



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

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


:)

IamDeirdre

Deirdre

littlemacv

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
   

dutchable

Quote from: littlemacv on May 13, 2006, 04:46:51 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:



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!

adam625

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!

Nibbler

Your external.js reads

ĐĎॹá

That might be the reason it doesn't work.

adam625

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?

adam625


franco7777

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.

Joachim Müller

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.

franco7777

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

lordfrikk

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

Paver

@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:
QuoteIf 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/

agentsmithjones

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.

Paver

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.

Joachim Müller

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.

Joachim Müller


Joachim Müller

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.