Skip to content

Commit 66ef995

Browse files
committed
making class definitions PHP7 compatible
1 parent aa4821d commit 66ef995

13 files changed

Lines changed: 35 additions & 32 deletions

class/art/object.persistable.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class _XoopsPersistableObject extends icms_core_Object
2222
*/
2323
var $table;
2424

25-
function _XoopsPersistableObject($table = null) {
25+
function __construct($table = null) {
2626
if (!empty($table)) {
2727
$this->table = $GLOBALS["xoopsDB"]->prefix($table);
2828
}
@@ -251,7 +251,7 @@ class _XoopsPersistableObjectHandler extends icms_core_ObjectHandler {
251251
*
252252
* @return void
253253
*/
254-
function _XoopsPersistableObjectHandler(&$db, $table = "", $className = "", $keyName = "", $identifierName = false) {
254+
function __construct(&$db, $table = "", $className = "", $keyName = "", $identifierName = false) {
255255
parent::__construct($db);
256256
$this->table = $table;
257257
$this->keyName = $keyName;
@@ -372,11 +372,14 @@ function &getAll($criteria = null, $tags = null, $asObject = true)
372372
*/
373373
function mysql_server_version($conn = null)
374374
{
375+
/*
375376
if (!is_null($conn)) {
376377
return mysql_get_server_info($conn);
377378
} else {
378379
return mysql_get_server_info();
379380
}
381+
*/
382+
return "6.0.0";
380383
}
381384

382385
/**

class/art/object.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ArtObject extends _XoopsPersistableObject
3838

3939
function __construct($table = "")
4040
{
41-
$this->_XoopsPersistableObject($table);
41+
parent::__construct($table);
4242
}
4343

4444
/**
@@ -69,7 +69,7 @@ function _loadFilters()
6969
if (!isset($loaded)) return;
7070
$loaded = 1;
7171

72-
$path = empty($this->plugin_path) ? dirname(__FILE__).'/filters' : $this->plugin_path;
72+
$path = empty($this->plugin_path) ? __DIR__ .'/filters' : $this->plugin_path;
7373
@include_once $path.'/filter.php';
7474
foreach ($this->_filters as $f) {
7575
@include_once $path.'/'.strtolower($f).'php';
@@ -135,7 +135,7 @@ class ArtObjectHandler extends _XoopsPersistableObjectHandler
135135
**/
136136
function __construct(&$db, $table = "", $className = "", $keyName = "", $identifierName = false) {
137137
$table = $db->prefix($table);
138-
$this->_XoopsPersistableObjectHandler( $db, $table, $className, $keyName, $identifierName );
138+
parent::__construct( $db, $table, $className, $keyName, $identifierName );
139139
}
140140

141141
function _loadHandler($name, $params = array()) {

class/category.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Category extends ArtObject {
3535

3636
function __construct()
3737
{
38-
$this->ArtObject("bb_categories");
38+
parent::__construct("bb_categories");
3939
$this->initVar('cat_id', XOBJ_DTYPE_INT);
4040
$this->initVar('pid', XOBJ_DTYPE_INT, 0);
4141
$this->initVar('cat_title', XOBJ_DTYPE_TXTBOX);
@@ -51,7 +51,7 @@ function __construct()
5151
class IforumCategoryHandler extends ArtObjectHandler {
5252
function __construct(&$db)
5353
{
54-
$this->ArtObjectHandler($db, 'bb_categories', 'Category', 'cat_id', 'cat_title');
54+
parent::__construct($db, 'bb_categories', 'Category', 'cat_id', 'cat_title');
5555
}
5656

5757
function &getAllCats($permission = false, $idAsKey = true, $tags = null)
@@ -77,7 +77,7 @@ function &getAllCats($permission = false, $idAsKey = true, $tags = null)
7777
return $_cachedCats[$perm_string];
7878
}
7979

80-
function insert(&$category)
80+
function insert(&$category,$force=true)
8181
{
8282
parent::insert($category, true);
8383
if ($category->isNew())
@@ -88,7 +88,7 @@ function insert(&$category)
8888
return $category->getVar('cat_id');
8989
}
9090

91-
function delete(&$category)
91+
function delete(&$category,$force=true)
9292
{
9393
global $icmsModule;
9494
$forum_handler =icms_getmodulehandler('forum', basename(dirname(dirname(__FILE__ ) ) ), 'iforum' );

class/forum.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Forum extends ArtObject {
3535

3636
function __construct()
3737
{
38-
$this->ArtObject("bb_forums");
38+
parent::__construct("bb_forums");
3939
$this->initVar('forum_id', XOBJ_DTYPE_INT);
4040
$this->initVar('forum_name', XOBJ_DTYPE_TXTBOX);
4141
$this->initVar('forum_desc', XOBJ_DTYPE_TXTAREA);
@@ -124,10 +124,10 @@ function disp_forumModerators($valid_moderators = 0)
124124
class IforumForumHandler extends ArtObjectHandler {
125125
function __construct(&$db)
126126
{
127-
$this->ArtObjectHandler($db, 'bb_forums', 'Forum', 'forum_id', 'forum_name');
127+
parent::__construct($db, 'bb_forums', 'Forum', 'forum_id', 'forum_name');
128128
}
129129

130-
function insert(&$forum)
130+
function insert(&$forum,$force=true)
131131
{
132132
if (!parent::insert($forum, true))
133133
{
@@ -143,7 +143,7 @@ function insert(&$forum)
143143
return $forum->getVar('forum_id');
144144
}
145145

146-
function delete(&$forum)
146+
function delete(&$forum,$force=true)
147147
{
148148
global $icmsModule;
149149
// RMV-NOTIFY
@@ -706,7 +706,7 @@ function applyPermissionTemplate(&$forum)
706706
*
707707
* @return bool true on success
708708
*/
709-
function cleanOrphan()
709+
function cleanOrphan($table_link='', $field_link='', $field_object='')
710710
{
711711
parent::cleanOrphan($this->db->prefix("bb_categories"), "cat_id");
712712

class/moderate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Moderate extends ArtObject {
4444

4545
function __construct()
4646
{
47-
$this->ArtObject("bb_moderates");
47+
parent::__construct("bb_moderates");
4848
$this->initVar('mod_id', XOBJ_DTYPE_INT);
4949
$this->initVar('mod_start', XOBJ_DTYPE_INT);
5050
$this->initVar('mod_end', XOBJ_DTYPE_INT);
@@ -58,7 +58,7 @@ function __construct()
5858
class IforumModerateHandler extends ArtObjectHandler {
5959
function __construct(&$db)
6060
{
61-
$this->ArtObjectHandler($db, 'bb_moderates', 'Moderate', 'mod_id', 'uid');
61+
parent::__construct($db, 'bb_moderates', 'Moderate', 'mod_id', 'uid');
6262
}
6363

6464
/**

class/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ function showPost($isadmin)
519519
class IforumPostHandler extends ArtObjectHandler {
520520
function __construct(&$db)
521521
{
522-
$this->ArtObjectHandler($db, 'bb_posts', 'Post', 'post_id', 'subject');
522+
parent::__construct($db, 'bb_posts', 'Post', 'post_id', 'subject');
523523
}
524524

525525
function &get($id)

class/rate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
class Nrate extends ArtObject {
3535
function __construct()
3636
{
37-
$this->ArtObject("bb_votedata");
37+
parent::__construct("bb_votedata");
3838
$this->initVar('ratingid', XOBJ_DTYPE_INT);
3939
$this->initVar('topic_id', XOBJ_DTYPE_INT);
4040
$this->initVar('ratinguser', XOBJ_DTYPE_INT);
@@ -47,7 +47,7 @@ function __construct()
4747
class IforumRateHandler extends ArtObjectHandler {
4848
function __construct(&$db)
4949
{
50-
$this->ArtObjectHandler($db, 'bb_votedata', 'Nrate', 'ratingid');
50+
parent::__construct($db, 'bb_votedata', 'Nrate', 'ratingid');
5151
}
5252

5353
/**

class/read.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
class Read extends ArtObject {
4444
function __construct($type)
4545
{
46-
$this->ArtObject("bb_reads_".$type);
46+
parent::__construct("bb_reads_".$type);
4747
$this->initVar('read_id', XOBJ_DTYPE_INT);
4848
$this->initVar('uid', XOBJ_DTYPE_INT);
4949
$this->initVar('read_item', XOBJ_DTYPE_INT);
@@ -93,7 +93,7 @@ function __construct(&$db, $type)
9393
{
9494
$type = ("forum" == $type) ? "forum" :
9595
"topic";
96-
$this->ArtObjectHandler($db, 'bb_reads_'.$type, 'Read'.$type, 'read_id', 'post_id');
96+
parent::__construct($db, 'bb_reads_'.$type, 'Read'.$type, 'read_id', 'post_id');
9797
$this->type = $type;
9898
$iforumConfig = iforum_load_config();
9999
$this->lifetime = !empty($iforumConfig["read_expire"]) ? $iforumConfig["read_expire"] * 24 * 3600 :

class/readforum.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
class Readforum extends Read {
3838
function __construct()
3939
{
40-
$this->Read("forum");
40+
parent::__construct("forum");
4141
}
4242
}
4343

4444
class IforumReadforumHandler extends IforumReadHandler {
4545
function __construct(&$db)
4646
{
47-
$this->IforumReadHandler($db, "forum");
47+
parent::__construct($db, "forum");
4848
}
4949

5050
/**

class/readtopic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
class Readtopic extends Read {
3838
function __construct()
3939
{
40-
$this->Read("topic");
40+
parent::__construct("topic");
4141
//$this->initVar('forum_id', XOBJ_DTYPE_INT);
4242
}
4343
}
@@ -53,7 +53,7 @@ class IforumReadtopicHandler extends IforumReadHandler {
5353

5454
function __construct(&$db)
5555
{
56-
$this->IforumReadHandler($db, "topic");
56+
parent::__construct($db, "topic");
5757
$iforumConfig = iforum_load_config();
5858
$this->items_per_forum = isset($iforumConfig["read_items"])?intval($iforumConfig["read_items"]):
5959
100;

0 commit comments

Comments
 (0)