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: [Solved]: how to show extra field below the image?  (Read 7024 times)

0 Members and 1 Guest are viewing this topic.

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
[Solved]: how to show extra field below the image?
« on: July 31, 2008, 11:16:16 am »

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.

 
« Last Edit: July 31, 2008, 11:58:57 am by Nibbler »
Logged

Nibbler

  • Guest
Re: how to show extra field below the image?
« Reply #1 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.
Logged

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: how to show extra field below the image?
« Reply #2 on: July 31, 2008, 11:27:00 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...
Logged

Nibbler

  • Guest
Re: how to show extra field below the image?
« Reply #3 on: July 31, 2008, 11:30:35 am »

Find

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

Code: [Select]
        if ($CONFIG['user_field1_name']){
            $caption .= $row[''user1'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user1']))."</span>" : '';
        }
« Last Edit: July 31, 2008, 12:43:29 pm by Nibbler »
Logged

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: how to show extra field below the image?
« Reply #4 on: July 31, 2008, 11:49:57 am »

Find

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

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

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: how to show extra field below the image?
« Reply #5 on: July 31, 2008, 12:01:28 pm »


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

Nibbler

  • Guest
Re: [Solved]: how to show extra field below the image?
« Reply #6 on: July 31, 2008, 12:43:13 pm »

Like this:

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

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: [Solved]: how to show extra field below the image?
« Reply #7 on: July 31, 2008, 12:58:25 pm »

Like this:

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

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

Nibbler

  • Guest
Re: [Solved]: how to show extra field below the image?
« Reply #8 on: July 31, 2008, 01:03:13 pm »

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

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

Logged

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: [Solved]: how to show extra field below the image?
« Reply #9 on: July 31, 2008, 01:20:45 pm »

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

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

Logged

rony446

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: [Solved]: how to show extra field below the image?
« Reply #10 on: July 31, 2008, 01:24:51 pm »

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

Nibbler

  • Guest
Re: [Solved]: how to show extra field below the image?
« Reply #11 on: July 31, 2008, 01:28:43 pm »

One question per thread. You already have a thread for that question.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.