@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | $path = dirname(dirname(dirname(__DIR__))); |
21 | -include_once $path . '/mainfile.php'; |
|
22 | -include_once $path . '/include/cp_functions.php'; |
|
23 | -require_once $path . '/include/cp_header.php'; |
|
21 | +include_once $path.'/mainfile.php'; |
|
22 | +include_once $path.'/include/cp_functions.php'; |
|
23 | +require_once $path.'/include/cp_header.php'; |
|
24 | 24 | |
25 | 25 | global $xoopsModule; |
26 | 26 | |
@@ -34,21 +34,21 @@ discard block |
||
34 | 34 | xoops_loadLanguage('modinfo', $moduleDirName); |
35 | 35 | xoops_loadLanguage('main', $moduleDirName); |
36 | 36 | |
37 | -$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); |
|
38 | -$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); |
|
37 | +$pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); |
|
38 | +$pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); |
|
39 | 39 | $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); |
40 | 40 | |
41 | -include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'); |
|
41 | +include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |
|
42 | 42 | |
43 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
44 | -require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php'; |
|
45 | -include_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php'; |
|
43 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
44 | +require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/functions.php'; |
|
45 | +include_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php'; |
|
46 | 46 | |
47 | 47 | // include the default language file for the admin interface |
48 | -if (!@include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' |
|
49 | - . $xoopsConfig['language'] . '/main.php' |
|
48 | +if (!@include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/' |
|
49 | + . $xoopsConfig['language'].'/main.php' |
|
50 | 50 | ) { |
51 | - include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/main.php'; |
|
51 | + include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/main.php'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | planet_define_url_delimiter(); |
@@ -32,9 +32,9 @@ |
||
32 | 32 | |
33 | 33 | // include the default language file for the admin interface |
34 | 34 | if (!@include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' |
35 | - . $xoopsConfig['language'] . '/main.php' |
|
35 | + . $xoopsConfig['language'] . '/main.php' |
|
36 | 36 | ) { |
37 | - include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/main.php'; |
|
37 | + include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/main.php'; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | planet_define_url_delimiter(); |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | |
42 | 42 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
45 | - if (!empty($_GET['purge'])) { |
|
46 | - $crit = new CriteriaCompo($criteria); |
|
47 | - $crit->add(new Criteria('art_comments', 0)); |
|
48 | - $article_expires =& $article_handler->getObjects($criteria); |
|
49 | - foreach ($article_expires as $id => $article_obj) { |
|
50 | - $article_handler->delete($article_obj); |
|
51 | - } |
|
52 | - } |
|
53 | - $article_count_expire = $article_handler->getCount($criteria); |
|
44 | + $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
45 | + if (!empty($_GET['purge'])) { |
|
46 | + $crit = new CriteriaCompo($criteria); |
|
47 | + $crit->add(new Criteria('art_comments', 0)); |
|
48 | + $article_expires =& $article_handler->getObjects($criteria); |
|
49 | + foreach ($article_expires as $id => $article_obj) { |
|
50 | + $article_handler->delete($article_obj); |
|
51 | + } |
|
52 | + } |
|
53 | + $article_count_expire = $article_handler->getCount($criteria); |
|
54 | 54 | } else { |
55 | - $article_count_expire = 0; |
|
55 | + $article_count_expire = 0; |
|
56 | 56 | } |
57 | 57 | $article_count = $article_handler->getCount(); |
58 | 58 | |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | echo "<br clear=\"all\" />" . planet_constant('AM_COUNT') . ': ' . $article_count; |
62 | 62 | echo "<br clear=\"all\" />"; |
63 | 63 | if ($article_count_expire > 0) { |
64 | - echo "<br clear=\"all\" /><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
65 | - . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire |
|
66 | - . '</a>'; |
|
67 | - echo "<br clear=\"all\" />"; |
|
64 | + echo "<br clear=\"all\" /><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
65 | + . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire |
|
66 | + . '</a>'; |
|
67 | + echo "<br clear=\"all\" />"; |
|
68 | 68 | } |
69 | 69 | echo '</div>'; |
70 | 70 | echo "</fieldset><br clear=\"all\" />"; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // URL: http://xoops.org // |
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | -include_once __DIR__ . '/admin_header.php'; |
|
27 | +include_once __DIR__.'/admin_header.php'; |
|
28 | 28 | |
29 | 29 | xoops_cp_header(); |
30 | 30 | $indexAdmin = new ModuleAdmin(); |
@@ -36,33 +36,33 @@ discard block |
||
36 | 36 | * This is a tricky fix for incomplete solution of module cone |
37 | 37 | * it is expected to have a better solution in article 1.0 |
38 | 38 | */ |
39 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
39 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
40 | 40 | //planet_adminmenu(3); |
41 | 41 | |
42 | 42 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
44 | + $criteria = new Criteria('art_time', time()-$xoopsModuleConfig['article_expire']*60*60*24, '<'); |
|
45 | 45 | if (!empty($_GET['purge'])) { |
46 | 46 | $crit = new CriteriaCompo($criteria); |
47 | 47 | $crit->add(new Criteria('art_comments', 0)); |
48 | - $article_expires =& $article_handler->getObjects($criteria); |
|
48 | + $article_expires = & $article_handler->getObjects($criteria); |
|
49 | 49 | foreach ($article_expires as $id => $article_obj) { |
50 | 50 | $article_handler->delete($article_obj); |
51 | 51 | } |
52 | 52 | } |
53 | 53 | $article_count_expire = $article_handler->getCount($criteria); |
54 | -} else { |
|
54 | +}else { |
|
55 | 55 | $article_count_expire = 0; |
56 | 56 | } |
57 | 57 | $article_count = $article_handler->getCount(); |
58 | 58 | |
59 | -echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">" . planet_constant('AM_ARTICLES') . '</legend>'; |
|
59 | +echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">".planet_constant('AM_ARTICLES').'</legend>'; |
|
60 | 60 | echo "<div style=\"padding: 8px;\">"; |
61 | -echo "<br clear=\"all\" />" . planet_constant('AM_COUNT') . ': ' . $article_count; |
|
61 | +echo "<br clear=\"all\" />".planet_constant('AM_COUNT').': '.$article_count; |
|
62 | 62 | echo "<br clear=\"all\" />"; |
63 | -if ($article_count_expire > 0) { |
|
64 | - echo "<br clear=\"all\" /><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
65 | - . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire |
|
63 | +if ($article_count_expire>0) { |
|
64 | + echo "<br clear=\"all\" /><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'] |
|
65 | + . "/admin/admin.article.php?purge=1\" >".planet_constant('AM_EXPIRED').': '.$article_count_expire |
|
66 | 66 | . '</a>'; |
67 | 67 | echo "<br clear=\"all\" />"; |
68 | 68 | } |
@@ -28,5 +28,5 @@ |
||
28 | 28 | // URL: http://www.myweb.ne.jp/, http://xoops.org/, http://jp.xoops.org/ // |
29 | 29 | // Project: XOOPS Project // |
30 | 30 | // ------------------------------------------------------------------------- // |
31 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
32 | -include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
31 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
32 | +include XOOPS_ROOT_PATH.'/include/notification_update.php'; |
@@ -32,63 +32,63 @@ |
||
32 | 32 | $blog_id = (int)(!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0)); |
33 | 33 | |
34 | 34 | if (empty($article_id) && empty($blog_id)) { |
35 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
35 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
39 | 39 | $blog_handler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
40 | 40 | if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) { |
41 | - $message = planet_constant('MD_NOACCESS'); |
|
41 | + $message = planet_constant('MD_NOACCESS'); |
|
42 | 42 | } else { |
43 | - $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
|
44 | - $ip = planet_getIP(); |
|
45 | - if ($article_id > 0) { |
|
46 | - $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
47 | - } else { |
|
48 | - $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id)); |
|
49 | - } |
|
50 | - if ($uid > 0) { |
|
51 | - $criteria->add(new Criteria('rate_uid', $uid)); |
|
52 | - } else { |
|
53 | - $criteria->add(new Criteria('rate_ip', $ip)); |
|
54 | - $criteria->add(new Criteria('rate_time', time() - 24 * 3600, '>')); |
|
55 | - } |
|
56 | - $rate_handler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']); |
|
57 | - if ($count = $rate_handler->getCount($criteria)) { |
|
58 | - $message = planet_constant('MD_ALREADYRATED'); |
|
59 | - } else { |
|
60 | - $rate_obj =& $rate_handler->create(); |
|
61 | - if ($article_id > 0) { |
|
62 | - $rate_obj->setVar('art_id', $article_id); |
|
63 | - } else { |
|
64 | - $rate_obj->setVar('blog_id', $blog_id); |
|
65 | - } |
|
66 | - $rate_obj->setVar('rate_uid', $uid); |
|
67 | - $rate_obj->setVar('rate_ip', $ip); |
|
68 | - $rate_obj->setVar('rate_rating', $rate); |
|
69 | - $rate_obj->setVar('rate_time', time()); |
|
70 | - if (!$rate_id = $rate_handler->insert($rate_obj, true)) { |
|
71 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED')); |
|
72 | - } |
|
73 | - if ($article_id > 0) { |
|
74 | - $article_obj =& $article_handler->get($article_id); |
|
75 | - $article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate); |
|
76 | - $article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1); |
|
77 | - $article_handler->insert($article_obj, true); |
|
78 | - } else { |
|
79 | - $blog_obj =& $blog_handler->get($blog_id); |
|
80 | - $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate); |
|
81 | - $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1); |
|
82 | - $blog_handler->insert($blog_obj, true); |
|
83 | - } |
|
84 | - $message = planet_constant('MD_ACTIONDONE'); |
|
85 | - } |
|
43 | + $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
|
44 | + $ip = planet_getIP(); |
|
45 | + if ($article_id > 0) { |
|
46 | + $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
47 | + } else { |
|
48 | + $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id)); |
|
49 | + } |
|
50 | + if ($uid > 0) { |
|
51 | + $criteria->add(new Criteria('rate_uid', $uid)); |
|
52 | + } else { |
|
53 | + $criteria->add(new Criteria('rate_ip', $ip)); |
|
54 | + $criteria->add(new Criteria('rate_time', time() - 24 * 3600, '>')); |
|
55 | + } |
|
56 | + $rate_handler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']); |
|
57 | + if ($count = $rate_handler->getCount($criteria)) { |
|
58 | + $message = planet_constant('MD_ALREADYRATED'); |
|
59 | + } else { |
|
60 | + $rate_obj =& $rate_handler->create(); |
|
61 | + if ($article_id > 0) { |
|
62 | + $rate_obj->setVar('art_id', $article_id); |
|
63 | + } else { |
|
64 | + $rate_obj->setVar('blog_id', $blog_id); |
|
65 | + } |
|
66 | + $rate_obj->setVar('rate_uid', $uid); |
|
67 | + $rate_obj->setVar('rate_ip', $ip); |
|
68 | + $rate_obj->setVar('rate_rating', $rate); |
|
69 | + $rate_obj->setVar('rate_time', time()); |
|
70 | + if (!$rate_id = $rate_handler->insert($rate_obj, true)) { |
|
71 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED')); |
|
72 | + } |
|
73 | + if ($article_id > 0) { |
|
74 | + $article_obj =& $article_handler->get($article_id); |
|
75 | + $article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate); |
|
76 | + $article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1); |
|
77 | + $article_handler->insert($article_obj, true); |
|
78 | + } else { |
|
79 | + $blog_obj =& $blog_handler->get($blog_id); |
|
80 | + $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate); |
|
81 | + $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1); |
|
82 | + $blog_handler->insert($blog_obj, true); |
|
83 | + } |
|
84 | + $message = planet_constant('MD_ACTIONDONE'); |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | if ($article_id > 0) { |
88 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
89 | - . $article_id, 2, $message); |
|
88 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
89 | + . $article_id, 2, $message); |
|
90 | 90 | } else { |
91 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, |
|
92 | - $message); |
|
91 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, |
|
92 | + $message); |
|
93 | 93 | } |
94 | 94 | include __DIR__ . '/footer.php'; |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | |
28 | -include __DIR__ . '/header.php'; |
|
28 | +include __DIR__.'/header.php'; |
|
29 | 29 | |
30 | -$rate = (int)(!empty($_POST['rate']) ? $_POST['rate'] : (!empty($_GET['rate']) ? $_GET['rate'] : 0)); |
|
31 | -$article_id = (int)(!empty($_POST['article']) ? $_POST['article'] : (!empty($_GET['article']) ? $_GET['article'] : 0)); |
|
32 | -$blog_id = (int)(!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0)); |
|
30 | +$rate = (int) (!empty($_POST['rate']) ? $_POST['rate'] : (!empty($_GET['rate']) ? $_GET['rate'] : 0)); |
|
31 | +$article_id = (int) (!empty($_POST['article']) ? $_POST['article'] : (!empty($_GET['article']) ? $_GET['article'] : 0)); |
|
32 | +$blog_id = (int) (!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0)); |
|
33 | 33 | |
34 | 34 | if (empty($article_id) && empty($blog_id)) { |
35 | 35 | redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
@@ -39,28 +39,28 @@ discard block |
||
39 | 39 | $blog_handler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
40 | 40 | if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) { |
41 | 41 | $message = planet_constant('MD_NOACCESS'); |
42 | -} else { |
|
42 | +}else { |
|
43 | 43 | $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
44 | 44 | $ip = planet_getIP(); |
45 | - if ($article_id > 0) { |
|
45 | + if ($article_id>0) { |
|
46 | 46 | $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
47 | - } else { |
|
47 | + }else { |
|
48 | 48 | $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id)); |
49 | 49 | } |
50 | - if ($uid > 0) { |
|
50 | + if ($uid>0) { |
|
51 | 51 | $criteria->add(new Criteria('rate_uid', $uid)); |
52 | - } else { |
|
52 | + }else { |
|
53 | 53 | $criteria->add(new Criteria('rate_ip', $ip)); |
54 | - $criteria->add(new Criteria('rate_time', time() - 24 * 3600, '>')); |
|
54 | + $criteria->add(new Criteria('rate_time', time()-24*3600, '>')); |
|
55 | 55 | } |
56 | 56 | $rate_handler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']); |
57 | 57 | if ($count = $rate_handler->getCount($criteria)) { |
58 | 58 | $message = planet_constant('MD_ALREADYRATED'); |
59 | - } else { |
|
60 | - $rate_obj =& $rate_handler->create(); |
|
61 | - if ($article_id > 0) { |
|
59 | + }else { |
|
60 | + $rate_obj = & $rate_handler->create(); |
|
61 | + if ($article_id>0) { |
|
62 | 62 | $rate_obj->setVar('art_id', $article_id); |
63 | - } else { |
|
63 | + }else { |
|
64 | 64 | $rate_obj->setVar('blog_id', $blog_id); |
65 | 65 | } |
66 | 66 | $rate_obj->setVar('rate_uid', $uid); |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | if (!$rate_id = $rate_handler->insert($rate_obj, true)) { |
71 | 71 | redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED')); |
72 | 72 | } |
73 | - if ($article_id > 0) { |
|
74 | - $article_obj =& $article_handler->get($article_id); |
|
75 | - $article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate); |
|
76 | - $article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1); |
|
73 | + if ($article_id>0) { |
|
74 | + $article_obj = & $article_handler->get($article_id); |
|
75 | + $article_obj->setVar('art_rating', $article_obj->getVar('art_rating')+$rate); |
|
76 | + $article_obj->setVar('art_rates', $article_obj->getVar('art_rates')+1); |
|
77 | 77 | $article_handler->insert($article_obj, true); |
78 | - } else { |
|
79 | - $blog_obj =& $blog_handler->get($blog_id); |
|
80 | - $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate); |
|
81 | - $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1); |
|
78 | + }else { |
|
79 | + $blog_obj = & $blog_handler->get($blog_id); |
|
80 | + $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating')+$rate); |
|
81 | + $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates')+1); |
|
82 | 82 | $blog_handler->insert($blog_obj, true); |
83 | 83 | } |
84 | 84 | $message = planet_constant('MD_ACTIONDONE'); |
85 | 85 | } |
86 | 86 | } |
87 | -if ($article_id > 0) { |
|
88 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
87 | +if ($article_id>0) { |
|
88 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.'' |
|
89 | 89 | . $article_id, 2, $message); |
90 | -} else { |
|
91 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, |
|
90 | +}else { |
|
91 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2, |
|
92 | 92 | $message); |
93 | 93 | } |
94 | -include __DIR__ . '/footer.php'; |
|
94 | +include __DIR__.'/footer.php'; |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | |
30 | 30 | $art_id = (int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0)); |
31 | 31 | if (empty($art_id)) { |
32 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
32 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
33 | 33 | } |
34 | 34 | if (!$xoopsUser->isAdmin()) { |
35 | - redirect_header('javascript:history.go(-1);', 2, _NOPERM); |
|
35 | + redirect_header('javascript:history.go(-1);', 2, _NOPERM); |
|
36 | 36 | } |
37 | 37 | include XOOPS_ROOT_PATH . '/header.php'; |
38 | 38 | include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
@@ -43,64 +43,64 @@ discard block |
||
43 | 43 | $op = isset($_POST['op']) ? $_POST['op'] : ''; |
44 | 44 | |
45 | 45 | if ($op === 'del' || !empty($_POST['del'])) { |
46 | - $article_handler->delete($article_obj); |
|
47 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
48 | - $message = planet_constant('MD_SAVED'); |
|
49 | - redirect_header($redirect, 2, $message); |
|
46 | + $article_handler->delete($article_obj); |
|
47 | + $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
48 | + $message = planet_constant('MD_SAVED'); |
|
49 | + redirect_header($redirect, 2, $message); |
|
50 | 50 | } elseif ($op === 'save') { |
51 | - if (empty($_POST['art_content'])) { |
|
52 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_TEXTEMPTY')); |
|
53 | - } |
|
51 | + if (empty($_POST['art_content'])) { |
|
52 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_TEXTEMPTY')); |
|
53 | + } |
|
54 | 54 | |
55 | - foreach (array( |
|
56 | - 'art_title', |
|
57 | - 'art_link', |
|
58 | - 'art_author', |
|
59 | - 'art_content' |
|
60 | - ) as $tag) { |
|
61 | - if (@$_POST[$tag] != $article_obj->getVar($tag)) { |
|
62 | - $article_obj->setVar($tag, @$_POST[$tag]); |
|
63 | - } |
|
64 | - } |
|
55 | + foreach (array( |
|
56 | + 'art_title', |
|
57 | + 'art_link', |
|
58 | + 'art_author', |
|
59 | + 'art_content' |
|
60 | + ) as $tag) { |
|
61 | + if (@$_POST[$tag] != $article_obj->getVar($tag)) { |
|
62 | + $article_obj->setVar($tag, @$_POST[$tag]); |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | - $art_id_new = $article_handler->insert($article_obj); |
|
67 | - if (!$article_obj->getVar('art_id')) { |
|
68 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
69 | - $message = planet_constant('MD_INSERTERROR'); |
|
70 | - } else { |
|
71 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
72 | - . $article_obj->getVar('art_id'); |
|
73 | - $message = planet_constant('MD_SAVED'); |
|
74 | - } |
|
75 | - redirect_header($redirect, 2, $message); |
|
66 | + $art_id_new = $article_handler->insert($article_obj); |
|
67 | + if (!$article_obj->getVar('art_id')) { |
|
68 | + $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
69 | + $message = planet_constant('MD_INSERTERROR'); |
|
70 | + } else { |
|
71 | + $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
72 | + . $article_obj->getVar('art_id'); |
|
73 | + $message = planet_constant('MD_SAVED'); |
|
74 | + } |
|
75 | + redirect_header($redirect, 2, $message); |
|
76 | 76 | } else { |
77 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
77 | + require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
78 | 78 | |
79 | - $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF')); |
|
79 | + $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF')); |
|
80 | 80 | |
81 | - $form->addElement(new XoopsFormText(planet_constant('MD_TITLE'), 'art_title', 50, 255, |
|
82 | - $article_obj->getVar('art_title', 'E')), true); |
|
83 | - $form->addElement(new XoopsFormText(planet_constant('MD_LINK'), 'art_link', 50, 255, |
|
84 | - $article_obj->getVar('art_link', 'E')), true); |
|
85 | - $form->addElement(new XoopsFormText(planet_constant('MD_AUTHOR'), 'art_author', 80, 255, |
|
86 | - $article_obj->getVar('art_author', 'E'))); |
|
87 | - $form->addElement(new XoopsFormTextArea(planet_constant('MD_CONTENT'), 'art_content', |
|
88 | - $article_obj->getVar('art_content', 'E')), true); |
|
81 | + $form->addElement(new XoopsFormText(planet_constant('MD_TITLE'), 'art_title', 50, 255, |
|
82 | + $article_obj->getVar('art_title', 'E')), true); |
|
83 | + $form->addElement(new XoopsFormText(planet_constant('MD_LINK'), 'art_link', 50, 255, |
|
84 | + $article_obj->getVar('art_link', 'E')), true); |
|
85 | + $form->addElement(new XoopsFormText(planet_constant('MD_AUTHOR'), 'art_author', 80, 255, |
|
86 | + $article_obj->getVar('art_author', 'E'))); |
|
87 | + $form->addElement(new XoopsFormTextArea(planet_constant('MD_CONTENT'), 'art_content', |
|
88 | + $article_obj->getVar('art_content', 'E')), true); |
|
89 | 89 | |
90 | - $form->addElement(new XoopsFormHidden('article', $art_id)); |
|
91 | - $form->addElement(new XoopsFormHidden('op', 'save')); |
|
90 | + $form->addElement(new XoopsFormHidden('article', $art_id)); |
|
91 | + $form->addElement(new XoopsFormHidden('op', 'save')); |
|
92 | 92 | |
93 | - $button_tray = new XoopsFormElementTray('', ''); |
|
94 | - $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
95 | - $button_tray->addElement($butt_save); |
|
96 | - $butt_del = new XoopsFormButton('', 'del', _DELETE, 'submit'); |
|
97 | - $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'"); |
|
98 | - $button_tray->addElement($butt_del); |
|
99 | - $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
|
100 | - $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
101 | - . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'"); |
|
102 | - $button_tray->addElement($butt_cancel); |
|
103 | - $form->addElement($button_tray); |
|
104 | - $form->display(); |
|
93 | + $button_tray = new XoopsFormElementTray('', ''); |
|
94 | + $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
95 | + $button_tray->addElement($butt_save); |
|
96 | + $butt_del = new XoopsFormButton('', 'del', _DELETE, 'submit'); |
|
97 | + $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'"); |
|
98 | + $button_tray->addElement($butt_del); |
|
99 | + $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
|
100 | + $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
101 | + . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'"); |
|
102 | + $button_tray->addElement($butt_cancel); |
|
103 | + $form->addElement($button_tray); |
|
104 | + $form->display(); |
|
105 | 105 | } |
106 | 106 | include XOOPS_ROOT_PATH . '/footer.php'; |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | |
28 | -include __DIR__ . '/header.php'; |
|
28 | +include __DIR__.'/header.php'; |
|
29 | 29 | |
30 | -$art_id = (int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0)); |
|
30 | +$art_id = (int) (isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0)); |
|
31 | 31 | if (empty($art_id)) { |
32 | 32 | redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
33 | 33 | } |
34 | 34 | if (!$xoopsUser->isAdmin()) { |
35 | 35 | redirect_header('javascript:history.go(-1);', 2, _NOPERM); |
36 | 36 | } |
37 | -include XOOPS_ROOT_PATH . '/header.php'; |
|
38 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
37 | +include XOOPS_ROOT_PATH.'/header.php'; |
|
38 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
39 | 39 | |
40 | 40 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
41 | 41 | $article_obj = $article_handler->get($art_id); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | if ($op === 'del' || !empty($_POST['del'])) { |
46 | 46 | $article_handler->delete($article_obj); |
47 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
47 | + $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'; |
|
48 | 48 | $message = planet_constant('MD_SAVED'); |
49 | 49 | redirect_header($redirect, 2, $message); |
50 | 50 | } elseif ($op === 'save') { |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | |
66 | 66 | $art_id_new = $article_handler->insert($article_obj); |
67 | 67 | if (!$article_obj->getVar('art_id')) { |
68 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
68 | + $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'; |
|
69 | 69 | $message = planet_constant('MD_INSERTERROR'); |
70 | - } else { |
|
71 | - $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
70 | + }else { |
|
71 | + $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.'' |
|
72 | 72 | . $article_obj->getVar('art_id'); |
73 | 73 | $message = planet_constant('MD_SAVED'); |
74 | 74 | } |
75 | 75 | redirect_header($redirect, 2, $message); |
76 | -} else { |
|
77 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
76 | +}else { |
|
77 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
78 | 78 | |
79 | 79 | $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF')); |
80 | 80 | |
@@ -97,10 +97,10 @@ discard block |
||
97 | 97 | $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'"); |
98 | 98 | $button_tray->addElement($butt_del); |
99 | 99 | $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
100 | - $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
101 | - . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'"); |
|
100 | + $butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'] |
|
101 | + . '/view.article.php'.URL_DELIMITER.''.(int) $art_id."\"'"); |
|
102 | 102 | $button_tray->addElement($butt_cancel); |
103 | 103 | $form->addElement($button_tray); |
104 | 104 | $form->display(); |
105 | 105 | } |
106 | -include XOOPS_ROOT_PATH . '/footer.php'; |
|
106 | +include XOOPS_ROOT_PATH.'/footer.php'; |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | include __DIR__ . '/header.php'; |
16 | 16 | |
17 | 17 | if (planet_parse_args($args_num, $args, $args_str)) { |
18 | - $args['article'] = @$args_num[0]; |
|
19 | - $args['op'] = @$args_str[0]; |
|
18 | + $args['article'] = @$args_num[0]; |
|
19 | + $args['op'] = @$args_str[0]; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $article_id = (int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
@@ -25,33 +25,33 @@ discard block |
||
25 | 25 | $op = strtolower(trim($op)); |
26 | 26 | |
27 | 27 | if (empty($article_id)) { |
28 | - if (empty($_SERVER['HTTP_REFERER'])) { |
|
29 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
30 | - xoops_error(_NOPERM); |
|
31 | - $xoopsOption['output_type'] = 'plain'; |
|
32 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
33 | - exit(); |
|
34 | - } else { |
|
35 | - $ref_parser = parse_url($_SERVER['HTTP_REFERER']); |
|
36 | - $uri_parser = parse_url($_SERVER['REQUEST_URI']); |
|
37 | - if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
38 | - || ($ref_parser['path'] != $uri_parser['path']) |
|
39 | - ) { |
|
40 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
41 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
42 | - xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), |
|
43 | - _CLOSE, $_SERVER['HTTP_REFERER']); |
|
44 | - $xoopsOption['output_type'] = 'plain'; |
|
45 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
46 | - exit(); |
|
47 | - } else { |
|
48 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
49 | - xoops_error(_NOPERM); |
|
50 | - $xoopsOption['output_type'] = 'plain'; |
|
51 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
52 | - exit(); |
|
53 | - } |
|
54 | - } |
|
28 | + if (empty($_SERVER['HTTP_REFERER'])) { |
|
29 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
30 | + xoops_error(_NOPERM); |
|
31 | + $xoopsOption['output_type'] = 'plain'; |
|
32 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
33 | + exit(); |
|
34 | + } else { |
|
35 | + $ref_parser = parse_url($_SERVER['HTTP_REFERER']); |
|
36 | + $uri_parser = parse_url($_SERVER['REQUEST_URI']); |
|
37 | + if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
38 | + || ($ref_parser['path'] != $uri_parser['path']) |
|
39 | + ) { |
|
40 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
41 | + include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
42 | + xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), |
|
43 | + _CLOSE, $_SERVER['HTTP_REFERER']); |
|
44 | + $xoopsOption['output_type'] = 'plain'; |
|
45 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
46 | + exit(); |
|
47 | + } else { |
|
48 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
49 | + xoops_error(_NOPERM); |
|
50 | + $xoopsOption['output_type'] = 'plain'; |
|
51 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
52 | + exit(); |
|
53 | + } |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
@@ -59,38 +59,38 @@ discard block |
||
59 | 59 | |
60 | 60 | // Display option form |
61 | 61 | if (empty($op)) { |
62 | - $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
63 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
64 | - exit(); |
|
62 | + $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
63 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
64 | + exit(); |
|
65 | 65 | } else { |
66 | - $data = array(); |
|
67 | - $data['id'] = $article_id; |
|
68 | - $data['title'] = $article_obj->getVar('art_title'); |
|
69 | - $data['time'] = $article_obj->getTime('l'); |
|
70 | - $data['image'] = ''; |
|
71 | - $data['source'] = $article_obj->getVar('art_link'); |
|
72 | - $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
73 | - . $article_obj->getVar('art_id'); |
|
74 | - $data['author'] = $article_obj->getVar('art_author'); |
|
66 | + $data = array(); |
|
67 | + $data['id'] = $article_id; |
|
68 | + $data['title'] = $article_obj->getVar('art_title'); |
|
69 | + $data['time'] = $article_obj->getTime('l'); |
|
70 | + $data['image'] = ''; |
|
71 | + $data['source'] = $article_obj->getVar('art_link'); |
|
72 | + $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
73 | + . $article_obj->getVar('art_id'); |
|
74 | + $data['author'] = $article_obj->getVar('art_author'); |
|
75 | 75 | |
76 | - switch ($op) { |
|
76 | + switch ($op) { |
|
77 | 77 | |
78 | - // Use title |
|
79 | - case 'bookmark'; |
|
80 | - break; |
|
78 | + // Use title |
|
79 | + case 'bookmark'; |
|
80 | + break; |
|
81 | 81 | |
82 | - case 'print': |
|
83 | - case 'pdf': |
|
84 | - ${"{$op}_data"} =& $data; |
|
85 | - ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
86 | - ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
87 | - break; |
|
82 | + case 'print': |
|
83 | + case 'pdf': |
|
84 | + ${"{$op}_data"} =& $data; |
|
85 | + ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
86 | + ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
87 | + break; |
|
88 | 88 | |
89 | - case 'newbb': |
|
90 | - default: |
|
91 | - $data['content'] = $article_obj->getSummary(); |
|
92 | - break; |
|
93 | - } |
|
94 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
95 | - exit(); |
|
89 | + case 'newbb': |
|
90 | + default: |
|
91 | + $data['content'] = $article_obj->getSummary(); |
|
92 | + break; |
|
93 | + } |
|
94 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
95 | + exit(); |
|
96 | 96 | } |
@@ -12,64 +12,64 @@ discard block |
||
12 | 12 | * @package Frameworks::transfer ; module::planet |
13 | 13 | */ |
14 | 14 | |
15 | -include __DIR__ . '/header.php'; |
|
15 | +include __DIR__.'/header.php'; |
|
16 | 16 | |
17 | 17 | if (planet_parse_args($args_num, $args, $args_str)) { |
18 | 18 | $args['article'] = @$args_num[0]; |
19 | 19 | $args['op'] = @$args_str[0]; |
20 | 20 | } |
21 | 21 | |
22 | -$article_id = (int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
|
22 | +$article_id = (int) (empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
|
23 | 23 | |
24 | 24 | $op = empty($_GET['op']) ? (empty($_POST['op']) ? @$args['op'] : $_POST['op']) : $_GET['op']; |
25 | 25 | $op = strtolower(trim($op)); |
26 | 26 | |
27 | 27 | if (empty($article_id)) { |
28 | 28 | if (empty($_SERVER['HTTP_REFERER'])) { |
29 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
29 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
30 | 30 | xoops_error(_NOPERM); |
31 | 31 | $xoopsOption['output_type'] = 'plain'; |
32 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
32 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
33 | 33 | exit(); |
34 | - } else { |
|
34 | + }else { |
|
35 | 35 | $ref_parser = parse_url($_SERVER['HTTP_REFERER']); |
36 | 36 | $uri_parser = parse_url($_SERVER['REQUEST_URI']); |
37 | 37 | if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
38 | 38 | || ($ref_parser['path'] != $uri_parser['path']) |
39 | 39 | ) { |
40 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
41 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
40 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
41 | + include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
42 | 42 | xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), |
43 | 43 | _CLOSE, $_SERVER['HTTP_REFERER']); |
44 | 44 | $xoopsOption['output_type'] = 'plain'; |
45 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
45 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
46 | 46 | exit(); |
47 | - } else { |
|
48 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
47 | + }else { |
|
48 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
49 | 49 | xoops_error(_NOPERM); |
50 | 50 | $xoopsOption['output_type'] = 'plain'; |
51 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
51 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
52 | 52 | exit(); |
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | 57 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
58 | -$article_obj =& $article_handler->get($article_id); |
|
58 | +$article_obj = & $article_handler->get($article_id); |
|
59 | 59 | |
60 | 60 | // Display option form |
61 | 61 | if (empty($op)) { |
62 | 62 | $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
63 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
63 | + include XOOPS_ROOT_PATH.'/Frameworks/transfer/option.transfer.php'; |
|
64 | 64 | exit(); |
65 | -} else { |
|
65 | +}else { |
|
66 | 66 | $data = array(); |
67 | 67 | $data['id'] = $article_id; |
68 | 68 | $data['title'] = $article_obj->getVar('art_title'); |
69 | 69 | $data['time'] = $article_obj->getTime('l'); |
70 | 70 | $data['image'] = ''; |
71 | 71 | $data['source'] = $article_obj->getVar('art_link'); |
72 | - $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
72 | + $data['url'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.'' |
|
73 | 73 | . $article_obj->getVar('art_id'); |
74 | 74 | $data['author'] = $article_obj->getVar('art_author'); |
75 | 75 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | case 'print': |
83 | 83 | case 'pdf': |
84 | - ${"{$op}_data"} =& $data; |
|
84 | + ${"{$op}_data"} = & $data; |
|
85 | 85 | ${"{$op}_data"}['date'] = $pdf_data['time']; |
86 | 86 | ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
87 | 87 | break; |
@@ -91,6 +91,6 @@ discard block |
||
91 | 91 | $data['content'] = $article_obj->getSummary(); |
92 | 92 | break; |
93 | 93 | } |
94 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
94 | + include XOOPS_ROOT_PATH.'/Frameworks/transfer/action.transfer.php'; |
|
95 | 95 | exit(); |
96 | 96 | } |
@@ -28,52 +28,52 @@ |
||
28 | 28 | */ |
29 | 29 | global $pdf_data; |
30 | 30 | if (!empty($_POST['pdf_data'])) { |
31 | - $pdf_data = unserialize(base64_decode($_POST['pdf_data'])); |
|
31 | + $pdf_data = unserialize(base64_decode($_POST['pdf_data'])); |
|
32 | 32 | } elseif (!empty($pdf_data)) { |
33 | 33 | } else { |
34 | - error_reporting(0); |
|
35 | - include __DIR__ . '/header.php'; |
|
36 | - error_reporting(0); |
|
34 | + error_reporting(0); |
|
35 | + include __DIR__ . '/header.php'; |
|
36 | + error_reporting(0); |
|
37 | 37 | |
38 | - if (planet_parse_args($args_num, $args, $args_str)) { |
|
39 | - $args['article'] = @$args_num[0]; |
|
40 | - } |
|
38 | + if (planet_parse_args($args_num, $args, $args_str)) { |
|
39 | + $args['article'] = @$args_num[0]; |
|
40 | + } |
|
41 | 41 | |
42 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
42 | + $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
43 | 43 | |
44 | - $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
45 | - $article_obj =& $article_handler->get($article_id); |
|
44 | + $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
45 | + $article_obj =& $article_handler->get($article_id); |
|
46 | 46 | |
47 | - $article_data = array(); |
|
47 | + $article_data = array(); |
|
48 | 48 | |
49 | - // title |
|
50 | - $article_data['title'] = $article_obj->getVar('art_title'); |
|
49 | + // title |
|
50 | + $article_data['title'] = $article_obj->getVar('art_title'); |
|
51 | 51 | |
52 | - $article_data['author'] = $article_obj->getVar('art_author'); |
|
52 | + $article_data['author'] = $article_obj->getVar('art_author'); |
|
53 | 53 | |
54 | - // source |
|
55 | - $article_data['source'] = $article_obj->getVar('art_link'); |
|
54 | + // source |
|
55 | + $article_data['source'] = $article_obj->getVar('art_link'); |
|
56 | 56 | |
57 | - // publish time |
|
58 | - $article_data['time'] = $article_obj->getTime(); |
|
57 | + // publish time |
|
58 | + $article_data['time'] = $article_obj->getTime(); |
|
59 | 59 | |
60 | - // summary |
|
61 | - $article_data['summary'] = $article_obj->getSummary(); |
|
60 | + // summary |
|
61 | + $article_data['summary'] = $article_obj->getSummary(); |
|
62 | 62 | |
63 | - // text of page |
|
64 | - $article_data['text'] = $article_obj->getVar('art_content'); |
|
63 | + // text of page |
|
64 | + $article_data['text'] = $article_obj->getVar('art_content'); |
|
65 | 65 | |
66 | - // Build the pdf_data array |
|
67 | - $pdf_data['title'] = $article_data['title']; |
|
68 | - $pdf_data['author'] = $article_data['author']; |
|
69 | - $pdf_data['date'] = $article_data['time']; |
|
70 | - $pdf_data['content'] = ''; |
|
71 | - if ($article_data['summary']) { |
|
72 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
73 | - } |
|
74 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
75 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER |
|
76 | - . $article_obj->getVar('art_id'); |
|
66 | + // Build the pdf_data array |
|
67 | + $pdf_data['title'] = $article_data['title']; |
|
68 | + $pdf_data['author'] = $article_data['author']; |
|
69 | + $pdf_data['date'] = $article_data['time']; |
|
70 | + $pdf_data['content'] = ''; |
|
71 | + if ($article_data['summary']) { |
|
72 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
73 | + } |
|
74 | + $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
75 | + $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER |
|
76 | + . $article_obj->getVar('art_id'); |
|
77 | 77 | } |
78 | 78 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
79 | 79 |
@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | if (!empty($_POST['pdf_data'])) { |
31 | 31 | $pdf_data = unserialize(base64_decode($_POST['pdf_data'])); |
32 | 32 | } elseif (!empty($pdf_data)) { |
33 | -} else { |
|
33 | +}else { |
|
34 | 34 | error_reporting(0); |
35 | - include __DIR__ . '/header.php'; |
|
35 | + include __DIR__.'/header.php'; |
|
36 | 36 | error_reporting(0); |
37 | 37 | |
38 | 38 | if (planet_parse_args($args_num, $args, $args_str)) { |
39 | 39 | $args['article'] = @$args_num[0]; |
40 | 40 | } |
41 | 41 | |
42 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
42 | + $article_id = (int) (empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
43 | 43 | |
44 | 44 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
45 | - $article_obj =& $article_handler->get($article_id); |
|
45 | + $article_obj = & $article_handler->get($article_id); |
|
46 | 46 | |
47 | 47 | $article_data = array(); |
48 | 48 | |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | $pdf_data['date'] = $article_data['time']; |
70 | 70 | $pdf_data['content'] = ''; |
71 | 71 | if ($article_data['summary']) { |
72 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
72 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY').': '.$article_data['summary'].'<br><br>'; |
|
73 | 73 | } |
74 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
75 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER |
|
74 | + $pdf_data['content'] .= $article_data['text'].'<br>'; |
|
75 | + $pdf_data['url'] = XOOPS_URL.'/modules/'.$GLOBALS['artdirname'].'/view.article.php'.URL_DELIMITER |
|
76 | 76 | . $article_obj->getVar('art_id'); |
77 | 77 | } |
78 | 78 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
79 | 79 | |
80 | -include XOOPS_ROOT_PATH . '/Frameworks/fpdf/init.php'; |
|
80 | +include XOOPS_ROOT_PATH.'/Frameworks/fpdf/init.php'; |
|
81 | 81 | error_reporting(0); |
82 | 82 | ob_end_clean(); |
83 | 83 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | planet_parse_function(' |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
16 | 16 | |
17 | 17 | if (!@include_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
18 | - return null; |
|
18 | + return null; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | // Specify the addons to skip for the module |
@@ -28,38 +28,38 @@ discard block |
||
28 | 28 | */ |
29 | 29 | class ModuleTransferHandler extends TransferHandler |
30 | 30 | { |
31 | - /** |
|
32 | - * ModuleTransferHandler constructor. |
|
33 | - */ |
|
34 | - public function __construct() { |
|
35 | - parent::__construct(); |
|
36 | - } |
|
31 | + /** |
|
32 | + * ModuleTransferHandler constructor. |
|
33 | + */ |
|
34 | + public function __construct() { |
|
35 | + parent::__construct(); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Get valid addon list |
|
40 | - * |
|
41 | - * @param array $skip Addons to skip |
|
42 | - * @param boolean $sort To sort the list upon 'level' |
|
43 | - * return array $list |
|
44 | - */ |
|
45 | - public function &getList($skip = array(), $sort = true) { |
|
46 | - $list = parent::getList($skip, $sort); |
|
38 | + /** |
|
39 | + * Get valid addon list |
|
40 | + * |
|
41 | + * @param array $skip Addons to skip |
|
42 | + * @param boolean $sort To sort the list upon 'level' |
|
43 | + * return array $list |
|
44 | + */ |
|
45 | + public function &getList($skip = array(), $sort = true) { |
|
46 | + $list = parent::getList($skip, $sort); |
|
47 | 47 | |
48 | - return $list; |
|
49 | - } |
|
48 | + return $list; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * If need change config of an item |
|
53 | - * 1 parent::load_item |
|
54 | - * 2 $this->config |
|
55 | - * 3 $this->do_transfer |
|
56 | - * @param $item |
|
57 | - * @param $data |
|
58 | - * @return |
|
59 | - */ |
|
60 | - public function do_transfer($item, &$data) { |
|
61 | - $ret = parent::do_transfer($item, $data); |
|
51 | + /** |
|
52 | + * If need change config of an item |
|
53 | + * 1 parent::load_item |
|
54 | + * 2 $this->config |
|
55 | + * 3 $this->do_transfer |
|
56 | + * @param $item |
|
57 | + * @param $data |
|
58 | + * @return |
|
59 | + */ |
|
60 | + public function do_transfer($item, &$data) { |
|
61 | + $ret = parent::do_transfer($item, $data); |
|
62 | 62 | |
63 | - return $ret; |
|
64 | - } |
|
63 | + return $ret; |
|
64 | + } |
|
65 | 65 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
16 | 16 | |
17 | -if (!@include_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
|
17 | +if (!@include_once XOOPS_ROOT_PATH.'/Frameworks/transfer/transfer.php') { |
|
18 | 18 | return null; |
19 | 19 | } |
20 | 20 |