Anpassung: Facebook, Google, Twitter, SEO Metatags - nitje - 25-12-2024
Ich glaube die Installation war nicht möglich bei PHP8.3 oder MYSQLi
Es ist nicht schön, nur schnell angepasst jetzt wo ich langsam wieder rein komme hätte man noch vieles eleganter lösen können aber es soll jezt nur Funktionieren.
Es Fehlen auch noch weitere SEO Tag Einträge die ich Händisch eingepflegt habe und eigentlich mit hier in das Script rein gehören.
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.");
}
$plugins->add_hook('global_start', 'do_metatag');
function socialseometatag_info()
{
global $mybb;
$metatag_config = "";
if($mybb->settings['metatagenable'] == 1)
{
$metatag_config = '<div style="float: right;"><a href="index.php?module=config&action=change&search=metatag" style="color:#035488; no-repeat 0px 18px;
padding: 21px; text-decoration: none;">Configure Plugin</a></div>';
}
return array(
"name" => "Facebook, Google, Twitter, SEO Metatags",
"description" => "Gain the exposure your forum deserves with Social and SEO meta tags.".$metatag_config,
"website" => "https://community.mybb.com",
"author" => "Skyon Archer",
"authorsite" => "https://tierrahosting.com",
"version" => "1.0",
"guid" => "",
"codename" => "socialseometatag",
"compatibility" => "18*"
);
}
function socialseometatag_activate()
{
global $mybb, $db, $templates;
// $sid = $db->insert_id();
$settings_group = array(
"gid" => (int)'',
"name" => "metatag",
"title" => "Facebook, Google, Twitter, SEO Metatags",
"description" => "Gain the exposure your forum deserves with Social and SEO meta tags.",
"disporder" => 100,
"isdefault" => "0",
);
$db->insert_query("settinggroups", $settings_group);
$gid = $db->insert_id();
$settings[] = array(
"sid" => intval($sid),
"name" => "metatagenable",
"title" => "Activation",
"description" => "Do you want to use this plugin?",
"optionscode" => "yesno",
"value" => "0",
"disporder" => 10,
"gid" => intval($gid),
);
$settings[] = array(
"sid" => intval($sid),
"name" => "metatagurl",
"title" => "Twitter and Facebook Image Address",
"description" => "Put the complete address to the image you want shown on Twitter Cards/Posts and Facebook Posts. · Recommended image size is 1200 pixels width by 628 pixels height, or 1.91:1 ratio · It is important to use an image a secure address, example: https://....",
"optionscode" => "text",
"value" => "",
"disporder" => 20,
"gid" => intval($gid),
);
$settings[] = array(
"sid" => intval($sid),
"name" => "metatagtwitter",
"title" => "Twitter Username",
"description" => "If you have a Twitter account, put the Username you have. (Example: @username)",
"optionscode" => "text",
"value" => "",
"disporder" => 30,
"gid" => intval($gid),
);
foreach($settings as $set)
// {
$db->insert_query("settings", $set);
// }