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: user info under pic  (Read 10657 times)

0 Members and 1 Guest are viewing this topic.

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
user info under pic
« on: July 07, 2008, 11:32:46 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: user info under pic
« Reply #1 on: July 07, 2008, 12:30:01 pm »

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

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: user info under pic
« Reply #2 on: July 07, 2008, 12:51:43 pm »

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:
Code: [Select]
         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







Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: user info under pic
« Reply #3 on: July 07, 2008, 12:52:21 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: user info under pic
« Reply #4 on: July 07, 2008, 12:57:15 pm »

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

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: user info under pic
« Reply #5 on: July 07, 2008, 01:07:10 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: user info under pic
« Reply #6 on: July 07, 2008, 01:14:52 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: user info under pic
« Reply #7 on: July 07, 2008, 01:22:06 pm »

I assume you mean this (see attachment)
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: user info under pic
« Reply #8 on: July 07, 2008, 01:26:21 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: user info under pic
« Reply #9 on: July 07, 2008, 05:39:29 pm »

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
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: user info under pic
« Reply #10 on: July 07, 2008, 05:48:49 pm »

Hi.

Please read my first post  ;D

Quote
The 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: user info under pic
« Reply #11 on: July 08, 2008, 07:58:36 am »

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


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
Code: [Select]
<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"
Code: [Select]
                $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external">{DESCRIPTION}</a></span>';with
Code: [Select]
                $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" rel="external" target="_blank">{DESCRIPTION}</a></span>';


Alles gelöst, super !

gruss, Dietmar
-> Done
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: user info under pic
« Reply #12 on: July 08, 2008, 09:11:33 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: user info under pic
« Reply #13 on: July 08, 2008, 09:22:49 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 ;)


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

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: user info under pic
« Reply #14 on: July 08, 2008, 10:03:21 am »

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.

Code: [Select]
$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:

Code: [Select]
$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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: user info under pic
« Reply #15 on: July 09, 2008, 07:10:03 am »

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.

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).
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.