user info under pic user info under pic
 

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]

Main Menu

user info under pic

Started by dwo, July 07, 2008, 11:32:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dwo

Hello.

My problem is described in these two links:
http://forum.coppermine-gallery.net/index.php/topic,53081.0.html
http://forum.coppermine-gallery.net/index.php/topic,53499.0.html

I want to display the "custom user data" under the picture.

All what has to be done is to insert the right code into displayimage.php and get the user data, I think.

Recognition of the coppermine bbcode in the output of the user data would just be perfect.

The solution, of course, should to be posted open for everyone, at least under the two mentioned links in the forum.


Thank you for your attention, regards.

Αndré

You store the homepage/url of users in the user custom field 1
You want to display the url to the homepage of the pic-owner in the file details AND below the picture title, right?

How much do you want to spend for this?

dwo

Thank you for reply.

Basically yes. I store the URLs in the custom user fields (I need the first 3 fields at least).

I want to display them ONLY in "File Information" under the pic as a list/array.
Best would be right before the photographers name.

I do not want a plugin, I want only the code, to insert it myself in displayimage.php.

Similar as the existing code for the custom pic fields would be fine:

displayimage.php:
         for ($i = 1; $i <= 4; $i++) {
        if ($CONFIG['user_field' . $i . '_name']) {
            if ($CURRENT_PIC_DATA['user' . $i] != "") {
                $info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
            }
        }
    }


Unfortunately, this code above does not work by simply exchanging user_field in user_profile. If this someone could get to work, this would be the solution.

This requested feature is already working with the custom pic fields. Means, that when I insert a URl in the custom pic fileds, it already gets displayed under the picture as link.


Best would be a recognition of the coppermine bbcode, or simply as alternative, a function to open the URL in a new window.


regards, Dietmar








Joachim Müller

@dwo: Read up "sub-board rules, read first!" and do as suggested there! Always read the stickies before posting on a sub-board, especially if the subject is similar to the one of the sticky I refered to above.

Αndré

Are you ready to pay for that modification or not? You posted your question in the board "paid help"!

dwo

Yes. Of course I will pay.

If all works perfect, a maximum of 40 dollars, 25 Euros.

I think I pay only knowledge. If you are familiar with php and coppermine, it should be a matter of 5-10 minutes to program that.

Thank you very much.

Αndré

Sorry for asking this silly question, but some users want support without paying in this board. I've send you a PM.

Αndré

I assume you mean this (see attachment)

dwo

I sent enne... a PM.

Sorry for all the others, he is german, and I am german speaking, too. This makes things easier.

I think this can be closed.

Thank you.

Joachim Müller

For the benefit of others you might want to pay eenemeenemuu to accomplish the changes and then post the results here. This is what we're calling "mod sponsoring". It's one of the ways to contribute to the project. See http://forum.coppermine-gallery.net/index.php/topic,14227.0.html

dwo

Hi.

Please read my first post  ;D

QuoteThe solution, of course, should to be posted open for everyone, at least under the two mentioned links in the forum.

As I benefit so much from this place, I already posted all I found out myself here, and will be glad to add the solution, too.

regards Dietmar

Αndré

Display custom user data in the picture details box: http://forum.coppermine-gallery.net/index.php/topic,53499.msg261477.html#msg261477


Quote from: dwo on July 07, 2008, 12:51:43 PM
open the URL in a new window.

This can be done either by placing the following javascript code in the head of your template.html
<script type="text/javascript">
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") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
}
}
window.onload = externalLinks;
</script>


or by replacing in "include/functions.inc.php"
                $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external">{DESCRIPTION}</a></span>';
with
                $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external" target="_blank">{DESCRIPTION}</a></span>';



Quote from: dwo on July 07, 2008, 09:55:33 PM
Alles gelöst, super !

gruss, Dietmar
-> Done

Joachim Müller

using the target attribute will render your page invalid in terms of w3c HTML validity checks. I suggest using the method described in http://forum.coppermine-gallery.net/index.php/topic,25580.0.html

Αndré

Quote from: Joachim Müller on July 08, 2008, 09:11:33 AM
I suggest using the method described in http://forum.coppermine-gallery.net/index.php/topic,25580.0.html
It's the same like the first method i posted ;)


Quote from: Joachim Müller on July 08, 2008, 09:11:33 AM
using the target attribute will render your page invalid in terms of w3c HTML validity checks.
Some paranoid people may have javascript disabled and wonder why the w3c-valid method doesn't work :P "target" works since now in every browser i think. Ok it's no trend-setting solution  ::)

dwo

Hello.

I solved it this way:

1. I wanted the links of the comments opened in a new window, as they are really external links to other websites.

$bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" target="_blank" rel="external">{DESCRIPTION}</a></span>';     

Like described above.

2. I wanted the link of the "userprofile website" opened in the same window.

So, basically, just add this code to functions.inc.php bbcode code:

$text = preg_replace('/\[urlx=([^ ]+).*\](.*)\[\/urlx\]/', '<a href="$1">$2</a>', $text); 

So, [urlx=http://www.xyz.com]customprofilepage[urlx]  entered in the custom userprofile opens in the same window.


This way, I can choose, which links I want to open in the same and which in the external window.

regards, Dietmar

Joachim Müller

Dietmar, I really suggest reviewing the entire idea to open external links in new windows. I absolutely hate it when pages do that, bossing me around. When sites do that, I usually close the window/tab that triggered the new window instantaneously.

Quote from: eenemeenemuu on July 08, 2008, 09:22:49 AM
Some paranoid people may have javascript disabled
Those who know their way around good enough to turn off JavaScript definitely are aware that they're going to miss some fun, so that simply can not be an issue. I don't know many users who know how to turn off JavaScript, and believe me: I know a lot of users (it's my job).