sciaxini ho un problema anche con questo plugin.
Ho messo il plugin nella cartella inc/plugins, poi sono andato nel pannello di amministrazione vado in plugin lo attivo e importa le cose che deve metter enel db. Poi gli vado a modificare le opzioni metto che devo attivarlo che deve essere al cento pub e che la pubblicità deve mettersi dopo il primo post e dopo 5 post e poi meddo il codice della pubblicità. Poi salvo creo un nuovo post ma non funziona
Il plugin non modificato è questo:
Ho messo il plugin nella cartella inc/plugins, poi sono andato nel pannello di amministrazione vado in plugin lo attivo e importa le cose che deve metter enel db. Poi gli vado a modificare le opzioni metto che devo attivarlo che deve essere al cento pub e che la pubblicità deve mettersi dopo il primo post e dopo 5 post e poi meddo il codice della pubblicità. Poi salvo creo un nuovo post ma non funziona
Il plugin non modificato è questo:
<?php
/*
Plugin Ads after first post
(c) 2005-2006 by MyBBoard.de
Website:
*/
$plugins->add_hook("postbit", "adsafp");
//Informationen zum Plugin
function adsafp_info()
{
return array(
"name" => "Ads after first post",
"description" => "Displays ads after the posts in your forums.",
"website" => "http://www.mybboard.de",
"author" => "MyBBoard.de",
"authorsite" => "http://www.mybboard.de",
"version" => "2.0",
);
}
// Aktivierung
function adsafp_activate() {
global $db;
// Variablen für dieses Plugin einfügen
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_seperator", '#</td>#', "{\$post['adsaf']}</td>");
// Einstellungsgruppe hinzufügen
$adsafp_group = array(
"gid" => "NULL",
"name" => "Publicità dopo del post",
"title" => "Publicità",
"description" => "Settings for the plugin.",
"disporder" => "1",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $adsafp_group);
$gid = $db->insert_id();
// Einstellungen hinzufügen
$adsafp_1 = array(
"sid" => "NULL",
"name" => "adsafp_code_onoff",
"title" => "Activate/Deactivate",
"description" => "Do you want to show ads after posts?",
"optionscode" => "yesno",
"value" => "no",
"disporder" => "1",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_1);
$adsafp_2 = array(
"sid" => "NULL",
"name" => "adsafp_align",
"title" => "Alignment",
"description" => "Choose the alignment.",
"optionscode" => "radio\r\n1=Left\r\n2=Center\r\n3=Right",
"value" => "2",
"disporder" => "2",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_2);
$adsafp_3 = array(
"sid" => "NULL",
"name" => "adsafp_mode",
"title" => "Mode",
"description" => "Where do you want to show the ads?",
"optionscode" => "radio\r\n1=After first post on each page (Default)\r\n2=After the first post and then after every x posts\r\n3=After every x posts",
"value" => "1",
"disporder" => "3",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_3);
$adsafp_4 = array(
"sid" => "NULL",
"name" => "adsafp_afterxposts",
"title" => "Number of posts",
"description" => "Enter the number of posts after that you want to display the ads (only necessary for the second mode)",
"optionscode" => "text",
"value" => "5",
"disporder" => "4",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_4);
$adsafp_5 = array(
"sid" => "NULL",
"name" => "adsafp_code",
"title" => "Code",
"description" => "Enter the HTML code for the ads.",
"optionscode" => "textarea",
"value" => "",
"disporder" => "5",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_5);
// settings.php erneuern
rebuild_settings();
}
// Deaktivierung
function adsafp_deactivate() {
global $db;
// Variablen von dieses Plugin entfernen
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_seperator", "#{\$post['adsaf']}#", "", 0);
// Einstellungsgruppen löschen
$query = $db->query("SELECT gid FROM ".TABLE_PREFIX."settinggroups WHERE name='Ads after first post'");
$g = $db->fetch_array($query);
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE gid='".$g['gid']."'");
// Einstellungen löschen
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE gid='".$g['gid']."'");
// Rebuilt settings.php
rebuild_settings();
}
// Funktionen
function adsafp($post) {
global $mybb, $postcounter;
$post['adsaf'] = "";
if ($mybb->settings['adsafp_code_onoff'] != "no") {
// Alignment
switch ($mybb->settings['adsafp_align']) {
case "1":
$ads_align = "left";
break;
case "2":
$ads_align = "center";
break;
case "3":
$ads_align = "right";
break;
}
// Ads after first post
if ($mybb->settings['adsafp_mode'] == "1") {
if (($postcounter - 1) % $mybb->settings['postsperpage'] == "0") {
$post['adsaf'] = "<div style=\"text-align:".$ads_align.";\">".stripslashes($mybb->settings['adsafp_code'])."</div>";
}
}
// Ads after first post and then every x posts
if ($mybb->settings['adsafp_mode'] == "2") {
if ($postcounter == "1" || ($postcounter - 1) % ($mybb->settings['adsafp_afterxposts']) == "0") {
$post['adsaf'] = "<div style=\"text-align:".$ads_align.";\">".stripslashes($mybb->settings['adsafp_code'])."</div>";
}
}
// Ads after every x posts
if ($mybb->settings['adsafp_mode'] == "3") {
if ($postcounter % ($mybb->settings['adsafp_afterxposts']) == "0") {
$post['adsaf'] = "<div style=\"text-align:".$ads_align.";\">".stripslashes($mybb->settings['adsafp_code'])."</div>";
}
}
}
}
// Einstellungen erneuern
if(!function_exists("rebuild_settings")) {
function rebuild_settings() {
global $db;
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."settings ORDER BY title ASC");
while($setting = $db->fetch_array($query)) {
$setting['value'] = addslashes($setting['value']);
$settings .= "\$settings['".$setting['name']."'] = \"".$setting['value']."\";\n";
}
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?>";
$file = fopen(MYBB_ROOT."/inc/settings.php", "w");
fwrite($file, $settings);
fclose($file);
}
}
?>
/*
Plugin Ads after first post
(c) 2005-2006 by MyBBoard.de
Website:
Perfavore,
Entra
oppure
Registrati
per vedere i Link!
*/
$plugins->add_hook("postbit", "adsafp");
//Informationen zum Plugin
function adsafp_info()
{
return array(
"name" => "Ads after first post",
"description" => "Displays ads after the posts in your forums.",
"website" => "http://www.mybboard.de",
"author" => "MyBBoard.de",
"authorsite" => "http://www.mybboard.de",
"version" => "2.0",
);
}
// Aktivierung
function adsafp_activate() {
global $db;
// Variablen für dieses Plugin einfügen
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_seperator", '#</td>#', "{\$post['adsaf']}</td>");
// Einstellungsgruppe hinzufügen
$adsafp_group = array(
"gid" => "NULL",
"name" => "Publicità dopo del post",
"title" => "Publicità",
"description" => "Settings for the plugin.",
"disporder" => "1",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $adsafp_group);
$gid = $db->insert_id();
// Einstellungen hinzufügen
$adsafp_1 = array(
"sid" => "NULL",
"name" => "adsafp_code_onoff",
"title" => "Activate/Deactivate",
"description" => "Do you want to show ads after posts?",
"optionscode" => "yesno",
"value" => "no",
"disporder" => "1",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_1);
$adsafp_2 = array(
"sid" => "NULL",
"name" => "adsafp_align",
"title" => "Alignment",
"description" => "Choose the alignment.",
"optionscode" => "radio\r\n1=Left\r\n2=Center\r\n3=Right",
"value" => "2",
"disporder" => "2",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_2);
$adsafp_3 = array(
"sid" => "NULL",
"name" => "adsafp_mode",
"title" => "Mode",
"description" => "Where do you want to show the ads?",
"optionscode" => "radio\r\n1=After first post on each page (Default)\r\n2=After the first post and then after every x posts\r\n3=After every x posts",
"value" => "1",
"disporder" => "3",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_3);
$adsafp_4 = array(
"sid" => "NULL",
"name" => "adsafp_afterxposts",
"title" => "Number of posts",
"description" => "Enter the number of posts after that you want to display the ads (only necessary for the second mode)",
"optionscode" => "text",
"value" => "5",
"disporder" => "4",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_4);
$adsafp_5 = array(
"sid" => "NULL",
"name" => "adsafp_code",
"title" => "Code",
"description" => "Enter the HTML code for the ads.",
"optionscode" => "textarea",
"value" => "",
"disporder" => "5",
"gid" => intval($gid),
);
$db->insert_query("settings", $adsafp_5);
// settings.php erneuern
rebuild_settings();
}
// Deaktivierung
function adsafp_deactivate() {
global $db;
// Variablen von dieses Plugin entfernen
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_seperator", "#{\$post['adsaf']}#", "", 0);
// Einstellungsgruppen löschen
$query = $db->query("SELECT gid FROM ".TABLE_PREFIX."settinggroups WHERE name='Ads after first post'");
$g = $db->fetch_array($query);
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE gid='".$g['gid']."'");
// Einstellungen löschen
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE gid='".$g['gid']."'");
// Rebuilt settings.php
rebuild_settings();
}
// Funktionen
function adsafp($post) {
global $mybb, $postcounter;
$post['adsaf'] = "";
if ($mybb->settings['adsafp_code_onoff'] != "no") {
// Alignment
switch ($mybb->settings['adsafp_align']) {
case "1":
$ads_align = "left";
break;
case "2":
$ads_align = "center";
break;
case "3":
$ads_align = "right";
break;
}
// Ads after first post
if ($mybb->settings['adsafp_mode'] == "1") {
if (($postcounter - 1) % $mybb->settings['postsperpage'] == "0") {
$post['adsaf'] = "<div style=\"text-align:".$ads_align.";\">".stripslashes($mybb->settings['adsafp_code'])."</div>";
}
}
// Ads after first post and then every x posts
if ($mybb->settings['adsafp_mode'] == "2") {
if ($postcounter == "1" || ($postcounter - 1) % ($mybb->settings['adsafp_afterxposts']) == "0") {
$post['adsaf'] = "<div style=\"text-align:".$ads_align.";\">".stripslashes($mybb->settings['adsafp_code'])."</div>";
}
}
// Ads after every x posts
if ($mybb->settings['adsafp_mode'] == "3") {
if ($postcounter % ($mybb->settings['adsafp_afterxposts']) == "0") {
$post['adsaf'] = "<div style=\"text-align:".$ads_align.";\">".stripslashes($mybb->settings['adsafp_code'])."</div>";
}
}
}
}
// Einstellungen erneuern
if(!function_exists("rebuild_settings")) {
function rebuild_settings() {
global $db;
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."settings ORDER BY title ASC");
while($setting = $db->fetch_array($query)) {
$setting['value'] = addslashes($setting['value']);
$settings .= "\$settings['".$setting['name']."'] = \"".$setting['value']."\";\n";
}
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?>";
$file = fopen(MYBB_ROOT."/inc/settings.php", "w");
fwrite($file, $settings);
fclose($file);
}
}
?>