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: Custom Fields in Seperate Table  (Read 11753 times)

0 Members and 1 Guest are viewing this topic.

pslawinski

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • Lighting-Gallery.net
Custom Fields in Seperate Table
« on: November 13, 2005, 02:34:21 am »

This mod displays custom fields in a seperate table.  It is best if you have several fields so that the file information field does not get cluttered up.

displayimage.php

Find:
Code: [Select]
// Display picture information
function html_picinfo()

Replace With:
Code: [Select]
function html_custinfo()
{
    global $CONFIG, $CURRENT_PIC_DATA;

    for($i = 1; $i <= 4; $i++)
{
        if ($CONFIG['user_field' . $i . '_name'])
{
            if ($CURRENT_PIC_DATA['user' . $i] != "")
{
$tester = true;
                $info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
            }
        }
    }
if(!isset($tester))
{
return 0;
}
else
{
return theme_html_picinfo($info);
}
}

// Display picture information
function html_picinfo()

If you install my other mod replace with:
Code: [Select]
function html_custinfo()
{
    global $CONFIG, $CURRENT_PIC_DATA;

    for($i = 1; $i <= $CONFIG['user_field_num']; $i++)
{
        if ($CONFIG['user_field' . $i . '_name'])
{
            if ($CURRENT_PIC_DATA['user' . $i] != "")
{
$tester = true;
                $info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
            }
        }
    }
if(!isset($tester))
{
return 0;
}
else
{
return theme_html_picinfo($info);
}
}

// Display picture information
function html_picinfo()

Find and comment out:
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]);
            }
        }
    }

*/

Find:
Code: [Select]
$pic_info = html_picinfo();

Replace With:
Code: [Select]
$pic_info = html_picinfo();
$cust_info = html_custinfo();

Find:
Code: [Select]
theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);

Replace With:
Code: [Select]
theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip, $cust_info);



theme.php

Add:
Code: [Select]
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip, $cust_info)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;

if($cust_info != "none")
{
$custinfo = "block";
}
else
{
$custinfo = "none";
}
echo "<div id=\"custinfo\" style=\"display: $custinfo;\">\n";
starttable("100%","Custom Information");
echo $cust_info;
endtable();
echo "</div>\n";

    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo $comments;
        echo "</div>\n";

}

See the mod in action here

I've also attached a grab from the site.
« Last Edit: July 06, 2006, 10:15:12 am by GauGau »
Logged

Ian MacMillan

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • Conrail's NH Division in N scale
Re: Custom Fields in Seperate Table
« Reply #1 on: February 08, 2006, 07:57:00 pm »

I am not able to get the fields to display... It creates the bar for where they should be, but nada.

http://www.portsmouthbranch.com/gallery/displayimage.php?album=1&pos=0
Logged
Yeah, I like that!

pslawinski

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • Lighting-Gallery.net
Re: Custom Fields in Seperate Table
« Reply #2 on: February 08, 2006, 08:52:25 pm »

Turn on debug mode and see if there are any errors.  I need more information to help you.  I can't just guess what the error might be.
Logged

pslawinski

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • Lighting-Gallery.net
Re: Custom Fields in Seperate Table
« Reply #3 on: July 06, 2006, 04:40:45 am »

I'm not sure if anyone cares at this point but I located the problem with the mod as posted.  I neglected to post the last bit of code that goes on displayimage.php  I've tested the code as posted and it does work with CPG 1.4.8
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Custom Fields in Seperate Table
« Reply #4 on: July 09, 2006, 10:54:21 am »

Hi,

I'm trying to install the mod on my cpg148 install, but i can't see any files info (same issue that Ian MacMillan)

I'm not sure if anyone cares at this point but I located the problem with the mod as posted.  I neglected to post the last bit of code that goes on displayimage.php  I've tested the code as posted and it does work with CPG 1.4.8

can you post the last bit of code ? please  :D
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Custom Fields in Seperate Table
« Reply #5 on: July 09, 2006, 11:26:33 am »

Ok, i've found the problem:
in theme.inc.php i've add:
Code: [Select]
starttable();
    echo $cust_info;
    endtable();
after
Code: [Select]
echo $votes;
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

pslawinski

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • Lighting-Gallery.net
Re: Custom Fields in Seperate Table
« Reply #6 on: July 09, 2006, 05:18:12 pm »

I have this code in the code that I provided for themes.php

If I remember correctly it is nested within an If block that checks to make sure that at least one of the fields is filled out.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Custom Fields in Seperate Table
« Reply #7 on: July 09, 2006, 06:03:18 pm »

you are right, i havent copy/paste the full code in theme.php  :-\

Thank's, it works fine
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

pslawinski

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • Lighting-Gallery.net
Re: Custom Fields in Seperate Table
« Reply #8 on: July 09, 2006, 06:38:59 pm »

No problem, thanks for testing it for me.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.