예제 #1
0
파일: history.php 프로젝트: kelsh/classic
<?php

session_start();
require 'include.php';
require 'paginate.php';
if ($_SESSION['Timezone']) {
    date_default_timezone_set($_SESSION['Timezone']);
}
$Page = replace_input($_GET['page']);
$Query = "Select `ID`,`Time`,`Data`\n\t\t\tfrom `Pages` \n\t\t\twhere `Page`='{$Page}'\n\t\t\tand `Deleted`='0'\n\t\t\torder by `ID`\n\t\t\tdesc";
list($Results, $Links) = Paginate($Query, 25, $_GET['p'], $_SERVER['QUERY_STRING'], 1);
if ($Results) {
    foreach ($Results as $Result) {
        list($ID, $Time, $Data) = $Result;
        echo "<div style='clear:both'></div>";
        $Toggle++;
        if ($Toggle % 2 == 1) {
            echo "<div style='background-color:#140526;'>";
        } else {
            echo "<div>";
        }
        $Time = date("G:i:s T", $Time);
        echo "<div class='view'><a href='/view.php?id={$ID}'>{$Time}</a></div>";
        $PotentialURL = trim(str_replace(array('&nbsp;', '<br>', '<', '>'), ' ', $Data));
        if (filter_var($PotentialURL, FILTER_VALIDATE_URL)) {
            $Data = str_replace($PotentialURL, "<a href='{$PotentialURL}' target='_blank'>{$PotentialURL}</a>", $Data);
        } else {
            foreach (explode(" ", str_replace(array('&nbsp;', '<br>', '<', '>'), ' ', $Data)) as $URL) {
                if (filter_var($URL, FILTER_VALIDATE_URL)) {
                    $Data = str_replace($URL, "<a href='{$URL}' target='_blank'>{$URL}</a>", $Data);
                }
예제 #2
0
    $content .= '<button onclick="printFunction()" id="print_button" class="btn btn-default pull-right">Print</button></div>';
}
if ($cmd == '[PARCEL]') {
    $content .= '<div class="container-fluid"><div class="row"><div class="col-md-4">';
    $parcel_tb = SelectTable();
    $parcel_tb_rel = SelectRelTable();
    //Calculate total number of parcels to work out how many pages needed for pagination
    $sql = "SELECT * FROM {$parcel_tb}";
    $result = mysqli_query($con, $sql) or die(mysqli_error() . "Error in " . $sql);
    $row_count = mysqli_num_rows($result);
    $total_pages = ceil($row_count / 25);
    $field = array('name', 'tracking', 'date_sent', 'date_received');
    $sql = "SELECT * FROM {$parcel_tb} ORDER BY date_entered DESC LIMIT {$start_from}, 25";
    $table_name = 'parcel';
    $content .= DisplayTable($sql, $field, $table_name, $row_count);
    $content .= Button('new_parcel', 'New Parcel', 'btn-default') . Paginate($total_pages) . '</div>';
    if ($pid != '') {
        $content .= '<div class="col-md-4">';
        $sql = "SELECT * from {$parcel_tb_rel} JOIN mmb_bespoke_job ON {$parcel_tb_rel}.mmb_parcel090foke_job_idb = mmb_bespoke_job.id  WHERE {$parcel_tb_rel}.mmb_parcele16e_parcel_ida = '{$pid}'  order by due_back_date";
        $result = mysqli_query($con, $sql) or die(mysqli_error() . "Error in " . $sql);
        $row_count = mysqli_num_rows($result);
        $field = array('name', 'repair_type', 'due_back_date');
        $total_pages = '';
        $table_name = 'parcel_jobs';
        $content .= DisplayTable($sql, $field, $table_name, $row_count);
        $sql = "SELECT * FROM {$parcel_tb} WHERE id = '{$pid}'";
        $field = array('date_sent', 'date_received', 'tracking');
        $content .= EditRecordSticky($sql, $field, 'edit_parcel', 'id', $pid);
        $content .= '<hr ><a href="?cmd=[EDIT_PARCEL]&sc=' . $sc . '&pid=' . $pid . '"  class="btn btn-info">EDIT PARCEL</a>';
        if ($sc == 'parcel_uk') {
            $content .= '<a href="?cmd=[INVOICE]&pid=' . $pid . '"  class="btn btn-info">INVOICE</a>';
예제 #3
0
파일: search.php 프로젝트: kelsh/classic
            list($Path, $Title, $Content) = $Result;
            echo "<a href='/{$Path}' style='font-weight:bold'>{$Title}</a><br />";
            echo substr($Content, 0, 255);
            echo "<hr />";
            $Count++;
        }
    }
    if (empty($Count)) {
        echo "<br /><b>Looks like your search didn't turn up anything.<br />Your query might be too short, too common, or maybe it's really not here.</b>";
    } else {
        $TimeQuery = mysql_query("Select `Time`\r\n\t\t\t\t\t\t\t\t\tfrom `Wiki Searches`\r\n\t\t\t\t\t\t\t\t\twhere `IP`='{$userIP}' and `Search`='{$Search}'\r\n\t\t\t\t\t\t\t\t\torder by `ID` desc");
        list($OldTime) = mysql_fetch_array($TimeQuery);
        if ($OldTime + 86400 < $Time) {
            mysql_query("Insert into `Wiki Searches` values ('', '{$Time}', '{$Results}', '{$Search}', '{$userIP}')");
        }
    }
    echo "<center>{$Links}</center>";
} else {
    $Query = "Select `Time`, `Results`, `Search`\r\n\t\t\t\tfrom `Wiki Searches`\r\n\t\t\t\torder by `ID` desc";
    //	echo "<hr />";
    list($Data, $Links) = Paginate($Query, 25, $_GET['page']);
    echo "<center class='page-navigation'>{$Links}</center>";
    foreach ($Data as $Result) {
        list($Time, $Results, $Search) = $Result;
        date_default_timezone_set('America/New_York');
        $Time = date("F j\\, Y G:i:s", $Time) . " EST";
        $TableContents .= "<tr><td><a href='search?q={$Search}'>{$Search}</a></td><td>{$Results}</td><td>{$Time}</td></tr>\n";
    }
    echo "\t<table>\r\n\t\t\t\t<tr style='font-weight:bold'><td>Search</td><td>Results</td><td>Time</td></tr>\r\n\t\t\t\t{$TableContents}\r\n\t\t\t</table>";
    echo "<center class='page-navigation bottom'>{$Links}</center>";
}
예제 #4
0
}
//Full list of records from mmb_parcel and mmb_parcel_thailand
if ($cmd == '[PARCEL]') {
    $content .= '<div class="container-fluid"><div class="row"><div class="col-md-4">';
    $parcel_tb = SelectTable();
    $parcel_tb_rel = SelectRelTable();
    //Calculate total number of parcels to work out how many pages needed for pagination
    $sql = "SELECT * FROM {$parcel_tb}";
    $result = mysqli_query($con, $sql) or die(mysqli_error() . "Error in " . $sql);
    $row_count = mysqli_num_rows($result);
    $total_pages = ceil($row_count / 25);
    $field = array('name', 'tracking', 'date_sent', 'date_received');
    $sql = "SELECT * FROM {$parcel_tb} ORDER BY date_entered DESC LIMIT {$start_from}, 25";
    $table_name = 'parcel';
    $content .= DisplayTable($sql, $field, $table_name, $row_count);
    $content .= Button('new_parcel', 'New Parcel', 'btn-default', '') . Paginate($total_pages) . '</div><div class="col-md-4">';
    //Display all job records related to parcel
    if ($pid != '') {
        $sql = "SELECT * from {$parcel_tb_rel} JOIN mmb_bespoke_job ON {$parcel_tb_rel}.mmb_parcel090foke_job_idb = mmb_bespoke_job.id  WHERE {$parcel_tb_rel}.mmb_parcele16e_parcel_ida = '{$pid}'  order by due_back_date";
        $result = mysqli_query($con, $sql) or die(mysqli_error() . "Error in " . $sql);
        $row_count = mysqli_num_rows($result);
        $field = array('name', 'repair_type', 'due_back_date');
        $table_name = 'parcel_jobs';
        $content .= DisplayTable($sql, $field, $table_name, $row_count);
        //Quick edits for parcel
        $sql = "SELECT * FROM {$parcel_tb} WHERE id = '{$pid}'";
        $field = array('date_sent', 'date_received', 'tracking');
        $content .= EditRecordSticky($sql, $field, 'edit_parcel', 'id', $pid);
        //Edit all parcel fields
        $content .= '<hr ><a href="?cmd=[EDIT_PARCEL]&sc=' . $sc . '&pid=' . $pid . '"  class="btn btn-info">EDIT PARCEL</a>';
        //Invoice view for parcel
예제 #5
0
	</table>
	</td>
</tr>

</table>

<?php 
// If this thread consists of more than one page, display the navigation thingy.
if ($iNumberPages > 1) {
    ?>

<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
	<td align="left" class="small">
<?php 
    Paginate("thread.php?threadid={$iThreadID}", $iNumberPages, $iPage, $iPostsPerPage);
    ?>
	</td>
</tr>
</table>

<?php 
}
// Is Quick Reply enabled?
if ($CFG['general']['quickreply']) {
    include "./skins/{$CFG['skin']}/quickreply.tpl.php";
}
?>

<br />
예제 #6
0
</table>

<br />

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
	<td><a href="newthread.php?forumid=<?php 
    echo $iForumID;
    ?>
"><img src="images/newthread.png" border="0" alt="Post New Thread" /></a></td>

<?php 
    // If this forum consists of more than one page, display the pagination links.
    if ($iNumberPages > 1) {
        echo '<td align="right" class="smaller">';
        Paginate("forumdisplay.php?forumid={$iForumID}", $iNumberPages, $iPage, $iThreadsPerPage, $strSortBy, strtolower($strSortOrder), $iDaysPrune);
        echo '</td>';
    }
    ?>

</tr>
</table>

<?php 
} else {
    ?>

<div class="medium" align="center"><b>There have been no posts in the last <?php 
    echo $iDaysPrune;
    ?>
 days in this forum.</b><br /><br /></div>
예제 #7
0
파일: edits.php 프로젝트: kelsh/classic
include 'include.php';
include '../fishformat.php';
$Name = stripslashes(filter_input(INPUT_GET, 'name', FILTER_SANITIZE_SPECIAL_CHARS));
?>

<form>
	&emsp;&emsp;&emsp;&emsp;Editor: <input type='text' name='name' value='<?php 
echo $Name;
?>
' /> <input type='submit' value='Submit' />
</form>

<?php 
if ($Name) {
    $Query = "Select `ID`,`PageID`,`AccountID`,`EditTime`,`Size`,`Name`,`Description`,`Title` from `Wiki_Edits` where `Name`='{$Name}' order by `ID` desc";
    list($QueryData, $Links) = Paginate($Query, 50, $_GET['page'], $_SERVER['QUERY_STRING']);
    if ($QueryData) {
        echo "<hr /><center>{$Links}</center><hr />";
        echo "<table width='100%'>";
        echo "<tr><td style='min-width:175px;'><b>Revision</b></td><td><b>Size</b></td><td><b>Editor</b></td><td style='min-width:200px;'><b>Title</b></td><td><b>Description</b></td></tr>";
        foreach ($QueryData as $Result) {
            list($EditID, $PageID, $AccountID, $PageTime, $PageSize, $PageName, $PageDescription, $PageTitle) = $Result;
            if (empty($Data[$PageID])) {
                $PageQuery = mysql_query("SELECT `Path` FROM `Wiki_Pages` WHERE `ID`='{$PageID}'");
                list($PagePath) = mysql_fetch_array($PageQuery);
                $Data[$PageID] = $PagePath;
            } else {
                $PagePath = $Data[$PageID];
            }
            $Toggle++;
            date_default_timezone_set('America/New_York');
예제 #8
0
파일: history.php 프로젝트: kelsh/classic
function history($path, $action, $title, $content)
{
    $Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['PageNav']->Active("Page History");
    $pageQuery = mysql_query("Select `ID` from `Wiki_Pages` where `Path`='{$path}'");
    list($pageID) = mysql_fetch_array($pageQuery);
    $totalQuery = mysql_query("Select `ID`\n\t\t\t\t\t\t\t\tfrom `Wiki_Edits`\n\t\t\t\t\t\t\t\twhere `PageID` = '{$pageID}' and `Archived` = 0");
    $nextQuery = mysql_query("Select `ID`, `Title`\n\t\t\t\t\t\t\t\tfrom `Wiki_Edits`\n\t\t\t\t\t\t\t\twhere `PageID` = '{$pageID}' and `Archived` = 0\n\t\t\t\t\t\t\t\torder by `ID` desc limit 1");
    $previousQuery = mysql_query("Select `ID`, `Title`\n\t\t\t\t\t\t\t\tfrom `Wiki_Edits`\n\t\t\t\t\t\t\t\twhere `PageID` = '{$pageID}' and `Archived` = 0\n\t\t\t\t\t\t\t\torder by `ID` limit 1");
    $totalEdits = mysql_num_rows($totalQuery);
    $next = mysql_fetch_array($nextQuery);
    $previous = mysql_fetch_array($previousQuery);
    if (is_numeric($action[1])) {
        $PreviousQuery = mysql_query("Select `Content` from `Wiki_Edits` where `ID` < '{$action['1']}' and `Archived` = 0 order by `ID` desc limit 1");
        list($PreviousContent) = mysql_fetch_array($PreviousQuery);
        $PageQuery = mysql_query("SELECT `AccountID`,`EditTime`,`Name`,`Description`,`Title`,`Content` FROM `Wiki_Edits` WHERE `ID`='{$action['1']}' and `Archived` = 0");
        list($AccountID, $PageEditTime, $PageName, $PageDescription, $PageTitle, $PageContent) = mysql_fetch_array($PageQuery);
        $previousQuery = mysql_query("Select `ID`, `Title`\n\t\t\t\t\t\t\t\t\t\tfrom `Wiki_Edits`\n\t\t\t\t\t\t\t\t\t\twhere `PageID` = '{$pageID}' and `ID` > '{$action['1']}' and `Archived` = 0\n\t\t\t\t\t\t\t\t\t\t\torder by `ID` limit 1");
        $nextQuery = mysql_query("Select `ID`, `Title`\n\t\t\t\t\t\t\t\t\t\tfrom `Wiki_Edits`\n\t\t\t\t\t\t\t\t\t\twhere `PageID` = '{$pageID}' and `ID` < '{$action['1']}' and `Archived` = 0\n\t\t\t\t\t\t\t\t\t\t\torder by `ID` desc limit 1");
        $pagePrevious = mysql_fetch_array($previousQuery);
        $pageNext = mysql_fetch_array($nextQuery);
        if ($pagePrevious) {
            $previous = $pagePrevious;
        }
        if ($pageNext) {
            $next = $pageNext;
        }
        $content['ExtraNav'] = new Navigation();
        $content['ExtraNav']->Add("View Source", FormatPath("/{$path}/") . "?source/{$action['1']}");
        $content['ExtraNav']->Add("View Difference", FormatPath("/{$path}/") . "?diff/{$action['1']}");
        if ($_SESSION['Verified'] == 1) {
            $content['ExtraNav']->Add("Revert Page", FormatPath("/{$path}/") . "?revert/{$action['1']}");
        }
        if ($_SESSION['admin']) {
            $content['ExtraNav']->Add("Archive This Edit", FormatPath("/{$path}/") . "?archive/{$action['1']}");
        }
        $title[] = FishFormat($PageTitle, "strip");
        $PageContent = FishFormat($PageContent);
        $previousPath = FormatPath("/{$path}/?history/{$previous['ID']}");
        $nextPath = FormatPath("/{$path}/?history/{$next['ID']}");
        $content['Title'] .= "<a href='{$previousPath}' title='Previous - {$previous['Title']}'>⟨</a> " . FishFormat($PageTitle) . " <a href='{$nextPath}' title='Next - {$next['Title']}'>⟩</a>";
        $content['Body'] .= $PageContent;
        date_default_timezone_set('America/New_York');
        //			$PageEditTime = date("F j\, Y G:i:s", $PageEditTime)." EST";
        $PageEditTime = formatTime($PageEditTime);
        $content['Footer'] = "This page is an old revision made by <b><a href='/names?id={$AccountID}'>{$PageName}</a></b> on {$PageEditTime}.";
        if ($PageDescription) {
            $content['Footer'] .= "<br />'{$PageDescription}'";
        }
    } else {
        $previousPath = FormatPath("/{$path}/?history/{$previous['ID']}");
        $nextPath = FormatPath("/{$path}/?history/{$next['ID']}");
        $content['Title'] = "<a href='{$previousPath}' title='Previous - {$previous['Title']}'>⟨</a> Page History <a href='{$nextPath}' title='Next - {$next['Title']}'>⟩</a>";
        $PageQuery = mysql_query("SELECT `ID` FROM `Wiki_Pages` WHERE `Path`='{$path}'");
        list($PageID) = mysql_fetch_array($PageQuery);
        $HistoryQuery = "SELECT `ID`,`AccountID`,`EditTime`,`Size`,`Tags`,`Name`,`Description`,`Title` FROM `Wiki_Edits` WHERE `PageID`='{$PageID}' and `Archived` = 0 ORDER BY `ID` DESC";
        $request = parse_url($_SERVER['REQUEST_URI']);
        list($Data, $Links) = Paginate($HistoryQuery, 50, $_GET['page'], $request['query']);
        if ($_SESSION['admin']) {
            $content['ExtraNav'] = new Navigation();
            $content['ExtraNav']->Add("Archive All Edits", FormatPath("/{$path}/") . "?archive");
        }
        $content['Body'] .= "<hr /><center>{$Links}</center><hr />";
        $content['Body'] .= "<table width='100%' class='history'>";
        $content['Body'] .= "<tr><td><b>Revision</b></td><td><b>Size</b></td><td><b>Tags</b></td><td><b>Editor</b></td><td><b>Title</b></td><td><b>Description</b></td></tr>";
        foreach ($Data as $Result) {
            list($HistoryID, $AccountID, $HistoryTime, $HistorySize, $historyTags, $HistoryName, $HistoryDescription, $HistoryTitle) = $Result;
            $Toggle++;
            date_default_timezone_set('America/New_York');
            $minWidth = recentTime($HistoryTime) ? 85 : 175;
            $HistoryTime = formatTime($HistoryTime);
            if ($Toggle % 2 == 1) {
                $Class = "class='toggle'";
            } else {
                $Class = '';
            }
            $HistoryName = FishFormat($HistoryName, "format");
            $HistoryDescription = FishFormat($HistoryDescription, "format");
            $HistoryTitle = FishFormat($HistoryTitle, "format");
            $HistoryURL = str_replace("//", "/", "/{$path}/?history/{$HistoryID}");
            $DiffURL = str_replace("//", "/", "/{$path}/?diff/{$HistoryID}");
            $content['Body'] .= "<tr {$Class}><td style='min-width:{$minWidth};'>{$HistoryTime}</td><td>{$HistorySize}</td><td>{$historyTags}</td><td><b><a href='/edits?name={$HistoryName}'>{$HistoryName}</a></b></td><td style='max-width:400px;'><span style='float:right;'><a href='{$DiffURL}' rel='nofollow'>d</a></span><b><a href='{$HistoryURL}' rel='nofollow'>{$HistoryTitle}</a></b></td><td>{$HistoryDescription}</td></tr>";
        }
        $content['Body'] .= "</table>";
        $content['Body'] .= "<hr /><center>{$Links}</center>";
    }
    $content['Body'] .= <<<JavaScript
\t
\t<script>
\t\t\$(document).ready(function ()
\t\t{
\t\t\t\$('body').on('keydown', function(event)
\t\t\t{
\t\t\t\tevent.stopImmediatePropagation()
\t\t\t\t
\t\t\t\tif(event.keyCode == 37) // Previous
\t\t\t\t\tlocation.href = '{$previousPath}';
\t\t\t\telse if(event.keyCode == 39) // Next
\t\t\t\t\tlocation.href = '{$nextPath}';

\t\t\t\t\t
\t//\t\t\tconsole.log(event);
\t\t\t});
\t\t});
\t</script>
\t
JavaScript;
    return array($title, $content);
}
예제 #9
0
</tr>

<?php 
}
?>

</table>

<?php 
// If this forum consists of more than one page, display the pagination links.
if ($iNumberPages > 1) {
    ?>

<div align="center" class="smaller"><br />
<?php 
    Paginate("search.php?action=showresult&amp;searchid={$iResultID}", $iNumberPages, $iPage, $iThreadsPerPage, $strSortBy, strtolower($strSortOrder));
    ?>
</div>
<?php 
}
?>

<div class="smaller" align="left"><br /><?php 
echo TimeInfo();
?>
</div>

<div align="center" class="smaller"><img src="images/space.png" width="1" height="10" alt="" /><br />
	<img style="vertical-align: middle;" src="images/thread_new_cold.png" border="0" alt="New Posts" align="middle" /> <b>New posts</b>&nbsp;&nbsp;
	<img style="vertical-align: middle;" src="images/thread_new_hot.png" border="0" alt="Hot Thread w/ New Posts" align="middle" /> <b>New posts w/ more than 15 replies or 150 views</b>&nbsp;&nbsp;
	<img style="vertical-align: middle;" src="images/thread_closed.png" border="0" alt="Closed Thread" align="middle" /> <b>Closed thread</b><br />
예제 #10
0
         $contentUrl = "";
         $thumbnailUrl = "";
         if ($photoEntry->getMediaGroup()->getContent() != null) {
             $mediaContentArray = $photoEntry->getMediaGroup()->getContent();
             $contentUrl = $mediaContentArray[0]->getUrl();
         }
         if ($photoEntry->getMediaGroup()->getThumbnail() != null) {
             $mediaThumbnailArray = $photoEntry->getMediaGroup()->getThumbnail();
             $thumbnailUrl = $mediaThumbnailArray[1]->getUrl();
         }
         echo "<div class='photo'><a rel='shadowbox[gallery]' href='" . $contentUrl . "'><img src='" . $thumbnailUrl . "' alt='" . $photoEntry->title->text . "' title='" . $albumName . "' /></a></div>\n";
     }
     //print_r($albumFeed);
     echo "<div style='clear:both;margin-bottom:6px;'>&nbsp;</div>";
     if ($numPages > 1) {
         echo Paginate($numPages, $page, $albumName, $albumId);
     }
 } catch (Zend_Gdata_App_HttpException $e) {
     echo "Error: " . $e->getMessage() . "<br />\n";
     if ($e->getResponse() != null) {
         echo "Body: <br />\n" . $e->getResponse()->getBody() . "<br />\n";
     }
     // In new versions of Zend Framework, you also have the option
     // to print out the request that was made.  As the request
     // includes Auth credentials, it's not advised to print out
     // this data unless doing debugging
     // echo "Request: <br />\n" . $e->getRequest() . "<br />\n";
 } catch (Zend_Gdata_App_Exception $e) {
     echo "Error: " . $e->getMessage() . "<br />\n";
 }
 ?>
예제 #11
0
파일: search.php 프로젝트: kelsh/classic
<?php

$Search = filter_var(stripslashes($_GET['q']), FILTER_SANITIZE_SPECIAL_CHARS);
?>

<form>
	<input type='text' name='q' value='<?php 
echo $Search;
?>
'>
	<input type='submit' value='Search'>
</form>
<?php 
include_once 'mysql.php';
include_once 'functions.php';
include_once 'paginate.php';
if ($Search) {
    $RecentQuery = "Select `ID`, `Time`, `Caption`, `Permalink` from `Images` where match(`Caption`) against('{$Search}')";
    list($Data, $Links) = Paginate($RecentQuery, 25, $_GET['page'], $_SERVER['QUERY_STRING'], 'redirect');
    if ($Data) {
        echo "<center>{$Links}</center>";
        echo "<table>";
        foreach ($Data as $Result) {
            list($ID, $Time, $Caption, $Permalink) = $Result;
            $Time = FormatTime($Time);
            echo "<tr><td class='time'>{$Time}</td> <td><a href='/view/{$ID}/{$Permalink}/'>{$Caption}</a></a></td></tr>\n";
        }
        echo "</table>";
        echo "<center>{$Links}</center>";
    }
    $Caption = "Searching for {$Search}";
예제 #12
0
파일: browse.php 프로젝트: kelsh/classic
$Modified = "<a href='?{$URL['Modified']}'>Date Modified</a>";
$Ascending = "<a href='?{$URL['Ascending']}'>Ascending</a>";
$Descending = "<a href='?{$URL['Descending']}'>Descending</a>";
if ($_GET['order'] == 'modified') {
    $Modified = "<a href='?{$URL['Modified']}' class='title'>Date Modified</a>";
    $Order = "order by `EditTime`";
} else {
    $Created = "<a href='?{$URL['Created']}' class='title'>Date Created</a>";
    $Order = "order by `ID`";
}
if ($_GET['sort'] == 'desc') {
    $Descending = "<a href='?{$URL['Descending']}' class='title'>Descending</a>";
    $Sort = "desc";
} else {
    $Ascending = "<a href='?{$URL['Ascending']}' class='title'>Ascending</a>";
    $Sort = "asc";
}
echo "<div style='font-size:8pt; float:right;'>\r\n\t\t\tOrder by: {$Created}, {$Modified} &mdash; {$Ascending}, {$Descending}\r\n\t\t</div>";
list($Data, $Links) = Paginate("Select `Path`, `Title`, `EditTime` from `Wiki_Pages` {$Order} {$Sort}", 50, $_GET['page'], $_SERVER['QUERY_STRING']);
echo "<div style='clear:right'></div>";
#$Time = simplexml_load_file("http://ipinfodb.com/ip_query.php?ip={$_SERVER['REMOTE_ADDR']}&timezone=true");
#date_default_timezone_set($Time->TimezoneName);
if ($Data) {
    echo "<center class='page-navigation'>{$Links}</center>";
    foreach ($Data as $Page) {
        echo "<a href='/{$Page['Path']}'>{$Page['Title']}</a> &mdash; Last edited at " . formatTime($Page['EditTime']) . "<br />";
    }
    echo "<center class='page-navigation bottom'>{$Links}</center>";
} else {
    echo "<b>Oops!!</b>";
}
예제 #13
0
파일: tag.php 프로젝트: kelsh/classic
function tag($path, $action, $title, $content)
{
    $action = implode('/', $action);
    $action = explode('/', $action, 3);
    $tag = Clean($action[1]);
    $cleanTag = ucwords(str_replace('-', ' ', $tag));
    if (isset($action[2])) {
        $path = $action[2];
    }
    $totalQuery = mysql_query("Select stats.`count`\n\t\t\t\t\t\t\t\tfrom `Wiki_Tag_Statistics` as stats\n\t\t\t\t\t\t\t\twhere stats.`tag` = '{$tag}'");
    $nextQuery = mysql_query("Select `Path`, `Title`\n\t\t\t\t\t\t\t\tfrom `Wiki_Pages`,\n\t\t\t\t\t\t\t\t\t`Wiki_Tags` as tag\n\t\t\t\t\t\t\t\twhere tag.`tag` = '{$tag}' and tag.`pageID` = `ID`\n\t\t\t\t\t\t\t\t\torder by tag.`tagID` desc limit 1");
    $previousQuery = mysql_query("Select `Path`, `Title`\n\t\t\t\t\t\t\t\tfrom `Wiki_Pages`,\n\t\t\t\t\t\t\t\t\t`Wiki_Tags` as tag\n\t\t\t\t\t\t\t\twhere tag.`tag` = '{$tag}' and tag.`pageID` = `ID`\n\t\t\t\t\t\t\t\t\torder by tag.`tagID` limit 1");
    list($tagTotal) = mysql_fetch_array($totalQuery);
    $next = mysql_fetch_array($nextQuery);
    $previous = mysql_fetch_array($previousQuery);
    if ($path or isset($action[2])) {
        $PageQuery = mysql_query("SELECT `ID`,`Title`,`Content`,`Edits`,`Views`,`EditTime`,tag.`tagID` FROM `Wiki_Pages`, `Wiki_Tags` as tag WHERE `Path` like '{$path}' and tag.`tag` = '{$tag}' and tag.`pageID` = `ID`");
        list($PageID, $PageTitle, $PageContent, $PageEdits, $pageViews, $PageEditTime, $tagID) = mysql_fetch_array($PageQuery);
        $previousQuery = mysql_query("Select `Path`, `Title`\n\t\t\t\t\t\t\t\t\t\tfrom `Wiki_Pages`,\n\t\t\t\t\t\t\t\t\t\t\t`Wiki_Tags` as tag\n\t\t\t\t\t\t\t\t\t\twhere tag.`tag` = '{$tag}' and tag.`pageID` = `ID` and tag.`tagID` >'{$tagID}'\n\t\t\t\t\t\t\t\t\t\t\torder by tag.`tagID` limit 1");
        $nextQuery = mysql_query("Select `Path`, `Title`\n\t\t\t\t\t\t\t\t\tfrom `Wiki_Pages`,\n\t\t\t\t\t\t\t\t\t\t`Wiki_Tags` as tag\n\t\t\t\t\t\t\t\t\twhere tag.`tag` = '{$tag}' and tag.`pageID` = `ID` and tag.`tagID` < '{$tagID}'\n\t\t\t\t\t\t\t\t\t\torder by tag.`tagID` desc limit 1");
        $pagePrevious = mysql_fetch_array($previousQuery);
        $pageNext = mysql_fetch_array($nextQuery);
        if ($pagePrevious) {
            $previous = $pagePrevious;
        }
        if ($pageNext) {
            $next = $pageNext;
        }
        $tagQuery = mysql_query("Select tags.`tag`, stats.`count`\n\t\t\t\t\t\t\t\t\tfrom `Wiki_Tags` as tags,\n\t\t\t\t\t\t\t\t\t\t `Wiki_Tag_Statistics` as stats\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\twhere tags.`pageID` = '{$PageID}'\n\t\t\t\t\t\t\t\t\t\tand stats.`tag` = tags.`tag`");
        while (list($tagName, $tagCount) = mysql_fetch_array($tagQuery)) {
            $plural = 's';
            if ($tagCount == 1) {
                $plural = '';
            }
            $tagLink = urlencode($tagName);
            $tagTitle = str_replace('-', ' ', $tagName);
            $tagLinks[] = "<a href='/?tag/{$tagLink}' title='{$tagCount} tagged page{$plural}'>{$tagTitle}</a>";
        }
        $tagLinks = implode(" | ", $tagLinks);
        if ($tagLinks) {
            $tagLinks = "<hr />Tags: {$tagLinks}";
        }
        $PageTitle = PageTitler($PageTitle);
        if (empty($PageContent)) {
            $PageContent = array("Hello friend. b{Wetfish regrets to inform you this page does not exist.}", "", "Confused? This is the {{wiki|Wetfish Wiki}}, a place anyone can edit!", "It appears you've stumbled upon a place none have yet traveled.", "Would you like to be the first? {{{$path}/?edit|All it takes is a click.}}", "", "i{But please, don't wallow.}", "i{A new page surely follows.}", "i{You have the power.}");
            $PageContent = implode("<br />", $PageContent);
        } else {
            mysql_query("Update `Wiki_Pages` set `Views` = `Views` + 1 where `ID`='{$PageID}'");
        }
        if ($_SESSION['admin']) {
            $content['ExtraNav'] = new Navigation();
            $content['ExtraNav']->Add("Archive This Page", FormatPath("/{$path}/") . "?archive");
            $content['ExtraNav']->Add("Rename This Page", FormatPath("/{$path}/") . "?rename");
        }
        if ($previous['Path']) {
            $previous['Path'] = "/{$previous['Path']}/?tag/{$tag}";
        } else {
            $previous['Path'] = "/?tag/{$tag}/";
        }
        if ($next['Path']) {
            $next['Path'] = "/{$next['Path']}/?tag/{$tag}";
        } else {
            $next['Path'] = "/?tag/{$tag}/";
        }
        $title[] = FishFormat($PageTitle, "strip");
        $content['Title'] .= "<a href='{$previous['Path']}' title='Previous - {$previous['Title']}'>⟨</a> " . FishFormat($PageTitle) . " <a href='{$next['Path']}' title='Next - {$next['Title']}'>⟩</a>";
        $content['Body'] .= FishFormat($PageContent);
        $content['Tags'] = $tagLinks;
    } else {
        mysql_query("Update `Wiki_Tag_Statistics` set `views` = `views` + 1\n\t\t\t\t\t\twhere `tag` = '{$tag}'");
        if ($previous['Path']) {
            $previous['Path'] = "/{$previous['Path']}/?tag/{$tag}";
        } else {
            $previous['Path'] = "/?tag/{$tag}/";
        }
        if ($next['Path']) {
            $next['Path'] = "/{$next['Path']}/?tag/{$tag}";
        } else {
            $next['Path'] = "/?tag/{$tag}/";
        }
        $content['Title'] = "Pages tagged: <a href='{$previous['Path']}' title='Previous - {$previous['Title']}'>⟨</a> {$cleanTag} <a href='{$next['Path']}' title='Next - {$next['Title']}'>⟩</a>";
        $pageQuery = "SELECT `ID`,`Path`,`Title`,`Content`,`Edits`, `EditTime`\n\t\t\t\t\t\tFROM `Wiki_Pages`,\n\t\t\t\t\t\t\t `Wiki_Tags` as tag\n\t\t\t\t\t\tWHERE tag.`tag` = '{$tag}' and tag.`pageID` = `ID`\n\t\t\t\t\t\torder by tag.`tagID` desc";
        list($Data, $Links) = Paginate($pageQuery, 50, $_GET['page'], $_SERVER['QUERY_STRING']);
        if ($Data) {
            $content['Body'] .= "<center class='page-navigation'>{$Links}</center>";
            foreach ($Data as $Result) {
                list($pageID, $pagePath, $pageTitle, $pageContent) = $Result;
                $tagQuery = mysql_query("Select tags.`tag`, stats.`count`\n\t\t\t\t\t\t\t\t\t\t\tfrom `Wiki_Tags` as tags,\n\t\t\t\t\t\t\t\t\t\t\t\t `Wiki_Tag_Statistics` as stats\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\twhere tags.`pageID` = '{$pageID}'\n\t\t\t\t\t\t\t\t\t\t\t\tand stats.`tag` = tags.`tag`");
                $tagLinks = array();
                while (list($tagName, $tagCount) = mysql_fetch_array($tagQuery)) {
                    $plural = 's';
                    if ($tagCount == 1) {
                        $plural = '';
                    }
                    $tagLink = urlencode($tagName);
                    $tagTitle = str_replace('-', ' ', $tagName);
                    $tagLinks[] = "<a href='/?tag/{$tagLink}' title='{$tagCount} tagged page{$plural}'>{$tagTitle}</a>";
                }
                $tagLinks = implode(" | ", $tagLinks);
                if ($Count % 4 == 1 or $Count % 4 == 2) {
                    $class = 'toggle';
                } else {
                    $class = '';
                }
                if ($Count % 2 == 0) {
                    $content['Body'] .= "<div class='clear'></div>";
                }
                $content['Body'] .= "<div class='{$class}' style='float:left; width:50%'><div style='padding:16px'>";
                $content['Body'] .= "<a href='/{$pagePath}/?tag/{$tag}' style='font-weight:bold'>{$pageTitle}</a><br />";
                $content['Body'] .= "Tags: {$tagLinks}";
                $content['Body'] .= "</div></div>";
                $Count++;
            }
            $content['Body'] .= "<div class='clear'></div>";
            $content['Body'] .= "<center class='page-navigation bottom'>{$Links}</center>";
        }
        if (empty($Count)) {
            $content['Body'] .= "<br /><b>Sorry friend, it appears the tag you're looking for doesn't exist.</b>";
        }
    }
    if ($tagTotal == 1) {
        $footerPlural = '';
    } else {
        $footerPlural = 's';
    }
    /*
    if($previous['Path'])
    	$previous['Path'] = "/{$previous['Path']}/?tag/$tag";
    else
    	$previous['Path'] = "/?tag/$tag/";
    
    if($next['Path'])
    	$next['Path'] = "/{$next['Path']}/?tag/$tag";
    else
    	$next['Path'] = "/?tag/$tag/";
    */
    $content['Body'] .= <<<JavaScript
\t
\t<script>
\t\t\$(document).ready(function ()
\t\t{
\t\t\t\$('body').on('keydown', function(event)
\t\t\t{
\t\t\t\t// what?

\t\t\t\tevent.stopImmediatePropagation()
\t\t\t\t
\t\t\t\tif(event.keyCode == 37) // Previous
\t\t\t\t\tlocation.href = '{$previous['Path']}';
\t\t\t\telse if(event.keyCode == 39) // Next
\t\t\t\t\tlocation.href = '{$next['Path']}';

\t\t\t\t\t
\t//\t\t\tconsole.log(event);
\t\t\t});
\t\t});
\t</script>
\t
JavaScript;
    $content['Footer'] = " <a href='{$previous['Path']}' title='Previous - {$previous['Title']}'>Previous</a> &emsp; You are browsing <b><a href='/?tag/{$tag}'>{$cleanTag}</a></b>, this tag appears on <b>{$tagTotal}</b> page{$footerPlural}. &emsp; <a href='{$next['Path']}' title='Next - {$next['Title']}'>Next</a>";
    return array($title, $content);
}
예제 #14
0
				<div class="clearfix"></div>
				<p class="caption">' . TrimText($c['name'], 17) . '</p>
				</div>
				</div>';
                } else {
                    $html .= '<div class="item">
				<a href="" class="img-thumbs" rel="' . $c['path'] . '" title="' . $c['name'] . '">
				<img src="asc-thumb.php?src=' . $c['path'] . '&w=130&h=90" class="img-polaroid" width="130" height="90">
				</a>
				<div>
				<a href="" class="pull-left transparent change-file" title="' . _lang('change_name') . '" rel="' . $c['name'] . '"><i class="icon-pencil"></i></a>
				<a href="" class="pull-right transparent delete-file" data-path="' . urlencode($c['x']) . '" rel="' . urlencode($c['p']) . '" title="' . _lang('delete') . '"><i class="icon-trash"></i></a>
				<div class="clearfix"></div>
				<p class="caption">' . TrimText($c['name'], 17) . '</p>
				</div>
				</div>';
                }
            }
        }
    }
    if ($html != '') {
        if ($view == 'list') {
            $html = '<br/><table class="table">' . $html . '</table>';
        }
        $output["html"] = $html . '<div class="clearfix"></div><div style="margin-top: 20px;"><center>' . Paginate($current_folder, $page, $number_of_pages, 3) . '</center></div>';
    } else {
        $output["html"] = '<center>' . _lang('no_images_in_the_folder') . '</center>';
    }
} else {
    $output["html"] = '<center>' . _lang('no_images_in_the_folder') . '</center>';
}
예제 #15
0
        echo gmtdate('m-d-Y', $aMember[JOINDATE]);
        ?>
</td>
	<td bgcolor="<?php 
        echo $strColor;
        ?>
" width="20%" align="center" class="medium"><?php 
        echo $aMember[POSTCOUNT];
        ?>
</td>
</tr>
<?php 
    }
    ?>

</table>

<div class="small" align="center"><br />

<?php 
    Paginate('memberlist.php?letter=' . urlencode($_REQUEST['letter']), $iNumberPages, $iPage, $iUsersPerPage, $strSortBy, strtolower($strSortOrder));
    ?>

</div>

<?php 
} else {
    echo '<div align="center" class="medium"><b>There are no members with usernames like that.</b></div>';
}
// Footer.
require "./skins/{$CFG['skin']}/footer.tpl.php";
예제 #16
0
파일: recent.php 프로젝트: kelsh/classic
function recent($path, $action, $title, $content)
{
    //		$Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['UserNav']->Active("Recent Activity");
    if (empty($_SESSION['Recent'])) {
        $_SESSION['Recent']['Active'][0] = "All Edits";
        $_SESSION['Recent']['Active'][3] = "Descending";
        $_SESSION['Recent']['Order'] = "DESC";
    }
    $content['ExtraNav'] = new Navigation();
    $content['ExtraNav']->Add("All Edits", "?recent/all");
    $content['ExtraNav']->Add("Most Recent Edit", "?recent/unique");
    $content['ExtraNav']->Add("Ascending", "?recent/asc");
    $content['ExtraNav']->Add("Descending", "?recent/desc");
    $content['ExtraNav']->Active($_SESSION['Recent']['Active']);
    $Template['Title'] = "View:";
    $content['ExtraNav']->Template($Template);
    if (empty($action[1])) {
        $content['Title'] = "Recent Activity";
        $ActivityQuery = "SELECT {$Unique} `ID`,`PageID`,`AccountID`,`EditTime`,`Size`,`Tags`,`Name`,`Description`,`Title` FROM `Wiki_Edits` where `Archived` = 0 ORDER BY `ID` {$_SESSION['Recent']['Order']}";
        list($QueryData, $Links) = Paginate($ActivityQuery, 50, $_GET['page'], $_SERVER['QUERY_STRING']);
        $content['Body'] .= "<center class='page-navigation'>{$Links}</center>";
        $content['Body'] .= "<table width='100%' class='history'>";
        $content['Body'] .= "<tr><td><b>Revision</b></td><td><b>Size</b></td><td><b>Tags</b></td><td><b>Editor</b></td><td style='min-width:200px;'><b>Title</b></td><td><b>Description</b></td></tr>";
        if ($QueryData) {
            foreach ($QueryData as $Result) {
                list($EditID, $PageID, $AccountID, $PageTime, $PageSize, $pageTags, $PageName, $PageDescription, $PageTitle) = $Result;
                if (empty($Data[$PageID])) {
                    $PageQuery = mysql_query("SELECT `Path` FROM `Wiki_Pages` WHERE `ID`='{$PageID}'");
                    list($PagePath) = mysql_fetch_array($PageQuery);
                    $Data[$PageID] = $PagePath;
                } else {
                    $PagePath = $Data[$PageID];
                }
                $Toggle++;
                date_default_timezone_set('America/New_York');
                $minWidth = recentTime($PageTime) ? 85 : 175;
                $PageTime = formatTime($PageTime);
                if ($Toggle % 2 == 1) {
                    $Class = "class='toggle'";
                } else {
                    $Class = '';
                }
                $PageName = FishFormat($PageName, "format");
                $PageDescription = FishFormat($PageDescription, "format");
                $PageTitle = FishFormat($PageTitle, "format");
                $DiffURL = str_replace("//", "/", "/{$PagePath}/?diff/{$EditID}");
                $content['Body'] .= "<tr {$Class}><td style='min-width:{$minWidth}px;'>{$PageTime}</td><td>{$PageSize}</td><td>{$pageTags}</td><td><b><a href='/edits?name={$PageName}'>{$PageName}</a></b></td><td style='max-width:400px'><span style='float:right;'><a href='{$DiffURL}' rel='nofollow'>d</a></span><b><a href='/{$PagePath}'>{$PageTitle}</a></b></td><td class='multi-line'>{$PageDescription}</td></tr>";
            }
        }
        $content['Body'] .= "</table>";
        $content['Body'] .= "<center class='page-navigation bottom'>{$Links}</center>";
    } elseif ($action[1] == "page") {
    } else {
        switch ($action[1]) {
            case "all":
                $_SESSION['Recent']['Active'][0] = "All Edits";
                $_SESSION['Recent']['Active'][1] = "";
                $_SESSION['Recent']['View'] = "";
                break;
            case "unique":
                $_SESSION['Recent']['Active'][0] = "";
                $_SESSION['Recent']['Active'][1] = "Most Recent Edit";
                $_SESSION['Recent']['View'] = "DISTINCT";
                break;
            case "asc":
                $_SESSION['Recent']['Active'][2] = "Ascending";
                $_SESSION['Recent']['Active'][3] = "";
                $_SESSION['Recent']['Order'] = "";
                break;
            case "desc":
                $_SESSION['Recent']['Active'][2] = "";
                $_SESSION['Recent']['Active'][3] = "Descending";
                $_SESSION['Recent']['Order'] = "DESC";
                break;
        }
        $content['Body'] = "<b>Settings changed...</b> <meta http-equiv='refresh' content='2;url=" . FormatPath("/{$path}/?recent") . "'>";
    }
    return array($title, $content);
}
예제 #17
0
파일: lonely.php 프로젝트: kelsh/classic
<?php 
// Lonely pages :(
//									   Count(tag.`tagID`) as tagCount,
//										 `Wiki_Tags` as tag,
//tag.`pageID` = page.`ID`
//
//			 `Wiki_Edits` as edit
//										edit.`PageID` = page.`ID`
include '../mysql.php';
include '../../fishformat.php';
include '../../fun/paginate.php';
$lonelyQuery = "Select page.`ID`, page.`Views`, page.`Path`, page.`Title`, page.`EditTime`,\n\t\t\t\t\t   Count(distinct edit.`ID`) as editCount,\n\t\t\t\t\t   Count(distinct tag.`tagID`) as tagCount\n\t\t\t\t\tfrom `Wiki_Pages` as page\n\t\t\t\t\tleft join `Wiki_Edits` as edit on page.`ID` = edit.`PageID`\n\t\t\t\t\tleft join `Wiki_Tags` as tag on page.`ID` = tag.`pageID`\n\t\t\t\t\tgroup by page.`ID`\n\t\t\t\t\torder by tagCount, editCount, page.`Views`, page.`EditTime`";
list($lonelyPages, $navigation) = Paginate($lonelyQuery, 50, $_GET['page'], $_SERVER['QUERY_STRING']);
if ($lonelyPages) {
    echo "<center class='page-navigation'>{$navigation}</center>";
    ?>
	<table width='100%' class='history'>
		<tr>
			<td><b>Date Modified</b></td>
			<td><b>Edits</b></td>		
			<td><b>Views</b></td>
			<td><b>Tags</b></td>
			<td><b>Title</b></td>
		</tr>
		<?php 
    foreach ($lonelyPages as $result) {
        $toggle++;
        $dateModified = date("F j\\, Y G:i:s", $result['EditTime']) . " EST";
        if ($toggle % 2 == 1) {
            $class = "class='toggle'";