1 | <?php
|
---|
2 | global $xoops_db,$xpress_config;
|
---|
3 | $xoops_trust_path = get_xoops_trust_path();
|
---|
4 | $xoops_root_path = get_xoops_root_path();
|
---|
5 | $inc_path = $xoops_trust_path . '/modules/d3forum/include/comment_functions.php';
|
---|
6 | include_once( $inc_path);
|
---|
7 | $xpress_dir = get_xpress_dir_path();
|
---|
8 | $xpress_dirname = get_xpress_dir_name();
|
---|
9 |
|
---|
10 | include_once($xpress_dir . '/class/xpressD3commentContent.class.php');
|
---|
11 |
|
---|
12 | $dir_name = $xpress_config->d3forum_module_dir;
|
---|
13 | $forum_id = $xpress_config->d3forum_forum_id;
|
---|
14 | $external_link_format = $xpress_config->d3forum_external_link_format;
|
---|
15 | if ($xpress_config->is_d3forum_desc){
|
---|
16 | $order = 'desc';
|
---|
17 | } else {
|
---|
18 | $order = 'asc';
|
---|
19 | }
|
---|
20 | if ($xpress_config->is_d3forum_desc){
|
---|
21 | $order = 'desc';
|
---|
22 | } else {
|
---|
23 | $order = 'asc';
|
---|
24 | }
|
---|
25 |
|
---|
26 | if ($xpress_config->is_d3forum_flat){
|
---|
27 | $view = 'listposts_flat';
|
---|
28 | } else {
|
---|
29 | $view = 'listtopics';
|
---|
30 | }
|
---|
31 | $posts_num = $xpress_config->d3forum_views_num;
|
---|
32 |
|
---|
33 | // force UPDATE forums.forum_external_link_format "(dirname)::(classname)::(trustdirname)"
|
---|
34 | $xoops_db->query( "UPDATE ".get_xoops_prefix() . $dir_name."_forums SET forum_external_link_format='".$external_link_format."' WHERE forum_id= $forum_id" ) ;
|
---|
35 |
|
---|
36 | $d3comment = new xpressD3commentContent( $dir_name , $xpress_dirname ) ;
|
---|
37 |
|
---|
38 | $post_title = get_the_title();
|
---|
39 | if (function_exists('get_the_ID')){ // upper wordpress 2.1
|
---|
40 | $post_id=get_the_ID();
|
---|
41 | } else { // lower wordpress 2.1
|
---|
42 | ob_start();
|
---|
43 | the_ID();
|
---|
44 | $post_id=ob_get_contents();
|
---|
45 | ob_end_clean();
|
---|
46 | }
|
---|
47 | if (empty($_GET['p'])){
|
---|
48 | $_GET['p']= $post_id;
|
---|
49 | }
|
---|
50 | // $params = array("dirname" => $dir_name, "forum_id" => $forum_id, "itemname" => "p", "id" => $post_id , "subject" => $post_title);
|
---|
51 | $params = array("forum_id" => $forum_id, "id" => $post_id , "subject" => $post_title , "order" => $order , "view" => $view , "posts_num" => $posts_num);
|
---|
52 | if(file_exists($xoops_trust_path .'/modules/d3forum/')) {
|
---|
53 | if(file_exists($xoops_root_path .'/modules/' . $dir_name . '/')) {
|
---|
54 | $d3comment->displayCommentsInline($params ) ;
|
---|
55 | } else {
|
---|
56 | echo ('<h3>' . $dir_name . 'is not found </h3>') ;
|
---|
57 | }
|
---|
58 | } else {
|
---|
59 | echo '<h3> d3forum is not install </h3>';
|
---|
60 | }
|
---|
61 |
|
---|
62 | ?> |
---|