Cezary Stasiak
- Super Gaduła
- 540 105 33 16
Więc zacząłem pisać swój plugin. Wszystko jest ok, tylko, że po aktywowaniu go w ACP nie widzę go w ogóle na forum.
ctrl+f5 - nic
Mój kod (wziąłem go z pluginu Fyeema):
ctrl+f5 - nic
Mój kod (wziąłem go z pluginu Fyeema):
<?php
define("IN_MYBB", 1);
$plugins->add_hook('index_start', 'reminder');
function reminder_info() {
return array(
"name" => "Przypomnienie",
"description" => "Ten plugin przypomina użytkownikowi o zrobieniu jakiejś czynności.",
"website" => "https://webboard.pl",
"author" => "Cezary Stasiak",
"authorsite" => "https://twitter.com/cezplayer",
"version" => "1.0",
"compatibility" => "18*"
);
}
function reminder_activate() {
global $db, $mybb;
//ustawienia przypomnienia w ACP
$firstf_group_settings = array(
"gid" => NULL,
"name" => "reminder_option_category",
"title" => "Przypomnienie",
"description" => "Skonfiguruj ustawienia przypomnienia.",
"disporder" => "50",
"isdefault" => "no"
);
$db->insert_query("settinggroups", $reminder_group_settings);
$gid = $db->insert_id();
// Włącz/Wyłącz
$option_1 = array(
"sid" => NULL,
"name" => "reminder_enabled",
"title" => "Pokazywać przypoomnienie?",
"description" => "Czy przypomnienie ma się pokazywać?",
"optionscode" => "yesno",
"value" => "yes",
"isdefault" => "yes",
"disporder" => "1",
"gid" => intval($gid)
);
// Tekst przypomnienia
$option_2 = array(
"sid" => NULL,
"name" => "reminder_text",
"title" => "Treść przypomnienia",
"description" => "Tu wpisz treść przypomnienia.",
"optionscode" => "textarea",
"value" => 'Drogi użytkowniku! Nie zapomnij się zapoznać z regulaminem Naszego forum!',
"isdefault" => "yes",
"disporder" => "2",
"gid" => intval($gid)
);
$db->insert_query("settings", $option_1);
$db->insert_query("settings", $option_2);
$db->insert_query("settings", $option_6);
require MYBB_ROOT."/inc/adminfunctions_templates.php";
}
function reminder_deactivate() {
global $db, $mybb;
$db->delete_query('settinggroups', 'name = "firstf_option_category"');
$db->delete_query('settings', 'name IN("firstf_enabled, firstf_nwm, firstf_nwm2, firstf_nwm5, firstf_nwm6")');
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets('index', '#(\n?){\$firstf}#', '', 0);
}
function reminder ()
{
global $mybb, $reminder;
if ($mybb->settings['reminder_enabled'] == 1)
{
$reminder = '<table border="0" cellspacing="0" cellpadding="5" class="tborder">
<tbody><tr><td class="thead">test</td></tr>';
}
$reminder .= '</tbody></table>';
}
?>
Nie strzelaj na nas focha! Poświęć parę chwil i poczytaj o tym, jak szybko otrzymać pomoc na forum