First error you posted is fixed. The second will occur after any SQL error, so they are linked and therefore it is fixed as well.
Freon22 wrote:Another question?
I like the list you have on the login page. What program are you using to get that infor. I can get my ToDo: list on each page in my editor and my lines are numbered so thats a given. But you have total lines of all pages I like that don't have to add each page total to find your total lines.
Also in your Number of Scource Files in SMR 1.5 is that just your Classes or a count of pages, images, and classes?
Its just PHP code I made. Here it is if you are interested.
Code: Select all
$scan_ext = array('inc','php','.js','css','tml','htm');
$scan[] = '../../game_files/';
$scan[] = '../game/';
$num_lines = 0;
$num_files = 0;
$mod = 0;
$todo = array();
while (sizeof($scan) > 0)
{
$dir = array_shift($scan);
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false)
{
if ($file == '.' || $file == '..' || is_numeric($file)) continue;
if (filetype($dir . $file) == 'dir') $scan[] = $dir . $file . '/';
else $files[] = $dir . $file;
}
closedir($dh);
}
}
foreach ($files as $fileName)
{
if (!in_array(substr($fileName, -3),$scan_ext)) continue;
$num_files++;
$handle = fopen($fileName, "r");
$contents = fread($handle, filesize($fileName));
fclose($handle);
$lines = preg_split('/[\n\r]+/',$contents);
$num_lines += sizeof($lines);
if (filemtime($fileName) >= (time() - 3600 * 24)) $mod++;
foreach ($lines as $text)
{
if (substr($text,0,6) == '//TODO' || substr($text,0,7) == '// TODO')
{
$todo[] = str_replace('../','',$fileName) . ' : ' . $text;
}
}
}
echo '<table class="standard">';
echo '<tr><td colspan="2" class="center">Current Status: (Auto Generated Material Not Included)</td></tr>';
echo '<tr><td class="right">Number of Scource Files in SMR 1.5</td><td class="left">' . $num_files . '</td></tr>';
echo '<tr><td class="right">Number of Lines in SMR 1.5</td><td class="left">' . $num_lines . '</td></tr>';
echo '<tr><td class="right">Number of Files Modified/Created in the last 24 Hours</td><td class="left">' . $mod . '</td></tr>';
echo '<tr><td class="right">Number of "TODO" tasks.</td><td class="left">' . sizeof($todo) . '</td></tr>';
echo '</table>';
if (isset($_REQUEST['todo']))
{
echo '<pre>';
print_r($todo);
echo '</pre>';
}
echo '</body></html>';
Basically $scan_ext tells the script what extensions (the last 3 letters of each extension really).
The script then scans all game directories ($scan[] = '../game/' and the other $scan[] = initiate the directories to look in) and puts the files into an array to be read later. It skips all folders with numeric names. This is because in my project anything with a numeric name means it is auto-generated and I didn't directly code it.
It then looks at every entry in the file array. It adds 1 to the file count (so the file count displayed is the count of the number of .php, .inc, .html, .htm, .css files). It opens the file, reads the number of lines and then goes through each line to determine if it has a TODO task.
It also has a nice function that only I see
[Last 6 or so lines of code]
If you go to
http://game.azool.us/login.php?todo it will show you all the TODO lines and the script they are on. It most likely won't mean anything to you, but it saves me a lot of time of searching scripts to make sure they are complete.
Men are born to succeed, not fail.
-Henry David Thoreau