Image URL for Facebook comments and share Image URL for Facebook comments and share
 

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

Image URL for Facebook comments and share

Started by Anturaju93, December 16, 2013, 05:11:00 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Anturaju93

Hello.
I have added Facebook share and Facebook comments for my Gallery, but i need to know the image URL to insert in Facebook code, because Facebook comments are not working okay - comments are shown all over my site, but i need to show different on every image.
This is the Facebook comments code:
<div class="fb-comments" data-href="http://imagini.moinesti.biz"
data-numposts="5" data-colorscheme="light"></div>

I need to replace my site imagini.moinesti.biz with the URL of the every image generated by the script. I have tried with
'{LINK}'
<a href="{LINK_TGT}">{THUMB}<br /></a>
{LINK_TGT}
{HREF_LNK}
$href_lnk
"{HREF_TGT}"
{HREF_LNK}

but none are working.
I need to know what to insert in Facebook code so the unique image URL are displayed in Facebook comments and share. 

Αndré

Quote from: Anturaju93 on December 16, 2013, 05:11:00 PM
I have added Facebook share and Facebook comments for my Gallery
Have you already tested one of the available Facebook plugins?

Anturaju93

Yes, i don't like them.
Please visit my site, i like it sipmple.
This is a sample link that i want generated in facebook code : http://imagini.moinesti.biz/displayimage.php?pid=785

Anturaju93

I need some help please.
How is the image URL generated by the script? Is it like this : displayimage.php?pid={$CURRENT_PIC_DATA['pid']} (not working)
I need to insert a unique URL in facebook comments plugin plase. displayimage.php?pid= ???? how is the pid generated in URL ?

Αndré

On intermediate-sized pages, the pid is always present as a parameter. This means, you can always access it via
$superCage = Inspekt::makeSuperCage();
$pid = $superCage->get->getInt('pid');

regardless of which variables and arrays are already set.

Anturaju93

Yes, pid is working now.
I added your variables in theme.php and then constructed the unique url for every image like this mysite.biz/displayimage.php?pid=$pid
Here is the working Facebook comments code:

<div class="fb-comments" data-href="mysite.biz/displayimage.php?pid=$pid"
data-numposts="5" data-colorscheme="light"></div>

Now Facebook comments are unique for every image, thanks a lot.

Αndré

Please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
tag your thread as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.

allvip

Quote from: Αndré on December 17, 2013, 09:09:46 AM
On intermediate-sized pages, the pid is always present as a parameter. This means, you can always access it via
$superCage = Inspekt::makeSuperCage();
$pid = $superCage->get->getInt('pid');

regardless of which variables and arrays are already set.

Where (what function in theme.php) I shoud add this?

I have facebook div in $template_image_rating (because I want the facebook comments under the rating stars):


<div class="fb-comments" data-href="http://allvip.us/displayimage.php?pid=$pid"  data-numposts="3" data-colorscheme="dark"></div>

allvip

Quote from: Αndré on December 17, 2013, 09:09:46 AM
On intermediate-sized pages, the pid is always present as a parameter. This means, you can always access it via
$superCage = Inspekt::makeSuperCage();
$pid = $superCage->get->getInt('pid');

regardless of which variables and arrays are already set.

Where in theme.php I should add it?What function?Under wich line?

I have the fb plugin in $template_image_rating because I want the fb comments under rating stars?


Αndré

As I said, you can always use this code, which means, you can add it to every function.

Quote from: allvip on February 03, 2014, 08:00:57 AM
I want the fb comments under rating stars
I suggest to undo your current change. Instead, add your code to the function theme_display_image (obviously below "echo $votes;").

allvip

I have the facebook div under echo $votes; and your code before:


    $superCage = Inspekt::makeSuperCage();
    $width = $CONFIG['picture_table_width'];


tryed even just $pid = $superCage->get->getInt('pid'); before  $width = $CONFIG['picture_table_width'];

comments show on all the images

Αndré

Please post the whole code, or even better, your theme_display_image function with your modifications.

allvip


/******************************************************************************
** Section <<<theme_display_image>>> - START
******************************************************************************/
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG, $LINEBREAK;
    $superCage = Inspekt::makeSuperCage();
    $pid = $superCage->get->getInt('pid');
    $superCage = Inspekt::makeSuperCage();
    $width = $CONFIG['picture_table_width'];
    echo '<a name="top_display_media"></a>'; // set the navbar-anchor
    echo '<div class="filmnavW">';
    echo '<div class="filmnav">';
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }
    /*starttable();*/
    echo $nav_menu;
    /*endtable();*/
    echo '<div class="clearer">';
    echo '</div>';
    echo '</div>';
    echo '</div>';
    echo '<div class="adMedia">';
    echo '</div>';
    echo '<div class="dmWrapp">';
    echo '<div class="clearer">';
    echo '</div>';

    starttable();
    echo $picture;
    endtable();
    echo $votes;
    echo '<div class="fb-comments" data-href="allvip.us/cpg/test/displayimage.php?pid=$pid"  data-numposts="3" data-colorscheme="dark">';   
    echo '</div>';
    $picinfo = $superCage->cookie->keyExists('picinfo') ? $superCage->cookie->getAlpha('picinfo') : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo $LINEBREAK . '<div id="picinfo" style="display: '.$picinfo.';">' . $LINEBREAK;
    starttable();
    echo $pic_info;
    endtable();
    echo '</div>' . $LINEBREAK;
    echo '<a name="comments_top"></a>';
    echo '<div id="comments">' . $LINEBREAK;
        echo $comments;
        echo '</div>' . $LINEBREAK;
    echo '</div>';
}
/******************************************************************************
** Section <<<theme_display_image>>> - END
******************************************************************************/

Αndré

Replace
echo '<div class="fb-comments" data-href="allvip.us/cpg/test/displayimage.php?pid=$pid"  data-numposts="3" data-colorscheme="dark">';
with
echo '<div class="fb-comments" data-href="allvip.us/cpg/test/displayimage.php?pid='.$pid.'"  data-numposts="3" data-colorscheme="dark">';

allvip