View file INSTALL.php

File size: 7.84Kb
<?php
#----------------------------------------------------------------#
#               ********* COOL-WAPA *********                    #
#                      Автор  :  Dog09                           #
#               E-mail  :  [email protected]                   #
#      Официальный сайт сайт проекта: : http://siza.pp.ua        #
#                  ICQ  :  617-333-896                           #
#      Вы не имеете право вносить изменения в код скрипта        #
#            для его дальнейшего распространения                 #
#----------------------------------------------------------------# 
error_reporting(0);
require('include/cfg.php');

$mod=substr(sprintf("%o",fileperms('data')),-3);
if($mod!=777){echo'Внимание прежде чем приступить к установке Cool-Wapa '.$ver.' нужно выставить права папке DATA 777';
			  exit;}

if(empty($_GET['adminl'])||empty($_GET['adminp']))
        {
	 require('README.txt');
     echo'Введите :<hr><form method="get" action="'.$_SERVER['PHP_SELF'].'">
      Логин:<br><input name="adminl" maxlength="25" value=""><br>
      Пароль:<br><input name="adminp" type="password" maxlength="25" value=""><br>
      <hr><input type="submit" value="Установить Cool-Wapa '.$ver.'"></form>';
	  exit;
	    }

mysql_query("
CREATE TABLE `c_post` (
  `id` int(11) NOT NULL auto_increment,
  `msg` text NOT NULL,
  `name` text NOT NULL,
  `time` int(11) NOT NULL default '0',
  `room` int(11) NOT NULL default '1',
  `privat` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `room` (`room`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `guest` (
  `id` int(11) NOT NULL auto_increment,
  `msg` text NOT NULL,
  `user` text NOT NULL,
  `time` int(11) NOT NULL,
  `mob` text NOT NULL,
  PRIMARY KEY  (`id`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `c_room` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `i` int(11) NOT NULL default '40',
  PRIMARY KEY  (`id`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `f_post` (
  `pid` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `text` text NOT NULL,
  `time` int(11) NOT NULL default '0',
  `tid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`pid`),
  KEY `tid` (`tid`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `f_section` (
  `fid` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `under` int(1) NOT NULL default '0',
  `place` int(11) NOT NULL default '50',
  `i` int(11) NOT NULL default '0',
  PRIMARY KEY  (`fid`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `f_topic` (
  `tid` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `user1` text NOT NULL,
  `user2` text NOT NULL,
  `posts` int(11) NOT NULL default '1',
  `fix` int(11) NOT NULL default '0',
  `close` int(11) NOT NULL default '0',
  `create` int(11) NOT NULL default '0',
  `time` int(11) NOT NULL default '0',
  `fid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`tid`),
  KEY `fid` (`fid`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `gallery` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `title` text NOT NULL,
  `text` text NOT NULL,
  `size` int(11) NOT NULL default '0',
  `time` int(11) NOT NULL default '0',
  `count` int(11) NOT NULL default '0',
  `rating` int(11) NOT NULL default '0',
  `user` text NOT NULL,
  PRIMARY KEY  (`id`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `mail` (
  `id` int(11) NOT NULL auto_increment,
  `title` text NOT NULL,
  `msg` text NOT NULL,
  `ot` text NOT NULL,
  `to` text NOT NULL,
  `time` int(11) NOT NULL default '0',
  `new` int(1) NOT NULL default '1',
  PRIMARY KEY  (`id`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `news` (
  `nid` int(11) NOT NULL auto_increment,
  `title` text NOT NULL,
  `news` text NOT NULL,
  `time` int(11) NOT NULL default '0',
  `name` text NOT NULL,
  PRIMARY KEY  (`nid`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `online` (
  `id` int(11) NOT NULL auto_increment,
  `user` text NOT NULL,
  `mob` text NOT NULL,
  `ip` text NOT NULL,
  `time` int(11) NOT NULL default '0',
  `map` text NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `map` (`map`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `users` (
  `id` int(11) NOT NULL auto_increment,
  `log` text NOT NULL,
  `pass` text NOT NULL,
  `name` text NOT NULL,
  `pol` text NOT NULL,
  `rost` int(11) NOT NULL default '0',
  `ves` int(11) NOT NULL default '0',
  `data` text NOT NULL,
  `city` text NOT NULL,
  `mob` text NOT NULL,
  `ip` text NOT NULL,
  `email` text NOT NULL,
  `telnum` int(11) NOT NULL default '0',
  `icq` int(11) NOT NULL default '0',
  `url` text NOT NULL,
  `about` text NOT NULL,
  `rdat` int(11) NOT NULL default '0',
  `lasttime` int(11) NOT NULL default '0',
  `alltime` int(11) NOT NULL default '0',
  `postchat` int(11) NOT NULL default '0',
  `quest` int(11) NOT NULL default '0',
  `postguest` int(11) NOT NULL default '0',
  `ball` int(11) NOT NULL default '0',
  `status` text NOT NULL,
  `level` int(11) NOT NULL default '1',
  `ban` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `smile` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `type` int(11) NOT NULL,
  `i` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `obmen` (
  `id` int(11) NOT NULL auto_increment,
  `file` text NOT NULL,
  `name` text NOT NULL,
  `time` int(11) NOT NULL,
  `type` text NOT NULL,
  `about` text NOT NULL,
  `size` int(11) NOT NULL,
  `count` int(11) NOT NULL,
  `user` text NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `type` (`type`)
)") or print mysql_error().'<br>';

mysql_query("
CREATE TABLE `comm` (
  `id` int(11) NOT NULL auto_increment,
  `msg` text NOT NULL,
  `user` text NOT NULL,
  `time` int(11) NOT NULL,
  `type` text NOT NULL,
  `id_comm` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `id_comm` (`id_comm`)
)") or print mysql_error().'<br>';
mysql_query('ALTER TABLE `users` CHANGE `icq` `icq` TEXT');
mysql_query('ALTER TABLE `users` CHANGE `telnum` `telnum` TEXT');
mysql_query('ALTER TABLE `users` ADD `realmob` TEXT NOT NULL AFTER `mob`;');
mysql_query('ALTER TABLE `f_post` DROP INDEX `tid_2`;');
mysql_query('ALTER TABLE `f_post` ADD `edit` TEXT NOT NULL AFTER `text`;');
mysql_query('ALTER TABLE `f_post` ADD `file` TEXT NOT NULL AFTER `edit`;');

mysql_query('ALTER TABLE `load` CHANGE `name` `dir` TEXT CHARACTER SET cp1251 COLLATE cp1251_general_ci;');
mysql_query('ALTER TABLE `load` ADD `name` TEXT NOT NULL AFTER `id` ,ADD `opis` TEXT NOT NULL AFTER `name`;');

if(mysql_num_rows(mysql_query('SELECT * FROM `users` WHERE `id`=1 LIMIT 1'))==0)
{mysql_query('INSERT INTO `users` SET `log`="'.mysql_escape_string(htmlspecialchars(trim($_GET['adminl']))).'",`pass`="'.md5(md5(mysql_escape_string(htmlspecialchars(trim($_GET['adminp']))))).'",`level`=15,`rdat`='.time().';') or print mysql_error().'<br>';}

mysql_query('INSERT INTO `news` SET `title`="Новый движок!", `news`="Всем привет! Мы установили новый движок Cool-Wapa '.$ver.'... скачать последнии версии можно на официальном сайте <a href=\"http://siza.pp.ua\">Siza.pp.ua</a>", `time`='.time().', `name`="Dog09";') or print mysql_error().'<br>';

echo '<hr>Логин админа: '.htmlspecialchars(trim($_GET['adminl'])).'<br>
	  Пароль админа: '.htmlspecialchars(trim($_GET['adminp'])).'<br>';

?>