• Regolamento Macrocategoria DEV
    Prima di aprire un topic nella Macrocategoria DEV, è bene leggerne il suo regolamento. Sei un'azienda o un hosting/provider? Qui sono anche contenute informazioni per collaborare con Sciax2 ed ottenere l'accredito nella nostra community!

Problema risolto plugin Ads after first post

chack1172

Utente Senior
Autore del topic
27 Aprile 2013
1.538
69
Miglior risposta
1
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:emoji_slight_frown:

Il plugin non modificato è questo:

<?php
/*
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);

}
}
?>
 
Riferimento: plugin Ads after first post

Scusa ma che plugin usi? In quello che hai postato vedo che è datato "2005-2006"!
Usa questo qui:
Perfavore, Entra oppure Registrati per vedere i Link!
:P
 
Riferimento: plugin Ads after first post

ok ci provo
--------------- AGGIUNTA AL POST ---------------
che p***** x andare su mybb devo cambiare connessione :/
--------------- AGGIUNTA AL POST ---------------
uffi non parte
--------------- AGGIUNTA AL POST ---------------
come funziona??????????
 
Ultima modifica:
Riferimento: plugin Ads after first post

Che problema riscontri?
Vai in Strumenti e Manutenzione -> My Advertisements -> Postbit -> Edit per fare quello che dici nel primo post modifica così:
Postbit Options: First Post and every X posts
X Posts: 5

Po vai alla scheda Advertisements -> Add e aggiungi la tua pubblicità mettendo Zone: Postbit
 
Riferimento: plugin Ads after first post

in strumenti e manutenzione non c'è my advertisements :/
--------------- AGGIUNTA AL POST ---------------
ah si c'è scusa avevo sbagliato forum
--------------- AGGIUNTA AL POST ---------------
ok sono andato lì e poi ho modificato post bit poi vado su add ed escono sti 2 cosi: Name e Description, cosa devo fare?
--------------- AGGIUNTA AL POST ---------------
ero andato da una parte sbagliato, adesso funziona grazie.

Potete chiudere, intanto ne apro un'altro xD
 
Ultima modifica:
Riferimento: plugin Ads after first post

in strumenti e manutenzione non c'è my advertisements :/
--------------- AGGIUNTA AL POST ---------------
ah si c'è scusa avevo sbagliato forum
--------------- AGGIUNTA AL POST ---------------
ok sono andato lì e poi ho modificato post bit poi vado su add ed escono sti 2 cosi: Name e Description, cosa devo fare?
--------------- AGGIUNTA AL POST ---------------
ero andato da una parte sbagliato, adesso funziona grazie.

Potete chiudere, intanto ne apro un'altro xD

Sposto e rinomino su richiesta dell'utente ^^
 
Riferimento: plugin Ads after first post

dopo 8 giorni ti ricordi :fottiti: