I absolutely hate advertisement bots, and i wish that their inventors would be blessed with a flesh eating virus. I have been fighting a losing battle over the last two years to regain control over my forums, claiming it back from the shitty bots, and i think i have finally figured things out.
Below is the beginnings of a script that you can run on a semi regular basis and keep your PHPBB3 Databases cleaned of ridiculous bullshit landing on your forum. Just remember to log in from time to time to resynchronize your statistics.
Continue reading “My Forums”
One thing that seems to always irritate me when im trying to organize my backups together is how the file sizes bloat over time. You can, and probably should look into optimizing your tables but for those of you who dont have the time or the will power to care to do it in any other method if you place this function at the top of your automated backup script and simply call it appropriately you will be able to automate the process of optimizing all tables that dont meet your threshold and or maximum free space requirements.
You can just set up a cron job to call your PHP scripts and it should take care of things from there.
$_CONFIG['threshold'] = 0.01;
$_CONFIG['maxfreedata'] = 102400;
function optimizeDatabase($host, $user, $pass, $dbase)
$mysqli = new mysqli($host, $user, $pass, $dbase);
printf("Connect failed: %sn", mysqli_connect_error());
if ($result = $mysqli->query('SHOW TABLE STATUS WHERE '.
'(Data_free / Data_length) > ' . $_CONFIG['threshold'] .
' AND Data_free > ' . $_CONFIG['maxfreedata']))
print 'Optimizing Database: ' . $dbase . "n";
while ($row = $result->fetch_object())
printf("%-25s %8d %8dn", $row->Name,
$mysqli->query('OPTIMIZE TABLE ' . $row->Name);
optimizeDatabase('localhost', 'User', 'Password', 'Database');
Continue reading “Atheist Nation Chat System”
Moving from static to dynamic pages in web applications has two routes: Flat files and databases. Being that I had a C background I was unimpressed by databases, but I was intrigued by them at the same time because I didn’t understand their purpose in applications. I had very little experience with databases and would have to learn them on my own, since it was midterm at school and no one I trusted knew was able to handle PHP well enough to teach me how to make PHP handle databases. I found my way, but did a lot of stupid shit along the road.
Continue reading “Chronicles of Swallowbush – My MySQL”