//Password
$admin_password = $nss->get('admin_password');
//Abspath
$protocol = array_key_exists('HTTPS', $_SERVER) ? "https://" : "http://";
$absolute_path = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/nss-admin/') + 1);
//Config
$nss_root = $nss->get('nss_root');
$cache_time = $nss->get('cache_time');
$debug_mode = $nss->get('debug_mode');
$facebook_feedback = $nss->get('facebook_feedback');
$date_time_format = $nss->get('date_time_format');
$theme = $nss->get('theme');
$error_no_data = $nss->get('error_no_data');
$channel_count = $nss->get('channel_count');
//Update available?
$update_available = is_update_available($nss);
//License
$license_name = $nss->get('license_name');
$license_owner = $nss->get('license_owner');
$license_key = $nss->get('license_key');
$license_sites_array = explode(',', $nss->get('license_sites'));
$license_sites = preg_replace('/,/', ',<br>', $nss->get('license_sites'));
$license_code = $nss->get('license_code');
$license_limit = intval($nss->get('license_limit'));
$license_status = $nss->get('license_status');
$current_site = $_SERVER['HTTP_HOST'];
if ($license_name == '') {
    $license_name = '<span class="error">Missing license key</span>';
}
if ($license_status == '') {
    $license_status = '<span class="error">Missing license key</span>';
Exemplo n.º 2
0
function portraiture_updates()
{
    ?>
<div class="wrap">
    <h2>Portraiture Theme Updates</h2>
    
<?php 
    if (is_update_available()) {
        ?>
	<h3>New Version of Portraiture is Available.</h3>
	<a href="<?php 
        echo $update_info->download_link;
        ?>
" class="button" >Download <?php 
        echo $update_info->version;
        ?>
</a> released on: <?php 
        echo date('D d M Y', strtotime($update_info->released));
    } else {
        ?>
	<h3>You have the latest version of Portraiture.</h3>
	<p>You already have the latest version of Portraiture installed. You don't need to update. However, You can always show support for Portraiture by spreading the message. Your help is appreciated.</p>
		<table width="100%">
            <tr>
                <td>
                    <a name="fb_share" type="box_count" share_url="http://portraiture.neerajkumar.name" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
                </td>
                <td>
                	<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://portraiture.neerajkumar.name" data-count="vertical" data-via="codemastersnake">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
                </td>
                <td>
                    <script type="text/javascript">
                        (function() {
                        var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
                        s.type = 'text/javascript';
                        s.async = true;
                        s.src = 'http://widgets.digg.com/buttons.js';
                        s1.parentNode.insertBefore(s, s1);
                        })();
                        </script>
                    <a class="DiggThisButton DiggMedium"
href="http://digg.com/submit?url=http%3A//portraiture.neerajkumar.name"></a>
                </td>
                <td>
                    <a title="Post to Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://portraiture.neerajkumar.name"></a>
<script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script>
                </td>
                <td>
                    <script src="http://www.stumbleupon.com/hostedbadge.php?s=5&r=http://portraiture.neerajkumar.name"></script>
                </td>
            </tr>

        </table>
<?php 
    }
    ?>
	<h4>Release Information about version <?php 
    echo $update_info->version;
    ?>
</h4>
	<?php 
    echo $update_info->release_info;
    ?>
</div>
<?php 
}
Exemplo n.º 3
0
    $id = str_replace($repo_url . "/commit/", "", $href);
    return $id;
}
function is_update_available()
{
    global $current_commit_id;
    global $commit_id_file;
    $latest = get_latest_commit_id();
    if ($current_commit_id !== $latest) {
        // set the id
        file_put_contents($commit_id_file, $latest);
        return true;
    }
    return false;
}
if ($to_do && !is_update_available()) {
    $to_do = false;
}
function deleteDirectory($dir)
{
    if (!file_exists($dir)) {
        return true;
    }
    if (!is_dir($dir) || is_link($dir)) {
        return unlink($dir);
    }
    foreach (scandir($dir) as $item) {
        if ($item == '.' || $item == '..') {
            continue;
        }
        if (!deleteDirectory($dir . "/" . $item)) {