Jump to content

Errors with init.php after upgrade to 5.2.4


paperweight

Recommended Posts

I just upgraded from 5.1.3 to 5.2.4. Most things seem fine but I have a problem with the init.php.

 

In the release notes it says:

The dbconnect.php file has been removed as of WHMCS V5.2 and so any custom files will require updating to include "init.php" and only "init.php", the current separate "functions.php" include will be handled automatically

However, when I switch the code my dbconnect.php for the init.php, I get an error like this:

Fatal error: Cannot redeclare getvalidlanguages() in /var/www/whmcslocal/data/www/whmcslocal.com/init.php on line 25

 

Here is my code before to show network status:

{php}
include("support/dbconnect.php");
include("support/includes/functions.php");
$query = "SELECT * FROM tblnetworkissues WHERE status='In Progress' ORDER BY lastupdate DESC LIMIT 0,3"; 
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {
   $id = $data["id"];
   $lastupdate = $data["lastupdate"];
   $title = $data["title"];
   $description = $data["description"];
   $date = fromMySQLDate($date);
   echo '<div class="alert alert-error"><p><strong>Network Status: '.$lastupdate.'</strong>: '.$title.' <a href="serverstatus.php?view=open">More...</a></p></div>';
}
{/php}

 

And here is the change I made to remove the dbconnect and the functions.php:

{php}
include("init.php");
$query = "SELECT * FROM tblnetworkissues WHERE status='In Progress' ORDER BY lastupdate DESC LIMIT 0,3"; 
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {
   $id = $data["id"];
   $lastupdate = $data["lastupdate"];
   $title = $data["title"];
   $description = $data["description"];
   $date = fromMySQLDate($date);
   echo '<div class="alert alert-error"><p><strong>Network Status: '.$lastupdate.'</strong>: '.$title.' <a href="serverstatus.php?view=open">More...</a></p></div>';
}
{/php}

 

Any idea why this is happening?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated