@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | |
36 | 36 | $op = $op = Request::getCmd('op', Request::getCmd('op', '', 'POST'), 'GET'); //!empty($_GET['op'])? $_GET['op'] : (!empty($_POST['op'])?$_POST['op']:""); |
37 | 37 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | case 'delvotes': |
40 | 40 | $rid = Request::getInt('rid', 0, 'GET'); |
41 | 41 | $topic_id = Request::getInt('topic_id', 0, 'GET'); |
42 | - $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . " WHERE ratingid = $rid"); |
|
42 | + $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata')." WHERE ratingid = $rid"); |
|
43 | 43 | $GLOBALS['xoopsDB']->query($sql); |
44 | 44 | |
45 | - $query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
45 | + $query = 'SELECT rating FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' WHERE topic_id = '.$topic_id.' '; |
|
46 | 46 | $voteresult = $GLOBALS['xoopsDB']->query($query); |
47 | 47 | $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
48 | 48 | $totalrating = 0; |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | $useravgrating = '0'; |
64 | 64 | $uservotes = '0'; |
65 | 65 | |
66 | - $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' ORDER BY ratingtimestamp DESC'; |
|
66 | + $sql = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' ORDER BY ratingtimestamp DESC'; |
|
67 | 67 | $results = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
68 | 68 | $votes = $GLOBALS['xoopsDB']->getRowsNum($results); |
69 | 69 | |
70 | - $sql = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' '; |
|
70 | + $sql = 'SELECT rating FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' '; |
|
71 | 71 | $result2 = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
72 | 72 | $uservotes = $GLOBALS['xoopsDB']->getRowsNum($result2); |
73 | 73 | $useravgrating = 0; |
@@ -86,28 +86,28 @@ discard block |
||
86 | 86 | $adminObject->displayNavigation(basename(__FILE__)); |
87 | 87 | |
88 | 88 | echo "<div style='padding: 8px;'>\n |
89 | - <div><strong>" . _AM_NEWBB_VOTE_USERAVG . ": </strong>$useravgrating</div>\n |
|
90 | - <div><strong>" . _AM_NEWBB_VOTE_TOTALRATE . ": </strong>$uservotes</div>\n |
|
89 | + <div><strong>" . _AM_NEWBB_VOTE_USERAVG.": </strong>$useravgrating</div>\n |
|
90 | + <div><strong>"._AM_NEWBB_VOTE_TOTALRATE.": </strong>$uservotes</div>\n |
|
91 | 91 | <div style='padding: 8px;'>\n |
92 | - <ul><li> " . _AM_NEWBB_VOTE_DELETEDSC . "</li></ul> |
|
92 | + <ul><li> "._AM_NEWBB_VOTE_DELETEDSC."</li></ul> |
|
93 | 93 | <div>\n |
94 | 94 | <br>\n |
95 | 95 | <table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'> |
96 | 96 | <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n |
97 | 97 | <tr>\n |
98 | - <th align='center'>" . _AM_NEWBB_VOTE_ID . "</th>\n |
|
99 | - <th align='center'>" . _AM_NEWBB_VOTE_USER . "</th>\n |
|
100 | - <th align='center'>" . _AM_NEWBB_VOTE_IP . "</th>\n |
|
101 | - <th align='center'>" . _AM_NEWBB_VOTE_FILETITLE . "</th>\n |
|
102 | - <th align='center'>" . _AM_NEWBB_VOTE_RATING . "</th>\n |
|
103 | - <th align='center'>" . _AM_NEWBB_VOTE_DATE . "</th>\n |
|
104 | - <th align='center'>" . _AM_NEWBB_ACTION . "</th></tr>\n"; |
|
98 | + <th align='center'>" . _AM_NEWBB_VOTE_ID."</th>\n |
|
99 | + <th align='center'>" . _AM_NEWBB_VOTE_USER."</th>\n |
|
100 | + <th align='center'>" . _AM_NEWBB_VOTE_IP."</th>\n |
|
101 | + <th align='center'>" . _AM_NEWBB_VOTE_FILETITLE."</th>\n |
|
102 | + <th align='center'>" . _AM_NEWBB_VOTE_RATING."</th>\n |
|
103 | + <th align='center'>" . _AM_NEWBB_VOTE_DATE."</th>\n |
|
104 | + <th align='center'>" . _AM_NEWBB_ACTION."</th></tr>\n"; |
|
105 | 105 | |
106 | 106 | if (0 == $votes) { |
107 | - echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . '</td></tr>'; |
|
107 | + echo "<tr><td align='center' colspan='7' class='head'>"._AM_NEWBB_VOTE_NOVOTES.'</td></tr>'; |
|
108 | 108 | } |
109 | 109 | while (false !== (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $GLOBALS['xoopsDB']->fetchRow($results))) { |
110 | - $sql = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id=' . $topic_id . ' '; |
|
110 | + $sql = 'SELECT topic_title FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE topic_id='.$topic_id.' '; |
|
111 | 111 | $down_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
112 | 112 | |
113 | 113 | $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | <td class='head' align='center'>$ratingid</td>\n |
118 | 118 | <td class='even' align='center'>$ratinguname</td>\n |
119 | 119 | <td class='even' align='center' >$ratinghostname</td>\n |
120 | - <td class='even' align='left'><a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id . "' target='topic'>" . $myts->htmlSpecialChars($down_array['topic_title']) . "</a></td>\n |
|
120 | + <td class='even' align='left'><a href='".XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$topic_id."' target='topic'>".$myts->htmlSpecialChars($down_array['topic_title'])."</a></td>\n |
|
121 | 121 | <td class='even' align='center'>$rating</td>\n |
122 | 122 | <td class='even' align='center'>$formatted_date</td>\n |
123 | - <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id=$topic_id&rid=$ratingid'>" . newbbDisplayImage('p_delete', _DELETE) . "</a></strong></td>\n |
|
123 | + <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id=$topic_id&rid=$ratingid'>".newbbDisplayImage('p_delete', _DELETE)."</a></strong></td>\n |
|
124 | 124 | </tr>\n"; |
125 | 125 | } |
126 | 126 | echo '</table>'; |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
130 | 130 | $page = ($votes > 10) ? _AM_NEWBB_INDEX_PAGE : ''; |
131 | 131 | $pagenav = new \XoopsPageNav($page, 20, $start, 'start'); |
132 | - echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; |
|
132 | + echo '<div align="right" style="padding: 8px;">'.$page.''.$pagenav->renderImageNav(4).'</div>'; |
|
133 | 133 | echo '<fieldset>'; |
134 | - echo '<legend> ' . _MI_NEWBB_ADMENU_VOTE . ' </legend>'; |
|
134 | + echo '<legend> '._MI_NEWBB_ADMENU_VOTE.' </legend>'; |
|
135 | 135 | echo _AM_NEWBB_HELP_VOTE_TAB; |
136 | 136 | echo '</fieldset>'; |
137 | 137 | break; |
138 | 138 | } |
139 | -require_once __DIR__ . '/admin_footer.php'; |
|
139 | +require_once __DIR__.'/admin_footer.php'; |
@@ -36,56 +36,56 @@ discard block |
||
36 | 36 | $op = $op = Request::getCmd('op', Request::getCmd('op', '', 'POST'), 'GET'); //!empty($_GET['op'])? $_GET['op'] : (!empty($_POST['op'])?$_POST['op']:""); |
37 | 37 | |
38 | 38 | switch ($op) { |
39 | - case 'delvotes': |
|
40 | - $rid = Request::getInt('rid', 0, 'GET'); |
|
41 | - $topic_id = Request::getInt('topic_id', 0, 'GET'); |
|
42 | - $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . " WHERE ratingid = $rid"); |
|
43 | - $GLOBALS['xoopsDB']->query($sql); |
|
39 | + case 'delvotes': |
|
40 | + $rid = Request::getInt('rid', 0, 'GET'); |
|
41 | + $topic_id = Request::getInt('topic_id', 0, 'GET'); |
|
42 | + $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . " WHERE ratingid = $rid"); |
|
43 | + $GLOBALS['xoopsDB']->query($sql); |
|
44 | 44 | |
45 | - $query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
46 | - $voteresult = $GLOBALS['xoopsDB']->query($query); |
|
47 | - $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
|
48 | - $totalrating = 0; |
|
49 | - while (false !== (list($rating) = $GLOBALS['xoopsDB']->fetchRow($voteresult))) { |
|
50 | - $totalrating += $rating; |
|
51 | - } |
|
52 | - $finalrating = $totalrating / $votesDB; |
|
53 | - $finalrating = number_format($finalrating, 4); |
|
54 | - $sql = sprintf('UPDATE `%s` SET rating = %u, votes = %u WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $finalrating, $votesDB, $topic_id); |
|
55 | - $GLOBALS['xoopsDB']->queryF($sql); |
|
45 | + $query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
46 | + $voteresult = $GLOBALS['xoopsDB']->query($query); |
|
47 | + $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
|
48 | + $totalrating = 0; |
|
49 | + while (false !== (list($rating) = $GLOBALS['xoopsDB']->fetchRow($voteresult))) { |
|
50 | + $totalrating += $rating; |
|
51 | + } |
|
52 | + $finalrating = $totalrating / $votesDB; |
|
53 | + $finalrating = number_format($finalrating, 4); |
|
54 | + $sql = sprintf('UPDATE `%s` SET rating = %u, votes = %u WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $finalrating, $votesDB, $topic_id); |
|
55 | + $GLOBALS['xoopsDB']->queryF($sql); |
|
56 | 56 | |
57 | - redirect_header('admin_votedata.php', 1, _AM_NEWBB_VOTEDELETED); |
|
58 | - break; |
|
57 | + redirect_header('admin_votedata.php', 1, _AM_NEWBB_VOTEDELETED); |
|
58 | + break; |
|
59 | 59 | |
60 | - case 'main': |
|
61 | - default: |
|
62 | - $start = Request::getInt('start', 0, 'POST'); |
|
63 | - $useravgrating = '0'; |
|
64 | - $uservotes = '0'; |
|
60 | + case 'main': |
|
61 | + default: |
|
62 | + $start = Request::getInt('start', 0, 'POST'); |
|
63 | + $useravgrating = '0'; |
|
64 | + $uservotes = '0'; |
|
65 | 65 | |
66 | - $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' ORDER BY ratingtimestamp DESC'; |
|
67 | - $results = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
68 | - $votes = $GLOBALS['xoopsDB']->getRowsNum($results); |
|
66 | + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' ORDER BY ratingtimestamp DESC'; |
|
67 | + $results = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
68 | + $votes = $GLOBALS['xoopsDB']->getRowsNum($results); |
|
69 | 69 | |
70 | - $sql = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' '; |
|
71 | - $result2 = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
72 | - $uservotes = $GLOBALS['xoopsDB']->getRowsNum($result2); |
|
73 | - $useravgrating = 0; |
|
70 | + $sql = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' '; |
|
71 | + $result2 = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
72 | + $uservotes = $GLOBALS['xoopsDB']->getRowsNum($result2); |
|
73 | + $useravgrating = 0; |
|
74 | 74 | |
75 | - while (false !== (list($rating2) = $GLOBALS['xoopsDB']->fetchRow($result2))) { |
|
76 | - // $useravgrating = $useravgrating + $rating2; |
|
77 | - $useravgrating += $rating2; |
|
78 | - } |
|
79 | - if ($useravgrating > 0) { |
|
80 | - // $useravgrating = $useravgrating / $uservotes; |
|
81 | - $useravgrating /= $uservotes; |
|
82 | - $useravgrating = number_format($useravgrating, 2); |
|
83 | - } |
|
75 | + while (false !== (list($rating2) = $GLOBALS['xoopsDB']->fetchRow($result2))) { |
|
76 | + // $useravgrating = $useravgrating + $rating2; |
|
77 | + $useravgrating += $rating2; |
|
78 | + } |
|
79 | + if ($useravgrating > 0) { |
|
80 | + // $useravgrating = $useravgrating / $uservotes; |
|
81 | + $useravgrating /= $uservotes; |
|
82 | + $useravgrating = number_format($useravgrating, 2); |
|
83 | + } |
|
84 | 84 | |
85 | - xoops_cp_header(); |
|
86 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
85 | + xoops_cp_header(); |
|
86 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
87 | 87 | |
88 | - echo "<div style='padding: 8px;'>\n |
|
88 | + echo "<div style='padding: 8px;'>\n |
|
89 | 89 | <div><strong>" . _AM_NEWBB_VOTE_USERAVG . ": </strong>$useravgrating</div>\n |
90 | 90 | <div><strong>" . _AM_NEWBB_VOTE_TOTALRATE . ": </strong>$uservotes</div>\n |
91 | 91 | <div style='padding: 8px;'>\n |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | <th align='center'>" . _AM_NEWBB_VOTE_DATE . "</th>\n |
104 | 104 | <th align='center'>" . _AM_NEWBB_ACTION . "</th></tr>\n"; |
105 | 105 | |
106 | - if (0 == $votes) { |
|
107 | - echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . '</td></tr>'; |
|
108 | - } |
|
109 | - while (false !== (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $GLOBALS['xoopsDB']->fetchRow($results))) { |
|
110 | - $sql = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id=' . $topic_id . ' '; |
|
111 | - $down_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
|
106 | + if (0 == $votes) { |
|
107 | + echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . '</td></tr>'; |
|
108 | + } |
|
109 | + while (false !== (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $GLOBALS['xoopsDB']->fetchRow($results))) { |
|
110 | + $sql = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id=' . $topic_id . ' '; |
|
111 | + $down_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
|
112 | 112 | |
113 | - $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); |
|
114 | - $ratinguname = newbbGetUnameFromId($ratinguser, $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
115 | - echo " |
|
113 | + $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); |
|
114 | + $ratinguname = newbbGetUnameFromId($ratinguser, $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
115 | + echo " |
|
116 | 116 | <tr>\n |
117 | 117 | <td class='head' align='center'>$ratingid</td>\n |
118 | 118 | <td class='even' align='center'>$ratinguname</td>\n |
@@ -122,18 +122,18 @@ discard block |
||
122 | 122 | <td class='even' align='center'>$formatted_date</td>\n |
123 | 123 | <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id=$topic_id&rid=$ratingid'>" . newbbDisplayImage('p_delete', _DELETE) . "</a></strong></td>\n |
124 | 124 | </tr>\n"; |
125 | - } |
|
126 | - echo '</table>'; |
|
127 | - echo '</td></tr></table>'; |
|
128 | - //Include page navigation |
|
129 | - require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
|
130 | - $page = ($votes > 10) ? _AM_NEWBB_INDEX_PAGE : ''; |
|
131 | - $pagenav = new \XoopsPageNav($page, 20, $start, 'start'); |
|
132 | - echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; |
|
133 | - echo '<fieldset>'; |
|
134 | - echo '<legend> ' . _MI_NEWBB_ADMENU_VOTE . ' </legend>'; |
|
135 | - echo _AM_NEWBB_HELP_VOTE_TAB; |
|
136 | - echo '</fieldset>'; |
|
137 | - break; |
|
125 | + } |
|
126 | + echo '</table>'; |
|
127 | + echo '</td></tr></table>'; |
|
128 | + //Include page navigation |
|
129 | + require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
|
130 | + $page = ($votes > 10) ? _AM_NEWBB_INDEX_PAGE : ''; |
|
131 | + $pagenav = new \XoopsPageNav($page, 20, $start, 'start'); |
|
132 | + echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; |
|
133 | + echo '<fieldset>'; |
|
134 | + echo '<legend> ' . _MI_NEWBB_ADMENU_VOTE . ' </legend>'; |
|
135 | + echo _AM_NEWBB_HELP_VOTE_TAB; |
|
136 | + echo '</fieldset>'; |
|
137 | + break; |
|
138 | 138 | } |
139 | 139 | require_once __DIR__ . '/admin_footer.php'; |
@@ -29,11 +29,11 @@ |
||
29 | 29 | // Project: XOOPS Project // |
30 | 30 | // ------------------------------------------------------------------------- // |
31 | 31 | |
32 | -require_once __DIR__ . '/admin_header.php'; |
|
32 | +require_once __DIR__.'/admin_header.php'; |
|
33 | 33 | xoops_cp_header(); |
34 | 34 | |
35 | 35 | $adminObject->displayNavigation(basename(__FILE__)); |
36 | 36 | \Xmf\Module\Admin::setPaypal('PBQZ7D6LT6UBC'); |
37 | 37 | $adminObject->displayAbout(false); |
38 | 38 | |
39 | -require_once __DIR__ . '/admin_footer.php'; |
|
39 | +require_once __DIR__.'/admin_footer.php'; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
36 | 36 | |
37 | 37 | $op = Request::getCmd('op', Request::getCmd('op', 'default', 'POST'), 'GET'); // !empty($_GET['op'])? $_GET['op'] : (!empty($_POST['op'])?$_POST['op']:"default"); |
@@ -87,16 +87,16 @@ discard block |
||
87 | 87 | |
88 | 88 | //if (!$newXoopsModuleGui) loadModuleAdminMenu(7,_AM_NEWBB_DIGESTADMIN); |
89 | 89 | // else $adminObject->displayNavigation(basename(__FILE__)); |
90 | - echo '<ul><li>' . _AM_NEWBB_DIGEST_HELP_1 . '</li>'; |
|
91 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_2 . '</li>'; |
|
92 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_3 . '</li>'; |
|
93 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_4 . '</li></ul>'; |
|
94 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
95 | - echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">'; |
|
90 | + echo '<ul><li>'._AM_NEWBB_DIGEST_HELP_1.'</li>'; |
|
91 | + echo '<li>'._AM_NEWBB_DIGEST_HELP_2.'</li>'; |
|
92 | + echo '<li>'._AM_NEWBB_DIGEST_HELP_3.'</li>'; |
|
93 | + echo '<li>'._AM_NEWBB_DIGEST_HELP_4.'</li></ul>'; |
|
94 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
95 | + echo '<form action="'.xoops_getenv('PHP_SELF').'" method="post">'; |
|
96 | 96 | echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
97 | 97 | echo "<tr align='center'>"; |
98 | - echo "<th class='bg3' width='2%'>" . _DELETE . '</th>'; |
|
99 | - echo "<th class='bg3'>" . _AM_NEWBB_DIGESTCONTENT . '</th>'; |
|
98 | + echo "<th class='bg3' width='2%'>"._DELETE.'</th>'; |
|
99 | + echo "<th class='bg3'>"._AM_NEWBB_DIGESTCONTENT.'</th>'; |
|
100 | 100 | echo '</tr>'; |
101 | 101 | |
102 | 102 | $digests = []; |
@@ -105,22 +105,22 @@ discard block |
||
105 | 105 | $digests = $digestHandler->getAllDigests($start, $limit); |
106 | 106 | foreach ($digests as $digest) { |
107 | 107 | echo "<tr class='odd' align='left'>"; |
108 | - echo "<td align='center' ><input type='checkbox' name='digest_id[" . $digest['digest_id'] . "]' value='1' /></td>"; |
|
109 | - echo '<td><strong>#' . $digest['digest_id'] . ' @ ' . formatTimestamp($digest['digest_time']) . '</strong><br>' . str_replace("\n", '<br>', $digest['digest_content']) . '</td>'; |
|
108 | + echo "<td align='center' ><input type='checkbox' name='digest_id[".$digest['digest_id']."]' value='1' /></td>"; |
|
109 | + echo '<td><strong>#'.$digest['digest_id'].' @ '.formatTimestamp($digest['digest_time']).'</strong><br>'.str_replace("\n", '<br>', $digest['digest_content']).'</td>'; |
|
110 | 110 | echo '</tr>'; |
111 | 111 | echo "<tr colspan='2'><td height='2'></td></tr>"; |
112 | 112 | } |
113 | 113 | $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
114 | - echo "<tr><td colspan='2' align='center'>" . $submit->render() . '</td></tr>'; |
|
114 | + echo "<tr><td colspan='2' align='center'>".$submit->render().'</td></tr>'; |
|
115 | 115 | $hidden = new \XoopsFormHidden('op', 'delete'); |
116 | 116 | echo $hidden->render(); |
117 | 117 | $hidden = new \XoopsFormHidden('item', $item); |
118 | - echo $hidden->render() . '</form>'; |
|
118 | + echo $hidden->render().'</form>'; |
|
119 | 119 | |
120 | 120 | echo '</table>'; |
121 | 121 | echo '</td></tr></table>'; |
122 | 122 | echo '<fieldset>'; |
123 | - echo '<legend> ' . _AM_NEWBB_PREFERENCES . ' - ' . _MI_NEWBB_ADMENU_DIGEST . ' </legend>'; |
|
123 | + echo '<legend> '._AM_NEWBB_PREFERENCES.' - '._MI_NEWBB_ADMENU_DIGEST.' </legend>'; |
|
124 | 124 | echo _AM_NEWBB_DIGEST_HELP_AUTO_DIGEST; |
125 | 125 | echo '</fieldset>'; |
126 | 126 | $nav = new \XoopsPageNav($digestHandler->getDigestCount(), $limit, $start, 'start'); |
@@ -128,4 +128,4 @@ discard block |
||
128 | 128 | |
129 | 129 | break; |
130 | 130 | } |
131 | -require_once __DIR__ . '/admin_footer.php'; |
|
131 | +require_once __DIR__.'/admin_footer.php'; |
@@ -42,90 +42,90 @@ |
||
42 | 42 | |
43 | 43 | xoops_cp_header(); |
44 | 44 | switch ($op) { |
45 | - case 'delete': |
|
46 | - $digest_ids = Request::getArray('digest_id', [], 'POST'); |
|
47 | - // /** @var Newbb\DigestHandler $digestHandler */ |
|
48 | - // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
49 | - foreach ($digest_ids as $did => $value) { |
|
50 | - $digest = $digestHandler->get($did); |
|
51 | - $digestHandler->delete($digest); |
|
52 | - } |
|
53 | - redirect_header('admin_digest.php', 1); |
|
54 | - break; |
|
45 | + case 'delete': |
|
46 | + $digest_ids = Request::getArray('digest_id', [], 'POST'); |
|
47 | + // /** @var Newbb\DigestHandler $digestHandler */ |
|
48 | + // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
49 | + foreach ($digest_ids as $did => $value) { |
|
50 | + $digest = $digestHandler->get($did); |
|
51 | + $digestHandler->delete($digest); |
|
52 | + } |
|
53 | + redirect_header('admin_digest.php', 1); |
|
54 | + break; |
|
55 | 55 | |
56 | - case 'digest': |
|
57 | - xoops_confirm(['op' => 'digestconfirmed'], 'admin_digest.php', _AM_NEWBB_DIGEST_CONFIRM); |
|
58 | - break; |
|
59 | - case 'digestconfirmed': |
|
60 | - $message = ''; |
|
61 | - if ('POST' === Request::getMethod()) { |
|
62 | - // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
56 | + case 'digest': |
|
57 | + xoops_confirm(['op' => 'digestconfirmed'], 'admin_digest.php', _AM_NEWBB_DIGEST_CONFIRM); |
|
58 | + break; |
|
59 | + case 'digestconfirmed': |
|
60 | + $message = ''; |
|
61 | + if ('POST' === Request::getMethod()) { |
|
62 | + // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
63 | 63 | |
64 | - switch ($digestHandler->process(true)) { |
|
65 | - case 0: |
|
66 | - $message = _AM_NEWBB_DIGEST_SENT; |
|
67 | - break; |
|
68 | - case 4: |
|
69 | - $message = _AM_NEWBB_DIGEST_NOT_SENT; |
|
70 | - break; |
|
71 | - default: |
|
72 | - $message = _AM_NEWBB_DIGEST_FAILED; |
|
73 | - break; |
|
74 | - } |
|
75 | - } |
|
76 | - redirect_header('admin_digest.php', 1, $message); |
|
77 | - break; |
|
64 | + switch ($digestHandler->process(true)) { |
|
65 | + case 0: |
|
66 | + $message = _AM_NEWBB_DIGEST_SENT; |
|
67 | + break; |
|
68 | + case 4: |
|
69 | + $message = _AM_NEWBB_DIGEST_NOT_SENT; |
|
70 | + break; |
|
71 | + default: |
|
72 | + $message = _AM_NEWBB_DIGEST_FAILED; |
|
73 | + break; |
|
74 | + } |
|
75 | + } |
|
76 | + redirect_header('admin_digest.php', 1, $message); |
|
77 | + break; |
|
78 | 78 | |
79 | - default: |
|
80 | - require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
79 | + default: |
|
80 | + require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
81 | 81 | |
82 | - $limit = 5; |
|
83 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
82 | + $limit = 5; |
|
83 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
84 | 84 | |
85 | - $adminObject->addItemButton(_AM_NEWBB_DIGEST, 'admin_digest.php?op=digest', $icon = 'add'); |
|
86 | - $adminObject->displayButton('left'); |
|
85 | + $adminObject->addItemButton(_AM_NEWBB_DIGEST, 'admin_digest.php?op=digest', $icon = 'add'); |
|
86 | + $adminObject->displayButton('left'); |
|
87 | 87 | |
88 | - //if (!$newXoopsModuleGui) loadModuleAdminMenu(7,_AM_NEWBB_DIGESTADMIN); |
|
89 | - // else $adminObject->displayNavigation(basename(__FILE__)); |
|
90 | - echo '<ul><li>' . _AM_NEWBB_DIGEST_HELP_1 . '</li>'; |
|
91 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_2 . '</li>'; |
|
92 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_3 . '</li>'; |
|
93 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_4 . '</li></ul>'; |
|
94 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
95 | - echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">'; |
|
96 | - echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
|
97 | - echo "<tr align='center'>"; |
|
98 | - echo "<th class='bg3' width='2%'>" . _DELETE . '</th>'; |
|
99 | - echo "<th class='bg3'>" . _AM_NEWBB_DIGESTCONTENT . '</th>'; |
|
100 | - echo '</tr>'; |
|
88 | + //if (!$newXoopsModuleGui) loadModuleAdminMenu(7,_AM_NEWBB_DIGESTADMIN); |
|
89 | + // else $adminObject->displayNavigation(basename(__FILE__)); |
|
90 | + echo '<ul><li>' . _AM_NEWBB_DIGEST_HELP_1 . '</li>'; |
|
91 | + echo '<li>' . _AM_NEWBB_DIGEST_HELP_2 . '</li>'; |
|
92 | + echo '<li>' . _AM_NEWBB_DIGEST_HELP_3 . '</li>'; |
|
93 | + echo '<li>' . _AM_NEWBB_DIGEST_HELP_4 . '</li></ul>'; |
|
94 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
95 | + echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">'; |
|
96 | + echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
|
97 | + echo "<tr align='center'>"; |
|
98 | + echo "<th class='bg3' width='2%'>" . _DELETE . '</th>'; |
|
99 | + echo "<th class='bg3'>" . _AM_NEWBB_DIGESTCONTENT . '</th>'; |
|
100 | + echo '</tr>'; |
|
101 | 101 | |
102 | - $digests = []; |
|
103 | - // /** @var Newbb\DigestHandler $digestHandler */ |
|
104 | - // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
105 | - $digests = $digestHandler->getAllDigests($start, $limit); |
|
106 | - foreach ($digests as $digest) { |
|
107 | - echo "<tr class='odd' align='left'>"; |
|
108 | - echo "<td align='center' ><input type='checkbox' name='digest_id[" . $digest['digest_id'] . "]' value='1' /></td>"; |
|
109 | - echo '<td><strong>#' . $digest['digest_id'] . ' @ ' . formatTimestamp($digest['digest_time']) . '</strong><br>' . str_replace("\n", '<br>', $digest['digest_content']) . '</td>'; |
|
110 | - echo '</tr>'; |
|
111 | - echo "<tr colspan='2'><td height='2'></td></tr>"; |
|
112 | - } |
|
113 | - $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
114 | - echo "<tr><td colspan='2' align='center'>" . $submit->render() . '</td></tr>'; |
|
115 | - $hidden = new \XoopsFormHidden('op', 'delete'); |
|
116 | - echo $hidden->render(); |
|
117 | - $hidden = new \XoopsFormHidden('item', $item); |
|
118 | - echo $hidden->render() . '</form>'; |
|
102 | + $digests = []; |
|
103 | + // /** @var Newbb\DigestHandler $digestHandler */ |
|
104 | + // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
105 | + $digests = $digestHandler->getAllDigests($start, $limit); |
|
106 | + foreach ($digests as $digest) { |
|
107 | + echo "<tr class='odd' align='left'>"; |
|
108 | + echo "<td align='center' ><input type='checkbox' name='digest_id[" . $digest['digest_id'] . "]' value='1' /></td>"; |
|
109 | + echo '<td><strong>#' . $digest['digest_id'] . ' @ ' . formatTimestamp($digest['digest_time']) . '</strong><br>' . str_replace("\n", '<br>', $digest['digest_content']) . '</td>'; |
|
110 | + echo '</tr>'; |
|
111 | + echo "<tr colspan='2'><td height='2'></td></tr>"; |
|
112 | + } |
|
113 | + $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
114 | + echo "<tr><td colspan='2' align='center'>" . $submit->render() . '</td></tr>'; |
|
115 | + $hidden = new \XoopsFormHidden('op', 'delete'); |
|
116 | + echo $hidden->render(); |
|
117 | + $hidden = new \XoopsFormHidden('item', $item); |
|
118 | + echo $hidden->render() . '</form>'; |
|
119 | 119 | |
120 | - echo '</table>'; |
|
121 | - echo '</td></tr></table>'; |
|
122 | - echo '<fieldset>'; |
|
123 | - echo '<legend> ' . _AM_NEWBB_PREFERENCES . ' - ' . _MI_NEWBB_ADMENU_DIGEST . ' </legend>'; |
|
124 | - echo _AM_NEWBB_DIGEST_HELP_AUTO_DIGEST; |
|
125 | - echo '</fieldset>'; |
|
126 | - $nav = new \XoopsPageNav($digestHandler->getDigestCount(), $limit, $start, 'start'); |
|
127 | - echo $nav->renderNav(4); |
|
120 | + echo '</table>'; |
|
121 | + echo '</td></tr></table>'; |
|
122 | + echo '<fieldset>'; |
|
123 | + echo '<legend> ' . _AM_NEWBB_PREFERENCES . ' - ' . _MI_NEWBB_ADMENU_DIGEST . ' </legend>'; |
|
124 | + echo _AM_NEWBB_DIGEST_HELP_AUTO_DIGEST; |
|
125 | + echo '</fieldset>'; |
|
126 | + $nav = new \XoopsPageNav($digestHandler->getDigestCount(), $limit, $start, 'start'); |
|
127 | + echo $nav->renderNav(4); |
|
128 | 128 | |
129 | - break; |
|
129 | + break; |
|
130 | 130 | } |
131 | 131 | require_once __DIR__ . '/admin_footer.php'; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | |
36 | 36 | $cat_orders = Request::getArray('cat_orders', null, 'POST'); |
37 | 37 | $orders = Request::getArray('orders', null, 'POST'); |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | if (Request::getString('submit', '', 'POST')) { |
42 | 42 | $catOrdersCount = count($cat_orders); |
43 | 43 | for ($i = 0; $i < $catOrdersCount; ++$i) { |
44 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_categories') . ' set cat_order = ' . $cat_orders[$i] . " WHERE cat_id=$cat[$i]"; |
|
44 | + $sql = 'update '.$GLOBALS['xoopsDB']->prefix('newbb_categories').' set cat_order = '.$cat_orders[$i]." WHERE cat_id=$cat[$i]"; |
|
45 | 45 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
46 | 46 | redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | $ordersCount = count($orders); |
50 | 50 | for ($i = 0; $i < $ordersCount; ++$i) { |
51 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' set forum_order = ' . $orders[$i] . ' WHERE forum_id=' . $forum[$i]; |
|
51 | + $sql = 'update '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' set forum_order = '.$orders[$i].' WHERE forum_id='.$forum[$i]; |
|
52 | 52 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
53 | 53 | redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
54 | 54 | } |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | |
66 | 66 | $adminObject->displayNavigation(basename(__FILE__)); |
67 | 67 | |
68 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
68 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
69 | 69 | $tform = new \XoopsThemeForm(_AM_NEWBB_SETFORUMORDER, '', ''); |
70 | 70 | $tform->display(); |
71 | 71 | echo "<form name='reorder' method='post'>"; |
72 | 72 | echo "<table border='0' width='100%' cellpadding='2' cellspacing='1' class='outer'>"; |
73 | 73 | echo '<tr>'; |
74 | - echo "<td class='head' align='left' width='60%'><strong>" . _AM_NEWBB_REORDERTITLE . '</strong></td>'; |
|
75 | - echo "<td class='head' align='center'><strong>" . _AM_NEWBB_REORDERWEIGHT . '</strong></td>'; |
|
74 | + echo "<td class='head' align='left' width='60%'><strong>"._AM_NEWBB_REORDERTITLE.'</strong></td>'; |
|
75 | + echo "<td class='head' align='center'><strong>"._AM_NEWBB_REORDERWEIGHT.'</strong></td>'; |
|
76 | 76 | echo '</tr>'; |
77 | 77 | |
78 | 78 | // /** @var Newbb\ForumHandler $forumHandler */ |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
86 | 86 | foreach (array_keys($categories) as $c) { |
87 | 87 | echo '<tr>'; |
88 | - echo "<td align='left' nowrap='nowrap' class='head' >" . $categories[$c]->getVar('cat_title') . '</td>'; |
|
88 | + echo "<td align='left' nowrap='nowrap' class='head' >".$categories[$c]->getVar('cat_title').'</td>'; |
|
89 | 89 | echo "<td align='right' class='head'>"; |
90 | - echo "<input type='text' name='cat_orders[]' value='" . $categories[$c]->getVar('cat_order') . "' size='5' maxlength='5' />"; |
|
91 | - echo "<input type='hidden' name='cat[]' value='" . $c . "' />"; |
|
90 | + echo "<input type='text' name='cat_orders[]' value='".$categories[$c]->getVar('cat_order')."' size='5' maxlength='5' />"; |
|
91 | + echo "<input type='hidden' name='cat[]' value='".$c."' />"; |
|
92 | 92 | echo '</td>'; |
93 | 93 | echo '</tr>'; |
94 | 94 | |
@@ -99,24 +99,24 @@ discard block |
||
99 | 99 | foreach ($forums[$c] as $key => $forum) { |
100 | 100 | echo '<tr>'; |
101 | 101 | $class = ((++$i) % 2) ? 'odd' : 'even'; |
102 | - echo "<td align='left' nowrap='nowrap' class='" . $class . "'>" . $forum['prefix'] . $forum['forum_name'] . '</td>'; |
|
103 | - echo "<td align='left' class='" . $class . "'>"; |
|
104 | - echo $forum['prefix'] . "<input type='text' name='orders[]' value='" . $forum['forum_order'] . "' size='5' maxlength='5' />"; |
|
105 | - echo "<input type='hidden' name='forum[]' value='" . $key . "' />"; |
|
102 | + echo "<td align='left' nowrap='nowrap' class='".$class."'>".$forum['prefix'].$forum['forum_name'].'</td>'; |
|
103 | + echo "<td align='left' class='".$class."'>"; |
|
104 | + echo $forum['prefix']."<input type='text' name='orders[]' value='".$forum['forum_order']."' size='5' maxlength='5' />"; |
|
105 | + echo "<input type='hidden' name='forum[]' value='".$key."' />"; |
|
106 | 106 | echo '</td>'; |
107 | 107 | echo '</tr>'; |
108 | 108 | } |
109 | 109 | } |
110 | 110 | echo "<tr><td class='even' align='center' colspan='6'>"; |
111 | 111 | |
112 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
112 | + echo "<input type='submit' name='submit' value='"._SUBMIT."' />"; |
|
113 | 113 | echo '</td></tr>'; |
114 | 114 | echo '</table>'; |
115 | 115 | echo '</form>'; |
116 | 116 | echo '</td></tr></table>'; |
117 | 117 | echo '<fieldset>'; |
118 | - echo '<legend> ' . _MI_NEWBB_ADMENU_ORDER . ' </legend>'; |
|
118 | + echo '<legend> '._MI_NEWBB_ADMENU_ORDER.' </legend>'; |
|
119 | 119 | echo _AM_NEWBB_HELP_ORDER_TAB; |
120 | 120 | echo '</fieldset>'; |
121 | 121 | } |
122 | -require_once __DIR__ . '/admin_footer.php'; |
|
122 | +require_once __DIR__.'/admin_footer.php'; |
@@ -39,84 +39,84 @@ |
||
39 | 39 | $forum = Request::getArray('forum', null, 'POST'); |
40 | 40 | |
41 | 41 | if (Request::getString('submit', '', 'POST')) { |
42 | - $catOrdersCount = count($cat_orders); |
|
43 | - for ($i = 0; $i < $catOrdersCount; ++$i) { |
|
44 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_categories') . ' set cat_order = ' . $cat_orders[$i] . " WHERE cat_id=$cat[$i]"; |
|
45 | - if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
46 | - redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
47 | - } |
|
48 | - } |
|
49 | - $ordersCount = count($orders); |
|
50 | - for ($i = 0; $i < $ordersCount; ++$i) { |
|
51 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' set forum_order = ' . $orders[$i] . ' WHERE forum_id=' . $forum[$i]; |
|
52 | - if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
53 | - redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
54 | - } |
|
55 | - } |
|
56 | - redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_BOARDREORDER); |
|
42 | + $catOrdersCount = count($cat_orders); |
|
43 | + for ($i = 0; $i < $catOrdersCount; ++$i) { |
|
44 | + $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_categories') . ' set cat_order = ' . $cat_orders[$i] . " WHERE cat_id=$cat[$i]"; |
|
45 | + if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
46 | + redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
47 | + } |
|
48 | + } |
|
49 | + $ordersCount = count($orders); |
|
50 | + for ($i = 0; $i < $ordersCount; ++$i) { |
|
51 | + $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' set forum_order = ' . $orders[$i] . ' WHERE forum_id=' . $forum[$i]; |
|
52 | + if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
53 | + redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
54 | + } |
|
55 | + } |
|
56 | + redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_BOARDREORDER); |
|
57 | 57 | } else { |
58 | - require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
59 | - $orders = []; |
|
60 | - $cat_orders = []; |
|
61 | - $forum = []; |
|
62 | - $cat = []; |
|
58 | + require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
59 | + $orders = []; |
|
60 | + $cat_orders = []; |
|
61 | + $forum = []; |
|
62 | + $cat = []; |
|
63 | 63 | |
64 | - xoops_cp_header(); |
|
64 | + xoops_cp_header(); |
|
65 | 65 | |
66 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
66 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
67 | 67 | |
68 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
69 | - $tform = new \XoopsThemeForm(_AM_NEWBB_SETFORUMORDER, '', ''); |
|
70 | - $tform->display(); |
|
71 | - echo "<form name='reorder' method='post'>"; |
|
72 | - echo "<table border='0' width='100%' cellpadding='2' cellspacing='1' class='outer'>"; |
|
73 | - echo '<tr>'; |
|
74 | - echo "<td class='head' align='left' width='60%'><strong>" . _AM_NEWBB_REORDERTITLE . '</strong></td>'; |
|
75 | - echo "<td class='head' align='center'><strong>" . _AM_NEWBB_REORDERWEIGHT . '</strong></td>'; |
|
76 | - echo '</tr>'; |
|
68 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
69 | + $tform = new \XoopsThemeForm(_AM_NEWBB_SETFORUMORDER, '', ''); |
|
70 | + $tform->display(); |
|
71 | + echo "<form name='reorder' method='post'>"; |
|
72 | + echo "<table border='0' width='100%' cellpadding='2' cellspacing='1' class='outer'>"; |
|
73 | + echo '<tr>'; |
|
74 | + echo "<td class='head' align='left' width='60%'><strong>" . _AM_NEWBB_REORDERTITLE . '</strong></td>'; |
|
75 | + echo "<td class='head' align='center'><strong>" . _AM_NEWBB_REORDERWEIGHT . '</strong></td>'; |
|
76 | + echo '</tr>'; |
|
77 | 77 | |
78 | - // /** @var Newbb\ForumHandler $forumHandler */ |
|
79 | - // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
|
80 | - // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
81 | - // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
82 | - $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1)); |
|
83 | - $criteriaCategory->setSort('cat_order'); |
|
84 | - $categories = $categoryHandler->getAll($criteriaCategory, ['cat_id', 'cat_order', 'cat_title']); |
|
85 | - $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
|
86 | - foreach (array_keys($categories) as $c) { |
|
87 | - echo '<tr>'; |
|
88 | - echo "<td align='left' nowrap='nowrap' class='head' >" . $categories[$c]->getVar('cat_title') . '</td>'; |
|
89 | - echo "<td align='right' class='head'>"; |
|
90 | - echo "<input type='text' name='cat_orders[]' value='" . $categories[$c]->getVar('cat_order') . "' size='5' maxlength='5' />"; |
|
91 | - echo "<input type='hidden' name='cat[]' value='" . $c . "' />"; |
|
92 | - echo '</td>'; |
|
93 | - echo '</tr>'; |
|
78 | + // /** @var Newbb\ForumHandler $forumHandler */ |
|
79 | + // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
|
80 | + // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
81 | + // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
82 | + $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1)); |
|
83 | + $criteriaCategory->setSort('cat_order'); |
|
84 | + $categories = $categoryHandler->getAll($criteriaCategory, ['cat_id', 'cat_order', 'cat_title']); |
|
85 | + $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
|
86 | + foreach (array_keys($categories) as $c) { |
|
87 | + echo '<tr>'; |
|
88 | + echo "<td align='left' nowrap='nowrap' class='head' >" . $categories[$c]->getVar('cat_title') . '</td>'; |
|
89 | + echo "<td align='right' class='head'>"; |
|
90 | + echo "<input type='text' name='cat_orders[]' value='" . $categories[$c]->getVar('cat_order') . "' size='5' maxlength='5' />"; |
|
91 | + echo "<input type='hidden' name='cat[]' value='" . $c . "' />"; |
|
92 | + echo '</td>'; |
|
93 | + echo '</tr>'; |
|
94 | 94 | |
95 | - if (!isset($forums[$c])) { |
|
96 | - continue; |
|
97 | - } |
|
98 | - $i = 0; |
|
99 | - foreach ($forums[$c] as $key => $forum) { |
|
100 | - echo '<tr>'; |
|
101 | - $class = ((++$i) % 2) ? 'odd' : 'even'; |
|
102 | - echo "<td align='left' nowrap='nowrap' class='" . $class . "'>" . $forum['prefix'] . $forum['forum_name'] . '</td>'; |
|
103 | - echo "<td align='left' class='" . $class . "'>"; |
|
104 | - echo $forum['prefix'] . "<input type='text' name='orders[]' value='" . $forum['forum_order'] . "' size='5' maxlength='5' />"; |
|
105 | - echo "<input type='hidden' name='forum[]' value='" . $key . "' />"; |
|
106 | - echo '</td>'; |
|
107 | - echo '</tr>'; |
|
108 | - } |
|
109 | - } |
|
110 | - echo "<tr><td class='even' align='center' colspan='6'>"; |
|
95 | + if (!isset($forums[$c])) { |
|
96 | + continue; |
|
97 | + } |
|
98 | + $i = 0; |
|
99 | + foreach ($forums[$c] as $key => $forum) { |
|
100 | + echo '<tr>'; |
|
101 | + $class = ((++$i) % 2) ? 'odd' : 'even'; |
|
102 | + echo "<td align='left' nowrap='nowrap' class='" . $class . "'>" . $forum['prefix'] . $forum['forum_name'] . '</td>'; |
|
103 | + echo "<td align='left' class='" . $class . "'>"; |
|
104 | + echo $forum['prefix'] . "<input type='text' name='orders[]' value='" . $forum['forum_order'] . "' size='5' maxlength='5' />"; |
|
105 | + echo "<input type='hidden' name='forum[]' value='" . $key . "' />"; |
|
106 | + echo '</td>'; |
|
107 | + echo '</tr>'; |
|
108 | + } |
|
109 | + } |
|
110 | + echo "<tr><td class='even' align='center' colspan='6'>"; |
|
111 | 111 | |
112 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
113 | - echo '</td></tr>'; |
|
114 | - echo '</table>'; |
|
115 | - echo '</form>'; |
|
116 | - echo '</td></tr></table>'; |
|
117 | - echo '<fieldset>'; |
|
118 | - echo '<legend> ' . _MI_NEWBB_ADMENU_ORDER . ' </legend>'; |
|
119 | - echo _AM_NEWBB_HELP_ORDER_TAB; |
|
120 | - echo '</fieldset>'; |
|
112 | + echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
113 | + echo '</td></tr>'; |
|
114 | + echo '</table>'; |
|
115 | + echo '</form>'; |
|
116 | + echo '</td></tr></table>'; |
|
117 | + echo '<fieldset>'; |
|
118 | + echo '<legend> ' . _MI_NEWBB_ADMENU_ORDER . ' </legend>'; |
|
119 | + echo _AM_NEWBB_HELP_ORDER_TAB; |
|
120 | + echo '</fieldset>'; |
|
121 | 121 | } |
122 | 122 | require_once __DIR__ . '/admin_footer.php'; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | xoops_cp_header(); |
36 | 36 | require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
37 | 37 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | ///** @var Newbb\ForumHandler $forumHandler */ |
41 | 41 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
42 | 42 | if (Request::getString('submit', '', 'POST')) { |
43 | - $fgroups = Request::getArray('group', '', 'POST');// !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | - $fforum = Request::getInt('forenid', 0, 'POST');// (int)($_POST['forenid']); |
|
43 | + $fgroups = Request::getArray('group', '', 'POST'); // !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | + $fforum = Request::getInt('forenid', 0, 'POST'); // (int)($_POST['forenid']); |
|
45 | 45 | $fuser = []; |
46 | 46 | if (0 !== $fforum) { |
47 | 47 | if ('' !== $fgroups) { |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | } |
57 | 57 | } |
58 | 58 | if (-1 == $fforum) { // alle Foren |
59 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "'"; |
|
59 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_forums')." SET forum_moderator='".serialize($fuser)."'"; |
|
60 | 60 | } else { |
61 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "' WHERE forum_id =" . $fforum; |
|
61 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_forums')." SET forum_moderator='".serialize($fuser)."' WHERE forum_id =".$fforum; |
|
62 | 62 | } |
63 | 63 | if (is_array($fuser) && $GLOBALS['xoopsDB']->queryF($sql)) { |
64 | 64 | $mess = _AM_NEWBB_GROUPMOD_ADDMOD; |
65 | 65 | } else { |
66 | - $mess = _AM_NEWBB_GROUPMOD_ERRMOD . '<br><small>( ' . $sql . ' )</small>'; |
|
66 | + $mess = _AM_NEWBB_GROUPMOD_ERRMOD.'<br><small>( '.$sql.' )</small>'; |
|
67 | 67 | } |
68 | 68 | redirect_header('admin_groupmod.php', 1, $mess); |
69 | 69 | // echo '<div class="confirmMsg">' . $mess . '</div><br><br>'; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | echo _AM_NEWBB_GROUPMOD_TITLEDESC; |
74 | -echo "<br><br><table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
74 | +echo "<br><br><table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
75 | 75 | echo "<form name='reorder' method='post'>"; |
76 | 76 | ///** @var Newbb\CategoryHandler $categoryHandler */ |
77 | 77 | //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | $categories = $categoryHandler->getAll($criteriaCategory, ['cat_id', 'cat_order', 'cat_title']); |
81 | 81 | $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
82 | 82 | echo '<select name="forenid">'; |
83 | -echo '<option value="-1">-- ' . _AM_NEWBB_GROUPMOD_ALLFORUMS . ' --</option>'; |
|
83 | +echo '<option value="-1">-- '._AM_NEWBB_GROUPMOD_ALLFORUMS.' --</option>'; |
|
84 | 84 | foreach (array_keys($categories) as $c) { |
85 | 85 | if (!isset($forums[$c])) { |
86 | 86 | continue; |
87 | 87 | } |
88 | 88 | $i = 0; |
89 | 89 | foreach ($forums[$c] as $key => $forum) { |
90 | - echo '<option value="' . $forum['forum_id'] . '"> ' . $categories[$c]->getVar('cat_title') . '::' . $forum['forum_name'] . '</option>'; |
|
90 | + echo '<option value="'.$forum['forum_id'].'"> '.$categories[$c]->getVar('cat_title').'::'.$forum['forum_name'].'</option>'; |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | echo '</select>'; |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | $groups = $memberHandler->getGroups(); |
97 | 97 | foreach ($groups as $value) { |
98 | - echo '<input type="checkbox" name="group[]" value="' . $value->getVar('groupid') . '" /> ' . $value->getVar('name') . '<br>'; |
|
98 | + echo '<input type="checkbox" name="group[]" value="'.$value->getVar('groupid').'" /> '.$value->getVar('name').'<br>'; |
|
99 | 99 | } |
100 | 100 | echo "</td><tr><tr><td class='odd' style='text-align:center;'>"; |
101 | -echo '<input type="submit" value="' . _SUBMIT . '" name="submit" />'; |
|
101 | +echo '<input type="submit" value="'._SUBMIT.'" name="submit" />'; |
|
102 | 102 | echo '</td></tr></table>'; |
103 | 103 | echo '</form>'; |
104 | 104 | echo '<fieldset>'; |
105 | -echo '<legend> ' . _MI_NEWBB_ADMENU_GROUPMOD . ' </legend>'; |
|
105 | +echo '<legend> '._MI_NEWBB_ADMENU_GROUPMOD.' </legend>'; |
|
106 | 106 | echo _AM_NEWBB_HELP_GROUPMOD_TAB; |
107 | 107 | echo '</fieldset>'; |
108 | -require_once __DIR__ . '/admin_footer.php'; |
|
108 | +require_once __DIR__.'/admin_footer.php'; |
@@ -40,34 +40,34 @@ discard block |
||
40 | 40 | ///** @var Newbb\ForumHandler $forumHandler */ |
41 | 41 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
42 | 42 | if (Request::getString('submit', '', 'POST')) { |
43 | - $fgroups = Request::getArray('group', '', 'POST');// !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | - $fforum = Request::getInt('forenid', 0, 'POST');// (int)($_POST['forenid']); |
|
45 | - $fuser = []; |
|
46 | - if (0 !== $fforum) { |
|
47 | - if ('' !== $fgroups) { |
|
48 | - $gg = []; |
|
49 | - foreach ($fgroups as $k) { |
|
50 | - $gg = $memberHandler->getUsersByGroup($k, false); |
|
51 | - foreach ($gg as $f) { |
|
52 | - if (!in_array($f, $fuser)) { |
|
53 | - $fuser[] = $f; |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | - } |
|
58 | - if (-1 == $fforum) { // alle Foren |
|
59 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "'"; |
|
60 | - } else { |
|
61 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "' WHERE forum_id =" . $fforum; |
|
62 | - } |
|
63 | - if (is_array($fuser) && $GLOBALS['xoopsDB']->queryF($sql)) { |
|
64 | - $mess = _AM_NEWBB_GROUPMOD_ADDMOD; |
|
65 | - } else { |
|
66 | - $mess = _AM_NEWBB_GROUPMOD_ERRMOD . '<br><small>( ' . $sql . ' )</small>'; |
|
67 | - } |
|
68 | - redirect_header('admin_groupmod.php', 1, $mess); |
|
69 | - // echo '<div class="confirmMsg">' . $mess . '</div><br><br>'; |
|
70 | - } |
|
43 | + $fgroups = Request::getArray('group', '', 'POST');// !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | + $fforum = Request::getInt('forenid', 0, 'POST');// (int)($_POST['forenid']); |
|
45 | + $fuser = []; |
|
46 | + if (0 !== $fforum) { |
|
47 | + if ('' !== $fgroups) { |
|
48 | + $gg = []; |
|
49 | + foreach ($fgroups as $k) { |
|
50 | + $gg = $memberHandler->getUsersByGroup($k, false); |
|
51 | + foreach ($gg as $f) { |
|
52 | + if (!in_array($f, $fuser)) { |
|
53 | + $fuser[] = $f; |
|
54 | + } |
|
55 | + } |
|
56 | + } |
|
57 | + } |
|
58 | + if (-1 == $fforum) { // alle Foren |
|
59 | + $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "'"; |
|
60 | + } else { |
|
61 | + $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "' WHERE forum_id =" . $fforum; |
|
62 | + } |
|
63 | + if (is_array($fuser) && $GLOBALS['xoopsDB']->queryF($sql)) { |
|
64 | + $mess = _AM_NEWBB_GROUPMOD_ADDMOD; |
|
65 | + } else { |
|
66 | + $mess = _AM_NEWBB_GROUPMOD_ERRMOD . '<br><small>( ' . $sql . ' )</small>'; |
|
67 | + } |
|
68 | + redirect_header('admin_groupmod.php', 1, $mess); |
|
69 | + // echo '<div class="confirmMsg">' . $mess . '</div><br><br>'; |
|
70 | + } |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | echo _AM_NEWBB_GROUPMOD_TITLEDESC; |
@@ -82,20 +82,20 @@ discard block |
||
82 | 82 | echo '<select name="forenid">'; |
83 | 83 | echo '<option value="-1">-- ' . _AM_NEWBB_GROUPMOD_ALLFORUMS . ' --</option>'; |
84 | 84 | foreach (array_keys($categories) as $c) { |
85 | - if (!isset($forums[$c])) { |
|
86 | - continue; |
|
87 | - } |
|
88 | - $i = 0; |
|
89 | - foreach ($forums[$c] as $key => $forum) { |
|
90 | - echo '<option value="' . $forum['forum_id'] . '"> ' . $categories[$c]->getVar('cat_title') . '::' . $forum['forum_name'] . '</option>'; |
|
91 | - } |
|
85 | + if (!isset($forums[$c])) { |
|
86 | + continue; |
|
87 | + } |
|
88 | + $i = 0; |
|
89 | + foreach ($forums[$c] as $key => $forum) { |
|
90 | + echo '<option value="' . $forum['forum_id'] . '"> ' . $categories[$c]->getVar('cat_title') . '::' . $forum['forum_name'] . '</option>'; |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | echo '</select>'; |
94 | 94 | echo "</td><tr><tr><td class='even'>"; |
95 | 95 | |
96 | 96 | $groups = $memberHandler->getGroups(); |
97 | 97 | foreach ($groups as $value) { |
98 | - echo '<input type="checkbox" name="group[]" value="' . $value->getVar('groupid') . '" /> ' . $value->getVar('name') . '<br>'; |
|
98 | + echo '<input type="checkbox" name="group[]" value="' . $value->getVar('groupid') . '" /> ' . $value->getVar('name') . '<br>'; |
|
99 | 99 | } |
100 | 100 | echo "</td><tr><tr><td class='odd' style='text-align:center;'>"; |
101 | 101 | echo '<input type="submit" value="' . _SUBMIT . '" name="submit" />'; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | use Xmf\Request; |
33 | 33 | use XoopsModules\Newbb; |
34 | 34 | |
35 | -require_once __DIR__ . '/admin_header.php'; |
|
35 | +require_once __DIR__.'/admin_header.php'; |
|
36 | 36 | xoops_cp_header(); |
37 | 37 | |
38 | 38 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if (!empty($queue)) { |
71 | 71 | echo "<pre>\n"; |
72 | 72 | foreach ($queue as $line) { |
73 | - echo $line . ";\n"; |
|
73 | + echo $line.";\n"; |
|
74 | 74 | } |
75 | 75 | echo "</pre>\n"; |
76 | 76 | } |
@@ -92,4 +92,4 @@ discard block |
||
92 | 92 | |
93 | 93 | echo "<div>$message</div>"; |
94 | 94 | |
95 | -require_once __DIR__ . '/admin_footer.php'; |
|
95 | +require_once __DIR__.'/admin_footer.php'; |
@@ -65,29 +65,29 @@ |
||
65 | 65 | $message = ''; |
66 | 66 | |
67 | 67 | switch ($op) { |
68 | - case 'show': |
|
69 | - $queue = $newbbMigrate->getSynchronizeDDL(); |
|
70 | - if (!empty($queue)) { |
|
71 | - echo "<pre>\n"; |
|
72 | - foreach ($queue as $line) { |
|
73 | - echo $line . ";\n"; |
|
74 | - } |
|
75 | - echo "</pre>\n"; |
|
76 | - } |
|
77 | - break; |
|
78 | - case 'migrate': |
|
79 | - $newbbMigrate->synchronizeSchema(); |
|
80 | - $message = 'Database migrated to current schema.'; |
|
81 | - break; |
|
82 | - case 'schema': |
|
83 | - xoops_confirm(['op' => 'confirmwrite'], 'migrate.php', 'Warning! This is intended for developers only. Confirm write schema file from current database.', 'Confirm'); |
|
84 | - break; |
|
85 | - case 'confirmwrite': |
|
86 | - if ($GLOBALS['xoopsSecurity']->check()) { |
|
87 | - $newbbMigrate->saveCurrentSchema(); |
|
88 | - $message = 'Current schema file written'; |
|
89 | - } |
|
90 | - break; |
|
68 | + case 'show': |
|
69 | + $queue = $newbbMigrate->getSynchronizeDDL(); |
|
70 | + if (!empty($queue)) { |
|
71 | + echo "<pre>\n"; |
|
72 | + foreach ($queue as $line) { |
|
73 | + echo $line . ";\n"; |
|
74 | + } |
|
75 | + echo "</pre>\n"; |
|
76 | + } |
|
77 | + break; |
|
78 | + case 'migrate': |
|
79 | + $newbbMigrate->synchronizeSchema(); |
|
80 | + $message = 'Database migrated to current schema.'; |
|
81 | + break; |
|
82 | + case 'schema': |
|
83 | + xoops_confirm(['op' => 'confirmwrite'], 'migrate.php', 'Warning! This is intended for developers only. Confirm write schema file from current database.', 'Confirm'); |
|
84 | + break; |
|
85 | + case 'confirmwrite': |
|
86 | + if ($GLOBALS['xoopsSecurity']->check()) { |
|
87 | + $newbbMigrate->saveCurrentSchema(); |
|
88 | + $message = 'Current schema file written'; |
|
89 | + } |
|
90 | + break; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | echo "<div>$message</div>"; |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | |
24 | 24 | // a complete rewrite by irmtfan to enhance: 1- RTL 2- Multilanguage (EMLH and Xlanguage) |
25 | 25 | error_reporting(0); |
26 | -require_once __DIR__ . '/header.php'; |
|
26 | +require_once __DIR__.'/header.php'; |
|
27 | 27 | |
28 | 28 | $attach_id = Request::getString('attachid', '', 'GET'); |
29 | 29 | $forum = Request::getInt('forum', 0, 'GET'); |
30 | 30 | $topic_id = Request::getInt('topic_id', 0, 'GET'); |
31 | 31 | $post_id = Request::getInt('post_id', 0, 'GET'); |
32 | 32 | |
33 | -if (!is_file(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) { |
|
34 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $topic_id, 3, 'TCPDF for Xoops not installed'); |
|
33 | +if (!is_file(XOOPS_ROOT_PATH.'/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) { |
|
34 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?topic_id='.$topic_id, 3, 'TCPDF for Xoops not installed'); |
|
35 | 35 | } else { |
36 | - require_once XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
36 | + require_once XOOPS_ROOT_PATH.'/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if (empty($post_id)) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $pf_title = ''; |
64 | 64 | if ($parent_forums) { |
65 | 65 | foreach ($parent_forums as $p_f) { |
66 | - $pf_title .= $p_f['forum_name'] . ' - '; |
|
66 | + $pf_title .= $p_f['forum_name'].' - '; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | if (!$forumHandler->getPermission($viewtopic_forum)) { |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | $pdf_data['author'] = $myts->undoHtmlSpecialChars($post_data['author']); |
84 | 84 | $pdf_data['title'] = $myts->undoHtmlSpecialChars($post_data['subject']); |
85 | 85 | $content = ''; |
86 | -$content .= '<b>' . $pdf_data['title'] . '</b><br><br>'; |
|
87 | -$content .= _MD_NEWBB_AUTHORC . ' ' . $pdf_data['author'] . '<br>'; |
|
88 | -$content .= _MD_NEWBB_POSTEDON . ' ' . formatTimestamp($post_data['date']) . '<br><br><br>'; |
|
89 | -$content .= $myts->undoHtmlSpecialChars($post_data['text']) . '<br>'; |
|
86 | +$content .= '<b>'.$pdf_data['title'].'</b><br><br>'; |
|
87 | +$content .= _MD_NEWBB_AUTHORC.' '.$pdf_data['author'].'<br>'; |
|
88 | +$content .= _MD_NEWBB_POSTEDON.' '.formatTimestamp($post_data['date']).'<br><br><br>'; |
|
89 | +$content .= $myts->undoHtmlSpecialChars($post_data['text']).'<br>'; |
|
90 | 90 | //$content .= $post_edit . '<br>'; //reserve for future versions to display edit records |
91 | 91 | $pdf_data['content'] = str_replace('[pagebreak]', '<br>', $content); |
92 | 92 | $pdf_data['topic_title'] = $forumtopic->getVar('topic_title'); |
93 | -$pdf_data['forum_title'] = $pf_title . $viewtopic_forum->getVar('forum_name'); |
|
93 | +$pdf_data['forum_title'] = $pf_title.$viewtopic_forum->getVar('forum_name'); |
|
94 | 94 | $pdf_data['cat_title'] = $viewtopic_cat->getVar('cat_title'); |
95 | -$pdf_data['subject'] = _MD_NEWBB_PDF_SUBJECT . ': ' . $pdf_data['topic_title']; |
|
96 | -$pdf_data['keywords'] = XOOPS_URL . ', ' . 'XOOPS Project, ' . $pdf_data['topic_title']; |
|
97 | -$pdf_data['HeadFirstLine'] = $GLOBALS['xoopsConfig']['sitename'] . ' - ' . $GLOBALS['xoopsConfig']['slogan']; |
|
98 | -$pdf_data['HeadSecondLine'] = _MD_NEWBB_FORUMHOME . ' - ' . $pdf_data['cat_title'] . ' - ' . $pdf_data['forum_title'] . ' - ' . $pdf_data['topic_title']; |
|
95 | +$pdf_data['subject'] = _MD_NEWBB_PDF_SUBJECT.': '.$pdf_data['topic_title']; |
|
96 | +$pdf_data['keywords'] = XOOPS_URL.', '.'XOOPS Project, '.$pdf_data['topic_title']; |
|
97 | +$pdf_data['HeadFirstLine'] = $GLOBALS['xoopsConfig']['sitename'].' - '.$GLOBALS['xoopsConfig']['slogan']; |
|
98 | +$pdf_data['HeadSecondLine'] = _MD_NEWBB_FORUMHOME.' - '.$pdf_data['cat_title'].' - '.$pdf_data['forum_title'].' - '.$pdf_data['topic_title']; |
|
99 | 99 | // START irmtfan to implement EMLH by GIJ |
100 | 100 | if (function_exists('easiestml')) { |
101 | 101 | $pdf_data = easiestml($pdf_data); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // set document information |
138 | 138 | $pdf->SetCreator(PDF_CREATOR); |
139 | 139 | $pdf->SetAuthor(PDF_AUTHOR); |
140 | -$pdf->SetTitle($pdf_data['forum_title'] . ' - ' . $pdf_data['subject']); |
|
140 | +$pdf->SetTitle($pdf_data['forum_title'].' - '.$pdf_data['subject']); |
|
141 | 141 | $pdf->SetSubject($pdf_data['subject']); |
142 | 142 | $pdf->SetKeywords($pdf_data['keywords']); |
143 | 143 | |
@@ -160,4 +160,4 @@ discard block |
||
160 | 160 | //$pdf->SetFont(PDF_FONT_NAME_MAIN, PDF_FONT_STYLE_MAIN, PDF_FONT_SIZE_MAIN); |
161 | 161 | $pdf->SetFont('dejavusans', '', 12); |
162 | 162 | $pdf->writeHTML($pdf_data['content'], true, 0); |
163 | -$pdf->Output($pdf_data['topic_title'] . '_' . $post_id . '.pdf', 'I'); |
|
163 | +$pdf->Output($pdf_data['topic_title'].'_'.$post_id.'.pdf', 'I'); |
@@ -31,19 +31,19 @@ discard block |
||
31 | 31 | $post_id = Request::getInt('post_id', 0, 'GET'); |
32 | 32 | |
33 | 33 | if (!is_file(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) { |
34 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $topic_id, 3, 'TCPDF for Xoops not installed'); |
|
34 | + redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $topic_id, 3, 'TCPDF for Xoops not installed'); |
|
35 | 35 | } else { |
36 | - require_once XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
36 | + require_once XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if (empty($post_id)) { |
40 | - exit(_MD_NEWBB_ERRORTOPIC); |
|
40 | + exit(_MD_NEWBB_ERRORTOPIC); |
|
41 | 41 | } |
42 | 42 | ///** @var Newbb\PostHandler $postHandler */ |
43 | 43 | //$postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
44 | 44 | $post = $postHandler->get($post_id); |
45 | 45 | if (!$approved = $post->getVar('approved')) { |
46 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
46 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
47 | 47 | } |
48 | 48 | $post_data = $postHandler->getPostForPDF($post); |
49 | 49 | //$post_edit = $post->displayPostEdit(); //reserve for future versions to display edit records |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $forumtopic = $topicHandler->getByPost($post_id); |
53 | 53 | $topic_id = $forumtopic->getVar('topic_id'); |
54 | 54 | if (!$approved = $forumtopic->getVar('approved')) { |
55 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
55 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
56 | 56 | } |
57 | 57 | ///** @var Newbb\ForumHandler $forumHandler */ |
58 | 58 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
@@ -62,19 +62,19 @@ discard block |
||
62 | 62 | $parent_forums = $forumHandler->getParents($viewtopic_forum); |
63 | 63 | $pf_title = ''; |
64 | 64 | if ($parent_forums) { |
65 | - foreach ($parent_forums as $p_f) { |
|
66 | - $pf_title .= $p_f['forum_name'] . ' - '; |
|
67 | - } |
|
65 | + foreach ($parent_forums as $p_f) { |
|
66 | + $pf_title .= $p_f['forum_name'] . ' - '; |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | if (!$forumHandler->getPermission($viewtopic_forum)) { |
70 | - exit(_MD_NEWBB_NORIGHTTOACCESS); |
|
70 | + exit(_MD_NEWBB_NORIGHTTOACCESS); |
|
71 | 71 | } |
72 | 72 | if (!$topicHandler->getPermission($viewtopic_forum, $forumtopic->getVar('topic_status'), 'view')) { |
73 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
73 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
74 | 74 | } |
75 | 75 | // irmtfan add pdf permission |
76 | 76 | if (!$topicHandler->getPermission($viewtopic_forum, $forumtopic->getVar('topic_status'), 'pdf')) { |
77 | - exit(_MD_NEWBB_NORIGHTTOPDF); |
|
77 | + exit(_MD_NEWBB_NORIGHTTOPDF); |
|
78 | 78 | } |
79 | 79 | //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
80 | 80 | $cat = $viewtopic_forum->getVar('cat_id'); |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | $pdf_data['HeadSecondLine'] = _MD_NEWBB_FORUMHOME . ' - ' . $pdf_data['cat_title'] . ' - ' . $pdf_data['forum_title'] . ' - ' . $pdf_data['topic_title']; |
99 | 99 | // START irmtfan to implement EMLH by GIJ |
100 | 100 | if (function_exists('easiestml')) { |
101 | - $pdf_data = easiestml($pdf_data); |
|
101 | + $pdf_data = easiestml($pdf_data); |
|
102 | 102 | // END irmtfan to implement EMLH by GIJ |
103 | - // START irmtfan to implement Xlanguage by phppp(DJ) |
|
103 | + // START irmtfan to implement Xlanguage by phppp(DJ) |
|
104 | 104 | } elseif (function_exists('xlanguage_ml')) { |
105 | - $pdf_data = xlanguage_ml($pdf_data); |
|
105 | + $pdf_data = xlanguage_ml($pdf_data); |
|
106 | 106 | } |
107 | 107 | // END irmtfan to implement Xlanguage by phppp(DJ) |
108 | 108 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // START irmtfan hack to add RTL-LTR local |
130 | 130 | // until _RTL added to core 2.6.0 |
131 | 131 | if (!defined('_RTL')) { |
132 | - define('_RTL', false); |
|
132 | + define('_RTL', false); |
|
133 | 133 | } |
134 | 134 | $pdf->setRTL(_RTL); |
135 | 135 | // END irmtfan hack to add RTL-LTR local |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []) |
43 | 43 | { |
44 | 44 | if ($option['id'] > 0) { |
45 | - $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="'; |
|
45 | + $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="'; |
|
46 | 46 | foreach ($parentIds as $pid) { |
47 | 47 | if ($pid <= 0) { |
48 | 48 | continue; |
49 | 49 | } |
50 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
51 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
50 | + $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']'; |
|
51 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
52 | 52 | } |
53 | 53 | foreach ($option['allchild'] as $cid) { |
54 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
55 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}"; |
|
54 | + $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']'; |
|
55 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}"; |
|
56 | 56 | } |
57 | 57 | $tree .= '" value="1"'; |
58 | 58 | if (in_array($option['id'], $this->_value)) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
75 | 75 | . "\" /><br>\n"; |
76 | 76 | } else { |
77 | - $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n"; |
|
77 | + $tree .= $prefix.$option['name'].'<input type="hidden" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" /><br>\n"; |
|
78 | 78 | } |
79 | 79 | if (isset($option['children'])) { |
80 | 80 | foreach ($option['children'] as $child) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | // array_push($parentIds, $option['id']); |
83 | 83 | $parentIds[] = $option['id']; |
84 | 84 | } |
85 | - $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
85 | + $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | } |
@@ -22,68 +22,68 @@ |
||
22 | 22 | */ |
23 | 23 | class GroupFormCheckBox extends \XoopsGroupFormCheckBox |
24 | 24 | { |
25 | - /** |
|
26 | - * @param $caption |
|
27 | - * @param $name |
|
28 | - * @param $groupId |
|
29 | - * @param null $values |
|
30 | - */ |
|
31 | - public function __construct($caption, $name, $groupId, $values = null) |
|
32 | - { |
|
33 | - parent::__construct($caption, $name, $groupId, $values); |
|
34 | - } |
|
25 | + /** |
|
26 | + * @param $caption |
|
27 | + * @param $name |
|
28 | + * @param $groupId |
|
29 | + * @param null $values |
|
30 | + */ |
|
31 | + public function __construct($caption, $name, $groupId, $values = null) |
|
32 | + { |
|
33 | + parent::__construct($caption, $name, $groupId, $values); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @param string $tree |
|
38 | - * @param array $option |
|
39 | - * @param string $prefix |
|
40 | - * @param array $parentIds |
|
41 | - */ |
|
42 | - public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []) |
|
43 | - { |
|
44 | - if ($option['id'] > 0) { |
|
45 | - $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="'; |
|
46 | - foreach ($parentIds as $pid) { |
|
47 | - if ($pid <= 0) { |
|
48 | - continue; |
|
49 | - } |
|
50 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
51 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
52 | - } |
|
53 | - foreach ($option['allchild'] as $cid) { |
|
54 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
55 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}"; |
|
56 | - } |
|
57 | - $tree .= '" value="1"'; |
|
58 | - if (in_array($option['id'], $this->_value)) { |
|
59 | - $tree .= ' checked'; |
|
60 | - } |
|
61 | - $tree .= ' />' |
|
62 | - . $option['name'] |
|
63 | - . '<input type="hidden" name="' |
|
64 | - . $this->getName() |
|
65 | - . '[parents][' |
|
66 | - . $option['id'] |
|
67 | - . ']" value="' |
|
68 | - . implode(':', $parentIds) |
|
69 | - . '" /><input type="hidden" name="' |
|
70 | - . $this->getName() |
|
71 | - . '[itemname][' |
|
72 | - . $option['id'] |
|
73 | - . ']" value="' |
|
74 | - . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
|
75 | - . "\" /><br>\n"; |
|
76 | - } else { |
|
77 | - $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n"; |
|
78 | - } |
|
79 | - if (isset($option['children'])) { |
|
80 | - foreach ($option['children'] as $child) { |
|
81 | - if ($option['id'] > 0) { |
|
82 | - // array_push($parentIds, $option['id']); |
|
83 | - $parentIds[] = $option['id']; |
|
84 | - } |
|
85 | - $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
86 | - } |
|
87 | - } |
|
88 | - } |
|
36 | + /** |
|
37 | + * @param string $tree |
|
38 | + * @param array $option |
|
39 | + * @param string $prefix |
|
40 | + * @param array $parentIds |
|
41 | + */ |
|
42 | + public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []) |
|
43 | + { |
|
44 | + if ($option['id'] > 0) { |
|
45 | + $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="'; |
|
46 | + foreach ($parentIds as $pid) { |
|
47 | + if ($pid <= 0) { |
|
48 | + continue; |
|
49 | + } |
|
50 | + $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
51 | + $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
52 | + } |
|
53 | + foreach ($option['allchild'] as $cid) { |
|
54 | + $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
55 | + $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}"; |
|
56 | + } |
|
57 | + $tree .= '" value="1"'; |
|
58 | + if (in_array($option['id'], $this->_value)) { |
|
59 | + $tree .= ' checked'; |
|
60 | + } |
|
61 | + $tree .= ' />' |
|
62 | + . $option['name'] |
|
63 | + . '<input type="hidden" name="' |
|
64 | + . $this->getName() |
|
65 | + . '[parents][' |
|
66 | + . $option['id'] |
|
67 | + . ']" value="' |
|
68 | + . implode(':', $parentIds) |
|
69 | + . '" /><input type="hidden" name="' |
|
70 | + . $this->getName() |
|
71 | + . '[itemname][' |
|
72 | + . $option['id'] |
|
73 | + . ']" value="' |
|
74 | + . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
|
75 | + . "\" /><br>\n"; |
|
76 | + } else { |
|
77 | + $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n"; |
|
78 | + } |
|
79 | + if (isset($option['children'])) { |
|
80 | + foreach ($option['children'] as $child) { |
|
81 | + if ($option['id'] > 0) { |
|
82 | + // array_push($parentIds, $option['id']); |
|
83 | + $parentIds[] = $option['id']; |
|
84 | + } |
|
85 | + $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
86 | + } |
|
87 | + } |
|
88 | + } |
|
89 | 89 | } |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | if (empty($postParentObject)) { |
67 | 67 | $postParentObject = $postHandler->get($pid); |
68 | 68 | } |
69 | - $form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>'; |
|
69 | + $form_title = _MD_NEWBB_REPLY.': <a href="'.XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}&post_id={$pid}\" rel=\"external\">".$postParentObject->getVar('subject').'</a>'; |
|
70 | 70 | } else { |
71 | - $form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>'; |
|
71 | + $form_title = _EDIT.': <a href="'.XOOPS_URL."/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">".$postObject->getVar('subject').'</a>'; |
|
72 | 72 | $editby = true; |
73 | 73 | } |
74 | 74 | $xoopsTpl->assign('form_title', $form_title); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | //$filname = XOOPS_URL.$_SERVER['REQUEST_URI']; |
103 | 103 | |
104 | -$forum_form = new \XoopsThemeForm(htmlspecialchars(@$form_title, ENT_QUOTES | ENT_HTML5), 'form_post', XOOPS_URL . '/modules/newbb/post.php', 'post', true); |
|
104 | +$forum_form = new \XoopsThemeForm(htmlspecialchars(@$form_title, ENT_QUOTES | ENT_HTML5), 'form_post', XOOPS_URL.'/modules/newbb/post.php', 'post', true); |
|
105 | 105 | $forum_form->setExtra('enctype="multipart/form-data"'); |
106 | 106 | |
107 | 107 | if ($editby) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $icons_radio = new \XoopsFormRadio(_MD_NEWBB_MESSAGEICON, 'icon', $icon); |
144 | 144 | $subject_icons = \XoopsLists::getSubjectsList(); |
145 | 145 | foreach ($subject_icons as $iconfile) { |
146 | - $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); |
|
146 | + $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />'); |
|
147 | 147 | } |
148 | 148 | $forum_form->addElement($icons_radio); |
149 | 149 | |
@@ -251,18 +251,18 @@ discard block |
||
251 | 251 | $upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT); |
252 | 252 | $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024)); |
253 | 253 | $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit')); |
254 | - $upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; ')); |
|
254 | + $upload_tray->addElement(new \XoopsFormLabel('<br><br>'._MD_NEWBB_MAX_FILESIZE.':', $forumObject->getVar('attach_maxkb').'Kb; ')); |
|
255 | 255 | $extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext'))); |
256 | 256 | $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions; |
257 | - $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions)); |
|
258 | - $upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width']))); |
|
257 | + $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS.':', $extensions)); |
|
258 | + $upload_tray->addElement(new \XoopsFormLabel('<br>'.sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width']))); |
|
259 | 259 | $forum_form->addElement($upload_tray); |
260 | 260 | } |
261 | 261 | |
262 | 262 | if (!empty($attachments) && is_array($attachments) && count($attachments)) { |
263 | 263 | $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]'); |
264 | 264 | foreach ($attachments as $key => $attachment) { |
265 | - $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>'; |
|
265 | + $attach = ' '._DELETE.' <a href='.XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['nameDisplay'].'</a><br>'; |
|
266 | 266 | $delete_attach_checkbox->addOption($key, $attach); |
267 | 267 | } |
268 | 268 | $forum_form->addElement($delete_attach_checkbox); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]'); |
274 | 274 | $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH); |
275 | 275 | foreach ($attachments_tmp as $key => $attachment) { |
276 | - $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>'; |
|
276 | + $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br>'; |
|
277 | 277 | $delete_attach_checkbox->addOption($key, $attach); |
278 | 278 | } |
279 | 279 | $forum_form->addElement($delete_attach_checkbox); |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | } |
297 | 297 | $karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma); |
298 | 298 | $karma_select->addOptionArray($karma_array); |
299 | - $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render()); |
|
299 | + $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA.$karma_select->render()); |
|
300 | 300 | } |
301 | 301 | } |
302 | 302 | $radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL); |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | |
328 | 328 | $cancel_button = new \XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
329 | 329 | if (!empty($topic_id)) { |
330 | - $extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id; |
|
330 | + $extra = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.(int)$topic_id; |
|
331 | 331 | } else { |
332 | - $extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id'); |
|
332 | + $extra = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$forumObject->getVar('forum_id'); |
|
333 | 333 | } |
334 | -$cancel_button->setExtra("onclick='location=\"" . $extra . "\"'"); |
|
334 | +$cancel_button->setExtra("onclick='location=\"".$extra."\"'"); |
|
335 | 335 | $cancel_button->setExtra("tabindex='6'"); |
336 | 336 | |
337 | 337 | if (!empty($isreply) && !empty($hidden)) { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | |
346 | 346 | $preview_button = new \XoopsFormButton('', 'btn_preview', _PREVIEW, 'button'); |
347 | 347 | $preview_button->setExtra("tabindex='5'"); |
348 | -$preview_button->setExtra('onclick="window.document.forms.' . $forum_form->getName() . '.contents_preview.value=1; window.document.forms.' . $forum_form->getName() . '.submit() ;"'); |
|
348 | +$preview_button->setExtra('onclick="window.document.forms.'.$forum_form->getName().'.contents_preview.value=1; window.document.forms.'.$forum_form->getName().'.submit() ;"'); |
|
349 | 349 | $forum_form->addElement(new \XoopsFormHidden('contents_preview', 0)); |
350 | 350 | |
351 | 351 | $button_tray->addElement($preview_button); |
@@ -30,69 +30,69 @@ discard block |
||
30 | 30 | |
31 | 31 | //check banning |
32 | 32 | $moderated_id = (is_object($GLOBALS['xoopsUser']) |
33 | - && $GLOBALS['xoopsUser']->uid() > 0) ? $GLOBALS['xoopsUser']->uid() : 0; |
|
33 | + && $GLOBALS['xoopsUser']->uid() > 0) ? $GLOBALS['xoopsUser']->uid() : 0; |
|
34 | 34 | $moderated_ip = Request::getString('REMOTE_ADDR', '', 'SERVER'); |
35 | 35 | $moderated_forum = $forumObject->getVar('forum_id'); |
36 | 36 | /** @var Newbb\ModerateHandler $moderateHandler */ |
37 | 37 | $moderateHandler = Newbb\Helper::getInstance()->getHandler('Moderate'); |
38 | 38 | if (!$moderateHandler->verifyUser($moderated_id, '', $moderated_forum)) { |
39 | - $criteria = new \CriteriaCompo(); |
|
40 | - $criteria->add(new \Criteria('uid', $moderated_id, '=')); |
|
41 | - $criteria->setSort('mod_end'); |
|
42 | - $criteria->setOrder('DESC'); |
|
43 | - $mod = $moderateHandler->getObjects($criteria, false, false); |
|
44 | - $tage = ($mod[0]['mod_end'] - $mod[0]['mod_start']) / 60 / 60 / 24; |
|
45 | - $msg = $myts->displayTarea(sprintf(_MD_NEWBB_SUSPEND_TEXT, newbbGetUnameFromId($moderated_id), (int)$tage, $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1); |
|
46 | - xoops_error($msg, _MD_NEWBB_SUSPEND_NOACCESS); |
|
47 | - require_once $GLOBALS['xoops']->path('footer.php'); |
|
48 | - exit(); |
|
39 | + $criteria = new \CriteriaCompo(); |
|
40 | + $criteria->add(new \Criteria('uid', $moderated_id, '=')); |
|
41 | + $criteria->setSort('mod_end'); |
|
42 | + $criteria->setOrder('DESC'); |
|
43 | + $mod = $moderateHandler->getObjects($criteria, false, false); |
|
44 | + $tage = ($mod[0]['mod_end'] - $mod[0]['mod_start']) / 60 / 60 / 24; |
|
45 | + $msg = $myts->displayTarea(sprintf(_MD_NEWBB_SUSPEND_TEXT, newbbGetUnameFromId($moderated_id), (int)$tage, $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1); |
|
46 | + xoops_error($msg, _MD_NEWBB_SUSPEND_NOACCESS); |
|
47 | + require_once $GLOBALS['xoops']->path('footer.php'); |
|
48 | + exit(); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $xoopsTpl->assign('category', ['id' => $forumObject->getVar('cat_id'), 'title' => $categoryObject->getVar('cat_title')]); |
52 | 52 | $xoopsTpl->assign('parentforum', $forumHandler->getParents($forumObject)); |
53 | 53 | $xoopsTpl->assign([ |
54 | - 'forum_id' => $forumObject->getVar('forum_id'), |
|
55 | - 'forum_name' => $forumObject->getVar('forum_name') |
|
56 | - ]); |
|
54 | + 'forum_id' => $forumObject->getVar('forum_id'), |
|
55 | + 'forum_name' => $forumObject->getVar('forum_name') |
|
56 | + ]); |
|
57 | 57 | |
58 | 58 | if (!is_object($topicObject)) { |
59 | - $topicObject = $topicHandler->create(); |
|
59 | + $topicObject = $topicHandler->create(); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $editby = false; |
63 | 63 | if ($topicObject->isNew()) { |
64 | - $form_title = _MD_NEWBB_POSTNEW; |
|
64 | + $form_title = _MD_NEWBB_POSTNEW; |
|
65 | 65 | } elseif ($postObject->isNew()) { |
66 | - if (empty($postParentObject)) { |
|
67 | - $postParentObject = $postHandler->get($pid); |
|
68 | - } |
|
69 | - $form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>'; |
|
66 | + if (empty($postParentObject)) { |
|
67 | + $postParentObject = $postHandler->get($pid); |
|
68 | + } |
|
69 | + $form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>'; |
|
70 | 70 | } else { |
71 | - $form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>'; |
|
72 | - $editby = true; |
|
71 | + $form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>'; |
|
72 | + $editby = true; |
|
73 | 73 | } |
74 | 74 | $xoopsTpl->assign('form_title', $form_title); |
75 | 75 | |
76 | 76 | foreach ([ |
77 | - 'start', |
|
78 | - 'topic_id', |
|
79 | - 'post_id', |
|
80 | - 'pid', |
|
81 | - 'isreply', |
|
82 | - 'isedit', |
|
83 | - 'contents_preview' |
|
84 | - ] as $getint) { |
|
85 | - ${$getint} = Request::getInt($getint, (!empty(${$getint}) ? ${$getint} : 0), 'GET'); // isset($_GET[$getint]) ? (int)($_GET[$getint]) : ((!empty(${$getint})) ? ${$getint} : 0); |
|
77 | + 'start', |
|
78 | + 'topic_id', |
|
79 | + 'post_id', |
|
80 | + 'pid', |
|
81 | + 'isreply', |
|
82 | + 'isedit', |
|
83 | + 'contents_preview' |
|
84 | + ] as $getint) { |
|
85 | + ${$getint} = Request::getInt($getint, (!empty(${$getint}) ? ${$getint} : 0), 'GET'); // isset($_GET[$getint]) ? (int)($_GET[$getint]) : ((!empty(${$getint})) ? ${$getint} : 0); |
|
86 | 86 | } |
87 | 87 | foreach ([ |
88 | - 'order', |
|
89 | - 'viewmode', |
|
90 | - 'hidden', |
|
91 | - 'newbb_form', |
|
92 | - 'icon', |
|
93 | - 'op' |
|
94 | - ] as $getstr) { |
|
95 | - ${$getstr} = Request::getString($getstr, (!empty(${$getstr}) ? ${$getstr} : ''), 'GET'); //isset($_GET[$getstr]) ? $_GET[$getstr] : ((!empty(${$getstr})) ? ${$getstr} : ''); |
|
88 | + 'order', |
|
89 | + 'viewmode', |
|
90 | + 'hidden', |
|
91 | + 'newbb_form', |
|
92 | + 'icon', |
|
93 | + 'op' |
|
94 | + ] as $getstr) { |
|
95 | + ${$getstr} = Request::getString($getstr, (!empty(${$getstr}) ? ${$getstr} : ''), 'GET'); //isset($_GET[$getstr]) ? $_GET[$getstr] : ((!empty(${$getstr})) ? ${$getstr} : ''); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** @var Newbb\TopicHandler $topicHandler */ |
@@ -105,30 +105,30 @@ discard block |
||
105 | 105 | $forum_form->setExtra('enctype="multipart/form-data"'); |
106 | 106 | |
107 | 107 | if ($editby) { |
108 | - $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_EDITEDMSG, 'editwhy', 60, 100, '')); |
|
108 | + $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_EDITEDMSG, 'editwhy', 60, 100, '')); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
112 | 112 | if (newbbIsAdmin($forumObject) |
113 | - || ($topicHandler->getPermission($forumObject, $topic_status, 'type') |
|
114 | - && (0 == $topic_id |
|
115 | - || $uid == $topicHandler->get(@$topic_id, 'topic_poster')))) { |
|
116 | - $type_id = $topicHandler->get(@$topic_id, 'type_id'); |
|
117 | - /** @var Newbb\TypeHandler $typeHandler */ |
|
118 | - $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
|
119 | - $types = $typeHandler->getByForum($forumObject->getVar('forum_id')); |
|
120 | - if (!empty($types)) { |
|
121 | - $type_element = new \XoopsFormSelect(_MD_NEWBB_TYPE, 'type_id', $type_id); |
|
122 | - //$type_element = new \XoopsFormRadio(_MD_NEWBB_TYPE, 'type_id', $type_id); |
|
123 | - $type_element->addOption(0, _NONE); |
|
124 | - foreach ($types as $key => $type) { |
|
125 | - //$value = empty($type["type_color"]) ? $type["type_name"] : "<em style=\"font-style: normal; color: " . $type["type_color"] . ";\">" . $type["type_name"] . "</em>"; |
|
126 | - $type_element->addOption($key, $type['type_name']); |
|
127 | - } |
|
128 | - $forum_form->addElement($type_element); |
|
129 | - } else { |
|
130 | - $forum_form->addElement(new \XoopsFormHidden('type_id', 0)); |
|
131 | - } |
|
113 | + || ($topicHandler->getPermission($forumObject, $topic_status, 'type') |
|
114 | + && (0 == $topic_id |
|
115 | + || $uid == $topicHandler->get(@$topic_id, 'topic_poster')))) { |
|
116 | + $type_id = $topicHandler->get(@$topic_id, 'type_id'); |
|
117 | + /** @var Newbb\TypeHandler $typeHandler */ |
|
118 | + $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
|
119 | + $types = $typeHandler->getByForum($forumObject->getVar('forum_id')); |
|
120 | + if (!empty($types)) { |
|
121 | + $type_element = new \XoopsFormSelect(_MD_NEWBB_TYPE, 'type_id', $type_id); |
|
122 | + //$type_element = new \XoopsFormRadio(_MD_NEWBB_TYPE, 'type_id', $type_id); |
|
123 | + $type_element->addOption(0, _NONE); |
|
124 | + foreach ($types as $key => $type) { |
|
125 | + //$value = empty($type["type_color"]) ? $type["type_name"] : "<em style=\"font-style: normal; color: " . $type["type_color"] . ";\">" . $type["type_name"] . "</em>"; |
|
126 | + $type_element->addOption($key, $type['type_name']); |
|
127 | + } |
|
128 | + $forum_form->addElement($type_element); |
|
129 | + } else { |
|
130 | + $forum_form->addElement(new \XoopsFormHidden('type_id', 0)); |
|
131 | + } |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $subject_form = new \XoopsFormText(_MD_NEWBB_SUBJECTC, 'subject', 60, 100, $subject); |
@@ -136,32 +136,32 @@ discard block |
||
136 | 136 | $forum_form->addElement($subject_form, true); |
137 | 137 | |
138 | 138 | if (!is_object($GLOBALS['xoopsUser'])) { |
139 | - $required = !empty($GLOBALS['xoopsModuleConfig']['require_name']); |
|
140 | - $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_NAMEMAIL, 'poster_name', 60, 255, (!empty($isedit) && !empty($poster_name)) ? $poster_name : ''), $required); |
|
139 | + $required = !empty($GLOBALS['xoopsModuleConfig']['require_name']); |
|
140 | + $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_NAMEMAIL, 'poster_name', 60, 255, (!empty($isedit) && !empty($poster_name)) ? $poster_name : ''), $required); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | $icons_radio = new \XoopsFormRadio(_MD_NEWBB_MESSAGEICON, 'icon', $icon); |
144 | 144 | $subject_icons = \XoopsLists::getSubjectsList(); |
145 | 145 | foreach ($subject_icons as $iconfile) { |
146 | - $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); |
|
146 | + $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); |
|
147 | 147 | } |
148 | 148 | $forum_form->addElement($icons_radio); |
149 | 149 | |
150 | 150 | $nohtml = !$topicHandler->getPermission($forumObject, $topic_status, 'html'); |
151 | 151 | |
152 | 152 | if (Request::getString('editor', '', 'POST')) { |
153 | - $editor = trim(Request::getString('editor', '', 'POST')); |
|
154 | - newbbSetCookie('editor', $editor); |
|
153 | + $editor = trim(Request::getString('editor', '', 'POST')); |
|
154 | + newbbSetCookie('editor', $editor); |
|
155 | 155 | } elseif (!$editor = newbbGetCookie('editor')) { |
156 | - if (empty($editor)) { |
|
157 | - $editor = @ $GLOBALS['xoopsModuleConfig']['editor_default']; |
|
158 | - } |
|
156 | + if (empty($editor)) { |
|
157 | + $editor = @ $GLOBALS['xoopsModuleConfig']['editor_default']; |
|
158 | + } |
|
159 | 159 | } |
160 | 160 | if (count(@$GLOBALS['xoopsModuleConfig']['editor_allowed']) > 0) { |
161 | - if (!in_array($editor, $GLOBALS['xoopsModuleConfig']['editor_allowed'])) { |
|
162 | - $editor = $GLOBALS['xoopsModuleConfig']['editor_allowed'][0]; |
|
163 | - newbbSetCookie('editor', $editor); |
|
164 | - } |
|
161 | + if (!in_array($editor, $GLOBALS['xoopsModuleConfig']['editor_allowed'])) { |
|
162 | + $editor = $GLOBALS['xoopsModuleConfig']['editor_allowed'][0]; |
|
163 | + newbbSetCookie('editor', $editor); |
|
164 | + } |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | $forum_form->addElement(new \XoopsFormSelectEditor($forum_form, 'editor', $editor, $nohtml, @$GLOBALS['xoopsModuleConfig']['editor_allowed'][0])); |
@@ -178,31 +178,31 @@ discard block |
||
178 | 178 | $forum_form->addElement($_editor, true); |
179 | 179 | |
180 | 180 | if (!empty($GLOBALS['xoopsModuleConfig']['do_tag']) && (empty($postObject) || $postObject->isTopic())) { |
181 | - $topic_tags = ''; |
|
182 | - if (Request::getString('topic_tags', '', 'POST')) { |
|
183 | - $topic_tags = $myts->htmlSpecialChars(Request::getString('topic_tags', '', 'POST')); |
|
184 | - } elseif (!empty($topic_id)) { |
|
185 | - $topic_tags = $topicHandler->get($topic_id, 'topic_tags'); |
|
186 | - } |
|
187 | - if (xoops_load('formtag', 'tag') && class_exists('TagFormTag')) { |
|
188 | - $forum_form->addElement(new TagFormTag('topic_tags', 60, 255, $topic_tags)); |
|
189 | - } |
|
181 | + $topic_tags = ''; |
|
182 | + if (Request::getString('topic_tags', '', 'POST')) { |
|
183 | + $topic_tags = $myts->htmlSpecialChars(Request::getString('topic_tags', '', 'POST')); |
|
184 | + } elseif (!empty($topic_id)) { |
|
185 | + $topic_tags = $topicHandler->get($topic_id, 'topic_tags'); |
|
186 | + } |
|
187 | + if (xoops_load('formtag', 'tag') && class_exists('TagFormTag')) { |
|
188 | + $forum_form->addElement(new TagFormTag('topic_tags', 60, 255, $topic_tags)); |
|
189 | + } |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | $options_tray = new \XoopsFormElementTray(_MD_NEWBB_OPTIONS, '<br>'); |
193 | 193 | if (is_object($GLOBALS['xoopsUser']) && 1 == $GLOBALS['xoopsModuleConfig']['allow_user_anonymous']) { |
194 | - $noname = (!empty($isedit) && is_object($postObject) && 0 == $postObject->getVar('uid')) ? 1 : 0; |
|
195 | - $noname_checkbox = new \XoopsFormCheckBox('', 'noname', $noname); |
|
196 | - $noname_checkbox->addOption(1, _MD_NEWBB_POSTANONLY); |
|
197 | - $options_tray->addElement($noname_checkbox); |
|
194 | + $noname = (!empty($isedit) && is_object($postObject) && 0 == $postObject->getVar('uid')) ? 1 : 0; |
|
195 | + $noname_checkbox = new \XoopsFormCheckBox('', 'noname', $noname); |
|
196 | + $noname_checkbox->addOption(1, _MD_NEWBB_POSTANONLY); |
|
197 | + $options_tray->addElement($noname_checkbox); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | if (!$nohtml) { |
201 | - $html_checkbox = new \XoopsFormCheckBox('', 'dohtml', $dohtml); |
|
202 | - $html_checkbox->addOption(1, _MD_NEWBB_DOHTML); |
|
203 | - $options_tray->addElement($html_checkbox); |
|
201 | + $html_checkbox = new \XoopsFormCheckBox('', 'dohtml', $dohtml); |
|
202 | + $html_checkbox->addOption(1, _MD_NEWBB_DOHTML); |
|
203 | + $options_tray->addElement($html_checkbox); |
|
204 | 204 | } else { |
205 | - $forum_form->addElement(new \XoopsFormHidden('dohtml', 0)); |
|
205 | + $forum_form->addElement(new \XoopsFormHidden('dohtml', 0)); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | $smiley_checkbox = new \XoopsFormCheckBox('', 'dosmiley', $dosmiley); |
@@ -214,99 +214,99 @@ discard block |
||
214 | 214 | $options_tray->addElement($xcode_checkbox); |
215 | 215 | |
216 | 216 | if (!$nohtml) { |
217 | - $br_checkbox = new \XoopsFormCheckBox('', 'dobr', $dobr); |
|
218 | - $br_checkbox->addOption(1, _MD_NEWBB_DOBR); |
|
219 | - $options_tray->addElement($br_checkbox); |
|
217 | + $br_checkbox = new \XoopsFormCheckBox('', 'dobr', $dobr); |
|
218 | + $br_checkbox->addOption(1, _MD_NEWBB_DOBR); |
|
219 | + $options_tray->addElement($br_checkbox); |
|
220 | 220 | } else { |
221 | - $forum_form->addElement(new \XoopsFormHidden('dobr', 1)); |
|
221 | + $forum_form->addElement(new \XoopsFormHidden('dobr', 1)); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | if (is_object($GLOBALS['xoopsUser']) && $topicHandler->getPermission($forumObject, $topic_status, 'signature')) { |
225 | - $attachsig_checkbox = new \XoopsFormCheckBox('', 'attachsig', $attachsig); |
|
226 | - $attachsig_checkbox->addOption(1, _MD_NEWBB_ATTACHSIG); |
|
227 | - $options_tray->addElement($attachsig_checkbox); |
|
225 | + $attachsig_checkbox = new \XoopsFormCheckBox('', 'attachsig', $attachsig); |
|
226 | + $attachsig_checkbox->addOption(1, _MD_NEWBB_ATTACHSIG); |
|
227 | + $options_tray->addElement($attachsig_checkbox); |
|
228 | 228 | } |
229 | 229 | $notify = 0; |
230 | 230 | if (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsModuleConfig']['notification_enabled']) { |
231 | - if (!empty($notify)) { |
|
232 | - // If 'notify' set, use that value (e.g. preview or upload) |
|
233 | - //$notify = 1; |
|
234 | - } else { |
|
235 | - // Otherwise, check previous subscribed status... |
|
236 | - /** @var \XoopsNotificationHandler $notificationHandler */ |
|
237 | - $notificationHandler = xoops_getHandler('notification'); |
|
238 | - if (!empty($topic_id) |
|
239 | - && $notificationHandler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $GLOBALS['xoopsUser']->getVar('uid'))) { |
|
240 | - $notify = 1; |
|
241 | - } |
|
242 | - } |
|
243 | - |
|
244 | - $notify_checkbox = new \XoopsFormCheckBox('', 'notify', $notify); |
|
245 | - $notify_checkbox->addOption(1, _MD_NEWBB_NEWPOSTNOTIFY); |
|
246 | - $options_tray->addElement($notify_checkbox); |
|
231 | + if (!empty($notify)) { |
|
232 | + // If 'notify' set, use that value (e.g. preview or upload) |
|
233 | + //$notify = 1; |
|
234 | + } else { |
|
235 | + // Otherwise, check previous subscribed status... |
|
236 | + /** @var \XoopsNotificationHandler $notificationHandler */ |
|
237 | + $notificationHandler = xoops_getHandler('notification'); |
|
238 | + if (!empty($topic_id) |
|
239 | + && $notificationHandler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $GLOBALS['xoopsUser']->getVar('uid'))) { |
|
240 | + $notify = 1; |
|
241 | + } |
|
242 | + } |
|
243 | + |
|
244 | + $notify_checkbox = new \XoopsFormCheckBox('', 'notify', $notify); |
|
245 | + $notify_checkbox->addOption(1, _MD_NEWBB_NEWPOSTNOTIFY); |
|
246 | + $options_tray->addElement($notify_checkbox); |
|
247 | 247 | } |
248 | 248 | $forum_form->addElement($options_tray); |
249 | 249 | |
250 | 250 | if ($topicHandler->getPermission($forumObject, $topic_status, 'attach')) { |
251 | - $upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT); |
|
252 | - $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024)); |
|
253 | - $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit')); |
|
254 | - $upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; ')); |
|
255 | - $extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext'))); |
|
256 | - $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions; |
|
257 | - $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions)); |
|
258 | - $upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width']))); |
|
259 | - $forum_form->addElement($upload_tray); |
|
251 | + $upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT); |
|
252 | + $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024)); |
|
253 | + $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit')); |
|
254 | + $upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; ')); |
|
255 | + $extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext'))); |
|
256 | + $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions; |
|
257 | + $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions)); |
|
258 | + $upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width']))); |
|
259 | + $forum_form->addElement($upload_tray); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | if (!empty($attachments) && is_array($attachments) && count($attachments)) { |
263 | - $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]'); |
|
264 | - foreach ($attachments as $key => $attachment) { |
|
265 | - $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>'; |
|
266 | - $delete_attach_checkbox->addOption($key, $attach); |
|
267 | - } |
|
268 | - $forum_form->addElement($delete_attach_checkbox); |
|
269 | - unset($delete_attach_checkbox); |
|
263 | + $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]'); |
|
264 | + foreach ($attachments as $key => $attachment) { |
|
265 | + $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>'; |
|
266 | + $delete_attach_checkbox->addOption($key, $attach); |
|
267 | + } |
|
268 | + $forum_form->addElement($delete_attach_checkbox); |
|
269 | + unset($delete_attach_checkbox); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | if (!empty($attachments_tmp) && is_array($attachments_tmp) && count($attachments_tmp)) { |
273 | - $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]'); |
|
274 | - $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH); |
|
275 | - foreach ($attachments_tmp as $key => $attachment) { |
|
276 | - $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>'; |
|
277 | - $delete_attach_checkbox->addOption($key, $attach); |
|
278 | - } |
|
279 | - $forum_form->addElement($delete_attach_checkbox); |
|
280 | - unset($delete_attach_checkbox); |
|
281 | - $attachments_tmp = base64_encode(serialize($attachments_tmp)); |
|
282 | - $forum_form->addElement(new \XoopsFormHidden('attachments_tmp', $attachments_tmp)); |
|
273 | + $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]'); |
|
274 | + $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH); |
|
275 | + foreach ($attachments_tmp as $key => $attachment) { |
|
276 | + $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>'; |
|
277 | + $delete_attach_checkbox->addOption($key, $attach); |
|
278 | + } |
|
279 | + $forum_form->addElement($delete_attach_checkbox); |
|
280 | + unset($delete_attach_checkbox); |
|
281 | + $attachments_tmp = base64_encode(serialize($attachments_tmp)); |
|
282 | + $forum_form->addElement(new \XoopsFormHidden('attachments_tmp', $attachments_tmp)); |
|
283 | 283 | } |
284 | 284 | $radiobox = null; |
285 | 285 | if ($GLOBALS['xoopsModuleConfig']['enable_karma'] || $GLOBALS['xoopsModuleConfig']['allow_require_reply']) { |
286 | - $view_require = $require_reply ? 'require_reply' : ($post_karma ? 'require_karma' : 'require_null'); |
|
287 | - $radiobox = new \XoopsFormRadio(_MD_NEWBB_VIEW_REQUIRE, 'view_require', $view_require); |
|
288 | - if ($GLOBALS['xoopsModuleConfig']['allow_require_reply']) { |
|
289 | - $radiobox->addOption('require_reply', _MD_NEWBB_REQUIRE_REPLY); |
|
290 | - } |
|
291 | - if ($GLOBALS['xoopsModuleConfig']['enable_karma']) { |
|
292 | - $karmas = array_map('trim', explode(',', $GLOBALS['xoopsModuleConfig']['karma_options'])); |
|
293 | - if (count($karmas) > 1) { |
|
294 | - foreach ($karmas as $karma) { |
|
295 | - $karma_array[(string)$karma] = (int)$karma; |
|
296 | - } |
|
297 | - $karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma); |
|
298 | - $karma_select->addOptionArray($karma_array); |
|
299 | - $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render()); |
|
300 | - } |
|
301 | - } |
|
302 | - $radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL); |
|
286 | + $view_require = $require_reply ? 'require_reply' : ($post_karma ? 'require_karma' : 'require_null'); |
|
287 | + $radiobox = new \XoopsFormRadio(_MD_NEWBB_VIEW_REQUIRE, 'view_require', $view_require); |
|
288 | + if ($GLOBALS['xoopsModuleConfig']['allow_require_reply']) { |
|
289 | + $radiobox->addOption('require_reply', _MD_NEWBB_REQUIRE_REPLY); |
|
290 | + } |
|
291 | + if ($GLOBALS['xoopsModuleConfig']['enable_karma']) { |
|
292 | + $karmas = array_map('trim', explode(',', $GLOBALS['xoopsModuleConfig']['karma_options'])); |
|
293 | + if (count($karmas) > 1) { |
|
294 | + foreach ($karmas as $karma) { |
|
295 | + $karma_array[(string)$karma] = (int)$karma; |
|
296 | + } |
|
297 | + $karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma); |
|
298 | + $karma_select->addOptionArray($karma_array); |
|
299 | + $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render()); |
|
300 | + } |
|
301 | + } |
|
302 | + $radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL); |
|
303 | 303 | } |
304 | 304 | if (null !== $radiobox) { |
305 | - $forum_form->addElement($radiobox); |
|
305 | + $forum_form->addElement($radiobox); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | if (empty($uid)) { |
309 | - $forum_form->addElement(new \XoopsFormCaptcha()); |
|
309 | + $forum_form->addElement(new \XoopsFormCaptcha()); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | $forum_form->addElement(new \XoopsFormHidden('pid', @$pid)); |
@@ -327,20 +327,20 @@ discard block |
||
327 | 327 | |
328 | 328 | $cancel_button = new \XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
329 | 329 | if (!empty($topic_id)) { |
330 | - $extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id; |
|
330 | + $extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id; |
|
331 | 331 | } else { |
332 | - $extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id'); |
|
332 | + $extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id'); |
|
333 | 333 | } |
334 | 334 | $cancel_button->setExtra("onclick='location=\"" . $extra . "\"'"); |
335 | 335 | $cancel_button->setExtra("tabindex='6'"); |
336 | 336 | |
337 | 337 | if (!empty($isreply) && !empty($hidden)) { |
338 | - $forum_form->addElement(new \XoopsFormHidden('hidden', $hidden)); |
|
338 | + $forum_form->addElement(new \XoopsFormHidden('hidden', $hidden)); |
|
339 | 339 | |
340 | - $quote_button = new \XoopsFormButton('', 'quote', _MD_NEWBB_QUOTE, 'button'); |
|
341 | - $quote_button->setExtra("onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value+ xoopsGetElementById(\"hidden\").value;xoopsGetElementById(\"hidden\").value=\"\";'"); |
|
342 | - $quote_button->setExtra("tabindex='4'"); |
|
343 | - $button_tray->addElement($quote_button); |
|
340 | + $quote_button = new \XoopsFormButton('', 'quote', _MD_NEWBB_QUOTE, 'button'); |
|
341 | + $quote_button->setExtra("onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value+ xoopsGetElementById(\"hidden\").value;xoopsGetElementById(\"hidden\").value=\"\";'"); |
|
342 | + $quote_button->setExtra("tabindex='4'"); |
|
343 | + $button_tray->addElement($quote_button); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | $preview_button = new \XoopsFormButton('', 'btn_preview', _PREVIEW, 'button'); |