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: facebook button & dynamic meta tags adding to login page  (Read 10255 times)

0 Members and 1 Guest are viewing this topic.

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
facebook button & dynamic meta tags adding to login page
« on: June 21, 2010, 03:49:48 pm »

Hi Guys

nearly have this working now just need one final piece of the puzzle

gallery is here www.magicmirrorphoto.co.uk/gallery

I now have the meta tags in place on teh displayimage.php page and all works as it should if the gallery is freely browsable
when I set guest users to only be able to see thumbnails the share button gets the correct link but displays magicmirror-login as the page title and does not pick up the thumbnail

what i some help with is knowing which bit of login.php to add the code to inject the meta tag and also how to convert the path to the image from the pid

as always any assistance greatly appreciated
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: facebook button & dynamic meta tags adding to login page
« Reply #1 on: June 21, 2010, 03:55:36 pm »

Use a plugin to inject the meta tag into each and every page. Editing all core files is baaaaad. The proper plugin hook would be page_meta. Post what you have got for details if you need help. Posting a reference to the facebook api specs might help as well.
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: facebook button & dynamic meta tags adding to login page
« Reply #2 on: June 21, 2010, 04:06:17 pm »

Thanks Joachim

the facebook button uses a link www.facebook.com/share.php?u=<url>
then scans teh page for 3 meta tags to fill out its info

<meta name="title" content="title" />
<meta name="description" content="description " />
<link rel="image_src" href="thumbnail_image" / >

i will have a read through the plugin documentation (& probably php manuals) and see what i can do
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: facebook button & dynamic meta tags adding to login page
« Reply #3 on: June 22, 2010, 11:26:39 am »

well after all that it doesnt work anyway

I was eventually able to add a couple of lines to joe's custom descriptions plugin which added the 3 lines (statically for a test image admittedly) but alas when I click the button it just posts a link to the login page :(

back to the drawing board
 
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: facebook button & dynamic meta tags adding to login page
« Reply #4 on: June 22, 2010, 02:47:40 pm »

Ahha, breakthrough

create a page with the meta tags in the header & then a meta redirect tag

Code: [Select]
<head>
<meta http-equiv="Pragma" content="no-cache" />
<meta name="title" content="<?php echo $pgTitle ?>" />
<meta name="description" content="<?php echo $pgDesc ?> " />
<link rel="image_src" href="<?php echo $thumbUrl ?>" />
<meta HTTP-EQUIV="REFRESH" content="0; url=<?php echo $redirectUrl ?>">
</head>

sofar have only tested this with statically assigned info but facebook picks up the correct title and thumbnail
when the link is clicked the user is redirected to the login page and then to the correct image

I have been studying the display image.php page but am at a loss as to how the Current_Pic_Data[] array is filled
is there a function that does this or do i need to manually populate variables from the database using mysql queries

I cant belive something that looked so simple on the outset is frying so many braincells  ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: facebook button & dynamic meta tags adding to login page
« Reply #5 on: June 22, 2010, 03:55:04 pm »

Why don't you post a link to the facebook API for a start...
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: facebook button & dynamic meta tags adding to login page
« Reply #6 on: June 22, 2010, 05:37:45 pm »

im going by the list of required meta tags from the developer wiki page

http://wiki.developers.facebook.com/index.php/Facebook_Share/Specifying_Meta_Tags

as I say i now have a partial solution which works but in order to make it dynamic i need to know how to populate the $CURRENT_PIC_DATA[]
so that i can pass the pid as a variable to the intermediate page.

Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: facebook button & dynamic meta tags adding to login page
« Reply #7 on: June 23, 2010, 02:30:01 pm »

Why don't you post a link to the facebook API for a start...

And why not test the Facebook plugin from the cpg1.4 board? You probably just need to edit the plugin's configuratione.php to get rid of the version number warning. Details about the edit here and here.
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: facebook button & dynamic meta tags adding to login page
« Reply #8 on: June 23, 2010, 04:04:00 pm »

Thats what I have done
ive been tweeking it to get it to work properly

ie post a link to the gallery page instead of direct to the image which is what that one does

guess im just going to need to write a php script to query the coppermine database
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: facebook button & dynamic meta tags adding to login page
« Reply #9 on: June 23, 2010, 06:37:15 pm »

You probably just need to edit the plugin's configuratione.php to get rid of the version number warning.
That's bad advice. If things were that easy, we wouldn't have bothered to come up with the version warning in the first place. Every non-trivial plugin needs to be re-written and will not work by just manipulating the version checking routine.

There already is a twitter plugin for cpg1.5.x: flf_zwitscher - Twitter plugin for coppermine
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: facebook button & dynamic meta tags adding to login page
« Reply #10 on: June 25, 2010, 10:28:44 pm »

solved :)

link button points to a new page called shareout.php

shareout.php is populated with dynamic metas and then redirets to displayimage.php

see here :)
http://forum.coppermine-gallery.net/index.php/topic,65697.0.html
Logged
Pages: [1]   Go Up
 

Page created in 0.053 seconds with 19 queries.