Skip to content

Commit

Permalink
php 7 future
Browse files Browse the repository at this point in the history
  • Loading branch information
diolektor committed Jan 11, 2017
1 parent e5fab72 commit 55a6ef8
Show file tree
Hide file tree
Showing 32 changed files with 650 additions and 652 deletions.
40 changes: 20 additions & 20 deletions bt/includes/init_tr.php
Expand Up @@ -54,33 +54,33 @@ function error_exit ($msg = '')
// Database
class sql_db
{
var $cfg = array();
var $cfg_keys = array('dbhost', 'dbname', 'dbuser', 'dbpasswd', 'charset', 'persist');
var $link = null;
var $result = null;
var $db_server = '';
var $selected_db = null;
public $cfg = array();
public $cfg_keys = array('dbhost', 'dbname', 'dbuser', 'dbpasswd', 'charset', 'persist');
public $link = null;
public $result = null;
public $db_server = '';
public $selected_db = null;

var $locked = false;
public $locked = false;

var $num_queries = 0;
var $sql_starttime = 0;
var $sql_inittime = 0;
var $sql_timetotal = 0;
var $sql_last_time = 0;
var $slow_time = 0;
public $num_queries = 0;
public $sql_starttime = 0;
public $sql_inittime = 0;
public $sql_timetotal = 0;
public $sql_last_time = 0;
public $slow_time = 0;

var $dbg = array();
var $dbg_id = 0;
var $dbg_enabled = false;
var $cur_query = null;
public $dbg = array();
public $dbg_id = 0;
public $dbg_enabled = false;
public $cur_query = null;

var $DBS = array();
public $DBS = array();

/**
* Constructor
*/
function sql_db ($cfg_values)
function __construct ($cfg_values)
{
global $DBS;

Expand Down Expand Up @@ -486,4 +486,4 @@ function log_error ()
$msg[] = '';
bb_log($msg, 'sql_error_tr');
}
}
}
4 changes: 2 additions & 2 deletions common.php
Expand Up @@ -304,7 +304,7 @@ function make_rand_str ($len = 10)
$str = '';
while (strlen($str) < $len)
{
$str .= str_shuffle(preg_replace('#[^0-9a-zA-Z]#', '', crypt(uniqid(mt_rand(), true))));
$str .= str_shuffle(preg_replace('#[^0-9a-zA-Z]#', '', crypt(uniqid(mt_rand(), true), 'salt')));
}
return substr($str, 0, $len);
}
Expand Down Expand Up @@ -507,4 +507,4 @@ function dummy_exit ($interval = 1800)
dummy_exit(mt_rand(60, 2400));
}
}
}
}
22 changes: 11 additions & 11 deletions library/ajax/view_torrent.php
Expand Up @@ -48,18 +48,18 @@ function build_tor_filelist ($file_contents)

class torrent
{
var $tor_decoded = array();
var $files_ary = array('/' => '');
var $multiple = null;
var $root_dir = '';
var $files_html = '';
public $tor_decoded = array();
public $files_ary = array('/' => '');
public $multiple = null;
public $root_dir = '';
public $files_html = '';

function torrent ($decoded_file_contents)
public function __construct ($decoded_file_contents)
{
$this->tor_decoded = $decoded_file_contents;
}

function get_filelist ()
public function get_filelist ()
{
$this->build_filelist_array();

Expand All @@ -79,7 +79,7 @@ function get_filelist ()
}
}

function build_filelist_array ()
public function build_filelist_array ()
{
$info = $this->tor_decoded['info'];

Expand Down Expand Up @@ -154,7 +154,7 @@ function build_filelist_array ()
}
}

function build_file_item ($name, $length)
public function build_file_item ($name, $length)
{
global $bb_cfg, $images, $lang;

Expand All @@ -169,7 +169,7 @@ function build_file_item ($name, $length)
return "$name <i>$length</i> $magnet_name $magnet_ext";
}

function build_filelist_html ()
public function build_filelist_html ()
{
global $html;
return $html->array2html($this->files_ary);
Expand All @@ -183,4 +183,4 @@ function clean_tor_dirname ($dirname)

if ($bnc_error) $tor_filelist = '<b style="color: #993300;">'.$lang['ERROR_BUILD'].'</b><br /><br />'.$tor_filelist;

$this->response['html'] = $tor_filelist;
$this->response['html'] = $tor_filelist;
48 changes: 24 additions & 24 deletions library/attach_mod/posting_attachments.php
Expand Up @@ -10,26 +10,26 @@

class attach_parent
{
var $post_attach = false;
var $attach_filename = '';
var $filename = '';
var $type = '';
var $extension = '';
var $file_comment = '';
var $num_attachments = 0; // number of attachments in message
var $filesize = 0;
var $filetime = 0;
var $thumbnail = 0;
var $page = 0; // On which page we are on ? This should be filled by child classes.
public $post_attach = false;
public $attach_filename = '';
public $filename = '';
public $type = '';
public $extension = '';
public $file_comment = '';
public $num_attachments = 0; // number of attachments in message
public $filesize = 0;
public $filetime = 0;
public $thumbnail = 0;
public $page = 0; // On which page we are on ? This should be filled by child classes.

// Switches
var $add_attachment_body = 0;
var $posted_attachments_body = 0;
public $add_attachment_body = 0;
public $posted_attachments_body = 0;

/**
* Constructor
*/
function attach_parent()
public function __construct()
{
$this->add_attachment_body = get_var('add_attachment_body', 0);
$this->posted_attachments_body = get_var('posted_attachments_body', 0);
Expand All @@ -52,7 +52,7 @@ function attach_parent()
/**
* Get Quota Limits
*/
function get_quota_limits($userdata_quota, $user_id = 0)
public function get_quota_limits($userdata_quota, $user_id = 0)
{
global $attach_config;

Expand Down Expand Up @@ -206,7 +206,7 @@ function get_quota_limits($userdata_quota, $user_id = 0)
* Handle all modes... (intern)
* @private
*/
function handle_attachments($mode)
public function handle_attachments($mode)
{
global $is_auth, $attach_config, $refresh, $post_id, $submit, $preview, $error, $error_msg, $lang;

Expand Down Expand Up @@ -594,7 +594,7 @@ function handle_attachments($mode)
/**
* Basic Insert Attachment Handling for all Message Types
*/
function do_insert_attachment($mode, $message_type, $message_id)
public function do_insert_attachment($mode, $message_type, $message_id)
{
global $upload_dir;

Expand Down Expand Up @@ -735,7 +735,7 @@ function do_insert_attachment($mode, $message_type, $message_id)
* Attachment Mod entry switch/output (intern)
* @private
*/
function display_attachment_bodies()
public function display_attachment_bodies()
{
global $attach_config, $is_auth, $lang, $template, $upload_dir, $forum_id;

Expand Down Expand Up @@ -831,7 +831,7 @@ function display_attachment_bodies()
/**
* Upload an Attachment to Filespace (intern)
*/
function upload_attachment()
public function upload_attachment()
{
global $error, $error_msg, $lang, $attach_config, $userdata, $upload_dir, $forum_id;

Expand Down Expand Up @@ -1186,7 +1186,7 @@ function upload_attachment()
}

// Copy the temporary attachment to the right location (copy, move_uploaded_file)
function move_uploaded_attachment($upload_mode, $file)
public function move_uploaded_attachment($upload_mode, $file)
{
global $error, $error_msg, $lang, $upload_dir;

Expand Down Expand Up @@ -1262,7 +1262,7 @@ class attach_posting extends attach_parent
/**
* Constructor
*/
function attach_posting()
public function __construct()
{
$this->attach_parent();
$this->page = 0;
Expand All @@ -1271,7 +1271,7 @@ function attach_posting()
/**
* Insert an Attachment into a Post (this is the second function called from posting.php)
*/
function insert_attachment($post_id)
public function insert_attachment($post_id)
{
global $is_auth, $mode;

Expand Down Expand Up @@ -1313,7 +1313,7 @@ function insert_attachment($post_id)
/**
* Handle Attachments (Add/Delete/Edit/Show) - This is the first function called from every message handler
*/
function posting_attachment_mod()
public function posting_attachment_mod()
{
global $mode, $confirm, $is_auth, $post_id, $delete, $refresh;

Expand Down Expand Up @@ -1355,4 +1355,4 @@ function execute_posting_attachment_handling()

$attachment_mod['posting'] = new attach_posting();
$attachment_mod['posting']->posting_attachment_mod();
}
}

0 comments on commit 55a6ef8

Please sign in to comment.