http://www.icyphoenix.com/viewtopic.php?f=30&t=477&p=4057#p4057
-----------------------------------
Mighty Gorgon
Tue 24 Oct, 2006 22:02

Re: Simple CHMOD Script For Linux Shell Users
-----------------------------------
I've rewritten it a bit for the new project... this is for XS plus CT5. :wink:

[codeblock syntax=php]<?php
// chmod_xs.php
// Time saver script to chmod the phpBBXS files
// Script must be executed from within the root directory of phpBBXS
// May require safemode = off

$chmod_777 = array();
$chmod_777[] ='./album_mod/upload';
$chmod_777[] ='./album_mod/upload/cache';
$chmod_777[] ='./album_mod/upload/med_cache';
$chmod_777[] ='./album_mod/upload/wm_cache';
$chmod_777[] ='./cache';
$chmod_777[] ='./ctracker/logfiles/logfile_attempt_counter.txt';
$chmod_777[] ='./ctracker/logfiles/logfile_blocklist.txt';
$chmod_777[] ='./ctracker/logfiles/logfile_debug_mode.txt';
$chmod_777[] ='./ctracker/logfiles/logfile_malformed_logins.txt';
$chmod_777[] ='./ctracker/logfiles/logfile_spammer.txt';
$chmod_777[] ='./ctracker/logfiles/logfile_worms.txt';
$chmod_777[] ='./files';
$chmod_777[] ='./files/thumbs';
$chmod_777[] ='./images/avatars';
$chmod_777[] ='./pafiledb/uploads';
$chmod_777[] ='./pafiledb/cache';
$chmod_777[] ='./pafiledb/cache/templates';
$chmod_777[] ='./pafiledb/cache/templates/ca_aphrodite';

$chmod_666 = array();
$chmod_666[] ='./includes/def_themes.php';
$chmod_666[] ='./includes/def_tree.php';
$chmod_666[] ='./includes/def_words.php';


for ( $i = 0; $i < count($chmod_777); $i++ )
{
	if (!chmod ($chmod_777[$i], 0777))
	{
		echo '<font color="#DD3333"><b>Unable to change permission of (' . $chmod_777[$i] . ')</b></font><br />';
	}
	else
	{
		echo '<font color="#228844"><b>Successfully chmodded (' . $chmod_777[$i] . ')</b></font><br />';
	}
}

for ( $i = 0; $i < count($chmod_666); $i++ )
{
	if (!chmod ($chmod_666[$i], 0666))
	{
		echo '<font color="#DD3333"><b>Unable to change permission of (' . $chmod_666[$i] . ')</b></font><br />';
	}
	else
	{
		echo '<font color="#228844"><b>Successfully chmodded (' . $chmod_666[$i] . ')</b></font><br />';
	}
}

?>[/codeblock]

[quote user="moreteavicar" post="3889"]I think we both suffer from multiple installing! [/quote]
Yes... of course! :mrb:

[quote user="moreteavicar" post="3889"]If you're thinking of adding it into the install script, I was thinking about adding some logic to use the ftp_chmod protocol if the standard php chmod returns false (added to that, might be worth checking the file/folder exists before resorting to ftp). However, that would then require another screen prompt for users to input their ftp host, username and password. Although in all, it might not sound much quicker than a user doing it manually, it is a way of avoiding those common chmod installation errors as experienced by the average newcomer![/quote]
Regarding this I have to think about it... I don't know how to implement it... if you have some ideas, please go working on it! :lol:


