Support > cpg1.5 miscellaneous
Open Graph meta data for coppermine
Anturaju93:
The meta data is displayed only on displayimage.php but like this:
--- Code: ---<meta property="og:url" content="http://imagini.moinesti.biz/displayimage.php?pid=71" /><meta property="og:image" content="http://imagini.moinesti.biz/" />
--- End code ---
meta property="og:image" must be a direct link to an intermediate file location and a <br> is needed to show <meta property="og:image" content="http://imagini.moinesti.biz/" /> down on a second line.
E. William:
Like I said, I'm no coder, so it's gonna be hit and miss :)
Try this:
--- Code: --- $meta = '<meta property="og:url" content="http://imagini.moinesti.biz/displayimage.php?pid=' . $pid . '" />' . $LINEBREAK;
if ($CONFIG['make_intermediate'] && cpg_picture_dimension_exceeds_intermediate_limit($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'])) {
$meta .= '<meta property="og:image" content="http://imagini.moinesti.biz/' . {$CURRENT_PIC_DATA['filepath']} . 'normal_' . {$CURRENT_PIC_DATA['filename']}" . ' />';
} else {
$meta .= '<meta property="og:image" content="http://imagini.moinesti.biz/' . {$CURRENT_PIC_DATA['filepath']} . {$CURRENT_PIC_DATA['filename']} . '" />';
}
--- End code ---
The "if" statement is there to link to the fullsize image in case no intermediate file has been generated (for instance if the file dimensions were smaller than those of the intermediate settings or the option has been turned off).
E. William:
Sorry, left a double quote in there which will result in an empty page...
Here's the correct version (I hope):
--- Code: --- $meta = '<meta property="og:url" content="http://imagini.moinesti.biz/displayimage.php?pid=' . $pid . '" />' . $LINEBREAK;
if ($CONFIG['make_intermediate'] && cpg_picture_dimension_exceeds_intermediate_limit($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'])) {
$meta .= '<meta property="og:image" content="http://imagini.moinesti.biz/' . {$CURRENT_PIC_DATA['filepath']} . 'normal_' . {$CURRENT_PIC_DATA['filename']} . ' />';
} else {
$meta .= '<meta property="og:image" content="http://imagini.moinesti.biz/' . {$CURRENT_PIC_DATA['filepath']} . {$CURRENT_PIC_DATA['filename']} . '" />';
}
--- End code ---
E. William:
You may also want to try leaving the {} out like this:
--- Code: --- $meta = '<meta property="og:url" content="http://imagini.moinesti.biz/displayimage.php?pid=' . $pid . '" />' . $LINEBREAK;
if ($CONFIG['make_intermediate'] && cpg_picture_dimension_exceeds_intermediate_limit($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'])) {
$meta .= '<meta property="og:image" content="http://imagini.moinesti.biz/' . $CURRENT_PIC_DATA['filepath'] . 'normal_' . $CURRENT_PIC_DATA['filename'] . ' />';
} else {
$meta .= '<meta property="og:image" content="http://imagini.moinesti.biz/' . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'] . '" />';
}
--- End code ---
This is how I code: Trial and Error ;). See what works, and what doesn't.
Αndré:
--- Quote from: Anturaju93 on December 18, 2013, 07:08:23 am ---The meta data is displayed only on displayimage.php
--- End quote ---
I cannot see any code that is responsible to display your additional meta data just on displayimage.php. Have you added anything different you haven't posted yet?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version