Ejemplo n.º 1
0
 function parse($args, $page)
 {
     global $pagestore, $LkTbl;
     $text = '';
     $first = 1;
     $q1 = $pagestore->dbh->query("SELECT page, SUM(count) AS ct FROM {$LkTbl} " . "GROUP BY page ORDER BY ct DESC, page");
     while ($result = $pagestore->dbh->result($q1)) {
         if (!$first) {
             $text = $text . "\n";
         } else {
             $first = 0;
         }
         $text = $text . '(' . $result[1] . ') ' . html_ref($result[0], $result[0]);
     }
     return html_code($text);
 }
Ejemplo n.º 2
0
 function parse($args, $page)
 {
     global $pagestore;
     $first = 1;
     $list = $pagestore->allpages();
     usort($list, 'sizeSort');
     $text = '';
     foreach ($list as $page) {
         if (!$first) {
             $text = $text . "\n";
         } else {
             $first = 0;
         }
         $text = $text . $page[4] . ' ' . html_ref($page[1], $page[1]);
     }
     return html_code($text);
 }
Ejemplo n.º 3
0
 function parse($args, $page)
 {
     global $pagestore, $LkTbl;
     $lastpage = '';
     $text = '';
     $q1 = $pagestore->dbh->query("SELECT page, link FROM {$LkTbl} ORDER BY page");
     while ($result = $pagestore->dbh->result($q1)) {
         if ($lastpage != $result[0]) {
             if ($lastpage != '') {
                 $text = $text . "\n";
             }
             $text = $text . html_ref($result[0], $result[0]) . ' |';
             $lastpage = $result[0];
         }
         $text = $text . ' ' . html_ref($result[1], $result[1]);
     }
     return html_code($text);
 }
Ejemplo n.º 4
0
 function parse($args, $page)
 {
     global $pagestore, $LkTbl, $PgTbl;
     $text = '';
     $first = 1;
     $q1 = $pagestore->dbh->query("SELECT link, SUM(count) AS ct FROM {$LkTbl} " . "GROUP BY link ORDER BY ct DESC, link");
     while ($result = $pagestore->dbh->result($q1)) {
         $q2 = $pagestore->dbh->query("SELECT lastversion FROM {$PgTbl} " . "WHERE title='{$result['0']}'");
         if (!($r2 = $pagestore->dbh->result($q2)) || empty($r2[0])) {
             if (!$first) {
                 $text = $text . "\n";
             } else {
                 $first = 0;
             }
             $text = $text . '(' . html_url(findURL($result[0]), $result[1]) . ') ' . html_ref($result[0], $result[0]);
         }
     }
     return html_code($text);
 }
Ejemplo n.º 5
0
 function parse($args, $page)
 {
     global $pagestore, $LkTbl;
     $text = '';
     $first = 1;
     $pages = $pagestore->allpages();
     usort($pages, 'nameSort');
     foreach ($pages as $page) {
         $q2 = $pagestore->dbh->query("SELECT page FROM {$LkTbl} " . "WHERE link='{$page['1']}' AND page!='{$page['1']}'");
         if (!($r2 = $pagestore->dbh->result($q2)) || empty($r2[0])) {
             if (!$first) {
                 $text = $text . "\n";
             } else {
                 $first = 0;
             }
             $text = $text . html_ref($page[1], $page[1]);
         }
     }
     return html_code($text);
 }
Ejemplo n.º 6
0
function view_macro_refs()
{
    global $pagestore, $LkTbl, $PgTbl;
    $text = '';
    $first = 1;
    // It's not quite as straightforward as one would imagine to turn the
    // following code into a JOIN, since we want to avoid multiplying the
    // number of links to a page by the number of versions of that page that
    // exist.  If anyone has some efficient suggestions, I'd be welcome to
    // entertain them.  -- ScottMoonen
    $q1 = $pagestore->dbh->query("SELECT link, SUM(count) AS ct FROM {$LkTbl} " . "GROUP BY link ORDER BY ct DESC, link");
    while ($result = $pagestore->dbh->result($q1)) {
        $esc_page = addslashes($result[0]);
        $q2 = $pagestore->dbh->query("SELECT MAX(version) FROM {$PgTbl} " . "WHERE title='{$esc_page}'");
        if (($r2 = $pagestore->dbh->result($q2)) && !empty($r2[0])) {
            if (!$first) {
                $text = $text . "\n";
            } else {
                $first = 0;
            }
            $text = $text . '(' . html_url(findURL($result[0]), $result[1]) . ') ' . html_ref($result[0], $result[0]);
        }
    }
    return html_code($text);
}
Ejemplo n.º 7
0
 public function code()
 {
     return html_code($this->get_attribute(0, $this->get_content()));
 }