<?php
    # ownedpages.php  {{OwnedPages}}
    # author: Chris Tessmer
    # date: 19 Dec 2002
    # license: [[GPL]]

    $str = 'SELECT COUNT(*) FROM '.$this->config["table_prefix"].'pages WHERE `owner` ';
    $str .= "= '" . $this->GetUserName() . "' AND `latest` = 'Y'";
    $countQuery = $this->Query( $str );
    
    # get the total # of pages
    $str = 'SELECT COUNT(*) FROM '.$this->config["table_prefix"].'pages WHERE `latest` = \'Y\' ';
    $totalQuery = $this->Query( $str );    
    
    $count  = mysql_result($countQuery, 0); 
    $total  = mysql_result($totalQuery, 0); 
    
    $percent = round( ($count/$total )*100, 2 ) ;
    
    print( "このWiki全体の<strong>$count</strong>ページ中、あなたは<strong>$total</strong>ページ所有しています。");
    print( "<br />全体の<strong>$percent%</strong>をあなたが所有していることになります。" );     
?>