Example #1
0
            $datetime = DateTime::createFromFormat('YmdHis', $l1['rev_timestamp']);
            $dateform = $datetime->format('Y-m-d H:i');
            $dateraw = $datetime->format('Ymd');
            if (isset($par['since']) && $par['since'] != '0000-00-00') {
                $timestamp = str_replace('-', '', $par['since']);
                if ($dateraw < $timestamp) {
                    continue;
                }
            }
            if (isset($par['until']) && $par['until'] != '0000-00-00') {
                $timestamp = str_replace('-', '', $par['until']);
                if ($dateraw > $timestamp) {
                    continue;
                }
            }
            $page->addHTML('* [[Special:PermaLink/' . $l1['rev_id'] . '|' . $dateform . ']]');
            $page->addHTML(' . . [[User:'******'rev_user_text'] . '|' . $l1['rev_user_text'] . ']]');
            if (isset($l1['rev_comment']) && $l1['rev_comment'] != '') {
                $comment = $l1['rev_comment'];
                $comment = str_replace('[[', '[[:', $comment);
                $comment = preg_replace('/\\{\\{(.+)\\}\\}/', '&lt;nowiki&gt;{{$1}}}&lt;/nowiki&gt;', $comment);
                $comment = preg_replace('/\\/\\*\\s(.+)\\s\\*\\//', '[[Special:PermaLink/' . $l1['rev_id'] . '#$1|→‎]]$1:', $comment);
                $page->addHTML(' \'\'(' . $comment . ')\'\' ');
            }
            $page->addHTML('<br />');
        }
        $page->closeBlock();
    }
    $q1->close();
    $page->closeBlock();
}
Example #2
0
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
require_once '/data/project/hgztools/public_html/general.php';
// create new page object
$page = new HtmlPage('Useless protections');
// create new database object
$db = new Database();
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);
$rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$page->openBlock('p');
$page->addHTML('This tool shows pages that meet the following criteria:');
$page->openBlock('ol');
$page->addInline('li', 'The page is protected from moves through non-autoconfirmed users');
$page->addInline('li', 'The page is not protected from editing through non-autoconfirmed users or sysops');
$page->closeBlock();
$page->addHTML('In most wikis, the autoconfirmed right is required for moving pages, so a single move protection for non-autoconfirmed users will never be effective.');
$page->closeBlock();
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');