[Solved]: how to show extra field below the image? [Solved]: how to show extra field below the image?
 

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

[Solved]: how to show extra field below the image?

Started by rony446, July 31, 2008, 11:16:16 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

rony446

I am using CPG 1.4.18 version. I want to add some extra field at the below of image. I add extra 2 field from >

config>Custom fields for image description (leave blank if unused)> Price
                                                                                                Photographer name:

When I upload any picture I have to provide title, description, keyword, price, photographer name. but when i viewed it from front page then i found only title, description. but keyword, price, photographer option does not shows.

any of you can tell me, how can i show this options too, at the below of the Image.


If this type of topic was posted then i am sorry for repost. then please provide me that link. thanks.


Nibbler

You need to add support for cutom fields as thumbnail captions. Modify build_caption() in include/functions.in.php.

rony446

Quote from: Nibbler on July 31, 2008, 11:21:11 AM
You need to add support for cutom fields as thumbnail captions. Modify build_caption() in include/functions.in.php.

thank you. I found an option where i got "File information is visible by default" from config menu. but i want to show price & photographer name from front page. I am not good in php-mysql. thats why i am afraid to change anything from function.inc.php. please give me more idea...

Nibbler

#3
Find


        if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['caption']))."</span>" : '';
        }


Near that add in custom fields 1 to 4:


        if ($CONFIG['user_field1_name']){
            $caption .= $row[''user1'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user1']))."</span>" : '';
        }

rony446

Quote from: Nibbler on July 31, 2008, 11:30:35 AM
Find


        if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['caption']))."</span>" : '';
        }


Near that add in custom fields 1 to 4:


        if ($CONFIG['user_field1_name']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user1']))."</span>" : '';
        }



Mr. Nibbler, Thank You Very Much. It works Great.Now I feel happy :)) :)

Mr. Nibbler can you help me once more? I have posted one article on another topics. I am searching a solution from last few days. but failed to over come. can u provide me proper solution?

rony446


One problem about this topics:

if i give the value as:  title: aa
                               description: bb
                               price:cc
                               photographer: dd

then it shows only: aa
                            bb
                            cc
                            dd

so it is difficult to any one to understand which is what. what does mean by aa, bb, cc, dd . do u tell me how can i show the title, descript... information too at the front page? like:
                               title: aa
                               description: bb
                               price:cc
                               photographer: dd

sorry for disturbing.:(

Nibbler

Like this:


        if ($CONFIG['user_field1_name']){
            $caption .= $row['user1'] ? "<span class=\"thumb_caption\">" . $CONFIG['user_field1_name'] . ': ' . strip_tags(bb_decode($row['user1']))."</span>" : '';
        }


Should work.

rony446

Quote from: Nibbler on July 31, 2008, 12:43:13 PM
Like this:


        if ($CONFIG['user_field1_name']){
            $caption .= $row['user1'] ? "<span class=\"thumb_caption\">" . $CONFIG['user_field1_name'] . ': ' . strip_tags(bb_decode($row['user1']))."</span>" : '';
        }


Should work.

Thank you very much. It works great....but its worked for custom field. if i change for descriptions code like:

   if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">". $CONFIG['caption_in_thumbview'] . ': ' .strip_tags(bb_decode($row['caption']))."</span>" : '';
        }



then it does not shows >> description: bb   <- here bb my description messages.

Nibbler

Just type 'description' instead of $CONFIG['caption_in_thumbview']

if ($CONFIG['caption_in_thumbview']){
    $caption .= $row['caption'] ? "<span class=\"thumb_caption\">". 'description' . ': ' .strip_tags(bb_decode($row['caption']))."</span>" : '';
}


rony446

Quote from: Nibbler on July 31, 2008, 01:03:13 PM
Just type 'description' instead of $CONFIG['caption_in_thumbview']

if ($CONFIG['caption_in_thumbview']){
    $caption .= $row['caption'] ? "<span class=\"thumb_caption\">". 'description' . ': ' .strip_tags(bb_decode($row['caption']))."</span>" : '';
}



Thank you very much. It works well. :).


rony446

it is possible to flip individual information ( description or views or price ) to the top of the image? if yes then how?

Nibbler

One question per thread. You already have a thread for that question.