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:
// Display picture information
function html_picinfo()
Replace With:
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 (http://forum.coppermine-gallery.net/index.php?topic=23695.0) replace with:
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:
/*
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:
$pic_info = html_picinfo();
Replace With:
$pic_info = html_picinfo();
$cust_info = html_custinfo();
Find:
theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
Replace With:
theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip, $cust_info);
theme.php
Add:
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 (http://www.lighting-gallery.net/gallery/displayimage.php?pos=-2161)
I've also attached a grab from the site.
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
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.
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
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)
Quote from: pslawinski 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
can you post the last bit of code ? please :D
Ok, i've found the problem:
in theme.inc.php i've add:
starttable();
echo $cust_info;
endtable();
after
echo $votes;
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.
you are right, i havent copy/paste the full code in theme.php :-\
Thank's, it works fine
No problem, thanks for testing it for me.