As a robot is a guests , technically this rebot must have access as a guests ....This is your story, but do you really want people to install another add-on to make this add-on working?
attachments for guests in the forum: NO!
attachments as og: yes, sure, else it makes no sense to use it.
also use the attachment itself and not the thumb for og.
public function getAttachment($attachments, $default, $canViewAttachment)
if($attachment->has_thumbnail)
{
$imageUrl = rtrim(\XF::app()->request()->getHostUrl(), '/') . '/' . ltrim($attachment->thumbnail_url, '/');
if($canViewAttachment)
{
$imageUrl = \XF::app()->router()->buildLink('full:attachments', $attachment);
}
//added by r9
$imageUrl = \XF::app()->router()->buildLink('full:attachments', $attachment);
//
return $imageUrl;
}
$imageUrl = rtrim(\XF::app()->request()->getHostUrl(), '/') . '/' . ltrim($attachment->thumbnail_url, '/');
if($attachment->has_thumbnail)
else
{
$imageUrl = \XF::app()->router()->buildLink('full:attachments', $attachment);
}
Yes, attachments must be pictures for og:imageAnother question, please:
Code:if($attachment->has_thumbnail)
Are there attachments without thumbnails?
Then we have to add something like
Code:else { $imageUrl = \XF::app()->router()->buildLink('full:attachments', $attachment); }
Oh! Ok, maybe every picture has a thumb, but not every attachment is a picture?
I clearly don't have the time right now, so I'll see about doing it next weekendDo you have any time planned for the next update, please?
foreach($attachments as $attachment)
Why would it be exacuted 10 times?If we have ten attachments, we run this ten times, right?
I have just redone some tests and in fact it works very well the robo have access to the attachment.There is indeed a problem for og:image as guests can't see thread attachments, so the default image of the og:image is used. We need to set up a system and say that if there is an attachment and this attachment is used for the meta og:image twitter:image then this attachment must be available for guests.
We use essential cookies to make this site work, and optional cookies to enhance your experience.