Advertisement:

Author Topic: SMF Articles  (Read 307947 times)

Offline Ataru Moroboshi

  • Semi-Newbie
  • *
  • Posts: 90
It is possible to make it opengraph and facebook compliant?

if i fetch the url www.mydomain.com/index.php?action=articles&sa=view&article=1

in

https://developers.facebook.com/tools/debug/og/object/



it takes og metadata from main page

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Possible to do but you would need to modify the code of the articles system using $context['html_headers']
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Ataru Moroboshi

  • Semi-Newbie
  • *
  • Posts: 90
Possible to do but you would need to modify the code of the articles system using $context['html_headers']

i added og metadata in index.template.php of my theme:

Code: [Select]
<title>', $context['page_title_html_safe'], '</title>';
// facebook and OG
if ($context['current_action'] != 'admin'){
if (isset($context['article']['title']))
echo '
<meta property="og:url" content="', $scripturl ,'/action,articles/sa,view/article,' , $context['article']['ID_ARTICLE'] , '.html" />';
elseif(empty($context['current_topic']))
echo '
<meta property="og:url" content="', $scripturl ,'" />';
else
echo '
<meta property="og:url" content="', $scripturl ,'?topic=',$context['current_topic'],'.0" />';
echo '
<meta property="og:type" content="article" />
<meta property="og:title" content="',$context['page_title_html_safe'], '" />
<meta property="og:description" content="' , !empty($context['meta_description']) ? $context['meta_description'] : $modSettings['meta_data_description_text'], '" />';
echo '
<meta property="og:image" content="http://www.mydomain.com/logofb.jpg" />';
echo '
<meta property="og:site_name" content="',$context['forum_name'],'" />
<meta property="fb:app_id" content="myapp_id" />';
} // facebook and OG


it's working good for topic pages, but not for smf articles. what's wrong?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Maybe $context['article'] isn't set?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Ataru Moroboshi

  • Semi-Newbie
  • *
  • Posts: 90
$context['article'] is set, and  'property="og:url"' is correctly compiled in html page

but when i test page in https://developers.facebook.com/tools/debug/og/object/ it fetches home page instead of article page

can't figure why

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Because you have this set
echo '
         <meta property="og:image" content="http://www.mydomain.com/logofb.jpg" />';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Ataru Moroboshi

  • Semi-Newbie
  • *
  • Posts: 90
It's an image that is shown when the link is shared with Facebook. Required in og guidelines for fb

Offline Ataru Moroboshi

  • Semi-Newbie
  • *
  • Posts: 90
I opened a ticket in facebook help,

they say PHPSESSID is the problem:

Quote
Hi David,

When our crawler accesses your page your server is injecting a PHPSESSID into the url and in turn you are displaying it in your og:url. This is what the crawler sees when it accesses your site.

<meta property="og:url" content="http://www.mydomain.com/index.php?PHPSESSID=44khamiod3qpj5sgr38pscvmv0&amp%3B%2Faction%2Carticles%2Fsa%2Cview%2Farticle%2C93.html" />

As this is the url that the crawler believes you want to be used as the canonical it redirects to that location and scrapes it. If you visit that url you will see that the og tags on that page match your index page.

To rectify this you will need to ensure that you are not using this url with PHPSESSID in your og:url.

Thanks,
Darren

any idea?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
No idea on session id but search the general smf support forums might be workarounds
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Ataru Moroboshi

  • Semi-Newbie
  • *
  • Posts: 90
ok, now i made it work using single quotes for og:url content, and phpsessid is not shown, but i have to use urls without quests and ecommercial and equals, if i put variables in querystrings (?action=articles;sa=view&article=92) it stops working, while using slashes and commas (index.php/action,article/sa,view/article,92.html) it works

now i need to change all urls in articles2.php and articles.template.php to  :o


Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 60,278
  • Gender: Male
    • Kindred-999 on GitHub
that would be because facebook is a decade behind the times in parsing valid URLs
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Bascilly replace any ; in the url with an &
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline SMFHacks.com Team

  • Full Member
  • ***
  • Posts: 440
    • smfhacks on Facebook
    • @smfhacks on Twitter
    • SMFHacks.com
Re: SMF Articles
« Reply #892 on: July 01, 2015, 09:17:20 PM »
Update
3.0.2
!Delete invalid pictures when they fail to upload
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.

http://ForumRankings.net - Get Forum Ranked!
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Offline KarmicStigmata

  • Semi-Newbie
  • *
  • Posts: 12
Re: SMF Articles
« Reply #893 on: July 07, 2015, 04:52:56 PM »
I am using 3.0 of your Article system.  I had someone post an article last night to test it (un-modded) in any shape way or form and now every time someone goes to the article portion whatsoever.  It loops with an approve request for the article, we  had about 10 last night and 2 today.  He isn't even home.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Articles
« Reply #894 on: July 07, 2015, 04:57:24 PM »
When trying to view the article?
Like what does it do?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline KarmicStigmata

  • Semi-Newbie
  • *
  • Posts: 12
Re: SMF Articles
« Reply #895 on: July 08, 2015, 11:41:45 PM »
I have no clue.  For some reason everytime you clicked on the Articles page, it would disapprove the article but the article was still live.  So it did it like 8 times, we just reinstalled and it was fine.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Articles
« Reply #896 on: July 09, 2015, 12:08:59 AM »
Glad you have it working now
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline iain sherriff

  • Jr. Member
  • **
  • Posts: 382
Re: SMF Articles
« Reply #897 on: August 02, 2015, 07:11:25 AM »
Anyone know if there is a way to get Simple Thread Tags mod working with Articles ?
SMF 2.0.12

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,506
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Articles
« Reply #898 on: August 02, 2015, 01:19:38 PM »
I am not aware of any mods for that at this time.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline iain sherriff

  • Jr. Member
  • **
  • Posts: 382
Re: SMF Articles
« Reply #899 on: August 03, 2015, 04:35:32 AM »
OK thanks
SMF 2.0.12