×
Kunena 5.1.6.1 Released - Security Release (09 Nov 2018)

The Kunena team has announce the arrival of Kunena 5.1.6 [K 5.1.6] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1. This is a Security release.

K5.1.6.1 is a install update.

× Please note: The Kunena project team takes NO responsibility for maintaining nor supporting anything in this category.

Solved SOLVED: Open Graph for image with og:image and image_src

  • Trony
  • Trony's Avatar Topic Author
  • Offline
  • Junior Member
  • Music and Electronic Devices Designer.
More
3 years 11 months ago - 3 years 11 months ago #1 by Trony
Hello, i'm trying to add meta tags as title topic.

In /libraries/kunena/bbcode/bbcode.php at line 1712 i added
$document = JFactory::getDocument();
$document->addCustomTag( '<link rel="image_src" href="'.$fileurl.'" />');
$document->addCustomTag ('<meta property="og:image" content="'.$fileurl.'" />');

and it's work very well.

The problem is that when i switch from backend Render HTML & BBCode in RSS feeds to Yes, the Rss Feed give me an Error 500.

How can i solve this problem ?!?
Tnx so much for your Tips. :)

Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover.

Last edit: 3 years 11 months ago by Trony.

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #2 by 810
enable kunena debug, and then go back then copy the error here
The following user(s) said Thank You: Trony

Please Log in or Create an account to join the conversation.

  • Trony
  • Trony's Avatar Topic Author
  • Offline
  • Junior Member
  • Music and Electronic Devices Designer.
More
3 years 11 months ago #3 by Trony
Hi, thanks for reply but with Kunena Debug i can't see the error.
There's the screen with report the wrong line and stop. :pinch:

Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover.

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #4 by 810
login as admin. then paste here the error

Please Log in or Create an account to join the conversation.

  • Trony
  • Trony's Avatar Topic Author
  • Offline
  • Junior Member
  • Music and Electronic Devices Designer.
More
3 years 11 months ago #5 by Trony
Hi. This is the only information from my Kunena Debug. :pinch:


Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover.

Attachments:

Please Log in or Create an account to join the conversation.

  • Trony
  • Trony's Avatar Topic Author
  • Offline
  • Junior Member
  • Music and Electronic Devices Designer.
More
3 years 11 months ago - 3 years 11 months ago #6 by Trony
Great !!! Now work !!! I changed my code in:
$document = JFactory::getDocument();
$doctype    = $document->getType();
// Only render for HTML output
if ($doctype == 'html') {
$document->addCustomTag( '<link rel="image_src" href="'.$fileurl.'" />');
$document->addCustomTag ('<meta property="og:image" content="'.$fileurl.'" />'); }

I hope is a good solution for insert in Kunena Topic the og:image and image_src
Anyway, tnx so much for your support. :)

Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover.

Last edit: 3 years 11 months ago by Trony.
The following user(s) said Thank You: kenzo

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #7 by kenzo
Hi! Thanks for share with us. Your solution still works? I'm looking for an "Open Graph plugin".
Thanks!

Please Log in or Create an account to join the conversation.

  • Trony
  • Trony's Avatar Topic Author
  • Offline
  • Junior Member
  • Music and Electronic Devices Designer.
More
2 years 10 months ago - 2 years 10 months ago #8 by Trony

kenzo wrote: Hi! Thanks for share with us. Your solution still works? I'm looking for an "Open Graph plugin".
Thanks!


Hello.
Yes it's still work but i changed for Kunena 4.0.7
New file is default.php in:

components -> com_kunena -> template -> system -> layouts -> image
defined ( '_JEXEC' ) or die ();
$document =& JFactory::getDocument();

and at the end of
</div>
of div class
<div class="kmsgimage">

<?
$document->addCustomTag( '<link rel="image_src" href="'.$url.'" />');
$document->addCustomTag ('<meta property="og:image" content="'.$url.'" />'); 
$document->addCustomTag ('<meta name="twitter:image:src" content="'.$url.'" />');
?>
</div>

Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover.

Last edit: 2 years 10 months ago by Trony.

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #9 by Ierofant
Hello!
Please tell me how to make a version 5.0.2

Please Log in or Create an account to join the conversation.

  • Trony
  • Trony's Avatar Topic Author
  • Offline
  • Junior Member
  • Music and Electronic Devices Designer.
More
2 years 3 weeks ago #10 by Trony

Ierofant wrote: Hello!
Please tell me how to make a version 5.0.2


For 5.0.2 and 5.0.3 you must edit these files in Crypsis Template:

template ► crypsis ► layouts ► attachment ► item ► image.php
defined('_JEXEC') or die();
$document =& JFactory::getDocument();

at end
<?
$doctype    = $document->getType();
// Only render for HTML output
if ($doctype == 'html') {
$document->addCustomTag('<link rel="image_src" href="'. JURI::base() .$attachment->getUrl().'">');
$document->addCustomTag ('<meta property="og:image" content="'. JURI::base() .$attachment->getUrl().'" />'); 
$document->addCustomTag ('<meta name="twitter:image:src" content="'. JURI::base() .$attachment->getUrl().'" />');
}
?>


template ► crypsis ► layouts ► bbcode ► image ► default.php
defined('_JEXEC') or die();
$document =& JFactory::getDocument();

at end
<?
$doctype    = $document->getType();
// Only render for HTML output
if ($doctype == 'html') {
$document->addCustomTag( '<link rel="image_src" href="'.$url.'">');
$document->addCustomTag ('<meta property="og:image" content="'.$url.'" />'); 
$document->addCustomTag ('<meta name="twitter:image:src" content="'.$url.'" />');
}
?>
</div>


Naturally.... BEFORE BACKUP ORIGINALS FILES !!!

Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover.

The following user(s) said Thank You: Ierofant

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.268 seconds