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: Image URL for Facebook comments and share  (Read 9066 times)

0 Members and 1 Guest are viewing this topic.

Anturaju93

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Image URL for Facebook comments and share
« on: December 16, 2013, 05:11:00 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Image URL for Facebook comments and share
« Reply #1 on: December 16, 2013, 05:12:40 pm »

I have added Facebook share and Facebook comments for my Gallery
Have you already tested one of the available Facebook plugins?
Logged

Anturaju93

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Image URL for Facebook comments and share
« Reply #2 on: December 16, 2013, 05:21:56 pm »

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
Logged

Anturaju93

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Image URL for Facebook comments and share
« Reply #3 on: December 16, 2013, 09:00:26 pm »

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 ?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Image URL for Facebook comments and share
« Reply #4 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
Code: [Select]
$superCage = Inspekt::makeSuperCage();
$pid = $superCage->get->getInt('pid');
regardless of which variables and arrays are already set.
Logged

Anturaju93

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Image URL for Facebook comments and share
« Reply #5 on: December 17, 2013, 09:30:58 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Image URL for Facebook comments and share
« Reply #6 on: December 17, 2013, 10:06:22 am »

Please
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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Image URL for Facebook comments and share
« Reply #7 on: February 03, 2014, 04:08:43 am »

On intermediate-sized pages, the pid is always present as a parameter. This means, you can always access it via
Code: [Select]
$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):

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Image URL for Facebook comments and share
« Reply #8 on: February 03, 2014, 08:00:57 am »

On intermediate-sized pages, the pid is always present as a parameter. This means, you can always access it via
Code: [Select]
$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?

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Image URL for Facebook comments and share
« Reply #9 on: February 03, 2014, 12:26:53 pm »

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

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;").
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Image URL for Facebook comments and share
« Reply #10 on: February 11, 2014, 05:53:35 pm »

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

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Image URL for Facebook comments and share
« Reply #11 on: February 12, 2014, 09:22:18 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Image URL for Facebook comments and share
« Reply #12 on: February 12, 2014, 03:43:41 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Image URL for Facebook comments and share
« Reply #13 on: February 12, 2014, 03:57:00 pm »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Image URL for Facebook comments and share
« Reply #14 on: February 12, 2014, 08:39:26 pm »

works fine.
Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 20 queries.