@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | include __DIR__ . '/header.php'; |
| 30 | 30 | |
| 31 | 31 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
| 32 | - $args['year'] = @$args_num[0]; |
|
| 33 | - $args['month'] = @$args_num[1]; |
|
| 34 | - $args['day'] = @$args_num[2]; |
|
| 32 | + $args['year'] = @$args_num[0]; |
|
| 33 | + $args['month'] = @$args_num[1]; |
|
| 34 | + $args['day'] = @$args_num[2]; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $day = Request::getInt('day', @$args['day'], 'GET'); //(int)(empty($_GET['day']) ? @$args['day'] : $_GET['day']); |
@@ -52,31 +52,31 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $year = empty($year) ? date('Y') : $year; |
| 54 | 54 | if ($month < 1) { |
| 55 | - $month = $day = 0; |
|
| 56 | - $page['time'] = sprintf(planet_constant('MD_TIME_Y'), $year); |
|
| 55 | + $month = $day = 0; |
|
| 56 | + $page['time'] = sprintf(planet_constant('MD_TIME_Y'), $year); |
|
| 57 | 57 | } elseif ($day < 1) { |
| 58 | - $day = 0; |
|
| 59 | - $page['time'] = sprintf(planet_constant('MD_TIME_YM'), $year, $month); |
|
| 58 | + $day = 0; |
|
| 59 | + $page['time'] = sprintf(planet_constant('MD_TIME_YM'), $year, $month); |
|
| 60 | 60 | } else { |
| 61 | - $page['time'] = sprintf(planet_constant('MD_TIME_YMD'), $year, $month, $day); |
|
| 61 | + $page['time'] = sprintf(planet_constant('MD_TIME_YMD'), $year, $month, $day); |
|
| 62 | 62 | } |
| 63 | 63 | $time = array('year' => $year, 'month' => $month, 'day' => $day); |
| 64 | 64 | if ($xoopsUser) { |
| 65 | - $timeoffset = ($xoopsUser->getVar('timezone_offset') - $xoopsConfig['server_TZ']) * 3600; |
|
| 65 | + $timeoffset = ($xoopsUser->getVar('timezone_offset') - $xoopsConfig['server_TZ']) * 3600; |
|
| 66 | 66 | } else { |
| 67 | - $timeoffset = ($xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ']) * 3600; |
|
| 67 | + $timeoffset = ($xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ']) * 3600; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $criteria = new CriteriaCompo(); |
| 71 | 71 | if ($blog_id) { |
| 72 | - $criteria->add(new Criteria('blog_id', $blog_id)); |
|
| 72 | + $criteria->add(new Criteria('blog_id', $blog_id)); |
|
| 73 | 73 | } |
| 74 | 74 | $criteria->add(new Criteria("YEAR(FROM_UNIXTIME(art_time_publish - $timeoffset))", $year)); |
| 75 | 75 | if ($month) { |
| 76 | - $criteria->add(new Criteria("MONTH(FROM_UNIXTIME(art_time_publish - $timeoffset))", $month)); |
|
| 77 | - if ($day) { |
|
| 78 | - $criteria->add(new Criteria("DAY(FROM_UNIXTIME(art_time_publish - $timeoffset))", $day)); |
|
| 79 | - } |
|
| 76 | + $criteria->add(new Criteria("MONTH(FROM_UNIXTIME(art_time_publish - $timeoffset))", $month)); |
|
| 77 | + if ($day) { |
|
| 78 | + $criteria->add(new Criteria("DAY(FROM_UNIXTIME(art_time_publish - $timeoffset))", $day)); |
|
| 79 | + } |
|
| 80 | 80 | } |
| 81 | 81 | $criteria->setStart($start); |
| 82 | 82 | $criteria->setLimit($xoopsModuleConfig['articles_perpage']); |
@@ -87,115 +87,115 @@ discard block |
||
| 87 | 87 | $articles = array(); |
| 88 | 88 | $blogs_id = array(); |
| 89 | 89 | foreach ($articles_obj as $id => $article) { |
| 90 | - $articles[] = array( |
|
| 91 | - 'id' => $id, |
|
| 92 | - 'blog' => array('id' => $article->getVar('blog_id'), 'title' => ''), |
|
| 93 | - 'title' => $article->getVar('art_title'), |
|
| 94 | - 'time' => $article->getTime(), |
|
| 95 | - 'content' => $article->getVar('art_content') |
|
| 96 | - ); |
|
| 97 | - $articles[] = $_article; |
|
| 98 | - $blogs_id[$article->getVar('blog_id')] = 1; |
|
| 99 | - unset($_article); |
|
| 90 | + $articles[] = array( |
|
| 91 | + 'id' => $id, |
|
| 92 | + 'blog' => array('id' => $article->getVar('blog_id'), 'title' => ''), |
|
| 93 | + 'title' => $article->getVar('art_title'), |
|
| 94 | + 'time' => $article->getTime(), |
|
| 95 | + 'content' => $article->getVar('art_content') |
|
| 96 | + ); |
|
| 97 | + $articles[] = $_article; |
|
| 98 | + $blogs_id[$article->getVar('blog_id')] = 1; |
|
| 99 | + unset($_article); |
|
| 100 | 100 | } |
| 101 | 101 | $criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN'); |
| 102 | 102 | $blogs = $blogHandler->getList($criteria_blog); |
| 103 | 103 | foreach (array_keys($articles) as $key) { |
| 104 | - $articles[$key]['blog']['title'] = $blogs[$articles[$key]['blog']['id']]; |
|
| 104 | + $articles[$key]['blog']['title'] = $blogs[$articles[$key]['blog']['id']]; |
|
| 105 | 105 | } |
| 106 | 106 | if ($blog_id > 0) { |
| 107 | - $page['blog'] = $blogs[$blog_id]; |
|
| 107 | + $page['blog'] = $blogs[$blog_id]; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if ($articles_count > $xoopsModuleConfig['articles_perpage']) { |
| 111 | - include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 112 | - $nav = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start', 'month=' . $month . '&day=' . $day . '&year=' . $year . '&blog=' . (int)$blog_id); |
|
| 113 | - $pagenav = $nav->renderNav(4); |
|
| 111 | + include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 112 | + $nav = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start', 'month=' . $month . '&day=' . $day . '&year=' . $year . '&blog=' . (int)$blog_id); |
|
| 113 | + $pagenav = $nav->renderNav(4); |
|
| 114 | 114 | } else { |
| 115 | - $pagenav = ''; |
|
| 115 | + $pagenav = ''; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $timenav = null; |
| 119 | 119 | $calendar = null; |
| 120 | 120 | $months = null; |
| 121 | 121 | if (empty($start)) { |
| 122 | - if ($blog_id) { |
|
| 123 | - $blog_criteria = ' AND blog_id=' . $blog_id; |
|
| 124 | - } else { |
|
| 125 | - $blog_criteria = ''; |
|
| 126 | - } |
|
| 127 | - // Get monthly list |
|
| 128 | - if (empty($month)) { |
|
| 129 | - $sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count |
|
| 122 | + if ($blog_id) { |
|
| 123 | + $blog_criteria = ' AND blog_id=' . $blog_id; |
|
| 124 | + } else { |
|
| 125 | + $blog_criteria = ''; |
|
| 126 | + } |
|
| 127 | + // Get monthly list |
|
| 128 | + if (empty($month)) { |
|
| 129 | + $sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count |
|
| 130 | 130 | FROM " . planet_DB_prefix('article') . " |
| 131 | 131 | WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year |
| 132 | 132 | " . $blog_criteria . ' |
| 133 | 133 | GROUP BY mon |
| 134 | 134 | '; |
| 135 | - $result = $xoopsDB->query($sql); |
|
| 136 | - $months = array(); |
|
| 137 | - while ($myrow = $xoopsDB->fetchArray($result)) { |
|
| 138 | - $months[] = array( |
|
| 139 | - 'title' => planet_constant('MD_MONTH_' . (int)$myrow['mon']) . ' (' . (int)$myrow['count'] . ')', |
|
| 140 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $myrow['mon'] . '/b' . $blog_id |
|
| 141 | - ); |
|
| 142 | - } |
|
| 143 | - $timenav['prev'] = array( |
|
| 144 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year - 1) . '/b' . $blog_id, |
|
| 145 | - 'title' => sprintf(planet_constant('MD_TIME_Y'), $year - 1) |
|
| 146 | - ); |
|
| 147 | - if ($year < date('Y')) { |
|
| 148 | - $timenav['next'] = array( |
|
| 149 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year + 1) . '/b' . $blog_id, |
|
| 150 | - 'title' => sprintf(planet_constant('MD_TIME_Y'), $year + 1) |
|
| 151 | - ); |
|
| 152 | - } |
|
| 153 | - } // Get daily list |
|
| 154 | - elseif (empty($day)) { |
|
| 155 | - $sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count |
|
| 135 | + $result = $xoopsDB->query($sql); |
|
| 136 | + $months = array(); |
|
| 137 | + while ($myrow = $xoopsDB->fetchArray($result)) { |
|
| 138 | + $months[] = array( |
|
| 139 | + 'title' => planet_constant('MD_MONTH_' . (int)$myrow['mon']) . ' (' . (int)$myrow['count'] . ')', |
|
| 140 | + 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $myrow['mon'] . '/b' . $blog_id |
|
| 141 | + ); |
|
| 142 | + } |
|
| 143 | + $timenav['prev'] = array( |
|
| 144 | + 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year - 1) . '/b' . $blog_id, |
|
| 145 | + 'title' => sprintf(planet_constant('MD_TIME_Y'), $year - 1) |
|
| 146 | + ); |
|
| 147 | + if ($year < date('Y')) { |
|
| 148 | + $timenav['next'] = array( |
|
| 149 | + 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year + 1) . '/b' . $blog_id, |
|
| 150 | + 'title' => sprintf(planet_constant('MD_TIME_Y'), $year + 1) |
|
| 151 | + ); |
|
| 152 | + } |
|
| 153 | + } // Get daily list |
|
| 154 | + elseif (empty($day)) { |
|
| 155 | + $sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count |
|
| 156 | 156 | FROM " . planet_DB_prefix('article') . " |
| 157 | 157 | WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year |
| 158 | 158 | AND MONTH(FROM_UNIXTIME(art_time - $timeoffset)) = $month |
| 159 | 159 | " . $blog_criteria . ' |
| 160 | 160 | GROUP BY day |
| 161 | 161 | '; |
| 162 | - $result = $xoopsDB->query($sql); |
|
| 163 | - $days = array(); |
|
| 164 | - while ($myrow = $xoopsDB->fetchArray($result)) { |
|
| 165 | - $days[$myrow['day']]['count'] = $myrow['count']; |
|
| 166 | - } |
|
| 167 | - for ($i = 1; $i <= 31; ++$i) { |
|
| 168 | - if (!isset($days[$i])) { |
|
| 169 | - continue; |
|
| 170 | - } |
|
| 171 | - $days[$i] = array( |
|
| 172 | - 'title' => $days[$i]['count'], |
|
| 173 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $month . '/' . $i . '/b' . $blog_id |
|
| 174 | - ); |
|
| 175 | - } |
|
| 176 | - $calendar = planet_getCalendar($year, $month, $days); |
|
| 177 | - $month_next = $month + 1; |
|
| 178 | - $month_prev = $month - 1; |
|
| 179 | - $_year = $year; |
|
| 180 | - if ($month == 12) { |
|
| 181 | - $month_next = 1; |
|
| 182 | - $_year = $year + 1; |
|
| 183 | - } |
|
| 184 | - if ($month == 1) { |
|
| 185 | - $month_pre = 12; |
|
| 186 | - $_year = $year - 1; |
|
| 187 | - } |
|
| 188 | - $timenav['prev'] = array( |
|
| 189 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_prev . '/b' . $blog_id, |
|
| 190 | - 'title' => planet_constant('MD_MONTH_' . $month_prev) |
|
| 191 | - ); |
|
| 192 | - if ($year < date('Y') || $month < date('n')) { |
|
| 193 | - $timenav['next'] = array( |
|
| 194 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_next . '/b' . $blog_id, |
|
| 195 | - 'title' => planet_constant('MD_MONTH_' . $month_next) |
|
| 196 | - ); |
|
| 197 | - } |
|
| 198 | - } |
|
| 162 | + $result = $xoopsDB->query($sql); |
|
| 163 | + $days = array(); |
|
| 164 | + while ($myrow = $xoopsDB->fetchArray($result)) { |
|
| 165 | + $days[$myrow['day']]['count'] = $myrow['count']; |
|
| 166 | + } |
|
| 167 | + for ($i = 1; $i <= 31; ++$i) { |
|
| 168 | + if (!isset($days[$i])) { |
|
| 169 | + continue; |
|
| 170 | + } |
|
| 171 | + $days[$i] = array( |
|
| 172 | + 'title' => $days[$i]['count'], |
|
| 173 | + 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $month . '/' . $i . '/b' . $blog_id |
|
| 174 | + ); |
|
| 175 | + } |
|
| 176 | + $calendar = planet_getCalendar($year, $month, $days); |
|
| 177 | + $month_next = $month + 1; |
|
| 178 | + $month_prev = $month - 1; |
|
| 179 | + $_year = $year; |
|
| 180 | + if ($month == 12) { |
|
| 181 | + $month_next = 1; |
|
| 182 | + $_year = $year + 1; |
|
| 183 | + } |
|
| 184 | + if ($month == 1) { |
|
| 185 | + $month_pre = 12; |
|
| 186 | + $_year = $year - 1; |
|
| 187 | + } |
|
| 188 | + $timenav['prev'] = array( |
|
| 189 | + 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_prev . '/b' . $blog_id, |
|
| 190 | + 'title' => planet_constant('MD_MONTH_' . $month_prev) |
|
| 191 | + ); |
|
| 192 | + if ($year < date('Y') || $month < date('n')) { |
|
| 193 | + $timenav['next'] = array( |
|
| 194 | + 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_next . '/b' . $blog_id, |
|
| 195 | + 'title' => planet_constant('MD_MONTH_' . $month_next) |
|
| 196 | + ); |
|
| 197 | + } |
|
| 198 | + } |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | $xoopsTpl->assign('dirname', $GLOBALS['moddirname']); |
@@ -222,66 +222,66 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | function planet_getCalendar($year = null, $month = null, $days = null) |
| 224 | 224 | { |
| 225 | - $year = empty($year) ? date('Y') : $year; |
|
| 226 | - $month = empty($month) ? date('n') : $month; |
|
| 227 | - $unixmonth = mktime(0, 0, 0, $month, 1, $year); |
|
| 225 | + $year = empty($year) ? date('Y') : $year; |
|
| 226 | + $month = empty($month) ? date('n') : $month; |
|
| 227 | + $unixmonth = mktime(0, 0, 0, $month, 1, $year); |
|
| 228 | 228 | |
| 229 | - ob_start(); |
|
| 230 | - echo '<table id="calendar">'; |
|
| 231 | - echo '<caption>'; |
|
| 232 | - printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_' . $month)); |
|
| 233 | - echo '</caption>'; |
|
| 229 | + ob_start(); |
|
| 230 | + echo '<table id="calendar">'; |
|
| 231 | + echo '<caption>'; |
|
| 232 | + printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_' . $month)); |
|
| 233 | + echo '</caption>'; |
|
| 234 | 234 | |
| 235 | - for ($i = 1; $i <= 7; ++$i) { |
|
| 236 | - echo "\n\t\t<th abbr=\"" . planet_constant('MD_WEEK_' . $i) . "\" scope=\"col\" title=\"" . planet_constant('MD_WEEK_' . $i) . "\">" . planet_constant('MD_WEEK_' . $i) . '</th>'; |
|
| 237 | - } |
|
| 235 | + for ($i = 1; $i <= 7; ++$i) { |
|
| 236 | + echo "\n\t\t<th abbr=\"" . planet_constant('MD_WEEK_' . $i) . "\" scope=\"col\" title=\"" . planet_constant('MD_WEEK_' . $i) . "\">" . planet_constant('MD_WEEK_' . $i) . '</th>'; |
|
| 237 | + } |
|
| 238 | 238 | |
| 239 | - echo '<tr>'; |
|
| 239 | + echo '<tr>'; |
|
| 240 | 240 | |
| 241 | - // See how much we should pad in the beginning |
|
| 242 | - $week_begins = 1; |
|
| 243 | - $pad = planet_calendar_week_mod(date('w', $unixmonth) - $week_begins); |
|
| 244 | - if (0 != $pad) { |
|
| 245 | - echo "\n\t\t" . '<td colspan="' . $pad . '"> </td>'; |
|
| 246 | - } |
|
| 241 | + // See how much we should pad in the beginning |
|
| 242 | + $week_begins = 1; |
|
| 243 | + $pad = planet_calendar_week_mod(date('w', $unixmonth) - $week_begins); |
|
| 244 | + if (0 != $pad) { |
|
| 245 | + echo "\n\t\t" . '<td colspan="' . $pad . '"> </td>'; |
|
| 246 | + } |
|
| 247 | 247 | |
| 248 | - $daysinmonth = (int)date('t', $unixmonth); |
|
| 249 | - for ($day = 1; $day <= $daysinmonth; ++$day) { |
|
| 250 | - if (isset($newrow) && $newrow) { |
|
| 251 | - echo "\n\t</tr>\n\t<tr>\n\t\t"; |
|
| 252 | - } |
|
| 253 | - $newrow = false; |
|
| 248 | + $daysinmonth = (int)date('t', $unixmonth); |
|
| 249 | + for ($day = 1; $day <= $daysinmonth; ++$day) { |
|
| 250 | + if (isset($newrow) && $newrow) { |
|
| 251 | + echo "\n\t</tr>\n\t<tr>\n\t\t"; |
|
| 252 | + } |
|
| 253 | + $newrow = false; |
|
| 254 | 254 | |
| 255 | - echo '<td>'; |
|
| 255 | + echo '<td>'; |
|
| 256 | 256 | |
| 257 | - if (!empty($days[$day]['url'])) { |
|
| 258 | - echo '<a href="' . $days[$day]['url'] . "\""; |
|
| 259 | - if (!empty($days[$day]['title'])) { |
|
| 260 | - echo "title=\"" . $days[$day]['title'] . "\""; |
|
| 261 | - } |
|
| 262 | - echo ">$day</a>"; |
|
| 263 | - } elseif (!empty($days[$day]['title'])) { |
|
| 264 | - echo "<acronym title=\"" . $days[$day]['title'] . "\">$day</acronym>"; |
|
| 265 | - } else { |
|
| 266 | - echo $day; |
|
| 267 | - } |
|
| 268 | - echo '</td>'; |
|
| 257 | + if (!empty($days[$day]['url'])) { |
|
| 258 | + echo '<a href="' . $days[$day]['url'] . "\""; |
|
| 259 | + if (!empty($days[$day]['title'])) { |
|
| 260 | + echo "title=\"" . $days[$day]['title'] . "\""; |
|
| 261 | + } |
|
| 262 | + echo ">$day</a>"; |
|
| 263 | + } elseif (!empty($days[$day]['title'])) { |
|
| 264 | + echo "<acronym title=\"" . $days[$day]['title'] . "\">$day</acronym>"; |
|
| 265 | + } else { |
|
| 266 | + echo $day; |
|
| 267 | + } |
|
| 268 | + echo '</td>'; |
|
| 269 | 269 | |
| 270 | - if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins)) { |
|
| 271 | - $newrow = true; |
|
| 272 | - } |
|
| 273 | - } |
|
| 270 | + if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins)) { |
|
| 271 | + $newrow = true; |
|
| 272 | + } |
|
| 273 | + } |
|
| 274 | 274 | |
| 275 | - $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins); |
|
| 276 | - if ($pad != 0 && $pad != 7) { |
|
| 277 | - echo "\n\t\t" . '<td class="pad" colspan="' . $pad . '"> </td>'; |
|
| 278 | - } |
|
| 275 | + $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins); |
|
| 276 | + if ($pad != 0 && $pad != 7) { |
|
| 277 | + echo "\n\t\t" . '<td class="pad" colspan="' . $pad . '"> </td>'; |
|
| 278 | + } |
|
| 279 | 279 | |
| 280 | - echo "\n\t</tr>\n\t</tbody>\n\t</table>"; |
|
| 281 | - $calendar = ob_get_contents(); |
|
| 282 | - ob_end_clean(); |
|
| 280 | + echo "\n\t</tr>\n\t</tbody>\n\t</table>"; |
|
| 281 | + $calendar = ob_get_contents(); |
|
| 282 | + ob_end_clean(); |
|
| 283 | 283 | |
| 284 | - return $calendar; |
|
| 284 | + return $calendar; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | // Used in get_calendar |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | function planet_calendar_week_mod($num) |
| 293 | 293 | { |
| 294 | - $base = 7; |
|
| 294 | + $base = 7; |
|
| 295 | 295 | |
| 296 | - return ($num - $base * floor($num / $base)); |
|
| 296 | + return ($num - $base * floor($num / $base)); |
|
| 297 | 297 | } |
@@ -38,159 +38,159 @@ |
||
| 38 | 38 | $charset = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']); |
| 39 | 39 | |
| 40 | 40 | if (empty($xoopsModuleConfig['trackback_option'])) { |
| 41 | - PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
|
| 41 | + PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
|
| 42 | 42 | } |
| 43 | 43 | if (!strlen($title . $url . $blog_name)) { |
| 44 | - PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
|
| 44 | + PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if (!empty($article_id) && !empty($url)) { |
| 48 | - $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
|
| 49 | - $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
| 50 | - $criteria->add(new Criteria('tb_url', $url)); |
|
| 51 | - if ($trackbackHandler->getCount($criteria) > 0) { |
|
| 52 | - PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
|
| 53 | - } |
|
| 48 | + $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
|
| 49 | + $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
| 50 | + $criteria->add(new Criteria('tb_url', $url)); |
|
| 51 | + if ($trackbackHandler->getCount($criteria) > 0) { |
|
| 52 | + PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - $charset = empty($charset) ? 'utf-8' : $charset; |
|
| 56 | - $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
|
| 57 | - $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
|
| 58 | - $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
|
| 59 | - $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
| 55 | + $charset = empty($charset) ? 'utf-8' : $charset; |
|
| 56 | + $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
|
| 57 | + $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
|
| 58 | + $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
|
| 59 | + $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
| 60 | 60 | |
| 61 | - $com_pid = 0; |
|
| 62 | - $com_itemid = $article_id; |
|
| 63 | - $com_rootid = 0; |
|
| 64 | - $com_title = $title; |
|
| 65 | - $com_text = $excerpt; |
|
| 66 | - $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
| 67 | - if (!empty($url)) { |
|
| 68 | - $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
| 69 | - } else { |
|
| 70 | - $com_text .= $blog_name; |
|
| 71 | - } |
|
| 72 | - $com_modid = $xoopsModule->getVar('mid'); |
|
| 61 | + $com_pid = 0; |
|
| 62 | + $com_itemid = $article_id; |
|
| 63 | + $com_rootid = 0; |
|
| 64 | + $com_title = $title; |
|
| 65 | + $com_text = $excerpt; |
|
| 66 | + $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
| 67 | + if (!empty($url)) { |
|
| 68 | + $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
| 69 | + } else { |
|
| 70 | + $com_text .= $blog_name; |
|
| 71 | + } |
|
| 72 | + $com_modid = $xoopsModule->getVar('mid'); |
|
| 73 | 73 | |
| 74 | - $commentHandler = xoops_getHandler('comment'); |
|
| 75 | - $comment = $commentHandler->create(); |
|
| 76 | - $comment->setVar('com_created', time()); |
|
| 77 | - $comment->setVar('com_pid', $com_pid); |
|
| 78 | - $comment->setVar('com_itemid', $com_itemid); |
|
| 79 | - $comment->setVar('com_rootid', $com_rootid); |
|
| 80 | - $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); |
|
| 81 | - switch ($tb_status) { |
|
| 82 | - case 2: |
|
| 83 | - $comment->setVar('com_status', 2); |
|
| 84 | - $call_approvefunc = true; |
|
| 85 | - $call_updatefunc = true; |
|
| 86 | - $notify_event = 'comment'; |
|
| 87 | - break; |
|
| 88 | - case 1: |
|
| 89 | - default: |
|
| 90 | - $comment->setVar('com_status', 1); |
|
| 91 | - $notify_event = 'comment_submit'; |
|
| 92 | - break; |
|
| 93 | - } |
|
| 94 | - $comment->setVar('com_uid', 0); |
|
| 95 | - $com_title = xoops_trim($com_title); |
|
| 96 | - $com_title = empty($com_title) ? _NOTITLE : $com_title; |
|
| 97 | - $comment->setVar('com_title', $com_title); |
|
| 98 | - $comment->setVar('com_text', $com_text); |
|
| 99 | - $comment->setVar('dohtml', 0); |
|
| 100 | - $comment->setVar('dosmiley', 0); |
|
| 101 | - $comment->setVar('doxcode', 1); |
|
| 102 | - $comment->setVar('doimage', 0); |
|
| 103 | - $comment->setVar('dobr', 1); |
|
| 104 | - $comment->setVar('com_icon', ''); |
|
| 105 | - $comment->setVar('com_modified', time()); |
|
| 106 | - $comment->setVar('com_modid', $com_modid); |
|
| 107 | - if (false != $commentHandler->insert($comment)) { |
|
| 108 | - $newcid = $comment->getVar('com_id'); |
|
| 74 | + $commentHandler = xoops_getHandler('comment'); |
|
| 75 | + $comment = $commentHandler->create(); |
|
| 76 | + $comment->setVar('com_created', time()); |
|
| 77 | + $comment->setVar('com_pid', $com_pid); |
|
| 78 | + $comment->setVar('com_itemid', $com_itemid); |
|
| 79 | + $comment->setVar('com_rootid', $com_rootid); |
|
| 80 | + $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); |
|
| 81 | + switch ($tb_status) { |
|
| 82 | + case 2: |
|
| 83 | + $comment->setVar('com_status', 2); |
|
| 84 | + $call_approvefunc = true; |
|
| 85 | + $call_updatefunc = true; |
|
| 86 | + $notify_event = 'comment'; |
|
| 87 | + break; |
|
| 88 | + case 1: |
|
| 89 | + default: |
|
| 90 | + $comment->setVar('com_status', 1); |
|
| 91 | + $notify_event = 'comment_submit'; |
|
| 92 | + break; |
|
| 93 | + } |
|
| 94 | + $comment->setVar('com_uid', 0); |
|
| 95 | + $com_title = xoops_trim($com_title); |
|
| 96 | + $com_title = empty($com_title) ? _NOTITLE : $com_title; |
|
| 97 | + $comment->setVar('com_title', $com_title); |
|
| 98 | + $comment->setVar('com_text', $com_text); |
|
| 99 | + $comment->setVar('dohtml', 0); |
|
| 100 | + $comment->setVar('dosmiley', 0); |
|
| 101 | + $comment->setVar('doxcode', 1); |
|
| 102 | + $comment->setVar('doimage', 0); |
|
| 103 | + $comment->setVar('dobr', 1); |
|
| 104 | + $comment->setVar('com_icon', ''); |
|
| 105 | + $comment->setVar('com_modified', time()); |
|
| 106 | + $comment->setVar('com_modid', $com_modid); |
|
| 107 | + if (false != $commentHandler->insert($comment)) { |
|
| 108 | + $newcid = $comment->getVar('com_id'); |
|
| 109 | 109 | |
| 110 | - // set own id as root id |
|
| 111 | - $com_rootid = $newcid; |
|
| 112 | - if (!$commentHandler->updateByField($comment, 'com_rootid', $com_rootid)) { |
|
| 113 | - $commentHandler->delete($comment); |
|
| 114 | - PlanetUtility::planetRespondToTrackback(1, xoops_error()); |
|
| 115 | - } |
|
| 110 | + // set own id as root id |
|
| 111 | + $com_rootid = $newcid; |
|
| 112 | + if (!$commentHandler->updateByField($comment, 'com_rootid', $com_rootid)) { |
|
| 113 | + $commentHandler->delete($comment); |
|
| 114 | + PlanetUtility::planetRespondToTrackback(1, xoops_error()); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - // call custom approve function if any |
|
| 118 | - if (false != $call_approvefunc && isset($comment_config['callback']['approve']) |
|
| 119 | - && trim($comment_config['callback']['approve']) != '') { |
|
| 120 | - $skip = false; |
|
| 121 | - if (!function_exists($comment_config['callback']['approve'])) { |
|
| 122 | - if (isset($comment_config['callbackFile'])) { |
|
| 123 | - $callbackfile = trim($comment_config['callbackFile']); |
|
| 124 | - if ($callbackfile != '' |
|
| 125 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 126 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 127 | - } |
|
| 128 | - if (!function_exists($comment_config['callback']['approve'])) { |
|
| 129 | - $skip = true; |
|
| 130 | - } |
|
| 131 | - } else { |
|
| 132 | - $skip = true; |
|
| 133 | - } |
|
| 134 | - } |
|
| 135 | - if (!$skip) { |
|
| 136 | - $comment_config['callback']['approve']($comment); |
|
| 137 | - } |
|
| 138 | - } |
|
| 117 | + // call custom approve function if any |
|
| 118 | + if (false != $call_approvefunc && isset($comment_config['callback']['approve']) |
|
| 119 | + && trim($comment_config['callback']['approve']) != '') { |
|
| 120 | + $skip = false; |
|
| 121 | + if (!function_exists($comment_config['callback']['approve'])) { |
|
| 122 | + if (isset($comment_config['callbackFile'])) { |
|
| 123 | + $callbackfile = trim($comment_config['callbackFile']); |
|
| 124 | + if ($callbackfile != '' |
|
| 125 | + && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 126 | + require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 127 | + } |
|
| 128 | + if (!function_exists($comment_config['callback']['approve'])) { |
|
| 129 | + $skip = true; |
|
| 130 | + } |
|
| 131 | + } else { |
|
| 132 | + $skip = true; |
|
| 133 | + } |
|
| 134 | + } |
|
| 135 | + if (!$skip) { |
|
| 136 | + $comment_config['callback']['approve']($comment); |
|
| 137 | + } |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - // call custom update function if any |
|
| 141 | - if (false != $call_updatefunc && isset($comment_config['callback']['update']) |
|
| 142 | - && trim($comment_config['callback']['update']) != '') { |
|
| 143 | - $skip = false; |
|
| 144 | - if (!function_exists($comment_config['callback']['update'])) { |
|
| 145 | - if (isset($comment_config['callbackFile'])) { |
|
| 146 | - $callbackfile = trim($comment_config['callbackFile']); |
|
| 147 | - if ($callbackfile != '' |
|
| 148 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 149 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 150 | - } |
|
| 151 | - if (!function_exists($comment_config['callback']['update'])) { |
|
| 152 | - $skip = true; |
|
| 153 | - } |
|
| 154 | - } else { |
|
| 155 | - $skip = true; |
|
| 156 | - } |
|
| 157 | - } |
|
| 158 | - if (!$skip) { |
|
| 159 | - $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid)); |
|
| 160 | - $criteria->add(new Criteria('com_itemid', $com_itemid)); |
|
| 161 | - $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); |
|
| 162 | - $comment_count = $commentHandler->getCount($criteria); |
|
| 163 | - $func = $comment_config['callback']['update']; |
|
| 164 | - call_user_func_array($func, array($com_itemid, $comment_count, $comment->getVar('com_id'))); |
|
| 165 | - } |
|
| 166 | - } |
|
| 140 | + // call custom update function if any |
|
| 141 | + if (false != $call_updatefunc && isset($comment_config['callback']['update']) |
|
| 142 | + && trim($comment_config['callback']['update']) != '') { |
|
| 143 | + $skip = false; |
|
| 144 | + if (!function_exists($comment_config['callback']['update'])) { |
|
| 145 | + if (isset($comment_config['callbackFile'])) { |
|
| 146 | + $callbackfile = trim($comment_config['callbackFile']); |
|
| 147 | + if ($callbackfile != '' |
|
| 148 | + && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 149 | + require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 150 | + } |
|
| 151 | + if (!function_exists($comment_config['callback']['update'])) { |
|
| 152 | + $skip = true; |
|
| 153 | + } |
|
| 154 | + } else { |
|
| 155 | + $skip = true; |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | + if (!$skip) { |
|
| 159 | + $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid)); |
|
| 160 | + $criteria->add(new Criteria('com_itemid', $com_itemid)); |
|
| 161 | + $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); |
|
| 162 | + $comment_count = $commentHandler->getCount($criteria); |
|
| 163 | + $func = $comment_config['callback']['update']; |
|
| 164 | + call_user_func_array($func, array($com_itemid, $comment_count, $comment->getVar('com_id'))); |
|
| 165 | + } |
|
| 166 | + } |
|
| 167 | 167 | |
| 168 | - // RMV-NOTIFY |
|
| 169 | - // trigger notification event if necessary |
|
| 170 | - if ($notify_event) { |
|
| 171 | - $not_modid = $com_modid; |
|
| 172 | - // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
| 173 | - $not_catinfo = notificationCommentCategoryInfo($not_modid); |
|
| 174 | - $not_category = $not_catinfo['name']; |
|
| 175 | - $not_itemid = $com_itemid; |
|
| 176 | - $not_event = $notify_event; |
|
| 177 | - // Build an ABSOLUTE URL to view the comment. Make sure we |
|
| 178 | - // point to a viewable page (i.e. not the system administration |
|
| 179 | - // module). |
|
| 180 | - $comment_tags = array(); |
|
| 181 | - $not_module = $xoopsModule; |
|
| 182 | - if (!isset($comment_url)) { |
|
| 183 | - $com_config = $not_module->getInfo('comments'); |
|
| 184 | - $comment_url = $com_config['pageName'] . '?'; |
|
| 185 | - $comment_url .= $com_config['itemName']; |
|
| 186 | - } |
|
| 187 | - $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
| 188 | - $notificationHandler = xoops_getHandler('notification'); |
|
| 189 | - $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
|
| 190 | - } |
|
| 168 | + // RMV-NOTIFY |
|
| 169 | + // trigger notification event if necessary |
|
| 170 | + if ($notify_event) { |
|
| 171 | + $not_modid = $com_modid; |
|
| 172 | + // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
| 173 | + $not_catinfo = notificationCommentCategoryInfo($not_modid); |
|
| 174 | + $not_category = $not_catinfo['name']; |
|
| 175 | + $not_itemid = $com_itemid; |
|
| 176 | + $not_event = $notify_event; |
|
| 177 | + // Build an ABSOLUTE URL to view the comment. Make sure we |
|
| 178 | + // point to a viewable page (i.e. not the system administration |
|
| 179 | + // module). |
|
| 180 | + $comment_tags = array(); |
|
| 181 | + $not_module = $xoopsModule; |
|
| 182 | + if (!isset($comment_url)) { |
|
| 183 | + $com_config = $not_module->getInfo('comments'); |
|
| 184 | + $comment_url = $com_config['pageName'] . '?'; |
|
| 185 | + $comment_url .= $com_config['itemName']; |
|
| 186 | + } |
|
| 187 | + $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
| 188 | + $notificationHandler = xoops_getHandler('notification'); |
|
| 189 | + $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
|
| 190 | + } |
|
| 191 | 191 | |
| 192 | - PlanetUtility::planetRespondToTrackback(0); |
|
| 193 | - } else { |
|
| 194 | - PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
|
| 195 | - } |
|
| 192 | + PlanetUtility::planetRespondToTrackback(0); |
|
| 193 | + } else { |
|
| 194 | + PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
|
| 195 | + } |
|
| 196 | 196 | } |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | include __DIR__ . '/header.php'; |
| 28 | 28 | $com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0; |
| 29 | 29 | if ($com_itemid > 0) { |
| 30 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 31 | - $article_obj = $articleHandler->get($com_itemid); |
|
| 32 | - $com_replytitle = $article_obj->getVar('art_title'); |
|
| 33 | - require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
| 30 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 31 | + $article_obj = $articleHandler->get($com_itemid); |
|
| 32 | + $com_replytitle = $article_obj->getVar('art_title'); |
|
| 33 | + require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
| 34 | 34 | } |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | include __DIR__ . '/header.php'; |
| 18 | 18 | |
| 19 | 19 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
| 20 | - $args['article'] = @$args_num[0]; |
|
| 21 | - $args['op'] = @$args_str[0]; |
|
| 20 | + $args['article'] = @$args_num[0]; |
|
| 21 | + $args['op'] = @$args_str[0]; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | $article_id = Request::getInt('article', Request::getInt('article', @$args['article'], 'POST'), 'GET');//(int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
@@ -27,33 +27,33 @@ discard block |
||
| 27 | 27 | $op = strtolower(trim($op)); |
| 28 | 28 | |
| 29 | 29 | if (empty($article_id)) { |
| 30 | - if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
|
| 31 | - //$_SERVER['HTTP_REFERER'])) |
|
| 30 | + if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
|
| 31 | + //$_SERVER['HTTP_REFERER'])) |
|
| 32 | 32 | |
| 33 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 34 | - xoops_error(_NOPERM); |
|
| 35 | - $xoopsOption['output_type'] = 'plain'; |
|
| 36 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 37 | - exit(); |
|
| 38 | - } else { |
|
| 39 | - $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
|
| 40 | - $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
| 41 | - if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
| 42 | - || ($ref_parser['path'] != $uri_parser['path'])) { |
|
| 43 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 44 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 45 | - xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
|
| 46 | - $xoopsOption['output_type'] = 'plain'; |
|
| 47 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 48 | - exit(); |
|
| 49 | - } else { |
|
| 50 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 51 | - xoops_error(_NOPERM); |
|
| 52 | - $xoopsOption['output_type'] = 'plain'; |
|
| 53 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 54 | - exit(); |
|
| 55 | - } |
|
| 56 | - } |
|
| 33 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
| 34 | + xoops_error(_NOPERM); |
|
| 35 | + $xoopsOption['output_type'] = 'plain'; |
|
| 36 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 37 | + exit(); |
|
| 38 | + } else { |
|
| 39 | + $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
|
| 40 | + $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
| 41 | + if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
| 42 | + || ($ref_parser['path'] != $uri_parser['path'])) { |
|
| 43 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
| 44 | + include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 45 | + xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
|
| 46 | + $xoopsOption['output_type'] = 'plain'; |
|
| 47 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 48 | + exit(); |
|
| 49 | + } else { |
|
| 50 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
| 51 | + xoops_error(_NOPERM); |
|
| 52 | + $xoopsOption['output_type'] = 'plain'; |
|
| 53 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 54 | + exit(); |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
@@ -61,37 +61,37 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // Display option form |
| 63 | 63 | if (empty($op)) { |
| 64 | - $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
| 65 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
| 66 | - exit(); |
|
| 64 | + $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
| 65 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
| 66 | + exit(); |
|
| 67 | 67 | } else { |
| 68 | - $data = array(); |
|
| 69 | - $data['id'] = $article_id; |
|
| 70 | - $data['title'] = $article_obj->getVar('art_title'); |
|
| 71 | - $data['time'] = $article_obj->getTime('l'); |
|
| 72 | - $data['image'] = ''; |
|
| 73 | - $data['source'] = $article_obj->getVar('art_link'); |
|
| 74 | - $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
| 75 | - $data['author'] = $article_obj->getVar('art_author'); |
|
| 68 | + $data = array(); |
|
| 69 | + $data['id'] = $article_id; |
|
| 70 | + $data['title'] = $article_obj->getVar('art_title'); |
|
| 71 | + $data['time'] = $article_obj->getTime('l'); |
|
| 72 | + $data['image'] = ''; |
|
| 73 | + $data['source'] = $article_obj->getVar('art_link'); |
|
| 74 | + $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
| 75 | + $data['author'] = $article_obj->getVar('art_author'); |
|
| 76 | 76 | |
| 77 | - switch ($op) { |
|
| 77 | + switch ($op) { |
|
| 78 | 78 | |
| 79 | - // Use title |
|
| 80 | - case 'bookmark': |
|
| 81 | - break; |
|
| 79 | + // Use title |
|
| 80 | + case 'bookmark': |
|
| 81 | + break; |
|
| 82 | 82 | |
| 83 | - case 'print': |
|
| 84 | - case 'pdf': |
|
| 85 | - ${"{$op}_data"} =& $data; |
|
| 86 | - ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
| 87 | - ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
| 88 | - break; |
|
| 83 | + case 'print': |
|
| 84 | + case 'pdf': |
|
| 85 | + ${"{$op}_data"} =& $data; |
|
| 86 | + ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
| 87 | + ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
| 88 | + break; |
|
| 89 | 89 | |
| 90 | - case 'newbb': |
|
| 91 | - default: |
|
| 92 | - $data['content'] = $article_obj->getSummary(); |
|
| 93 | - break; |
|
| 94 | - } |
|
| 95 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
| 96 | - exit(); |
|
| 90 | + case 'newbb': |
|
| 91 | + default: |
|
| 92 | + $data['content'] = $article_obj->getSummary(); |
|
| 93 | + break; |
|
| 94 | + } |
|
| 95 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
| 96 | + exit(); |
|
| 97 | 97 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(isset($_GET['blog']) ? $_GET['blog'] : (isset($_POST['blog']) ? $_POST['blog'] : 0)); |
| 32 | 32 | |
| 33 | 33 | if (!is_object($xoopsUser) || empty($blog_id)) { |
| 34 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
| 34 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id)); |
| 40 | 40 | $criteria->add(new Criteria('bm_uid', $uid)); |
| 41 | 41 | if ($count = $bookmarkHandler->getCount($criteria)) { |
| 42 | - $message = planet_constant('MD_ALREADYBOOKMARKED'); |
|
| 43 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
| 42 | + $message = planet_constant('MD_ALREADYBOOKMARKED'); |
|
| 43 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
| 44 | 44 | } |
| 45 | 45 | $bookmark_obj = $bookmarkHandler->create(); |
| 46 | 46 | $bookmark_obj->setVar('blog_id', $blog_id); |
| 47 | 47 | $bookmark_obj->setVar('bm_uid', $uid); |
| 48 | 48 | if (!$bookmark_id = $bookmarkHandler->insert($bookmark_obj, true)) { |
| 49 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
| 49 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
| 50 | 50 | } |
| 51 | 51 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
| 52 | 52 | $blog_obj = $blogHandler->get($blog_id); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $configHandler = xoops_getHandler('config'); |
| 33 | 33 | $xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH); |
| 34 | 34 | if (empty($xoopsConfigSearch['enable_search'])) { |
| 35 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS')); |
|
| 35 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS')); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; |
@@ -50,90 +50,90 @@ discard block |
||
| 50 | 50 | $blog = Request::getInt('blog', Request::getInt('blog', 0, 'GET'), 'POST');//(int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null)); |
| 51 | 51 | $uid = Request::getInt('uid', Request::getInt('uid', 0, 'GET'), 'POST');//(int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null)); |
| 52 | 52 | $searchin = Request::getArray('searchin', 0 !== count(Request::getArray('searchin', array(), 'GET')) ? explode('|', Request::getArray('searchin', array(), 'GET')) : array(), |
| 53 | - 'POST'); //isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|', $_GET['searchin']) : array()); |
|
| 53 | + 'POST'); //isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|', $_GET['searchin']) : array()); |
|
| 54 | 54 | $sortby = Request::getString('sortby', Request::getString('sortby', null, 'GET'), 'POST');//isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null); |
| 55 | 55 | $term = Request::getString('term', Request::getString('term', '', 'GET'), 'POST');//isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : ''); |
| 56 | 56 | |
| 57 | 57 | $andor = in_array(strtoupper($andor), array('OR', 'AND', 'EXACT')) ? strtoupper($andor) : 'OR'; |
| 58 | 58 | $sortby = in_array(strtolower($sortby), array( |
| 59 | - 'a.art_id desc', |
|
| 60 | - 'a.art_time desc', |
|
| 61 | - 'a.art_title', |
|
| 62 | - 'a.blog_id', |
|
| 63 | - 'b.blog_id', |
|
| 64 | - 'b.blog_feed', |
|
| 65 | - 'b.blog_title', |
|
| 66 | - 'b.blog_time' |
|
| 59 | + 'a.art_id desc', |
|
| 60 | + 'a.art_time desc', |
|
| 61 | + 'a.art_title', |
|
| 62 | + 'a.blog_id', |
|
| 63 | + 'b.blog_id', |
|
| 64 | + 'b.blog_feed', |
|
| 65 | + 'b.blog_title', |
|
| 66 | + 'b.blog_time' |
|
| 67 | 67 | )) ? strtolower($sortby) : ''; |
| 68 | 68 | |
| 69 | 69 | if (!(empty(Request::getString('submit', '', 'POST')) && empty(Request::getString('term', '', 'GET')))) { |
| 70 | - $next_search['category'] = $category; |
|
| 71 | - $next_search['blog'] = $blog; |
|
| 72 | - $next_search['uid'] = $uid; |
|
| 73 | - $next_search['andor'] = $andor; |
|
| 70 | + $next_search['category'] = $category; |
|
| 71 | + $next_search['blog'] = $blog; |
|
| 72 | + $next_search['uid'] = $uid; |
|
| 73 | + $next_search['andor'] = $andor; |
|
| 74 | 74 | |
| 75 | - $next_search['term'] = $term; |
|
| 76 | - $query = trim($term); |
|
| 75 | + $next_search['term'] = $term; |
|
| 76 | + $query = trim($term); |
|
| 77 | 77 | |
| 78 | - if ($andor !== 'EXACT') { |
|
| 79 | - $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length |
|
| 80 | - $temp_queries = preg_split("/[\s,]+/", $query); |
|
| 81 | - foreach ($temp_queries as $q) { |
|
| 82 | - $q = trim($q); |
|
| 83 | - if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
| 84 | - $queries[] = $myts->addSlashes($q); |
|
| 85 | - } else { |
|
| 86 | - $ignored_queries[] = $myts->addSlashes($q); |
|
| 87 | - } |
|
| 88 | - } |
|
| 89 | - if (count($queries) == 0) { |
|
| 90 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
| 91 | - } |
|
| 92 | - } else { |
|
| 93 | - if (strlen($query) < $xoopsConfigSearch['keyword_min']) { |
|
| 94 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
| 95 | - } |
|
| 96 | - $queries = array($myts->addSlashes($query)); |
|
| 97 | - } |
|
| 78 | + if ($andor !== 'EXACT') { |
|
| 79 | + $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length |
|
| 80 | + $temp_queries = preg_split("/[\s,]+/", $query); |
|
| 81 | + foreach ($temp_queries as $q) { |
|
| 82 | + $q = trim($q); |
|
| 83 | + if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
| 84 | + $queries[] = $myts->addSlashes($q); |
|
| 85 | + } else { |
|
| 86 | + $ignored_queries[] = $myts->addSlashes($q); |
|
| 87 | + } |
|
| 88 | + } |
|
| 89 | + if (count($queries) == 0) { |
|
| 90 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
| 91 | + } |
|
| 92 | + } else { |
|
| 93 | + if (strlen($query) < $xoopsConfigSearch['keyword_min']) { |
|
| 94 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
| 95 | + } |
|
| 96 | + $queries = array($myts->addSlashes($query)); |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - $next_search['sortby'] = $sortby; |
|
| 100 | - $next_search['searchin'] = implode('|', $searchin); |
|
| 99 | + $next_search['sortby'] = $sortby; |
|
| 100 | + $next_search['searchin'] = implode('|', $searchin); |
|
| 101 | 101 | |
| 102 | - /* To be added: year-month |
|
| 102 | + /* To be added: year-month |
|
| 103 | 103 | * see view.archive.php |
| 104 | 104 | */ |
| 105 | - if (!empty($time)) { |
|
| 106 | - $extra = ''; |
|
| 107 | - } else { |
|
| 108 | - $extra = ''; |
|
| 109 | - } |
|
| 105 | + if (!empty($time)) { |
|
| 106 | + $extra = ''; |
|
| 107 | + } else { |
|
| 108 | + $extra = ''; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - $results = planet_search($queries, $andor, $limit, $start, $uid, $category, $blog, $sortby, $searchin, $extra); |
|
| 111 | + $results = planet_search($queries, $andor, $limit, $start, $uid, $category, $blog, $sortby, $searchin, $extra); |
|
| 112 | 112 | |
| 113 | - /* |
|
| 113 | + /* |
|
| 114 | 114 | if ( count($results) < 1 ) { |
| 115 | 115 | redirect_header("javascript:history.go(-1);", 2, _SR_NOMATCH); |
| 116 | 116 | } else |
| 117 | 117 | */ |
| 118 | - { |
|
| 119 | - $xoopsTpl->assign('results', $results); |
|
| 118 | + { |
|
| 119 | + $xoopsTpl->assign('results', $results); |
|
| 120 | 120 | |
| 121 | - if (count($next_search) > 0) { |
|
| 122 | - $items = array(); |
|
| 123 | - foreach ($next_search as $para => $val) { |
|
| 124 | - if (!empty($val)) { |
|
| 125 | - $items[] = "$para=$val"; |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | - if (count($items) > 0) { |
|
| 129 | - $paras = implode('&', $items); |
|
| 130 | - } |
|
| 131 | - unset($next_search); |
|
| 132 | - unset($items); |
|
| 133 | - } |
|
| 134 | - $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras; |
|
| 121 | + if (count($next_search) > 0) { |
|
| 122 | + $items = array(); |
|
| 123 | + foreach ($next_search as $para => $val) { |
|
| 124 | + if (!empty($val)) { |
|
| 125 | + $items[] = "$para=$val"; |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + if (count($items) > 0) { |
|
| 129 | + $paras = implode('&', $items); |
|
| 130 | + } |
|
| 131 | + unset($next_search); |
|
| 132 | + unset($items); |
|
| 133 | + } |
|
| 134 | + $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras; |
|
| 135 | 135 | |
| 136 | - /* |
|
| 136 | + /* |
|
| 137 | 137 | $next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra); |
| 138 | 138 | $next_count = count($next_results); |
| 139 | 139 | $has_next = false; |
@@ -142,41 +142,41 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | if (false != $has_next) |
| 144 | 144 | */ |
| 145 | - if (count($results)) { |
|
| 146 | - $next = $start + $limit; |
|
| 147 | - $queries = implode(',', $queries); |
|
| 148 | - $search_url_next = $search_url . "&start=$next"; |
|
| 149 | - $search_next = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>'; |
|
| 150 | - $xoopsTpl->assign('search_next', $search_next); |
|
| 151 | - } |
|
| 152 | - if ($start > 0) { |
|
| 153 | - $prev = $start - $limit; |
|
| 154 | - $search_url_prev = $search_url . "&start=$prev"; |
|
| 155 | - $search_prev = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>'; |
|
| 156 | - $xoopsTpl->assign('search_prev', $search_prev); |
|
| 157 | - } |
|
| 158 | - } |
|
| 145 | + if (count($results)) { |
|
| 146 | + $next = $start + $limit; |
|
| 147 | + $queries = implode(',', $queries); |
|
| 148 | + $search_url_next = $search_url . "&start=$next"; |
|
| 149 | + $search_next = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>'; |
|
| 150 | + $xoopsTpl->assign('search_next', $search_next); |
|
| 151 | + } |
|
| 152 | + if ($start > 0) { |
|
| 153 | + $prev = $start - $limit; |
|
| 154 | + $search_url_prev = $search_url . "&start=$prev"; |
|
| 155 | + $search_prev = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>'; |
|
| 156 | + $xoopsTpl->assign('search_prev', $search_prev); |
|
| 157 | + } |
|
| 158 | + } |
|
| 159 | 159 | |
| 160 | - unset($results); |
|
| 161 | - $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term); |
|
| 162 | - $xoopsTpl->assign('search_info', $search_info); |
|
| 160 | + unset($results); |
|
| 161 | + $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term); |
|
| 162 | + $xoopsTpl->assign('search_info', $search_info); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /* type */ |
| 166 | 166 | $type_select = "<select name=\"andor\">"; |
| 167 | 167 | $type_select .= "<option value=\"OR\""; |
| 168 | 168 | if ('OR' === $andor) { |
| 169 | - $type_select .= " selected=\"selected\""; |
|
| 169 | + $type_select .= " selected=\"selected\""; |
|
| 170 | 170 | } |
| 171 | 171 | $type_select .= '>' . _SR_ANY . '</option>'; |
| 172 | 172 | $type_select .= "<option value=\"AND\""; |
| 173 | 173 | if ('AND' === $andor) { |
| 174 | - $type_select .= " selected=\"selected\""; |
|
| 174 | + $type_select .= " selected=\"selected\""; |
|
| 175 | 175 | } |
| 176 | 176 | $type_select .= '>' . _SR_ALL . '</option>'; |
| 177 | 177 | $type_select .= "<option value=\"EXACT\""; |
| 178 | 178 | if ('exact' === $andor) { |
| 179 | - $type_select .= " selected=\"selected\""; |
|
| 179 | + $type_select .= " selected=\"selected\""; |
|
| 180 | 180 | } |
| 181 | 181 | $type_select .= '>' . _SR_EXACT . '</option>'; |
| 182 | 182 | $type_select .= '</select>'; |
@@ -185,32 +185,32 @@ discard block |
||
| 185 | 185 | $searchin_select = ''; |
| 186 | 186 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"title\""; |
| 187 | 187 | if (in_array('title', $searchin)) { |
| 188 | - $searchin_select .= ' checked'; |
|
| 188 | + $searchin_select .= ' checked'; |
|
| 189 | 189 | } |
| 190 | 190 | $searchin_select .= '>' . planet_constant('MD_TITLE') . ' '; |
| 191 | 191 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\""; |
| 192 | 192 | if (in_array('text', $searchin)) { |
| 193 | - $searchin_select .= ' checked'; |
|
| 193 | + $searchin_select .= ' checked'; |
|
| 194 | 194 | } |
| 195 | 195 | $searchin_select .= '>' . planet_constant('MD_BODY') . ' || '; |
| 196 | 196 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\""; |
| 197 | 197 | if (in_array('blog', $searchin)) { |
| 198 | - $searchin_select .= ' checked'; |
|
| 198 | + $searchin_select .= ' checked'; |
|
| 199 | 199 | } |
| 200 | 200 | $searchin_select .= '>' . planet_constant('MD_BLOG') . ' '; |
| 201 | 201 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\""; |
| 202 | 202 | if (in_array('feed', $searchin)) { |
| 203 | - $searchin_select .= ' checked'; |
|
| 203 | + $searchin_select .= ' checked'; |
|
| 204 | 204 | } |
| 205 | 205 | $searchin_select .= '>' . planet_constant('MD_FEED') . ' '; |
| 206 | 206 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\""; |
| 207 | 207 | if (in_array('desc', $searchin)) { |
| 208 | - $searchin_select .= ' checked'; |
|
| 208 | + $searchin_select .= ' checked'; |
|
| 209 | 209 | } |
| 210 | 210 | $searchin_select .= '>' . planet_constant('MD_DESC') . ' '; |
| 211 | 211 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\""; |
| 212 | 212 | if (empty($searchin)) { |
| 213 | - $searchin_select .= ' checked'; |
|
| 213 | + $searchin_select .= ' checked'; |
|
| 214 | 214 | } |
| 215 | 215 | $searchin_select .= '>' . _ALL . ' '; |
| 216 | 216 | |
@@ -218,28 +218,28 @@ discard block |
||
| 218 | 218 | $sortby_select = "<select name=\"sortby\">"; |
| 219 | 219 | $sortby_select .= "<option value=\"\""; |
| 220 | 220 | if (empty($sortby)) { |
| 221 | - $sortby_select .= " selected=\"selected\""; |
|
| 221 | + $sortby_select .= " selected=\"selected\""; |
|
| 222 | 222 | } |
| 223 | 223 | $sortby_select .= '>' . _NONE . '</option>'; |
| 224 | 224 | $sortby_select .= "<option value=\"a.art_time\""; |
| 225 | 225 | if ('a.art_time' === $sortby) { |
| 226 | - $sortby_select .= " selected=\"selected\""; |
|
| 226 | + $sortby_select .= " selected=\"selected\""; |
|
| 227 | 227 | } |
| 228 | 228 | $sortby_select .= '>' . planet_constant('MD_TIME') . '</option>'; |
| 229 | 229 | $sortby_select .= "<option value=\"a.art_title\""; |
| 230 | 230 | if ('a.art_title' === $sortby) { |
| 231 | - $sortby_select .= " selected=\"selected\""; |
|
| 231 | + $sortby_select .= " selected=\"selected\""; |
|
| 232 | 232 | } |
| 233 | 233 | $sortby_select .= '>' . planet_constant('MD_TITLE') . '</option>'; |
| 234 | 234 | $sortby_select .= "<option value=\"\"> ---- </option>"; |
| 235 | 235 | $sortby_select .= "<option value=\"a.blog_title\""; |
| 236 | 236 | if ('a.blog_title' === $sortby) { |
| 237 | - $sortby_select .= " selected=\"selected\""; |
|
| 237 | + $sortby_select .= " selected=\"selected\""; |
|
| 238 | 238 | } |
| 239 | 239 | $sortby_select .= '>' . planet_constant('MD_BLOG') . '</option>'; |
| 240 | 240 | $sortby_select .= "<option value=\"a.blog_time\""; |
| 241 | 241 | if ('b.blog_time' === $sortby) { |
| 242 | - $sortby_select .= " selected=\"selected\""; |
|
| 242 | + $sortby_select .= " selected=\"selected\""; |
|
| 243 | 243 | } |
| 244 | 244 | $sortby_select .= '>' . planet_constant('MD_UPDATE') . '</option>'; |
| 245 | 245 | $sortby_select .= '</select>'; |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $xoopsTpl->assign('uid', $uid); |
| 257 | 257 | |
| 258 | 258 | if ($xoopsConfigSearch['keyword_min'] > 0) { |
| 259 | - $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
|
| 259 | + $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | include XOOPS_ROOT_PATH . '/footer.php'; |
@@ -32,51 +32,51 @@ |
||
| 32 | 32 | include __DIR__ . '/header.php'; |
| 33 | 33 | global $pdf_data; |
| 34 | 34 | if (!empty($_POST['pdf_data'])) { |
| 35 | - $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
| 35 | + $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
| 36 | 36 | } elseif (!empty($pdf_data)) { |
| 37 | 37 | } else { |
| 38 | - error_reporting(0); |
|
| 39 | - include __DIR__ . '/header.php'; |
|
| 40 | - error_reporting(0); |
|
| 38 | + error_reporting(0); |
|
| 39 | + include __DIR__ . '/header.php'; |
|
| 40 | + error_reporting(0); |
|
| 41 | 41 | |
| 42 | - if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 43 | - $args['article'] = @$args_num[0]; |
|
| 44 | - } |
|
| 42 | + if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 43 | + $args['article'] = @$args_num[0]; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 46 | + $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 47 | 47 | |
| 48 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 49 | - $article_obj = $articleHandler->get($article_id); |
|
| 48 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 49 | + $article_obj = $articleHandler->get($article_id); |
|
| 50 | 50 | |
| 51 | - $article_data = array(); |
|
| 51 | + $article_data = array(); |
|
| 52 | 52 | |
| 53 | - // title |
|
| 54 | - $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 53 | + // title |
|
| 54 | + $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 55 | 55 | |
| 56 | - $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 56 | + $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 57 | 57 | |
| 58 | - // source |
|
| 59 | - $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 58 | + // source |
|
| 59 | + $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 60 | 60 | |
| 61 | - // publish time |
|
| 62 | - $article_data['time'] = $article_obj->getTime(); |
|
| 61 | + // publish time |
|
| 62 | + $article_data['time'] = $article_obj->getTime(); |
|
| 63 | 63 | |
| 64 | - // summary |
|
| 65 | - $article_data['summary'] = $article_obj->getSummary(); |
|
| 64 | + // summary |
|
| 65 | + $article_data['summary'] = $article_obj->getSummary(); |
|
| 66 | 66 | |
| 67 | - // text of page |
|
| 68 | - $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 67 | + // text of page |
|
| 68 | + $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 69 | 69 | |
| 70 | - // Build the pdf_data array |
|
| 71 | - $pdf_data['title'] = $article_data['title']; |
|
| 72 | - $pdf_data['author'] = $article_data['author']; |
|
| 73 | - $pdf_data['date'] = $article_data['time']; |
|
| 74 | - $pdf_data['content'] = ''; |
|
| 75 | - if ($article_data['summary']) { |
|
| 76 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 77 | - } |
|
| 78 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 70 | + // Build the pdf_data array |
|
| 71 | + $pdf_data['title'] = $article_data['title']; |
|
| 72 | + $pdf_data['author'] = $article_data['author']; |
|
| 73 | + $pdf_data['date'] = $article_data['time']; |
|
| 74 | + $pdf_data['content'] = ''; |
|
| 75 | + if ($article_data['summary']) { |
|
| 76 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 77 | + } |
|
| 78 | + $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | + $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 80 | 80 | } |
| 81 | 81 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
| 82 | 82 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
| 32 | 32 | } else { |
| 33 | - $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
| 33 | + $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
| 34 | 34 | } |
| 35 | 35 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 36 | 36 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | $myts = MyTextSanitizer::getInstance(); |
| 47 | 47 | |
| 48 | 48 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
| 49 | - require_once $GLOBALS['xoops']->path('class/template.php'); |
|
| 50 | - $xoopsTpl = new XoopsTpl(); |
|
| 49 | + require_once $GLOBALS['xoops']->path('class/template.php'); |
|
| 50 | + $xoopsTpl = new XoopsTpl(); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
@@ -41,18 +41,18 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
| 43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
| 44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
| 45 | - if (!empty($_GET['purge'])) { |
|
| 46 | - $crit = new CriteriaCompo($criteria); |
|
| 47 | - $crit->add(new Criteria('art_comments', 0)); |
|
| 48 | - $article_expires = $articleHandler->getObjects($criteria); |
|
| 49 | - foreach ($article_expires as $id => $article_obj) { |
|
| 50 | - $articleHandler->delete($article_obj); |
|
| 51 | - } |
|
| 52 | - } |
|
| 53 | - $article_count_expire = $articleHandler->getCount($criteria); |
|
| 44 | + $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
| 45 | + if (!empty($_GET['purge'])) { |
|
| 46 | + $crit = new CriteriaCompo($criteria); |
|
| 47 | + $crit->add(new Criteria('art_comments', 0)); |
|
| 48 | + $article_expires = $articleHandler->getObjects($criteria); |
|
| 49 | + foreach ($article_expires as $id => $article_obj) { |
|
| 50 | + $articleHandler->delete($article_obj); |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | + $article_count_expire = $articleHandler->getCount($criteria); |
|
| 54 | 54 | } else { |
| 55 | - $article_count_expire = 0; |
|
| 55 | + $article_count_expire = 0; |
|
| 56 | 56 | } |
| 57 | 57 | $article_count = $articleHandler->getCount(); |
| 58 | 58 | |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | echo "<br clear=\"all\">" . planet_constant('AM_COUNT') . ': ' . $article_count; |
| 62 | 62 | echo "<br clear=\"all\">"; |
| 63 | 63 | if ($article_count_expire > 0) { |
| 64 | - echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
| 65 | - echo "<br clear=\"all\">"; |
|
| 64 | + echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
| 65 | + echo "<br clear=\"all\">"; |
|
| 66 | 66 | } |
| 67 | 67 | echo '</div>'; |
| 68 | 68 | echo "</fieldset><br clear=\"all\">"; |