| punbb-1.2.21/upload/admin_index.php |
punbb-1.2.22/upload/admin_index.php |
| 50: if ($latest_version == '') | 50: if ($latest_version == '') |
| 51: message('Check for upgrade failed for unknown reasons.'); | 51: message('Check for upgrade failed for unknown reasons.'); |
| 52: | 52: |
| 53: $cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version'])); | 53: $latest_version = preg_replace('/(\.0)+(?!\.)|(\.0+$)/', '$2', $latest_version); |
| 54: $cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version); | 54: $cur_version = preg_replace('/(\.0)+(?!\.)|(\.0+$)/', '$2', $cur_version); |
| 55: | 55: |
| 56: $latest_version = str_replace('.', '', strtolower($latest_version)); | 56: if (version_compare($cur_version, $latest_version, '>=')) |
| 57: $latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version); | |
| 58: | |
| 59: if ($cur_version >= $latest_version) | |
| 60: message('You are running the latest version of PunBB.'); | 57: message('You are running the latest version of PunBB.'); |
| 61: else | 58: else |
| 62: message('A new version of PunBB has been released. You can download the latest version at <a href="http://punbb.informer.com/">PunBB.Informer.Com</a>.'); | 59: message('A new version of PunBB has been released. You can download the latest version at <a href="http://punbb.informer.com/">PunBB.Informer.Com</a>.'); |
| punbb-1.2.21/upload/admin_prune.php |
punbb-1.2.22/upload/admin_prune.php |
| 42: confirm_referrer('admin_prune.php'); | 42: confirm_referrer('admin_prune.php'); |
| 43: | 43: |
| 44: $prune_from = $_POST['prune_from']; | 44: $prune_from = $_POST['prune_from']; |
| | 45: $prune_sticky = isset($_POST['prune_sticky']) ? '1' : '0'; |
| 45: $prune_days = intval($_POST['prune_days']); | 46: $prune_days = intval($_POST['prune_days']); |
| 46: $prune_date = ($prune_days) ? time() - ($prune_days*86400) : -1; | 47: $prune_date = ($prune_days) ? time() - ($prune_days*86400) : -1; |
| 47: | 48: |
| 56: { | 57: { |
| 57: $fid = $db->result($result, $i); | 58: $fid = $db->result($result, $i); |
| 58: | 59: |
| 59: prune($fid, $_POST['prune_sticky'], $prune_date); | 60: prune($fid, $prune_sticky, $prune_date); |
| 60: update_forum($fid); | 61: update_forum($fid); |
| 61: } | 62: } |
| 62: } | 63: } |
| 63: else | 64: else |
| 64: { | 65: { |
| 65: $prune_from = intval($prune_from); | 66: $prune_from = intval($prune_from); |
| 66: prune($prune_from, $_POST['prune_sticky'], $prune_date); | 67: prune($prune_from, $prune_sticky, $prune_date); |
| 67: update_forum($prune_from); | 68: update_forum($prune_from); |
| 68: } | 69: } |
| 69: | 70: |
| 93: // Concatenate together the query for counting number or topics to prune | 94: // Concatenate together the query for counting number or topics to prune |
| 94: $sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL'; | 95: $sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL'; |
| 95: | 96: |
| 96: if ($_POST['prune_sticky'] == '0') | 97: if (!$prune_sticky) |
| 97: $sql .= ' AND sticky=\'0\''; | 98: $sql .= ' AND sticky=\'0\''; |
| 98: | 99: |
| 99: if ($prune_from != 'all') | 100: if ($prune_from != 'all') |
| 127: <form method="post" action="admin_prune.php?action=foo"> | 128: <form method="post" action="admin_prune.php?action=foo"> |
| 128: <div class="inform"> | 129: <div class="inform"> |
| 129: <input type="hidden" name="prune_days" value="<?php echo $prune_days ?>" /> | 130: <input type="hidden" name="prune_days" value="<?php echo $prune_days ?>" /> |
| 130: <input type="hidden" name="prune_sticky" value="<?php echo $_POST['prune_sticky'] ?>" /> | 131: <input type="hidden" name="prune_sticky" value="<?php echo $prune_sticky ?>" /> |
| 131: <input type="hidden" name="prune_from" value="<?php echo $prune_from ?>" /> | 132: <input type="hidden" name="prune_from" value="<?php echo $prune_from ?>" /> |
| 132: <fieldset> | 133: <fieldset> |
| 133: <legend>Confirm prune posts</legend> | 134: <legend>Confirm prune posts</legend> |