示例#1
0
// canned.php
//
// catchall page for assorted canned queries
//
// TODO: wrap up "scrapers" and "verysimilararticles" into classes
// sigh... stupid php include-path trainwreck...
chdir(dirname(dirname(__FILE__)));
require_once '../conf/general';
require_once '../phplib/misc.php';
require_once '../../phplib/db.php';
require_once '../../phplib/utility.php';
require_once '../phplib/adm.php';
require_once '../phplib/journo.php';
// for journo_link()
require_once '../phplib/xap.php';
admEnforceAccess();
$canned = array(new KnownEmailAddresses(), new OrgList(), new ArticleCount(), new AlertUsers(), new ProlificJournos(), new MostIndepthJournos(), new TopTags(), new OldQueryFight(), new QueryFight(), new WhosWritingAbout(), new NewsletterSubscribers(), new EventLog(), new RegisteredJournos(), new Pingbacks(), new FakeJournos(), new MightBeStudents(), new UserCreatedJournoProfiles(), new RecentlyEditedJournos(), new WeeklyStats(), new PublicationBreakdown());
function view_menu()
{
    global $canned;
    admPageHeader("Canned Queries");
    ?>
<h2>Assorted Canned Queries</h2>
<dl>
<dt><a href="/adm/canned?action=scrapers">Scrapers (very slow)</a></dt>
<dd>summary of number of articles scraped by each scraper over the last week</dd>
<dt><a href="/adm/canned?action=verysimilararticles">VerySimilarArticles</a></dt>
<dd>groups of very-similar articles</dd>
<?php 
    foreach ($canned as $c) {
        ?>
示例#2
0
function admPageHeader($title = '', $extra_head_fn = null)
{
    admEnforceAccess();
    header('Content-Type: text/html; charset=utf-8');
    ?>
<!DOCTYPE html>
<html>
<head>
<title>JL admin<?php 
    if ($title) {
        print " - {$title}";
    }
    ?>
</title>
<style type="text/css" media="all">@import "/adm/admin-style.css";</style>
<style type="text/css" media="all">@import "/js/jquery.autocomplete.css";</style>

<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.stylish-select.min.js"></script>
<script type="text/javascript" src="/js/jl-util.js"></script>

<script type="text/javascript" src="/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" src="/js/tooltip.js"></script>

<script type="text/JavaScript">


$(document).ready(function() {
    $(".journo-lookup").autocomplete("ajax-ref-lookup.php");
/*
    $(".journo-info").toptip({
        'fetch': function(trigger,tip) {
            var txt = trigger.attr('href') || trigger.html();
            var m = txt.match(/[a-zA-Z]+[-][-a-zA-Z0-9]+/g)
            if(m && m[0]) {
                ref = m[0];
                tip.html('<img src="/img/indicator.gif" />Loading...');
                tip.load('/adm/ajax-journo-info?j=' + ref);
            }
        }
        });
*/
    });
</script>

<?php 
    if (!is_null($extra_head_fn)) {
        call_user_func($extra_head_fn);
    }
    ?>
</head>
<body>
<h1>Journalisted admin</h1>
<a href="/">Home</a>
<a href="/adm/articles">Articles</a>
 (<small>
 <a href="/adm/submitted_articles">Submitted Articles</a>
 <a href="/adm/scrape">Scrape</a> |
 </small>) |
<a href="/adm/journo">Journos</a>
 (<small>
 <a href="/adm/journo-bios">Bios</a> |
 <a href="/adm/journo-email">Email</a> |
 <a href="/adm/journo-split">Split</a> |
 <a href="/adm/journo_merge">Merge</a> |
 <a href="/adm/journo-create">Create</a>
 </small>) |
<a href="/adm/canned">Canned Queries</a> |
<a href="/adm/news">News</a> |
<a href="/adm/useraccounts">User Accounts</a>
 (<small>
 <a href="/adm/claims">Claims</a>
 </small>) |
<a href="/adm/publication">Publications</a>
<hr>
<?php 
}