<?php
if(!defined("IN_MYBB")) die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
 
function reminder_info() {
 return array(
 "name" => "Przypomnienie",
 "description" => "Ten plugin przypomina uzytkownikowi o zrobieniu jakiejs rzeczy (domyslnie przeczytanie regulaminu).",
 "website" => "https://mybboard.pl",
 "author" => "CezPlayer",
 "authorsite" => "http://csgoforum.ct8.pl",
 "version" => "BETA",
 "guid" => "",
 "compatibility" => "18*"
 );
}
 
function reminder_install() {
 global $db; 
 
 $db -> insert_query('settinggroups', array(
 "gid" => "NULL", 
 "name" => "Przypomnienie", 
 "title" => "Ustawienia przypomnienia", 
 "description" => "Tu możesz zmienić ustawienia przypomnienia.", 
 "disporder" => "1", 
 "isdefault" => "1"
 )); 
 
    $id = $db -> insert_id(); 
 
 $db -> insert_query('settings', array( 
 "sid" => "NULL", 
 "name" => "przypomnienie", 
 "title" => "Pokazywać?", // Tytuł
 "description" => "Pokazywać przypomnienie na forum?", 
 "optionscode" => "yesno", 
 "value" => "1", 
 "disporder" => "1", 
 "gid" => $id, 
 "isdefault" => "1"
 ));
 
    rebuild_settings(); 
}
 
function reminder_uninstall() {
 global $db;
 
 $id = $db -> simple_select('settinggroups', 'gid', "name = 'przypomnienie'");
 $id = $db -> fetch_field($id, 'gid'); 
 $db -> delete_query('settinggroups', "name = 'przypomnienie'"); 
 $db -> delete_query('settings', "gid = {$id}"); 
}
 
function reminder_is_installed() {
 global $db;
 $q = $db -> simple_select('settinggroups', '*', "name = 'mojplugin'");
 if($db -> num_rows($q)) return true;
 else return false;
}
 
$plugins -> add_hook('global_start', 'przypomnienie_write'); 
 
function przypomnienie_write() {
 global $db, $mybb, $reminder; 
  
 $reminder = '<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
<tr><td class="thead">Ogloszenie</td></tr>
<tr><td class="trow1">Drogi uzytkowniku! Nie zapomnij sie zapoznac z regulaminem Naszego forum!</td></tr>
</table><ol>';
}