0

I have bought this Theme on CodeCanyon and would like to install it now, but the browser says that there is a unexpected end of file in index.php on line 150. The problem seems to be, that there is a condition regarding the php version. It should be 5.2.16 - I have 5.5 - is it to new or is there an other problem?

<?php
require_once "../config.php";
if(!defined('ROOT_PATH') || ROOT_PATH==''){
die(get_text("ROOT_PATH_NOT_SET"));
}
if(!file_exists(ROOT_PATH."/liveblog/install/handler.php")){
die(get_text("INVALID_ROOT_PATH"));
}
if(file_exists(ROOT_PATH.'/liveblog/db/live_blogs.db')){
die(get_text("ULB_ALREADY_INSTALLED"));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Ultimate Live Blog - <?=get_text("INSTALLATION")?></title>
<meta name="description" content="Live blogging made easy with Ultimate Live Blog"/>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
<script type="text/javascript" src="../js/swfobject.js"></script>
<style type="text/css">
</style>
<script type="text/javascript">
var readyToGo = false;
var connected = false;
 function throwResponse(desc, type){
    $('html, body').animate( { scrollTop: 0 }, 600 );
if(type=='1'){
    var pid = 'err-mess';
    }else{
    var pid = 'ok-mess';
    }
$('.info-message').css("display", "block").attr('id', pid).children('p').html(desc);

}
function securityOkay(){
connected = true;
}
$(document).ready(function () {


    $("#btn-install").click(function(){
    if($("#server").val()=='' || $("#devkey").val()=='' || $("#aname").val()=='' || $("#upass").val()=='' || $("#apassre").val()==''){

         throwResponse("<?=get_text("FILL_ALL_FIELDS")?>", 1);
    }else{
$.getJSON("handler.php?final="+connected+"&server="+encodeURIComponent($("#server").val())+"&devkey="+encodeURIComponent($("#devkey").val())+"&name="+encodeURIComponent($("#aname").val())+"&pass="+encodeURIComponent($("#apass").val())+"&repass="+encodeURIComponent($("#apassre").val()), function (data) {
   if (data.length != 0) {
        if (data[0]['error'] == undefined) {
        $('.info-message').css("display", "none");
        readyToGo = true;

        if(readyToGo && !connected){
        $("#p2p-object").slideDown();
           var flashvars = {
        stype: "install",
        server: $("#server").val(),
        devkey: $("#devkey").val()
    };
    var params = {
        menu: "false",
        scale: "noScale",
        allowScriptAccess: "always",
        wmode: "opaque"
    };
    var attributes = {
        id: "secAllow"
    };
    swfobject.embedSWF("../p2p.swf", "secAllow", "300", "150", "10", "http://<?=$_SERVER['SERVER_NAME']?>/liveblog/expressInstall.swf", flashvars, params, attributes);
    }
    if(readyToGo && connected){
    $("#install-form").fadeOut(500);
    $("#install-note").fadeIn(200);
    throwResponse("<?=get_text("INSTALLED_SUCCESSFULLY")?>", 2);
    }
    }else{
        var tmp = data[0]['error'];
    throwResponse(tmp, 1);
    }
    }
    });
}

    });
   });
</script>
</head>
<body>
<div id="window">
<div class="header-title"><?=get_text("INSTALLATION")?></div>
<?php
 if (strnatcmp(phpversion(),'5.2.16') >= 0) 
{
//that's ok
}
else 
{ 
$tmp = str_replace('<ver>', phpversion(), get_text("UNSUPPORTED_PHP_VERSION"));
$errors[] = $tmp; // 150th line!!!!!
}

?>
<?php if(!isset($errors)){?>
<div class="info-message" id="i-mess"><p><?=get_text("THANKS_FOR_BUYING")?></p></div>
<div id="install-form">
<p class="desc"><?=get_text("ADOBE_CIRRUS_SETTINGS")?> (<?=get_text("REFER_DOCUMENTATION")?>)</p>
<div class="field-section"><span><?=get_text("SERVER")?>:</span><input type="text" id="server" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div class="field-section"><span><?=get_text("DEVKEY")?>:</span><input type="text" id="devkey" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<p class="desc"><?=get_text("SET_UP_ADMIN")?></p>
<div class="field-section"><span><?=get_text("USERNAME")?>:</span><input type="text" id="aname" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div class="field-section"><span><?=get_text("PASSWORD")?>:</span><input type="password" id="apass" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div class="field-section"><span><?=get_text("CONFIRM_PASSWORD")?>:</span><input type="password" id="apassre" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div id="p2p-object" style="display:none;">
<p class="desc"><?=get_text("P2P_CLICK_ALLOW")?></p>
<div style="width:300px;margin:0px auto;">
<div id="secAllow" style="text-align:center;font-size:18px;" name="secAllow"><p>
<?php
$tmp = str_replace('<url>', '<a href="http://www.adobe.com/go/getflashplayer" target="_blank">', get_text("NEED_UPDATE_FLASH_PLAYER"));
$tmp = str_replace('</url>', '</a>', $tmp);
echo $tmp;
?>
</p></div>
</div></div>
<a href="javascript:void(0)" class="button" id="btn-install"><?=get_text("INSTALL")?></a>
</div>
<div id="install-note">
<h1><?=get_text("READY_TO_GO")?></h1>
<p><?php
$tmp = str_replace('<url>', '<a href="http://'.$_SERVER['SERVER_NAME'].'/liveblog/panel">', get_text("INSTALLED_TEXT"));
$tmp = str_replace('</url>', '</a>', $tmp);
echo $tmp;
?></p>
</div>
<? }else{
foreach($errors as $mess){
echo '<div class="info-message" id="err-mess" style="margin:15px auto;"><p>'.$mess.'</p></div>';
}
echo '<p class="desc">'.get_text("CORRECT_ERRORS_THEN_RELOAD").'</p>';
} ?>

</div>
</body>
</html>
3
  • 1
    Which one is your 150th line? Commented May 18, 2014 at 10:11
  • This usually indicates you're missing a closing curly brace somewhere. Check all your braces are closed properly. Commented May 18, 2014 at 10:12
  • I added a comment on the 150th line now. Yes I checked it, but I don´t see anything... Commented May 18, 2014 at 10:14

2 Answers 2

1

You should change in line 141

<? }else{

into

<?php }else{

because probably in your configuration you don't have short tags enabled

Sign up to request clarification or add additional context in comments.

Comments

0

try this:

<?php
    require_once "../config.php";
    if(!defined('ROOT_PATH') || ROOT_PATH==''){
        die(get_text("ROOT_PATH_NOT_SET"));
    }
    if(!file_exists(ROOT_PATH."/liveblog/install/handler.php")){
        die(get_text("INVALID_ROOT_PATH"));
    }
    if(file_exists(ROOT_PATH.'/liveblog/db/live_blogs.db')){
        die(get_text("ULB_ALREADY_INSTALLED"));
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Ultimate Live Blog - <?=get_text("INSTALLATION")?></title>
    <meta name="description" content="Live blogging made easy with Ultimate Live Blog"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <script type="text/javascript" src="../js/swfobject.js"></script>
    <script type="text/javascript">
        var readyToGo = false;
        var connected = false;
        function throwResponse(desc, type){
            $('html, body').animate( { scrollTop: 0 }, 600 );
            if(type=='1'){
                var pid = 'err-mess';
            }
            else{
                var pid = 'ok-mess';
            }
            $('.info-message').css("display", "block").attr('id', pid).children('p').html(desc);
        }
        function securityOkay(){
            connected = true;
        }
        $(document).ready(function () {
            $("#btn-install").click(function(){
                if($("#server").val()=='' || $("#devkey").val()=='' || $("#aname").val()=='' || $("#upass").val()=='' || $("#apassre").val()==''){

                    throwResponse("<?=get_text("FILL_ALL_FIELDS")?>", 1);
                }
                else{
                    $.getJSON("handler.php?final="+connected+"&server="+encodeURIComponent($("#server").val())+"&devkey="+encodeURIComponent($("#devkey").val())+"&name="+encodeURIComponent($("#aname").val())+"&pass="+encodeURIComponent($("#apass").val())+"&repass="+encodeURIComponent($("#apassre").val()), function (data) {
                        if (data.length != 0) {
                            if (data[0]['error'] == undefined) {
                                $('.info-message').css("display", "none");
                                readyToGo = true;

                                if(readyToGo && !connected){
                                    $("#p2p-object").slideDown();
                                    var flashvars = {
                                            stype: "install",
                                            server: $("#server").val(),
                                            devkey: $("#devkey").val()
                                        };
                                    var params = {
                                            menu: "false",
                                            scale: "noScale",
                                            allowScriptAccess: "always",
                                            wmode: "opaque"
                                        };
                                    var attributes = {
                                            id: "secAllow"
                                        };
                                    swfobject.embedSWF("../p2p.swf", "secAllow", "300", "150", "10", "http://<?=$_SERVER['SERVER_NAME']?>/liveblog/expressInstall.swf", flashvars, params, attributes);
                                }
                                if(readyToGo && connected){
                                    $("#install-form").fadeOut(500);
                                    $("#install-note").fadeIn(200);
                                    throwResponse("<?=get_text("INSTALLED_SUCCESSFULLY")?>", 2);
                                }
                            }
                            else{
                                var tmp = data[0]['error'];
                                throwResponse(tmp, 1);
                            }
                        }
                    });
                }
            });
        });
</script>
</head>
<body>
<div id="window">
<div class="header-title"><?=get_text("INSTALLATION")?></div>
<?php
    if (strnatcmp(phpversion(),'5.2.16') <= 0) {
         $tmp = str_replace('<ver>', phpversion(), get_text("UNSUPPORTED_PHP_VERSION"));
         $errors[] = $tmp; // 150th line!!!!!
    }
?>
<?php 
    if(!isset($errors)){
?>
<div class="info-message" id="i-mess"><p><?=get_text("THANKS_FOR_BUYING")?></p></div>
<div id="install-form">
<p class="desc"><?=get_text("ADOBE_CIRRUS_SETTINGS")?> (<?=get_text("REFER_DOCUMENTATION")?>)</p>
<div class="field-section"><span><?=get_text("SERVER")?>:</span><input type="text" id="server" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div class="field-section"><span><?=get_text("DEVKEY")?>:</span><input type="text" id="devkey" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<p class="desc"><?=get_text("SET_UP_ADMIN")?></p>
<div class="field-section"><span><?=get_text("USERNAME")?>:</span><input type="text" id="aname" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div class="field-section"><span><?=get_text("PASSWORD")?>:</span><input type="password" id="apass" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div class="field-section"><span><?=get_text("CONFIRM_PASSWORD")?>:</span><input type="password" id="apassre" class="text-input" style="float:left;"/>
<div style="clear:both;"></div></div>
<div id="p2p-object" style="display:none;">
<p class="desc"><?=get_text("P2P_CLICK_ALLOW")?></p>
<div style="width:300px;margin:0px auto;">
<div id="secAllow" style="text-align:center;font-size:18px;" name="secAllow"><p>
<?php
    $tmp = str_replace('<url>', '<a href="http://www.adobe.com/go/getflashplayer" target="_blank">', get_text("NEED_UPDATE_FLASH_PLAYER"));
    $tmp = str_replace('</url>', '</a>', $tmp);
    echo $tmp;
?>
</p></div>
</div></div>
<a href="javascript:void(0)" class="button" id="btn-install"><?=get_text("INSTALL")?></a>
</div>
<div id="install-note">
<h1><?=get_text("READY_TO_GO")?></h1>
<p><?php
$tmp = str_replace('<url>', '<a href="http://'.$_SERVER['SERVER_NAME'].'/liveblog/panel">', get_text("INSTALLED_TEXT"));
$tmp = str_replace('</url>', '</a>', $tmp);
echo $tmp;
?>
</p>
</div>
<?php 
}
else{
    foreach($errors as $mess){
        echo '<div class="info-message" id="err-mess" style="margin:15px auto;"><p>'.$mess.'</p></div>';
    }
    echo '<p class="desc">'.get_text("CORRECT_ERRORS_THEN_RELOAD").'</p>';
} 
?>
</div>
</body>
</html>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.