Вход Регистрация
Файл: adultscript-2.0.3-pro/files/install/upgrade-1.0rc2-to-1.0rc3.php
Строк: 206
<?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');
    
    
// updating player configurations with license/logo
    
$db->query("SELECT player_id, config, config_cache
                FROM #__player"
);
    
$players     $db->fetch_rows();
    
$pupdate    = array(
        
'license'    => '',
        
'logo'        => '',
        
'top'        => 0,
        
'left'        => 0,
        
'bottom'    => 5,
        
'right'        => 20
    
);
    foreach (
$players as $player) {
        
$config         array_merge(unserialize($player['config']), $pupdate);
        
$config_cache    array_merge(unserialize($player['config_cache']), $pupdate);
        
$db->query("UPDATE #__player
                    SET config = '"
.$db->escape(serialize($config))."',
                        config_cache = '"
.$db->escape(serialize($config_cache))."'
                    WHERE player_id = "
.(int) $player['player_id']."
                    LIMIT 1"
);
    }
    
    
// updating some advertising groups
//    $db->query("INSERT INTO #__adv_groups
//                SET adv_group_name = 'Video Category Square',
//                    adv_group_desc = 'Video Category Square Advertising',
//                    adv_group_slug = 'video-category-square'");
    
    // fixing unsigned bug with mysql 5.5
    
$db->query("ALTER TABLE `#__video` CHANGE `total_comments` `total_comments` int(11) NOT NULL default '0'");    
    
$db->query("ALTER TABLE `#__video` CHANGE `total_favorites` `total_favorites` int(11) NOT NULL default '0'");
    
$db->query("ALTER TABLE `#__user_activity` CHANGE `total_video_comments` `total_video_comments` int(11) NOT NULL default '0'");
    
$db->query("ALTER TABLE `#__user_activity` CHANGE `total_topics` `total_topics` int(11) NOT NULL default '0'");
    
$db->query("ALTER TABLE `#__user_activity` CHANGE `total_posts` `total_posts` int(11) NOT NULL default '0'");
    
    
$db->query("ALTER TABLE #__video_categories ADD `auto_term` varchar(255) NOT NULL default ''");
    
$db->query("SELECT cat_id, name FROM #__video_categories");
    
$categories $db->fetch_rows();
    foreach (
$categories as $category) {
        
$db->query("UPDATE #__video_categories
                    SET auto_term = '"
.$db->escape(strtolower($category['name']))."'
                    WHERE cat_id = "
.(int) $category['cat_id']."
                    LIMIT 1"
);
    }
    
    
$db->query("ALTER TABLE `#__video` DROP KEY `title`");
    
$db->query("ALTER TABLE `#__video` ADD FULLTEXT KEY `title` (`title`)");
    
    
$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.0rc2-to-1.0rc3.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.0rc2-to-1.0rc3.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 /><i>This upgrade contains a few important flash player configuration changes. Please log to your site's Administration
        Panel and reconfigure every player profile from Admin -> Video -> Player -> Edit. You need to do this even if you dont
        have a commercial Flowplayer license. WARNING: Your videos will not play without this update!</i><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>
Онлайн: 0
Реклама