Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
<?php
include(dirname(__FILE__).'/gallery.php');
$query = "SELECT * FROM `plogger_pictures` WHERE 1";
$result = run_query($query);
while ($row = mysql_fetch_assoc($result)) {
$old_path = $row['path'];
$basename = basename($row['path']);
$path = dirname($row['path']).'/';
$new_path = $path.str_replace('_', '-', $basename);
if ($new_path != $old_path) {
$move = @rename(PLOGGER_DIR.'images/'.$old_path, PLOGGER_DIR.'images/'.$new_path);
if (!$move) {
echo "\n".'<li>Error renaming filename from <strong>'.basename($old_path).'</strong> to <strong>'.basename($new_path).'</strong></li>';
} else {
$sql = "UPDATE `plogger_pictures` SET `path` = '".mysql_real_escape_string($new_path)."' WHERE `id` = ".$row['id'];
$sql_result = run_query($sql);
if (!$sql_result) {
echo "\n".'<li>Error updating filename in database for <strong>'.basename($old_path).'</strong></li>';
} else {
echo "\n".'<li>Updated filename to <strong>'.basename($new_path).'</strong></li>';
}
}
}
}
echo "\n".'<br />Done!';
?>
<?php
include(dirname(__FILE__).'/gallery.php');
$query = "SELECT * FROM `plogger_pictures` WHERE 1";
$result = run_query($query);
while ($row = mysql_fetch_assoc($result)) {
$old_path = $row['path'];
$basename = basename($row['path']);
$path = dirname($row['path']).'/';
$new_path = $path.str_replace('_', '-', $basename);
if ($new_path != $old_path) {
$move = @rename(PLOGGER_DIR.'plog-content/images/'.$old_path, PLOGGER_DIR.'plog-content/images/'.$new_path);
if (!$move) {
echo "\n".'<li>Error renaming filename from <strong>'.basename($old_path).'</strong> to <strong>'.basename($new_path).'</strong></li>';
} else {
$sql = "UPDATE `plogger_pictures` SET `path` = '".mysql_real_escape_string($new_path)."' WHERE `id` = ".$row['id'];
$sql_result = run_query($sql);
if (!$sql_result) {
echo "\n".'<li>Error updating filename in database for <strong>'.basename($old_path).'</strong></li>';
} else {
echo "\n".'<li>Updated filename to <strong>'.basename($new_path).'</strong></li>';
}
}
}
}
echo "\n".'<br />Done!';
?>
1 to 9 of 9