Created
September 22, 2009 13:19
-
-
Save newism/191058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function update_last_revision($entry_id) | |
{ | |
global $DB, $IN; | |
$weblog_id = $IN->GBL('weblog_id'); | |
$query = $DB->query("SELECT | |
enable_versioning, | |
enable_qucksave_versioning | |
FROM exp_weblogs | |
WHERE weblog_id = '".$weblog_id | |
); | |
$enable_versioning = $query->row['enable_versioning']; | |
$enable_qucksave_versioning = $query->row['enable_qucksave_versioning']; | |
if ( ! isset($_POST['versioning_enabled'])) | |
$enable_versioning = 'n'; | |
if (isset($_POST['save']) AND $enable_qucksave_versioning == 'n') | |
$enable_versioning = 'n'; | |
if ($enable_versioning == 'y') | |
$DB->query("UPDATE `exp_entry_versioning` | |
SET `version_data` = '".addslashes(serialize($_POST))."' | |
WHERE `entry_id` = {$entry_id} | |
ORDER BY `version_id` DESC | |
LIMIT 1"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment