Skip to content

Commit 0afef56

Browse files
committed
replace basename(dirname(__FILE__ ) ) with basename(__DIR__)
1 parent b40fe8d commit 0afef56

25 files changed

Lines changed: 101 additions & 101 deletions

action.post.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
exit();
4747
}
4848

49-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
50-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
51-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
49+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
50+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
51+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
5252
if (empty($topic_id))
5353
{
5454
$viewtopic_forum = null;

action.topic.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
}
4343

4444
$topic_id = array_values($topic_id);
45-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
46-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
45+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
46+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
4747
/*
4848
$topicid = is_array($topic_id)?$topic_id[0]:$topic_id;
4949
$forumtopic = $topic_handler->get($topicid);
@@ -149,7 +149,7 @@
149149
)
150150
{
151151
$criteria = new icms_db_criteria_Item('topic_id', "(".implode(",", $topic_id).")", "IN");
152-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
152+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
153153
$post_handler->updateAll("forum_id", intval($_POST["newforum"]), $criteria, true);
154154
$topic_handler->updateAll("forum_id", intval($_POST["newforum"]), $criteria, true);
155155

@@ -158,7 +158,7 @@
158158
}
159159
else
160160
{
161-
$category_handler = icms_getmodulehandler('category', basename(dirname(__FILE__ ) ), 'iforum' );
161+
$category_handler = icms_getmodulehandler('category', basename(__DIR__), 'iforum' );
162162
$categories = $category_handler->getAllCats('access', true);
163163
$forums = $forum_handler->getForumsByCategory(array_keys($categories), 'post', false);
164164

action.transfer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@
6666
}
6767
}
6868

69-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
69+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
7070
$post = $post_handler->get($post_id);
7171
if (!$approved = $post->getVar('approved')) die(_NOPERM);
7272

73-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
73+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
7474
$forumtopic = $topic_handler->getByPost($post_id);
7575
$topic_id = $forumtopic->getVar('topic_id');
7676
if (!$approved = $forumtopic->getVar('approved')) die(_NOPERM);
7777

78-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
78+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
7979
$forum = ($forum)?$forum:
8080
$forumtopic->getVar('forum_id');
8181
$viewtopic_forum = $forum_handler->get($forum);
@@ -87,7 +87,7 @@
8787
$_POST["op"];
8888
$op = strtolower(trim($op));
8989

90-
$transfer_handler = icms_getmodulehandler("transfer", basename(dirname(__FILE__ ) ), 'iforum' );
90+
$transfer_handler = icms_getmodulehandler("transfer", basename(__DIR__), 'iforum' );
9191
$op_options = $transfer_handler->getList();
9292

9393
// Display option form
@@ -114,7 +114,7 @@
114114
$data = array();
115115
$data["id"] = $post_id;
116116
$data["uid"] = $post->getVar("uid");
117-
$data["url"] = ICMS_URL."/modules/".basename(dirname(__FILE__ ) )."/viewtopic.php?topic_id=".$topic_id."&post_id=".$post_id;
117+
$data["url"] = ICMS_URL."/modules/".basename(__DIR__)."/viewtopic.php?topic_id=".$topic_id."&post_id=".$post_id;
118118
$post_data = $post->getPostBody();
119119
$data["author"] = $post_data["author"];
120120
$data["title"] = $post_data["subject"];

delete.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
$viewmode = ($viewmode)?$viewmode:
5252
(isset($_POST['viewmode'])?$_POST['viewmode'] : 'flat');
5353

54-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
55-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
56-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
54+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
55+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
56+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
5757

5858
if (!empty($post_id) )
5959
{
@@ -104,7 +104,7 @@
104104

105105
if (icms::$module->config['wol_enabled'])
106106
{
107-
$online_handler = icms_getmodulehandler('online', basename(dirname(__FILE__ ) ), 'iforum' );
107+
$online_handler = icms_getmodulehandler('online', basename(__DIR__), 'iforum' );
108108
$online_handler->init($forum_obj);
109109
}
110110

digest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
echo "<br />Not set";
3333
return false;
3434
}
35-
$digest_handler = icms_getmodulehandler('digest', basename(dirname(__FILE__ ) ), 'iforum' );
35+
$digest_handler = icms_getmodulehandler('digest', basename(__DIR__), 'iforum' );
3636
$msg = $digest_handler->process();
3737
$msg .= ob_get_contents();
3838
ob_end_clean();

dl_attachment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434

3535
if (!$post_id || !$attach_id) die(_MD_NO_SUCH_FILE.': post_id:'.$post_id.'; attachid'.$attachid);
3636

37-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
37+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
3838
$forumpost = $post_handler->get($post_id);
3939
if (!$approved = $forumpost->getVar('approved')) die(_MD_NORIGHTTOVIEW);
40-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
40+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
4141
$forumtopic = $topic_handler->getByPost($post_id);
4242
$topic_id = $forumtopic->getVar('topic_id');
4343
if (!$approved = $forumtopic->getVar('approved')) die(_MD_NORIGHTTOVIEW);
44-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
44+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
4545
$viewtopic_forum = $forum_handler->get($forumtopic->getVar('forum_id'));
4646
if (!$forum_handler->getPermission($viewtopic_forum)) die(_MD_NORIGHTTOACCESS);
4747
if (!$topic_handler->getPermission($viewtopic_forum, $forumtopic->getVar('topic_status'), "view")) die(_MD_NORIGHTTOVIEW);

edit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
}
4949
else
5050
{
51-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
52-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
53-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
51+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
52+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
53+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
5454

5555

5656
$forumpost = $post_handler->get($post_id);
@@ -63,7 +63,7 @@
6363

6464
if (icms::$module->config['wol_enabled'])
6565
{
66-
$online_handler = icms_getmodulehandler('online', basename(dirname(__FILE__ ) ), 'iforum' );
66+
$online_handler = icms_getmodulehandler('online', basename(__DIR__), 'iforum' );
6767
$online_handler->init($forum_obj);
6868
}
6969
$isadmin = iforum_isAdmin($forum_obj);

index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747

4848
$viewcat = @intval($_GET['cat']);
49-
$category_handler = icms_getmodulehandler('category', basename(dirname(__FILE__ ) ), 'iforum' );
49+
$category_handler = icms_getmodulehandler('category', basename(__DIR__), 'iforum' );
5050

5151
$categories = array();
5252
if (!$viewcat)
@@ -89,7 +89,7 @@
8989
$icmsTpl->assign('forum_index_title', $forum_index_title);
9090
if (icms::$module->config['wol_enabled'])
9191
{
92-
$online_handler = icms_getmodulehandler('online', basename(dirname(__FILE__ ) ), 'iforum' );
92+
$online_handler = icms_getmodulehandler('online', basename(__DIR__), 'iforum' );
9393
$online_handler->init();
9494
$icmsTpl->assign('online', $online_handler->show_online());
9595
}
@@ -102,7 +102,7 @@
102102
"lang_lastvisit" => sprintf(_MD_LASTVISIT, formatTimestamp($last_visit)),
103103
"lang_currenttime" => sprintf(_MD_TIMENOW, formatTimestamp(time(), "m"))));
104104

105-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
105+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
106106
$forums_obj = $forum_handler->getForumsByCategory(array_keys($categories), "access");
107107
$forums_array = $forum_handler->display($forums_obj);
108108
unset($forums_obj);

makepdf.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,49 +35,49 @@
3535

3636
if (empty($post_id))
3737
{
38-
redirect_header(ICMS_URL.'/modules/'.basename(dirname(__FILE__ ) ).'/index.php', 2, _MD_ERRORTOPIC);
38+
redirect_header(ICMS_URL.'/modules/'.basename(__DIR__).'/index.php', 2, _MD_ERRORTOPIC);
3939
exit();
4040
}
4141

4242
// Not exists
43-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
43+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
4444
$post = $post_handler->get($post_id);
4545
if (empty($post) )
4646
{
47-
redirect_header(ICMS_URL.'/modules/'.basename(dirname(__FILE__ ) ).'/index.php', 2, _MD_NORIGHTTOVIEW);
47+
redirect_header(ICMS_URL.'/modules/'.basename(__DIR__).'/index.php', 2, _MD_NORIGHTTOVIEW);
4848
exit();
4949
}
5050
// Not yet approved
51-
$post_handler = icms_getmodulehandler('post', basename(dirname(__FILE__ ) ), 'iforum' );
51+
$post_handler = icms_getmodulehandler('post', basename(__DIR__), 'iforum' );
5252
$post = $post_handler->get($post_id);
5353
if (!$approved = $post->getVar('approved') )
5454
{
55-
redirect_header(ICMS_URL.'/modules/'.basename(dirname(__FILE__ ) ).'/index.php', 2, _MD_NORIGHTTOVIEW);
55+
redirect_header(ICMS_URL.'/modules/'.basename(__DIR__).'/index.php', 2, _MD_NORIGHTTOVIEW);
5656
exit();
5757
}
5858

59-
$topic_handler = icms_getmodulehandler('topic', basename(dirname(__FILE__ ) ), 'iforum' );
59+
$topic_handler = icms_getmodulehandler('topic', basename(__DIR__), 'iforum' );
6060
$forumtopic = $topic_handler->getByPost($post_id);
6161
$topic_id = $forumtopic->getVar('topic_id');
6262
if (!$approved = $forumtopic->getVar('approved') )
6363
{
64-
redirect_header(ICMS_URL.'/modules/'.basename(dirname(__FILE__ ) ).'/index.php', 2, _MD_NORIGHTTOVIEW);
64+
redirect_header(ICMS_URL.'/modules/'.basename(__DIR__).'/index.php', 2, _MD_NORIGHTTOVIEW);
6565
exit();
6666
}
6767

68-
$forum_handler = icms_getmodulehandler('forum', basename(dirname(__FILE__ ) ), 'iforum' );
68+
$forum_handler = icms_getmodulehandler('forum', basename(__DIR__), 'iforum' );
6969
$forum = ($forum)?$forum:
7070
$forumtopic->getVar('forum_id');
7171
$viewtopic_forum = $forum_handler->get($forum);
7272
if (!$forum_handler->getPermission($viewtopic_forum) )
7373
{
74-
redirect_header(ICMS_URL.'/modules/'.basename(dirname(__FILE__ ) ).'/index.php', 2, _MD_NORIGHTTOACCESS);
74+
redirect_header(ICMS_URL.'/modules/'.basename(__DIR__).'/index.php', 2, _MD_NORIGHTTOACCESS);
7575
exit();
7676
}
7777

7878
if (!$topic_handler->getPermission($viewtopic_forum, $forumtopic->getVar('topic_status'), "view") )
7979
{
80-
redirect_header(ICMS_URL.'/modules/'.basename(dirname(__FILE__ ) ).'/index.php', 2, _MD_NORIGHTTOVIEW);
80+
redirect_header(ICMS_URL.'/modules/'.basename(__DIR__).'/index.php', 2, _MD_NORIGHTTOVIEW);
8181
exit();
8282
}
8383
require_once ICMS_ROOT_PATH.'/include/pdf.php';

moderate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
}
3939
$is_administrator = iforum_isAdmin();
4040

41-
$moderate_handler = icms_getmodulehandler('moderate', basename(dirname(__FILE__ ) ), 'iforum' );
41+
$moderate_handler = icms_getmodulehandler('moderate', basename(__DIR__), 'iforum' );
4242

4343
if (!empty($_POST["submit"]) && !empty($_POST["expire"]))
4444
{
@@ -62,7 +62,7 @@
6262
if ($res = $moderate_handler->insert($moderate_obj) && !empty($forum_id) && !empty($_POST["uid"]) )
6363
{
6464
$uname = XoopsUser::getUnameFromID($_POST["uid"]);
65-
$post_handler = icms_getmodulehandler("post", basename(dirname(__FILE__ ) ), 'iforum' );
65+
$post_handler = icms_getmodulehandler("post", basename(__DIR__), 'iforum' );
6666
$forumpost = $post_handler->create();
6767
$forumpost->setVar("poster_ip", iforum_getIP());
6868
$forumpost->setVar("uid", empty($GLOBALS["xoopsUser"])?0:$GLOBALS["xoopsUser"]->getVar("uid"));

0 commit comments

Comments
 (0)