Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to CHMOD folder writing permissions during installation???
11-12-2011, 10:49 PM
Post: #4
RE: How to CHMOD folder writing permissions during installation???
replace the /install/index.php code with this code
Code:
<?

function deger_ata($deger,$atanacak)

{
global $root_url,$root_dir;
$filename = "../config/config.php";
$handle = fopen($filename, "r");
$onur = fread($handle, filesize($filename));
fclose($handle);

//$yerisi1=strpos($onur,'//###');
//$yerisi2=strpos($onur,'//###',$yerisi1+5);
//$onur=substr($onur,$yerisi1,$yerisi2-$yerisi1);

$yerisi1=strpos($onur,$deger);
$yerisi2=strpos($onur,";",$yerisi1);
$tumu=substr($onur,$yerisi1,$yerisi2-$yerisi1);
$onur=str_replace($tumu,$deger."=".$atanacak,$onur);


$fp = fopen($filename, 'w');
fwrite($fp, $onur);
fclose($fp);



}


//if (substr(sprintf('%o', fileperms('../tmp')), -4)!="0777")
//{
//$error_file=true;
//$error_msg="<font color='red'>Error:</font>Before Begining to installation Give write permition to <font color='red'>/tmp</font> folder. Do permitions <font color='red'>777</font><br><br>";
//}


//if (substr(sprintf('%o', fileperms('../config')), -4)!="0777")
//{
//$error_file=true;
//$error_msg=$error_msg."<font color='red'>Error:</font>Before Begining to installation Give write permition to <font color='red'>/config</font> folder. Do permitions <font color='red'>777</font><br><br>";
//}

//if (substr(sprintf('%o', fileperms('../img')), -4)!="0777")
//{
//$error_file=true;
//$error_msg=$error_msg."<font color='red'>Error:</font>Before Begining to installation Give write permition to <font color='red'>/img</font> folder. Do permitions <font color='red'>777</font><br><br>";
//}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Free Adult Script Instalation</title>
<meta name="keywords" content="" />
<meta name="Gestured" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<!-- start header -->
<div id="header">
    <div id="menu">
        
    </div>
    <div id="logo">
        <h1><span>Free Adult Script V 2.1 - Installation</span></a></h1>
        
    </div>
</div>

<!-- end header -->
    <!-- start page -->
    <div id="page">
        <div id="sidebar1" class="sidebar">
            <ul>
                
                <li>
                     <h2>Installation</h2>
                    
                </li>
                

                
                
                
            </ul>
        </div>
        <!-- start content -->
        <div id="content">
            
                
                <div class="post">
                
                <? if ($error_file==true) { ?>
                
                <h1 class="title">Write Permition Error</h1>
                
                <div class="entry">
                    <p>
                    <?=$error_msg;?>
                    </p>
                </div>
                <? } else {
                
                
                
                if (!is_dir('../tmp/google_game')) {mkdir('../tmp/google_game',0777); }
                if (!is_dir('../tmp/encok_game')) {mkdir('../tmp/encok_game',0777);}
                if (!is_dir('../tmp/tablo_game')) {mkdir('../tmp/tablo_game',0777);}
                if (!is_dir('../tmp/taglar_game')) {mkdir('../tmp/taglar_game',0777);}
                if (!is_dir('../tmp/game')) {mkdir('../tmp/game',0777);}
                if (!is_dir('../tmp/backlinkspider')) {mkdir('../tmp/backlinkspider',0777);}
                
                
                if (!is_dir('../tmp/google')) {mkdir('../tmp/google',0777); }
                if (!is_dir('../tmp/encok')) {mkdir('../tmp/encok',0777);}
                if (!is_dir('../tmp/html')) {mkdir('../tmp/html',0777);}
                if (!is_dir('../tmp/tablo')) {mkdir('../tmp/tablo',0777);}
                if (!is_dir('../tmp/taglar')) {mkdir('../tmp/taglar',0777);}
                if (!is_dir('../tmp/video')) {mkdir('../tmp/video',0777);}
                if (!is_dir('../img/thumb')) {mkdir('../img/thumb',0777);}
                if (!is_dir('../img/thumb_game')) {mkdir('../img/thumb_game',0777);}
                if (!is_dir('../img/swf')) {mkdir('../img/swf',0777);}
                
//                foreach (scandir('depo/html/') as $deger)
//{
//if (is_file('depo/html/'.$deger)) {
//if (is_file('../tmp/html/'.$deger)) {break;}

copy("depo/html/center_down.php", "../tmp/html/center_down.php");
copy("depo/html/center_up.php", "../tmp/html/center_up.php");
copy("depo/html/footer.php", "../tmp/html/footer.php");
copy("depo/html/header.php", "../tmp/html/header.php");
copy("depo/html/left_one.php", "../tmp/html/left_one.php");
copy("depo/html/left_tree.php", "../tmp/html/left_tree.php");
copy("depo/html/left_two.php", "../tmp/html/left_two.php");
copy("depo/html/right_one.php", "../tmp/html/right_one.php");
copy("depo/html/right_two.php", "../tmp/html/right_two.php");
copy("depo/html/tepe.php", "../tmp/html/tepe.php");





//}
//}

//foreach (scandir('depo/thumb_game/') as $deger)
//{
//if (is_file('depo/thumb_game/'.$deger)) {
//if (is_file('../img/thumb_game/'.$deger)) {break;}

copy("depo/thumb_game/.htaccess", "../img/thumb_game/.htaccess");
copy("depo/thumb_game/no-pre.png", "../img/thumb_game/no-pre.png");

//}
//}


                


//if (!is_file('../config/config.php')) { copy("depo/config.php", "../config/config.php"); }
                
                
                $root_url=$_SERVER['SCRIPT_NAME'];
$root_url=str_replace('install/index.php','',$root_url);
$root_dir=$_SERVER['DOCUMENT_ROOT'];
//$root_ata=deger_ata('$root_url','"'.$root_url.'"');
//$root_ata=deger_ata('$website','"http://'.$_SERVER['HTTP_HOST'].'"');
if ($_POST['sunucu'])
{
$$link = @mysql_connect($_POST['sunucu'], $_POST['username'], $_POST['password']) or $db_error = mysql_error();
    if ($db_error!="")
    {$db_error2="Mysql Server, UserName or Password is incorect. Please write again.";}
    
    if ($db_error=="")
    {
     mysql_select_db($_POST['database']);
     $select_error=mysql_error();
    if ($select_error!="")
    {$select_error2="Incorrect Database Name. Please Write again";}
    
    }
    
    
    if ($db_error=="" && $select_error=="")
    {
    
    
    //$ata1=deger_ata('$sunucu','"'.$_POST['sunucu'].'"');
    //$ata2=deger_ata('$db_username','"'.$_POST['username'].'"');
    //$ata3=deger_ata('$db_password','"'.$_POST['password'].'"');
    //$ata4=deger_ata('$db_database','"'.$_POST['database'].'"');
    //$ata4=deger_ata('$admin_password','"'.$_POST['admin'].'"');
    
    $configdata="<?

//###IMPORTANY DONT DELETE THIS LETTER


\$sunucu=\"".$_POST['sunucu']."\";
\$db_username=\"".$_POST['username']."\";
\$db_password=\"".$_POST['password']."\";
\$db_database=\"".$_POST['database']."\";
\$admin_password=\"".$_POST['admin']."\";
\$kaynak_url=\"http://freeadultscript.com/\";
\$sutun=3;
\$satir=6;
\$video_link=\"\";
\$tag_link=\"\";
\$category_link=\"\";
\$meta_title=\"Free Adult Script V2\";
\$meta_keywords=\"free, adult, tube, video, script\";
\$meta_description=\"Free Adult tube Video Script\";
\$email=\"\";
\$website=\"http://".$_SERVER['HTTP_HOST']."\";
\$comment_yayin=1;
\$comment_enable=1;
\$commet_order=\"asc\";
\$kolonlar=\"cift.css\";
\$tag_stop=0;
\$content_stop=0;
\$ping_stop=0;
\$template=\"blend\";
\$cache_time=86400;
\$auto_cache_clean=1;
\$locale=\"en.php\";


//GAMESS

\$sutun_game=3;
\$satir_game=8;
\$game_link=\"\";
\$category_game_link=\"\";
\$tag_game_link=\"\";
\$tag_game_stop=0;
\$content_game_stop=0;
\$comment_game_yayin=1;
\$comment_game_enable=1;
\$commet_game_order=\"asc\";
\$version=\"2\";

//GAMESS END


\$root_url=\"".$root_url."\";
\$root_dir=\$_SERVER[\"DOCUMENT_ROOT\"].\"/\";



//###IMPORTANY DONT DELETE THIS LETTER

?>";

$file = fopen('../config/config.php', 'w');
    fwrite($file, $configdata);
    fclose($file);
    
    
    require_once('../config/config.php');
        require_once('../include/functions.php');
    global $conn;
    $baglanti=db_baglan();
    
    
    //###### GAME SQLLERI
    
$sql1_g="CREATE TABLE IF NOT EXISTS `category_game` (
  `id` int(11) NOT NULL auto_increment,
  `category` varchar(250) character set utf8 NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `category` (`category`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;";
    
$sql2_g="CREATE TABLE IF NOT EXISTS `comments_game` (
  `id` int(11) NOT NULL auto_increment,
  `adi` varchar(200) character set utf8 default NULL,
  `email` varchar(50) character set utf8 default NULL,
  `comment` text collate latin1_general_ci NOT NULL,
  `v_id` int(11) NOT NULL,
  `tarih` datetime NOT NULL,
  `yayin` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;";
    
$sql3_g="CREATE TABLE IF NOT EXISTS `encok_game` (
  `id` int(11) NOT NULL auto_increment,
  `kelime` varchar(250) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `kelime` (`kelime`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;";
    

$sql4_g="CREATE TABLE IF NOT EXISTS `tag_game` (
  `id` int(11) NOT NULL auto_increment,
  `kelime` varchar(250) NOT NULL,
  `tarih` datetime NOT NULL,
  `ping` int(11) NOT NULL default '0',
   `v_id` int(11) NOT NULL default '0',
  
PRIMARY KEY  (`id`),
UNIQUE KEY `kelime` (`kelime`,`v_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;";

$sql5_g="CREATE TABLE IF NOT EXISTS `game` (
  `id` bigint(20) NOT NULL auto_increment,
  `v_id` bigint(11) NOT NULL,
  `title` varchar(250) NOT NULL,
  `description` text,
  `category` int(11) NOT NULL default '0',
  `tamam` int(11) NOT NULL default '0',
  `num` int(11) NOT NULL default '0',
  `tarih` datetime NOT NULL,
  `hit` int(11) NOT NULL default '0',
  `kaynak` varchar(50) NOT NULL default 'default',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `v_id` (`v_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";


    //### GAME SQLLERI SONU
    
    
    
    
    
    $sql1="CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL auto_increment,
  `category` varchar(250) character set utf8 NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `category` (`category`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;";


$sql2="CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(11) NOT NULL auto_increment,
  `adi` varchar(200) character set utf8 default NULL,
  `email` varchar(50) character set utf8 default NULL,
  `comment` text collate latin1_general_ci NOT NULL,
  `v_id` int(11) NOT NULL,
  `tarih` datetime NOT NULL,
  `yayin` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;";



$sql3="CREATE TABLE IF NOT EXISTS `encok` (
  `id` int(11) NOT NULL auto_increment,
  `kelime` varchar(250) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `kelime` (`kelime`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;";




$sql4="INSERT INTO `encok` (`id`, `kelime`) VALUES
(29, 'erotic+video'),
(30, 'nude'),
(3, 'video'),
(28, 'porn+video'),
(27, 'hot'),
(25, 'fuck'),
(24, 'sexy'),
(23, 'erotic'),
(22, 'porn'),
(26, 'naked'),
(11, 'sex'),
(12, 'anal'),
(13, 'adult'),
(14, 'oral');";

$sql5="CREATE TABLE IF NOT EXISTS `filtre` (
  `id` int(11) NOT NULL auto_increment,
  `kelime` varchar(250) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `kelime` (`kelime`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;";


$sql6="INSERT INTO `filtre` (`id`, `kelime`) VALUES
(1, 'www.'),
(2, 'http'),
(3, '.com'),
(4, '.net'),
(5, '.org'),
(9, 'child');";

$sql7="CREATE TABLE IF NOT EXISTS `ping` (
  `id` int(11) NOT NULL auto_increment,
  `url` varchar(200) collate latin1_general_ci NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `url` (`url`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=5 ;";


$sql8="INSERT INTO `ping` (`id`, `url`) VALUES
(1, 'http://blogsearch.google.com/ping/RPC2'),
(3, 'http://rpc.weblogs.com/RPC2'),
(4, 'http://rpc.pingomatic.com');";


$sql9="CREATE TABLE IF NOT EXISTS `tag` (
  `id` int(11) NOT NULL auto_increment,
  `kelime` varchar(250) NOT NULL,
  `tarih` datetime NOT NULL,
  `ping` int(11) NOT NULL default '0',
  `v_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `kelime` (`kelime`,`v_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;";






$sql11="CREATE TABLE IF NOT EXISTS `video` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) character set utf8 NOT NULL,
  `tamam` int(11) NOT NULL default '0',
  `description` text collate latin1_general_ci NOT NULL,
  `v_id` int(11) NOT NULL,
  `num` int(11) NOT NULL default '0',
  `tarih` datetime NOT NULL,
  `hit` int(11) NOT NULL default '0',
  `category` int(11) NOT NULL default '0',
  `kaynak` varchar(50)  character set utf8 NOT NULL default 'default',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `v_id` (`v_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;";






mysql_query($sql1_g);
    echo mysql_error();
    mysql_query($sql2_g);
    echo mysql_error();
    mysql_query($sql3_g);
    echo mysql_error();
    mysql_query($sql4_g);
    echo mysql_error();
    mysql_query($sql5_g);
    echo mysql_error();
    

    
    mysql_query($sql1);
    echo mysql_error();
    mysql_query($sql2);
    echo mysql_error();
    
    mysql_query($sql3);
    echo mysql_error();
    mysql_query($sql4);
    echo mysql_error();
    mysql_query($sql5);
    echo mysql_error();
    mysql_query($sql6);
    echo mysql_error();
    mysql_query($sql7);
    echo mysql_error();
    mysql_query($sql8);
    echo mysql_error();
    mysql_query($sql9);
    echo mysql_error();
    
    mysql_query($sql11);
    echo mysql_error();
    
    
    
    
    
    
    }
    
    
    
}

            if ($_POST['sunucu'] && $db_error=="" && $select_error=="")
    {    
                
                ?>
                
                
                <h1 class="title">Installation is Complate</h1>
                
                <div class="entry">
                    <p>
                    <b><font color='red'>IMPORTANT: For Securty Reasons You MUST DELETE /install forder now!...</font></b>
          
                    
                    </p>
                </div>
                
                
                
                
                
                <? } else { ?>
                
                
   <h1 class="title">MySql and Password Settings</h1>
                
                <div class="entry">
                    <p>
                    <font color="red"><?=$db_error2;?> <?=$select_error2;?></font><br>

                    
                    <form name="sql" onSubmit="return denetle();" method="post">

MySql Server : <input type="text" value="localhost" name="sunucu" id="sunucu" /><br /><br />
MySql Database Name : <input type="text" name="database" id="database" /><br /><br />
MySql UserName : <input type="text" name="username" id="username" /><br /><br />
MySql Password : <input type="text" name="password" id="password" /><br /><br />
<hr>
Admin Login Password : <input type="text" name="admin" id="admin"  /><br /><br />
<input type="submit" value="Kaydet" />

</form>
<script language="javascript">
function denetle()
{
if (document.getElementById("sunucu").value=="") {alert("Please enter MySql Server!");return false;}
if (document.getElementById("database").value=="") {alert("Please enter MySql Database Name!");return false;}
if (document.getElementById("username").value=="") {alert("Please enter MySql UserName!");return false;}
if (document.getElementById("password").value=="") {alert("Please enter MySql Password!");return false;}
if (document.getElementById("admin").value=="") {alert("Please enter Admin Login Password!");return false;}
return true;
}
</script>
                    
                    </p>
                </div>
                
                <?  }  } ?>
                
                
                </div>
              
            
            
            
        </div>
        <!-- end content -->
        
        <div style="clear: both;">&nbsp;</div>
    </div>
    <!-- end page -->
</div>
<div id="footer">
    <p class="copyright">&copy;&nbsp;&nbsp;2010 All Rights Reserved &nbsp;&bull;&nbsp; Scripted by <a href="<?=$kaynak_url;?>">Free Adult Script V 2.1</a>.</p>
</div>
</body>
</html>



<html>

<body>


</body>
</html>

NOTE: I do NOT guarantee this will work, I do NOT guarantee that you will not run into other problems due to this code.

The install checks are there for a reason, so all you can do is try.

let me know how it goes.

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to CHMOD folder writing permissions during installation??? - Punktured - 11-12-2011 10:49 PM

Forum Jump: