Файл: adultscript-2.0.3-pro/files/install/upgrade-1.0.10-to-1.0.11.php
Строк: 313
<?php
define('_VALID', true);
define('_INSTALL', true);
require '../libraries/bootstrap.php';
require 'functions.php';
set_time_limit(0);
error_reporting(E_ALL);
ini_set('display_errors', 1);
if (ini_get('date.timezone') == '') {
date_default_timezone_set('Europe/Helsinki');
}
$uri = get_uri();
define('INSTALL_URL', BASE_URL.'/install');
$errors = array();
$finished = false;
$test = VF::factory('test');
$required = $test->get_required_results();
$optional = $test->get_optional_results();
$recommended = $test->get_recommended_results();
if (isset($_POST['submit-upgrade'])) {
$db = VF::factory('database');
$db->query("CREATE TABLE `photo_servers` (
`server_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`server_name` varchar(100) NOT NULL DEFAULT '',
`ftp_host` varchar(255) NOT NULL DEFAULT '',
`ftp_port` tinyint(5) unsigned NOT NULL DEFAULT '21',
`ftp_username` varchar(100) NOT NULL DEFAULT '',
`ftp_password` varchar(100) NOT NULL DEFAULT '',
`ftp_root` varchar(100) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL DEFAULT '',
`total_photos` int(11) unsigned NOT NULL DEFAULT '0',
`last_used` int(11) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`server_id`,`status`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8");
$db->query("ALTER TABLE #__photo ADD `server` int(11) unsigned not null default '0' after album_id");
$db->query("SELECT code FROM #__language");
$rows = $db->fetch_rows();
foreach ($rows as $row) {
$code = $row['code'];
language_add($code, 'frontend', 'global', array(
'watch' => 'Watch',
'pornstar' => 'Pornstar'
), NULL);
language_add($code, 'frontend', 'mobile', array(
'upgrade-button' => 'Upgrade',
'upgrade-title' => 'Upgrade your account',
'comments' => 'Comments',
'comment-approve-success' => 'Comment approved!',
'comment-approve-access' => 'You are not allowed to approve this comment!',
'comment-approve-login' => 'Please login to approve comments!',
'comment-delete-access' => 'You are not allowed to delete this comment!',
'comment-delete-success' => 'Comment deleted!',
'comment-missing' => 'Video not found!',
'comment-login-delete' => 'Please login to delete comments!',
'favorites-title' => 'Favorite Videos',
'favorite-already' => 'You already added this video to your favorites list!',
'favorite-success' => 'Video added to your favorites list!',
'favorite-own' => 'You cannot add your own video to favorites!',
'favorite-login' => 'Please login to favorite videos!',
'favorite' => 'Favorite',
'dislike' => 'Dislike',
'like' => 'Like',
'favorites' => 'Favorites',
'views' => 'Views',
'length' => 'Length',
'rating' => 'Rating',
'now' => 'now',
'by' => 'By',
'post-comment' => 'Post Comment',
'more-comments' => 'Load more comments!',
'comment-success' => 'Comment posted!',
'comment-approve' => 'Comment posted! Will appear online once approved!',
'comment-allow-no' => 'You are not allowed to comment on this video!',
'comment-length' => 'Comment can contain maximum 500 characters!',
'comment-empty' => 'Please enter your comment!',
'comments-login' => 'Please login as a %s to post comments!',
'comments-disabled' => 'Comments disabled! Please try again later!',
'dont-spam' => 'Please dont spam!',
'rating-success' => 'Thank you for rating!',
'video-invalid' => 'Invalid video!',
'rating-already' => 'Already rated!',
'rating-login' => 'Please loginto rate videos!',
'rating-disabled' => 'Rating disabled. Please try again later!'
), NULL);
VF::cache_del($code.'.frontend.global', 'language');
VF::cache_del($code.'.frontend.mobile', 'language');
VConfig::add('photo', 'multi_server', '1');
VConfig::add('photo', 'thumb_server', '0');
VConfig::add('photo', 'thumb_host', '');
VConfig::add('photo', 'thumb_port', '');
VConfig::add('photo', 'thumb_user', '');
VConfig::add('photo', 'thumb_pass', '');
VConfig::add('photo', 'thumb_root', '');
VConfig::add('mobile', 'view_access', 'all');
VConfig::add('mobile', 'view_desc', '1');
VConfig::add('mobile', 'view_comments', '1');
VConfig::add('mobile', 'allow_comment', '1');
VConfig::add('mobile', 'approve_comments', '0');
VConfig::add('mobile', 'comments_per_page', '10');
VConfig::add('mobile', 'allow_rating', '1');
VConfig::add('mobile', 'rating_count', '1');
VConfig::add('mobile', 'rating_type', 'ip');
VConfig::add('mobile', 'download', '0');
VConfig::add('mobile', 'download_perms', 'all');
VF::cache_del('photo', 'module');
VF::cache_del('mobile', 'module');
}
$finished = TRUE;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>Adult Script Pro Installation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<?php echo INSTALL_URL ?>/css/style.css?v1" type="text/css" media="all" />
<script type="text/javascript">
var base_url = "<?php echo BASE_URL; ?>";
</script>
</head>
<script type="text/javascript" src="<?php echo INSTALL_URL; ?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("img[id^='help_']").click(function() {
var id = $(this).attr('id').match(/help_(.*)/)[1];
if ($("p[id='test_" + id + "']").is(':visible')) {
$("p[id='test_" + id + "']").slideUp();
} else {
$("p[id='test_" + id + "']").slideDown();
}
});
});
</script>
<body>
<div id="container">
<?php if (!$finished): ?>
<?php if ($errors): ?>
<div class="errors">
<?php foreach ($errors as $error): ?>
<span><?php echo htmlspecialchars($error),'<br />'; ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="left width-475">
<h2>Testing Requirements</h2>
<div class="box-content">
<h3>Required Items</h3>
<?php foreach ($required as $id => $values): if (!isset($values['system'])): ?>
<span class="key"><?php if ($values['status'] !== true): echo '<strong>'; endif; ?><?php echo htmlspecialchars($values['message']); ?><?php if ($values['status'] !== true): echo '</strong>'; endif; ?></span>
<span class="value">
<?php if ($values['status'] === true): ?>
<img src="<?php echo INSTALL_URL; ?>/images/accept.png" alt="accept.png" />
<?php else: ?>
<img src="<?php echo INSTALL_URL; ?>/images/help.png" id="help_<?php echo $id; ?>" class="help" alt="help.png" />
<?php if (isset($values['warning']) && $values['warning'] == '1'): ?>
<img src="<?php echo INSTALL_URL; ?>/images/error.png" alt="error.png" />
<?php else: ?>
<img src="<?php echo INSTALL_URL; ?>/images/delete.png" alt="delete.png" />
<?php endif; endif; ?>
</span>
<div class="clear"></div>
<p id="test_<?php echo $id; ?>" style="display: none;"><?php echo htmlspecialchars($values['error']); ?></p>
<?php endif; endforeach; ?>
<h3>Required PHP Settings</h3>
<?php foreach ($recommended as $id => $values): if (!isset($values['system'])): ?>
<span class="key"><?php if ($values['status'] !== true): echo '<strong>'; endif; ?><?php echo htmlspecialchars($values['message']); ?><?php if ($values['status'] !== true): echo '</strong>'; endif; ?></span>
<span class="value">
<?php if ($values['status'] === true): ?>
<img src="<?php echo INSTALL_URL; ?>/images/accept.png" alt="accept.png" />
<?php else: ?>
<img src="<?php echo INSTALL_URL; ?>/images/help.png" id="help_<?php echo $id; ?>" class="help" alt="help.png" />
<?php if ($values['warning'] == '1'): ?>
<img src="<?php echo INSTALL_URL; ?>/images/error.png" alt="error.png" />
<?php else: ?>
<img src="<?php echo INSTALL_URL; ?>/images/delete.png" alt="delete.png" />
<?php endif; endif; ?>
</span>
<div class="clear"></div>
<p id="test_<?php echo $id; ?>" style="display: none;"><?php echo htmlspecialchars($values['error']); ?></p>
<?php endif; endforeach; ?>
<h3>Optional Items</h3>
<?php foreach ($optional as $id => $values): if (!isset($values['system'])): ?>
<span class="key"><?php if ($values['status'] !== true): echo '<strong>'; endif; ?><?php echo htmlspecialchars($values['message']); ?><?php if ($values['status'] !== true): echo '</strong>'; endif; ?></span>
<span class="value">
<?php if ($values['status'] === true): ?>
<img src="<?php echo INSTALL_URL; ?>/images/accept.png" alt="accept.png" />
<?php else: ?>
<img src="<?php echo INSTALL_URL; ?>/images/help.png" id="help_<?php echo $id; ?>" class="help" alt="help.png" />
<img src="<?php echo INSTALL_URL; ?>/images/error.png" alt="error.png" />
<?php endif; ?>
</span>
<div class="clear"></div>
<p id="test_<?php echo $id; ?>" style="display: none;"><?php echo htmlspecialchars($values['error']); ?></p>
<?php endif; endforeach; ?>
<form name="test-form" method="post" action="<?php echo BASE_URL; ?>/install/upgrade-1.0.10-to-1.0.11.php?a=test">
<div class="submit">
<input name="submit-test" type="submit" id="submit-test" class="submit" value="Run Tests Again" />
</div>
</form>
</div>
</div>
<div class="right width-475">
<h2>Upgrade Options</h2>
<div class="box-content">
<form id="upgrade-form" method="post" action="<?php echo BASE_URL; ?>/install/upgrade-1.0.10-to-1.0.11.php?a=upgrade">
<div class="submit">
<input name="submit-upgrade" type="submit" id="submit-upgrade" class="submit" value="Upgrade >"<?php if ($test->is_error() === true): echo ' disabled="1"'; endif; ?> />
</div>
</form>
</div>
</div>
<div class="clear"></div>
<?php else: ?>
<div class="box">
<h1>Congratulations! Adult Script Pro has been upgraded!</h1>
<br />Adult Script Pro 1.0.11 continues to improve the mobile experience. Please update your mobile configuration options<br />
from Admin -> Extend -> Module Manager -> mobile -> config.<br /><br />
<br />Click on the 'Site' button to view your site or 'Administrator' button to configure installed upgrades!
<div class="links">
<a href="<?php echo BASE_URL; ?>">Site</a>
<a href="<?php echo ADMIN_URL; ?>/index.php">Administrator Panel</a>
</div>
<div class="install">
Please completly remove the installation directory (/install). This is a security feature!
</div>
</div>
<?php endif; ?>
</div>
</body>
</html>