<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
  function iniSetup ()
  {
    global $prefix;
    global $db;
    global $allBackendCalenderFormAttributes;
    global $StandardFrontendAttributes;
    global $StandardFrontendDetailAttributes;
    global $CharsSetupNewsChannelTitle;
    global $CharsSetupNewsChannelURL;
    global $CharsSetupNewsChannelDescription;
    global $CharsSetupNewsChannelLanguage;
    global $CharsSetupNewsChannelCopyright;
    global $CharsSetupUserMaximumInactivityTime;
    global $GigKalenderPath;
    
    $SQLQuery_1 = 'CREATE TABLE '.$prefix.'setup
    (
      SetupID INTEGER NOT NULL AUTO_INCREMENT,
      SetupRefreshtime TINYINT(2),
      SetupRowsTextareas TINYINT(2),
      SetupExportSeparator CHAR(1),
      SetupFrontendLanguage CHAR(32),
      SetupGuestbookEntriesPerPage TINYINT(2),
      SetupGuestbookMail CHAR(50),
      SetupFrontendCssFile CHAR(255),
      SetupGuestbookEntriesUnlock TINYINT(1),
      SetupGuestbookSpamDomains TEXT,
      SetupGuestbookSpamIPs TEXT,
      SetupGuestbookSpamWords TEXT,
      SetupUserMaximumInactivityTime SMALLINT('.$CharsSetupUserMaximumInactivityTime.'),
      SetupNewsEntriesPerPage TINYINT(2),
      SetupFrontendAllowOptionalGigs TINYINT(1),
      SetupFrontendAllowPrivateGigs TINYINT(1),
      SetupAllowDoubleDates TINYINT(1),
      SetupCalendarAttributeInAddGigForm TEXT,
      SetupFrontendAttributes TEXT,
      SetupFrontendDetailAttributes TEXT,
      SetupNewsChannelTitle CHAR('.$CharsSetupNewsChannelTitle.'),
      SetupNewsChannelURL CHAR('.$CharsSetupNewsChannelURL.'),
      SetupNewsChannelDescription CHAR('.$CharsSetupNewsChannelDescription.'),
      SetupNewsChannelLanguage CHAR('.$CharsSetupNewsChannelLanguage.'),
      SetupNewsChannelCopyright CHAR('.$CharsSetupNewsChannelCopyright.'),
      SetupFrontendCalendarCharsInFields INT,
      SetupFrontendCalendarShowTableHeads TINYINT(1),
      SetupFrontendCalendarSelector CHAR(10),
      SetupFrontendCalendarMaxAmountOfGigs INT,
      SetupFrontendCalendarPeriodSelector CHAR(10),
      SetupFrontendCalendarShowMonthlySeparator TINYINT(1),
      SetupShowEditorInAddGigForm TINYINT(1),
      PRIMARY KEY (SetupID)
    ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci';

      if (mysqli_query($db, $SQLQuery_1))
      {
        $SetupRefreshtime = 1;
        $SetupRowsTextareas = 5;
        $SetupExportSeparator = ';';
        $SetupFrontendLanguage = 'deutsch';
        $SetupGuestbookEntriesPerPage = '10';
        $SetupGuestbookMail = 'mail@max-mustermann.xyz';
        $SetupFrontendCssFile = '../styles/gigkalender.css';
        $SetupGuestbookEntriesUnlock = 1;
        $SetupGuestbookSpamDomains = "rubyurl.com";
        $SetupGuestbookSpamIPs = "212.12.41.130";
        $SetupGuestbookSpamWords = "pussy, porn, fetish, anal, gay, ilovecoolgirl, adultsitepoint, sexpasspussy, showforlove, lesbian, viagra, nude, tits, tgp, teenundressed, fucking, busty, hardcore, doyoulovepussy";
        $SetupUserMaximumInactivityTime = "180";
        $SetupNewsEntriesPerPage = '10';
        $SetupFrontendAllowOptionalGigs = '0';
        $SetupFrontendAllowPrivateGigs = '0';
        $SetupAllowDoubleDates = '1';
        $SetupCalendarAttributeInAddGigForm = $allBackendCalenderFormAttributes;
        $SetupFrontendAttributes = $StandardFrontendAttributes;
        $SetupFrontendDetailAttributes = $StandardFrontendDetailAttributes;
        $SetupNewsChannelTitle = "Band-News";
        $SetupNewsChannelURL = ""; //$GigKalenderPath."frontend/example_news.php";
        $SetupNewsChannelDescription = "Band-News...";
        $SetupNewsChannelLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5);
        $SetupNewsChannelCopyright = "Max Mustermann";
        $SetupFrontendCalendarCharsInFields = '20';
        $SetupFrontendCalendarShowTableHeads = '1';
        $SetupFrontendCalendarSelector = 'list';
        $SetupFrontendCalendarMaxAmountOfGigs = '20';
        $SetupFrontendCalendarPeriodSelector = 'future';
        $SetupFrontendCalendarShowMonthlySeparator = '1';
        $SetupShowEditorInAddGigForm = '1';
        
        $SQLQuery_2 = "INSERT INTO ".$prefix."setup
        (
          SetupRefreshtime,
          SetupRowsTextareas,
          SetupExportSeparator,
          SetupFrontendLanguage,
          SetupGuestbookEntriesPerPage,
          SetupGuestbookMail,
          SetupFrontendCssFile,
          SetupGuestbookEntriesUnlock,
          SetupGuestbookSpamDomains,
          SetupGuestbookSpamIPs,
          SetupGuestbookSpamWords,
          SetupUserMaximumInactivityTime,
          SetupNewsEntriesPerPage,
          SetupFrontendAllowOptionalGigs,
          SetupFrontendAllowPrivateGigs,
          SetupAllowDoubleDates,
          SetupCalendarAttributeInAddGigForm,
          SetupFrontendAttributes,
          SetupFrontendDetailAttributes,
          SetupNewsChannelTitle,
          SetupNewsChannelURL,
          SetupNewsChannelDescription,
          SetupNewsChannelLanguage,
          SetupNewsChannelCopyright,
          SetupFrontendCalendarCharsInFields,
          SetupFrontendCalendarShowTableHeads,
          SetupFrontendCalendarSelector,
          SetupFrontendCalendarMaxAmountOfGigs,
          SetupFrontendCalendarPeriodSelector,
          SetupFrontendCalendarShowMonthlySeparator,
          SetupShowEditorInAddGigForm
        )
        VALUES
        (
          '$SetupRefreshtime',
      	  '$SetupRowsTextareas',
          '$SetupExportSeparator',
          '$SetupFrontendLanguage',
          '$SetupGuestbookEntriesPerPage',
          '$SetupGuestbookMail',
        	'$SetupFrontendCssFile',
        	'$SetupGuestbookEntriesUnlock',
          '$SetupGuestbookSpamDomains',
          '$SetupGuestbookSpamIPs',
          '$SetupGuestbookSpamWords',
          '$SetupUserMaximumInactivityTime',
          '$SetupNewsEntriesPerPage',
          '$SetupFrontendAllowOptionalGigs',
          '$SetupFrontendAllowPrivateGigs',
          '$SetupAllowDoubleDates',
          '$SetupCalendarAttributeInAddGigForm',
          '$SetupFrontendAttributes',
          '$SetupFrontendDetailAttributes',
          '$SetupNewsChannelTitle',
          '$SetupNewsChannelURL',
          '$SetupNewsChannelDescription',
          '$SetupNewsChannelLanguage',
          '$SetupNewsChannelCopyright',
          '$SetupFrontendCalendarCharsInFields',
          '$SetupFrontendCalendarShowTableHeads',
          '$SetupFrontendCalendarSelector',
          '$SetupFrontendCalendarMaxAmountOfGigs',
          '$SetupFrontendCalendarPeriodSelector',
          '$SetupFrontendCalendarShowMonthlySeparator',
          '$SetupShowEditorInAddGigForm'
        )";

        $Result = mysqli_query($db, $SQLQuery_2);
        if ($Result) return true;
          else return false;
        return true;
      }
      else return false;
  }
?>