settings = Settings::instance();
}
public function generateTitle($title)
{
$settings = $this->settings;
if ($settings->enable_title) {
$position = $settings->title_position;
$site_title = $settings->title;
if ($position == 'prefix') {
$new_title = $site_title . " " . $title;
} else {
$new_title = $title . " " . $site_title;
}
} else {
$new_title = $title;
}
return $new_title;
}
function generateCanonicalUrl()
{
$settings = $this->settings;
if ($settings->enable_canonical_url) {
return '';
}
return "";
}
public function otherMetaTags()
{
$settings = $this->settings;
if ($settings->other_tags) {
return $settings->other_tags;
}
return "";
}
public function generateOgMetaTags($post)
{
$settings = $this->settings;
if ($settings->enable_og_tags) {
$ogTags = "";
if ($settings->og_fb_appid) {
$ogTags .= '' . "\n";
}
if ($settings->og_sitename) {
$ogTags .= '' . "\n";
}
if ($post->powerseo_description) {
$ogTags .= '' . "\n";
}
$ogTitle = empty($post->powerseo_title) ? $post->title : $post->powerseo_title;
$ogUrl = Request::url();
if(!empty($post->powerseo_canonical_url)){
$ogUrl = $post->powerseo_canonical_url;
}
else if(!empty($this->page->powerseo_canonical_url)){
$ogUrl = $this->page->powerseo_canonical_url;
}
//Add featured images to the social tags
if($post->featured_images){
foreach($post->featured_images as $image){
$ogTags .= '' . "\n";
}
}
$ogTags .= '' . "\n";
$ogTags .= '';
return $ogTags;
}
}
}