Ejemplo n.º 1
0
 function toHTML()
 {
     $HTML = '';
     if ($this->_ShowLogo) {
         $HTML .= freshports_Logo();
     }
     if ($this->_ShowAnnouncements) {
         $Announcement = new Announcement($this->{$_db});
         $NumRows = $Announcement->FetchAllActive();
         if ($NumRows > 0) {
             $HTML .= DisplayAnnouncements($Announcement);
         }
     }
     $HTML .= freshports_MainTable() . "\n<tr><td width='100%' valign='top'>\n" . freshports_MainContentTable() . "\n<tr>\n" . freshports_PageBannerText($this->_title);
     $this->prependBodyContent($HTML);
     $this->addBodyContent("\n</table><td valign=\"top\">" . freshports_SideBar() . "</td></tr></table>\n" . freshports_ShowFooter());
     return parent::toHTML();
 }
Ejemplo n.º 2
0
<li>These statistics are updated daily.
<li><sup>1</sup><a name="1"></a>The number of Google pages used in this calculation is <?php 
echo number_format($GooglePages);
?>
.
</ul>

</td></tr>

<?php 
echo freshports_BannerSpace();
?>

<TR>
	<?php 
echo freshports_PageBannerText("How much diskspace?");
?>
</TR>

<TR><TD>

<P>
The total space used by the FreshPorts database is:
<blockquote><code class="code">
# select pg_database_size('freshports.org');<br>
&nbsp;pg_database_size<br>
------------------<br>
<?php 
$Value = DBSize($db);
echo number_format($Value) . '<br>';
?>
Ejemplo n.º 3
0
<ul>
<li>www/ports pages
<li>portsmon
<li>fenner's output
<li>GNATS
<li>cvsweb
</ul>

<p>
In short, it doesn't make sense to obscure that which is freely available elsewhere.
	</TD></TR><TR><TD>&nbsp;</TD></TR>

<TR>
<?php 
echo freshports_PageBannerText('Why does the PORTVERSION at the top of page differ from that of the first commit?');
?>
</TR>

   <TR><TD>
   <P>
   This question refers to the a port page.  
   
<p>
This situation usually occurs with MASTER/SLAVE ports.  The Master port is updated with a new
REVISION.  No commit is done against the Slave port.  FreshPorts knows to refresh the Slave port
when its Master port is updated.    This refresh updates the PORTVERSION at the top of the 
page.  This update reflects the REVISION you would get if you were to install the Slave port
now that the Master has been upgraded.

	</TD></TR><TR><TD>&nbsp;</TD></TR>
Ejemplo n.º 4
0
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/design-voting/voting.php';
$Debug = 0;
$Title = "FreshPorts Design Contest - Voting";
freshports_Start($Title, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
echo freshports_MainTable();
?>

<tr><td valign="top" width="100%" colspan="2">
<table width="100%" border="0">
<tr>
    <?php 
echo freshports_PageBannerText($Title);
?>
    </tr>
</table>
</td></tr>
<tr><td valign="top" width="100%">
<?php 
if (!$User->id) {
    echo 'You must login to vote.';
} else {
    if (AlreadyVoted($db, $User->id)) {
        echo 'You have already voted.  Thank you';
    } else {
        ?>
<p>
Read about the <a href="http://news.freshports.org/2007/01/30/freshports-design-contest/">FreshPorts Design Contest</a> first. Then
Ejemplo n.º 5
0
function freshports_ErrorMessage($Title, $ErrorMessage)
{
    $HTML = '
<table width="100%" border="1" align="center" cellpadding="1" cellspacing="0" border="1">
<tr><td valign=TOP>
<table width="100%">
<tr>
	' . freshports_PageBannerText($Title) . '
</tr>
<tr bgcolor="#ffffff">
<td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign=top>
   <td><img src="/images/warning.gif"></td>
   <td width="100%">
  <p>' . "WARNING: {$ErrorMessage}" . '</p>
 <p>If you need help, please ask in the forum. </p>
 </td>
 </tr>
 </table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>';
    return $HTML;
}
Ejemplo n.º 6
0
function freshports_PortDisplay($db, $category, $port)
{
    global $TableWidth;
    global $FreshPortsTitle;
    global $User;
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/port-display.php';
    # these two options must be the last on the line.  And as such are mutually exclusive
    define('BYPASSCACHE', 'bypasscache=1');
    # do not read the cache for display
    define('REFRESHCACHE', 'refreshcache=1');
    # refresh the cache
    $BypassCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(BYPASSCACHE)) == BYPASSCACHE;
    $RefreshCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(REFRESHCACHE)) == REFRESHCACHE;
    $Debug = 0;
    if ($Debug) {
        echo 'into ' . __FILE__ . ' now' . "<br>\n";
    }
    $PageNumber = 1;
    if (isset($_SERVER['REDIRECT_QUERY_STRING'])) {
        parse_str($_SERVER['REDIRECT_QUERY_STRING'], $query_parts);
    } else {
        $query_parts = null;
    }
    if ($Debug) {
        echo print_r($query_parts, true);
    }
    if (isset($query_parts['page']) && Is_Numeric($query_parts['page'])) {
        $PageNumber = intval($query_parts['page']);
        if ($PageNumber != $query_parts['page'] || $PageNumber < 1) {
            $PageNumber = 1;
        }
    }
    $port_display = new port_display($db, $User);
    $port_display->SetDetailsFull();
    $Cache = new CachePort();
    $Cache->PageSize = $User->page_size;
    $result = $Cache->RetrievePort($category, $port, CACHE_PORT_DETAIL, $PageNumber);
    if (!$result && !$BypassCache && !$RefreshCache) {
        if ($Debug) {
            echo "found something from the cache<br>\n";
        }
        $HTML = $Cache->CacheDataGet();
        #
        # we need to know the element_id of this port
        # and the whether or not it is on the person's watch list
        # let's create a special function for that!
        #
        $EndOfFirstLine = strpos($HTML, "\n");
        if ($EndOfFirstLine == false) {
            die('Internal error: I was expecting an ElementID and found nothing');
        }
        # extract the ElementID from the cache
        $ElementID = intval(substr($HTML, 0, $EndOfFirstLine));
        if ($ElementID == 0) {
            syslog(LOG_ERR, "Extract of ElementID from cache failed.  Is cache corrupt/deprecated? port was {$category}/{$port}");
            die('sorry, I encountered a problem with the cache.  Please send the URL and this message to the webmaster.');
        }
        if ($User->id) {
            $OnWatchList = freshports_OnWatchList($db, $User->id, $ElementID);
        } else {
            $OnWatchList = 0;
        }
        $HTML = substr($HTML, $EndOfFirstLine + 1);
    } else {
        if ($Debug) {
            echo "found NOTHING in cache for '{$category}/{$port}'<br>\n";
        }
        $HTML = '';
        $port_id = freshports_GetPortID($db, $category, $port);
        if (!isset($port_id)) {
            if ($Debug) {
                echo "{$category}/{$port} is not a port according to freshports_GetPortID<br>\n";
            }
            return -1;
        }
        if ($Debug) {
            echo "{$category}/{$port} found by freshports_GetPortID<br>";
        }
        $MyPort = new Port($db);
        $MyPort->FetchByID($port_id, $User->id);
        $port_display->port = $MyPort;
        $HTML .= $port_display->Display();
        $HTML .= "</TD></TR>\n</TABLE>\n\n";
        $HTML .= DisplayPortCommits($MyPort, $PageNumber);
        # If we are not reading
        if (!$BypassCache || $RefreshCache) {
            $Cache->CacheDataSet($MyPort->{'element_id'} . "\n" . $HTML);
            $Cache->AddPort($MyPort->category, $MyPort->port, CACHE_PORT_DETAIL, $PageNumber);
        }
        $ElementID = $MyPort->{'element_id'};
        $OnWatchList = $MyPort->{'onwatchlist'};
    }
    # At this point, we have the port detail HTML
    $HTML = $port_display->ReplaceWatchListToken($OnWatchList, $HTML, $ElementID);
    global $ShowAds, $BannerAd;
    global $ShowAds;
    global $BannerAd;
    if ($ShowAds && $BannerAd) {
        $HTML_For_Ad = "<hr><center>\n" . Ad_728x90PortDescription() . "\n</center>\n<hr>\n";
    } else {
        $HTML_For_Ad = '';
    }
    $HTML = $port_display->ReplaceAdvertismentToken($HTML, $HTML_For_Ad);
    freshports_ConditionalGetUnix($Cache->LastModifiedGet());
    header("HTTP/1.1 200 OK");
    $Title = $category . "/" . $port;
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php';
    freshports_Start($Title, "{$FreshPortsTitle} - new ports, applications", "FreeBSD, index, applications, ports");
    ?>


<?php 
    echo freshports_MainTable();
    ?>

<tr><TD VALIGN="top" width="100%">

<?php 
    echo freshports_MainContentTable();
    ?>

<TR>
<?php 
    echo freshports_PageBannerText("Port details");
    ?>
</TR>

<tr><td valign="top" width="100%">

<?php 
    echo $HTML;
    ?>

</TD>
  <TD VALIGN="top" WIDTH="*" ALIGN="center">
  <?php 
    echo freshports_SideBar();
    ?>
  </td>
</TR>

</TABLE>

<?php 
    echo freshports_ShowFooter();
    ?>

</body>
</html>

<?php 
    return 0;
}
Ejemplo n.º 7
0
?>
) in the
Commit History for any port, you'll see a new link.  This link is represented
by the Revision Details icon (<?php 
echo freshports_Revision_Icon();
?>
).
</P>
</TD></TR>

<?php 
echo freshports_BannerSpace();
?>
<TR>
<?php 
echo freshports_PageBannerText('Expanded search options');
?>
</TR>

<TR><TD>
<P>
The <a href="/search.php">search page</a> now allows you to search by 
the following fields.
<blockquote>
<table cellpadding="5" cellspacing="0" border="0">
<tr><td><b>Field</b></td><td><b>Origin</b></td></tr>
<tr><td>Port Name</td><td><code class="code">PORTNAME</code></td></tr>
<tr><td>Package Name</td><td><code class="code">PKGNAME</code></td></tr>
<tr><td>Latest Link</td><td><code class="code">PKGNAME</code></td></tr>
<tr><td>Maintainer</td><td><code class="code">MAINTAINER</code></td></tr>
<tr><td>Short Description</td><td><code class="code">COMMENT</code></td></tr>
Ejemplo n.º 8
0
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:searchbox-only></gcse:searchbox-only>
<!-- SiteSearch Google -->

</table>

<br>

<?php 
echo freshports_MainContentTable();
?>
  <tr>
	<?php 
echo freshports_PageBannerText("The FreshPorts Search");
?>
  </tr>
<tr><td valign="top">


<form ACTION="<?php 
echo $_SERVER["PHP_SELF"];
?>
" name="search" >
	<SELECT NAME="stype" size="1">
		<OPTION VALUE="<?php 
echo SEARCH_FIELD_NAME . '"';
if ($stype == SEARCH_FIELD_NAME) {
    echo 'SELECTED';
}
Ejemplo n.º 9
0
</TD></TR><TR><TD>&nbsp;</TD></TR>

<TR>
	<?php 
echo freshports_PageBannerText("What are these check boxes in my staging area?");
?>
</TR>
<TR><TD>
Your staging area is just a temporary situation.  You must save this information
to your watch list.  You can choose the ports you wish to watch using the
check boxes.  Only selected ports will be saved to your watch list.
</TD></TR><TR><TD>&nbsp;</TD></TR>

<TR>
	<?php 
echo freshports_PageBannerText("Why would I want to clear my staging area?");
?>
</TR>
<TR><TD>
You cannot upload anything to your staging area unless it is empty.  If you 
don't wish to save the data to your watch list, you must first clear
your staging area before uploading again.
</TD></TR>


	
</TABLE>
</TD>

  <TD VALIGN="top" WIDTH="*" ALIGN="center">
	<?php 
Ejemplo n.º 10
0
FreshPorts will notify you of any problems it encounters when processing a port change
which you committed.  In the past, such problems are related to syntax errors in the Makefile.
</P>

<P>
One committer referred to this service as a automated nagging mentor...
</P>
</TD></TR>

<?php 
echo freshports_BannerSpace();
?>

<TR>
	<?php 
echo freshports_PageBannerText("Your opt-in status");
?>
</TR>

<TR><TD>
<P>
<?php 
if (!empty($visitor)) {
    $sql = "select committer\n\t\t\t  from committer_notify\n\t\t\t where user_id = {$User->id}";
    if ($Debug) {
        echo "sql={$sql}<br>\n";
    }
    $result = pg_exec($db, $sql) or die("determine committer query failed " . pg_errormessage());
    if ($result) {
        echo 'You are: ';
        if ($Debug) {
Ejemplo n.º 11
0
<BR>';
}

if (!IsSet($submit) && !$errors) {
  // provide default values for an empy form.
  require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php');
}

</script>

<?php 
echo freshports_MainContentTable();
?>
      <TR>
		<?php 
echo freshports_PageBannerText("New User Details");
?>
      </TR>
      <TR>
        <TD>

<P><BIG><BIG>Please observe the following points:</BIG></BIG>

<ul>
<li>
You must supply a valid email address. Instructions to enable your account 
will be emailed to you at that address.

<li>If you have a spam filter, please allow all
mail from <CODE CLASS="code">unixathome.org</CODE> and <CODE CLASS="code">freshports.org</CODE>.
Ejemplo n.º 12
0
freshports_Start('Privacy Policy', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
?>
	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable();
?>


<TR>
	<?php 
echo freshports_PageBannerText('Privacy statement');
?>
</TR>
<TR><TD>

<CENTER>
<?php 
if ($ShowAds) {
    echo Ad_728x90();
}
?>
</CENTER>

<P>All the information we
    gather is for our own use.  We do not release it to anyone else.</P>
    <P>For example, when you subscribe to our mailing list, we
Ejemplo n.º 13
0
	<script src="jquery.flot.pack.js"></script>
	<script src="graphs.js"></script>

	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable();
?>

<TR>
	<?php 
echo freshports_PageBannerText("Statistics - everyone loves a graph");
?>
</TR>

<TR><TD>
<P>
All of these graphs require javascript.  Please select the graph you would like to view from the dropdown.
</P>
<P>
If you have suggestions for graphs, please submit them via the forum.
</P>

<center>
<?php 
if ($ShowAds) {
    echo Ad_728x90();
Ejemplo n.º 14
0
freshports_ConditionalGet(freshports_LastModified());
freshports_Start('The Authors', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
?>
	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable();
?>

  <tr>
	<?php 
echo freshports_PageBannerText("About the authors");
?>
  </tr>
<TR><TD>
<CENTER>
<?php 
if ($ShowAds) {
    echo Ad_728x90();
}
?>
</CENTER>

<p><a href="http://www.langille.org/">Dan Langille</a> thought up the idea, found the data sources, bugged people to 
write scripts, and did the html and database work. But he certainly didn't 
do it alone.</p>
Ejemplo n.º 15
0
    function CreateHTML($WhichRepo)
    {
        global $TableWidth;
        global $freshports_CommitMsgMaxNumOfLinesToShow;
        global $DaysMarkedAsNew;
        $this->HTML = '';
        if (!$this->ResultSet) {
            die("read from database failed");
            exit;
        }
        $NumRows = pg_numrows($this->ResultSet);
        if ($this->Debug) {
            echo __FILE__ . ':' . __LINE__ . " Number of rows = {$NumRows}<br>\n";
        }
        if (!$NumRows) {
            $this->HTML = "<TR><TD>\n<P>Sorry, nothing found in the database....</P>\n</td></tr>\n";
            return $this->HTML;
        }
        $this->HTML .= '
<table border="1" width="100%" CELLSPACING="0" CELLPADDING="5">
<TR>
';
        switch ($NumRows) {
            case 0:
                $title = 'no files found';
                break;
            case 1:
                $title = '1 file found';
                break;
            default:
                $title = $NumRows . ' files found';
        }
        $this->HTML .= freshports_PageBannerText($title, 4);
        $this->HTML .= "\n\t\t<TR>\n\t\t\t<TD><b>Action</b></TD><TD><B>Revision</B></TD><td><b>Links</b></td><TD><b>File</b></TD>\n\t\t</TR>\n";
        for ($i = 0; $i < $NumRows; $i++) {
            $myrow = pg_fetch_array($this->ResultSet, $i);
            $this->HTML .= "<TR>\n";
            switch ($myrow["change_type"]) {
                case "M":
                    $Change_Type = "modify";
                    break;
                case "A":
                    $Change_Type = "import";
                    break;
                case "R":
                    $Change_Type = "remove";
                    break;
                default:
                    $Change_Type = $myrow["change_type"];
            }
            $this->HTML .= "  <TD>" . $Change_Type . "</TD>";
            $this->HTML .= '  <TD>' . $myrow["revision_name"];
            $this->HTML .= "</TD>";
            $this->HTML .= '<td>';
            if ($Change_Type == "modify") {
                switch ($WhichRepo) {
                    case FREEBSD_REPO_CVS:
                        $this->HTML .= ' ';
                        $previousRevision = $this->GetPreviousRevision($myrow["revision_name"]);
                        $this->HTML .= freshports_cvsweb_Diff_Link($myrow["pathname"], $previousRevision, $myrow["revision_name"]);
                        break;
                    case FREEBSD_REPO_SVN:
                        $this->HTML .= ' ';
                        $previousRevision = $this->GetPreviousRevision($myrow["revision_name"]);
                        # we want something like http://svnweb.freebsd.org/ports/head/www/p5-App-Nopaste/Makefile?r1=300951&r2=300950&pathrev=300951
                        $this->HTML .= ' <A HREF="http://' . $myrow['svn_hostname'] . $myrow["pathname"] . '?r1=' . $myrow["revision_name"] . '&amp;r2=' . $previousRevision . '&amp;pathrev=' . $myrow["revision_name"] . '">';
                        $this->HTML .= freshports_Diff_Icon() . '</a> ';
                        break;
                }
            }
            switch ($WhichRepo) {
                case FREEBSD_REPO_CVS:
                    $this->HTML .= freshports_cvsweb_Annotate_Link($myrow["pathname"], $myrow["revision_name"]);
                    break;
                case FREEBSD_REPO_SVN:
                    # we want something like
                    # http://svn.freebsd.org/ports/head/x11-wm/awesome/Makefile
                    $this->HTML .= ' <A HREF="http://' . $myrow['svn_hostname'] . $myrow["pathname"] . '?annotate=' . $myrow["revision_name"] . '">';
                    $this->HTML .= freshports_Revision_Icon() . '</a> ';
                    break;
                default:
                    $this->HTML .= 'unknown: \'' . htmlentities($WhichRepo) . '\'';
            }
            $this->HTML .= '</td>';
            $this->HTML .= '  <TD WIDTH="100%" VALIGN="middle">';
            switch ($WhichRepo) {
                case FREEBSD_REPO_CVS:
                    $this->HTML .= freshports_cvsweb_Revision_Link($myrow["pathname"], $myrow["revision_name"]);
                    break;
                case FREEBSD_REPO_SVN:
                    # we want something like
                    # http://svnweb.freebsd.org/ports/head/textproc/bsddiff/Makefile?view=log#rev300953
                    $this->HTML .= ' <A HREF="http://' . $myrow['svn_hostname'] . $myrow["pathname"] . '?view=log#rev' . $myrow["revision_name"] . '">';
                    break;
            }
            $this->HTML .= '<CODE CLASS="code">' . $myrow["pathname"] . "</CODE></A></TD>";
            $this->HTML .= "</TR>\n";
        }
        $this->HTML .= "</table>";
        return $this->HTML;
    }
Ejemplo n.º 16
0
<A HREF="<?php 
echo MAILTO;
?>
:freebsd-ports&#64;freebsd.org">FreeBSD Ports mailing list</A>.  We do not maintain ports.  We do not
create ports.  We do not fix ports.  We just tell you what others have been doing to the Ports tree.
</P>

</TD></TR>

	<?php 
echo freshports_BannerSpace();
?>

<TR>
	<?php 
echo freshports_PageBannerText("OK, whose bright idea was this?");
?>
</TR>

<TR><TD>
<P>This site was created by Dan Langille.  His other web feats include 
<A HREF="http://www.freebsddiary.org/">The FreeBSD Diary</A>, <a 
href="http://www.racingsystem.com">The Racing System</A>, 
<a href="http://www.bsdcan.org/">BSDCan</a>, and an ability
to avoid reading the inane comments on <A HREF="http://slashdot.org">slashdot</A>.
But Dan didn't create the site all by himself.  Have a look at <A HREF="authors.php">
About the Authors</A> for details of who else helped.</P>
</TD></TR>

</TABLE>
</TD>
Ejemplo n.º 17
0
$DisplayCommit->Debug = $Debug;
$DisplayCommit->SetUserID($User->id);
$links = $Pager->GetLinks();
$HTML .= $NumPortsFound . ' ' . $links['all'];
$HTML .= $DisplayCommit->CreateHTML();
if ($db) {
    ?>
<TR><TD VALIGN="top" WIDTH="100%">

<?php 
    echo freshports_MainContentTable();
    ?>

<TR>
<?php 
    echo freshports_PageBannerText("My flagged commits", 3);
    ?>
        <?php 
    //echo ($StartAt + 1) . " - " . ($StartAt + $MaxNumberOfPortsLong)
    ?>
</TR>
<TR><TD>
<p><?php 
    echo EVERYTHING;
    ?>
<p>
A port is marked as new for 10 days.

<?php 
    if ($ShowAds && $BannerAd) {
        echo "</td></tr>\n<tr><td>\n<CENTER>\n";
Ejemplo n.º 18
0
    }
}
?>
	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable(NOBORDER);
# article table start
?>
  <tr>
	<?php 
echo freshports_PageBannerText("Watch List - categories");
?>
  </tr>
<tr><td valign="top" width="100%">


<table width="100%" border="0">
<?php 
# list of categories table start
?>
<tr><td>
This screen contains a list of the port categories. A * indicates a category that contains ports which are
on your watch list. When a port changes in one of your watch categories, you will be notified by email if you have selected a 
notification frequency within your <a href="customize.php">personal preferences</a>.

<p>
Ejemplo n.º 19
0
if (isset($_REQUEST['update'])) {
    $Category->{description} = pg_escape_string($_REQUEST['description']);
    $Category->UpdateDescription();
}
freshports_Start($Title . ' - ' . $CategoryName, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
?>
<TABLE WIDTH="<?php 
echo $TableWidth;
?>
" BORDER="0" ALIGN="center">
<TR><TD VALIGN="top" WIDTH="100%">
<TABLE WIDTH="100%" BORDER="0">

<TR>
	<?php 
echo freshports_PageBannerText($Title . ' - ' . $CategoryName);
?>
</TR>
<TR><TD>
<p>
<?php 
if ($User->IsTaskAllowed(FRESHPORTS_TASKS_CATEGORY_VIRTUAL_DESCRIPTION_SET)) {
    ?>
This page allows you to maintain a category, if you have permission to do so.


<p>

<?php 
    if (!$IsPrimary) {
        echo '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" NAME=f>';
Ejemplo n.º 20
0
if (Is_Numeric($dailysummary)) {
    $dailysummary = min($NumberOfDays, max(0, $dailysummary));
} else {
    unset($dailysummary);
}
if ($db) {
    ?>
<TR><TD VALIGN="top" WIDTH="100%">

<?php 
    echo freshports_MainContentTable();
    ?>

<TR>
<?php 
    echo freshports_PageBannerText("{$MaxNumberOfPortsLong} most recent commits", 3);
    ?>
        <?php 
    //echo ($StartAt + 1) . " - " . ($StartAt + $MaxNumberOfPortsLong)
    ?>
</TR>
<TR><TD>
<p><?php 
    echo EVERYTHING;
    ?>
<p>
A port is marked as new for 10 days.

<?php 
    if ($ShowAds && $BannerAd) {
        echo "</td></tr>\n<tr><td>\n<CENTER>\n";
Ejemplo n.º 21
0
Some categories have a very large number of ports.  This can make loading
the page very slow, especially for those on dial up.  Therefore, we've introduced
paging to the <a href="/categories.php">categories</a> page.

<p>
You can set the paging length via the 
<a href="/customize.php">customization</> page.
</P>
</TD></TR>

<?php 
echo freshports_BannerSpace();
?>
<TR>
<?php 
echo freshports_PageBannerText("Faster pages");
?>
</TR>

<TR><TD>
<P>
Much work has gone into finding faster ways to extract data
from the FreshPorts database.  Thanks to the amazing capabilities
of <a href="http://www.postgresql.org/">PostgreSQL</a>, I've been able
to create very fast queries through the use of nested queries, outer
joins, and static functions.

<p>
These changes to the web pages have enabled the removal of a housekeeping
process which used to refresh a hidden caching table.  Most webpages used
this cache table.  Instead, they now access the main tables directly.  This
Ejemplo n.º 22
0
function freshports_NonPortDescription($db, $element_record)
{
    global $TableWidth;
    global $FreshPortsTitle;
    $Debug = 1;
    freshports_ConditionalGet(freshports_LastModified());
    header("HTTP/1.1 200 OK");
    $Title = preg_replace('|^/?ports/|', '', $element_record->element_pathname);
    $FileName = preg_replace('|^/?ports/|', '', $element_record->element_pathname);
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php';
    freshports_Start($Title, "{$FreshPortsTitle} - new ports, applications", "FreeBSD, index, applications, ports");
    ?>

	<?php 
    echo freshports_MainTable();
    ?>

	<tr><td valign="top" width="100%">

	<?php 
    echo freshports_MainContentTable();
    ?>
<TR>
<?php 
    echo freshports_PageBannerText('non port: ' . $Title);
    ?>
</TR>
<tr><td>
<a HREF="<?php 
    echo FRESHPORTS_FREEBSD_SVN_URL . $element_record->element_pathname;
    ?>
?view=log">SVNWeb</a>
</td></tr>

<?php 
    global $User;
    # these two options must be the last on the line.  And as such are mutually exclusive
    define('BYPASSCACHE', 'bypasscache=1');
    # do not read the cache for display
    define('REFRESHCACHE', 'refreshcache=1');
    # refresh the cache
    $BypassCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(BYPASSCACHE)) == BYPASSCACHE;
    $RefreshCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(REFRESHCACHE)) == REFRESHCACHE;
    $PageNumber = 1;
    if (isset($_SERVER['REDIRECT_QUERY_STRING'])) {
        parse_str($_SERVER['REDIRECT_QUERY_STRING'], $query_parts);
        if (isset($query_parts['page']) && Is_Numeric($query_parts['page'])) {
            $PageNumber = intval($query_parts['page']);
            if ($PageNumber != $query_parts['page'] || $PageNumber < 1) {
                $PageNumber = 1;
            }
        }
    }
    $NumCommitsPerPage = $User->page_size;
    $Cache = new CacheFile();
    $Cache->PageSize = $User->page_size;
    $result = $Cache->Retrieve($FileName, $PageNumber);
    if (!$result && !$BypassCache && !$RefreshCache) {
        if ($Debug) {
            echo "found something from the cache<br>\n";
        }
        $HTML = $Cache->CacheDataGet();
        #
        # we need to know the element_id of this port
        # and the whether or not it is on the person's watch list
        # let's create a special function for that!
        #
        $EndOfFirstLine = strpos($HTML, "\n");
        if ($EndOfFirstLine == false) {
            die('Internal error: I was expecting an ElementID and found nothing');
        }
        # extract the ElementID from the cache
        $ElementID = intval(substr($HTML, 0, $EndOfFirstLine));
        if ($ElementID == 0) {
            syslog(LOG_ERR, "Extract of ElementID from cache failed.  Is cache corrupt/deprecated? port was {$category}/{$port}");
            die('sorry, I encountered a problem with the cache.  Please send the URL and this message to the webmaster.');
        }
        if ($User->id) {
            $OnWatchList = freshports_OnWatchList($db, $User->id, $ElementID);
        } else {
            $OnWatchList = 0;
        }
        $HTML = substr($HTML, $EndOfFirstLine + 1);
    } else {
        if ($Debug) {
            echo "found NOTHING in cache<br>\n";
        }
        $HTML = '';
        $Commits = new CommitsByTreeLocation($db);
        $Commits->SetLimit($Cache->PageSize);
        $Commits->Debug = $Debug;
        $Commits->UserIDSet($User->id);
        $Commits->TreePathConditionSet("= '" . $element_record->element_pathname . "'");
        #
        # get the count without excuting the whole query
        # we don't want to pull back all the data.
        #
        $NumCommits = $Commits->GetCountCommits();
        $params = array('mode' => 'Sliding', 'perPage' => $NumCommitsPerPage, 'delta' => 5, 'totalItems' => $NumCommits, 'urlVar' => 'page', 'currentPage' => $PageNumber, 'spacesBeforeSeparator' => 1, 'spacesAfterSeparator' => 1, 'append' => false, 'path' => '/' . preg_replace('|^/?ports/|', '', $element_record->element_pathname), 'fileName' => '?page=%d', 'altFirst' => 'First Page', 'firstPageText' => 'First Page', 'altLast' => 'Last Page', 'lastPageText' => 'Last Page');
        $Pager =& Pager::factory($params);
        $links = $Pager->GetLinks();
        $NumCommitsHTML = '<tr><td><p align="left">Number of commits found: ' . $NumCommits;
        $Offset = 0;
        $PageLinks = $links['all'];
        $PageLinksHTML = str_replace('/?page=1"', '"', $PageLinks);
        $PageLinksHTML = str_replace('/?page=', '?page=', $PageLinksHTML);
        if ($PageLinksHTML != '') {
            $offset = $Pager->getOffsetByPageId();
            $NumOnThisPage = $offset[1] - $offset[0] + 1;
            $Offset = $offset[0] - 1;
            $NumCommitsHTML .= " (showing only {$NumOnThisPage} on this page)";
            unset($offset);
        }
        if ($PageNumber > 1) {
            $Commits->SetOffset($Offset);
        }
        $NumCommitsHTML .= '</p>';
        if ($PageLinksHTML != '') {
            $PageLinksHTML = '<p align="center">' . $PageLinksHTML . '</p>';
        }
        $NumCommitsHTML .= $PageLinksHTML . '</td></tr>';
        $HTML = $NumCommitsHTML;
        if ($Commits->Debug) {
            echo "PageNumber='{$PageNumber}'<br>Offset='{$Offset}'<br>";
        }
        $NumFetches = $Commits->Fetch();
        $DisplayCommit = new DisplayCommit($db, $Commits->LocalResult);
        $HTML .= $DisplayCommit->CreateHTML();
        $HTML .= $NumCommitsHTML;
        # If we are not reading
        if (!$BypassCache || $RefreshCache) {
            $Cache->CacheDataSet($element_record->{'id'} . "\n" . $HTML);
            $Cache->Add($FileName, $PageNumber);
        }
    }
    echo $HTML;
    echo "</table>\n";
    ?>

</TD>
  <TD VALIGN="top" WIDTH="*" ALIGN="center">
  <?php 
    echo freshports_SideBar();
    ?>
  </td>
</TR>

</TABLE>

<?php 
    echo freshports_ShowFooter();
    ?>

</body>
</html>

<?php 
}
Ejemplo n.º 23
0
#
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php';
freshports_ConditionalGet(freshports_LastModified());
freshports_Start('In The News', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
?>
	<?php 
echo freshports_MainTable();
?>
<tr><td valign="top" width="100%">
<table width="100%" border="0">
  <tr>
	<?php 
echo freshports_PageBannerText("In the news");
?>
  </tr>

<TR>
<TD VALIGN="top">
<p>This page is just a place for me to record the <?php 
echo $FreshPortsTitle;
?>
 articles which appear
on other sites.  Links are recorded in reverse chronological order (i.e. newest first).
</p>
<p>
BSD Today - <a href="http://www.bsdtoday.com/2000/May/News146.html">Keeping track of your favorite ports</a>
</p>
}
$ErrorMessage .= CheckForNoDefaultAndAddToDefault($db, $User);
?>

	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable();
?>
<TR>
	<?php 
echo freshports_PageBannerText("Watch list maintenance");
?>
</TR>

<?php 
if ($ErrorMessage != '') {
    echo freshports_ErrorMessage("Let's try that again!", $ErrorMessage);
}
?>
<tr><td>
<table WIDTH="100%" BORDER="0">
<tr><td valign="top">

<form action="<?php 
echo $_SERVER["PHP_SELF"];
?>
Ejemplo n.º 25
0
    }
    pg_exec($db, $CommitOrRollback);
}
?>
	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable();
?>
<TR>
	<?php 
echo freshports_PageBannerText("Unrefreshed ports");
?>
</TR>
<tr><td>
This is a list of ports in our database which need to be refreshed.
Ports in our datbase which need refreshing do not match what's in the ports tree.  The most common reason
for this situation is a port error.

<?php 
freshports_DisplayUnrefreshedPorts($db);
?>

</td></tr>
</table>
</td>
Ejemplo n.º 26
0
        $ResultConfirm = $row[0];
    } else {
        echo pg_errormessage() . $sql;
    }
}
?>


<?php 
echo freshports_MainTable();
?>
<tr><td VALIGN=TOP width="100%">
<TABLE WIDTH="100%">
<TR>
	<?php 
echo freshports_PageBannerText("Account confirmation");
?>
</TR>

<TR><TD>
<P>
<?php 
if ($Debug) {
    echo $ResultConfirm;
}
switch ($ResultConfirm) {
    case 0:
        echo "I don't know anything about that token.";
        break;
    case 1:
        echo 'Your account has been enabled.  Please proceed to the <A HREF="login.php">login page</A>';
Ejemplo n.º 27
0
function freshports_UpdatingOutput($NumRowsUpdating, $PortsUpdating, $port)
{
    $HTML = '';
    if ($NumRowsUpdating > 0) {
        $HTML .= '<TABLE BORDER="1" width="100%" CELLSPACING="0" CELLPADDING="5">' . "\n";
        $HTML .= "<TR>\n";
        $HTML .= freshports_PageBannerText("Notes from UPDATING", 1);
        $HTML .= "<tr><td>\n";
        $HTML .= "These upgrade notes are taken from <a href=\"/UPDATING\">/usr/ports/UPDATING</a>";
        $HTML .= "<ul>\n";
        for ($i = 0; $i < $NumRowsUpdating; $i++) {
            $PortsUpdating->FetchNth($i);
            $HTML .= '<li>' . freshports_PortsUpdating($port, $PortsUpdating) . "</li>\n";
        }
        $HTML .= "</ul>\n";
        $HTML .= "</td></tr>\n";
        $HTML .= "</table>\n";
    }
    return $HTML;
}
Ejemplo n.º 28
0
</tr>
<tr><td>

<p>You are a registered user. You have indicated that we can send you email.  This will either
be part of your watch list notifications or as an announcement.  You can view these settings
on the customization page (see the link on the right hand side of the page).</p>

<p>The problem is that the email we are sending you is not getting to you.  It is bouncing back
to us.  So we have stopped sending out messages to you.  If you wish to continue to receive such
messages, you should update your email address on the customization page.</p>
</td></tr>
<TR><TD HEIGHT="20">
</TD></TR>
<tr>
<?php 
echo freshports_PageBannerText("How to fix the problem");
?>
</tr>
<tr><td>
<p>There are two things which might have caused your email to bounce:</p>
<ol>
  <li>Your email address has changed.</li>
  <li>There was a problem with your email but it's been fixed.</li>
</ol>

<p>If your email address has changed, please update it on the <a href="customize.php">customize</a> page.</p>

<p>If there was a problem with your email, such as your server was down, you can 
tell FreshPorts that you want it to start using your email address again by pressing 
the button below.</p>
Ejemplo n.º 29
0
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php';
freshports_Start('New User', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
$origin = $_GET["origin"];
?>
	<?php 
echo freshports_MainTable();
?>

	<tr><td valign="top" width="100%">

	<?php 
echo freshports_MainContentTable();
?>
  <TR>
	<?php 
echo freshports_PageBannerText("Account created");
?>
  </TR>
	<TR>
	<TD>
	<P>
	Your account has been created.
	</P>

	<P>
	You should soon receive an email at the mail address you supplied.
	It will contain instructions to enable your account.

	<P>
	If you do not receive that email, please attempt to login and you
	will have an opportunity to resend the notification.
Ejemplo n.º 30
0
function freshports_CategoryDisplay($db, $category, $PageNo = 1, $PageSize = DEFAULT_PAGE_SIZE)
{
    global $TableWidth;
    global $User;
    header('HTTP/1.1 200 OK');
    $Debug = 0;
    if (isset($_SERVER['REDIRECT_QUERY_STRING'])) {
        if (isset($_SERVER["REDIRECT_QUERY_STRING"])) {
            parse_str($_SERVER['REDIRECT_QUERY_STRING'], $query_parts);
            if (isset($query_parts['page'])) {
                $PageNo = $query_parts['page'];
            }
            if (isset($query_parts['page_size'])) {
                $PageSize = $query_parts['page_size'];
            }
        }
    }
    if (!isset($page) || $page == '') {
        $page = 1;
    }
    if (!isset($page_size) || $page_size == '') {
        $page_size = $User->page_size;
    }
    if ($Debug) {
        echo "\$page      = '{$page}'<br>\n";
        echo "\$page_size = '{$page_size}'<br>\n";
    }
    SetType($PageNo, "integer");
    SetType($PageSize, "integer");
    if (!isset($PageNo) || !str_is_int("{$PageNo}") || $PageNo < 1) {
        $PageNo = 1;
    }
    if (!isset($PageSize) || !str_is_int("{$PageSize}") || $PageSize < 1 || $PageSize > MAX_PAGE_SIZE) {
        $PageSize = DEFAULT_PAGE_SIZE;
    }
    if ($Debug) {
        echo "\$PageNo   = '{$PageNo}'<br>\n";
        echo "\$PageSize = '{$PageSize}'<br>\n";
    }
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/categories.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/watch_lists.php';
    if ($category->IsPrimary()) {
        $WatchLists = new WatchLists($db);
        $WatchListCount = $WatchLists->IsOnWatchList($User->id, $category->element_id);
    }
    $title = $category->{'name'};
    # find out how many ports are in this category
    $PortCount = $category->PortCount($category->name);
    global $User;
    if ($Debug) {
        echo "\$User->id='{$User->id}'";
    }
    freshports_Start($title, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
    $port = new Port($db);
    $numrows = $port->FetchByCategoryInitialise($category->name, $User->id, $PageSize, $PageNo);
    ?>

	<?php 
    echo freshports_MainTable();
    ?>

	<tr><td valign="top" width="100%">

	<?php 
    echo freshports_MainContentTable();
    ?>

		<tr>
		 <?php 
    echo freshports_PageBannerText('Category listing - ' . $category->{'name'});
    ?>
		</tr>

	<tr><td>
<?php 
    if ($category->IsPrimary()) {
        if ($WatchListCount) {
            echo freshports_Watch_Link_Remove('', 0, $category->{'element_id'});
        } else {
            echo freshports_Watch_Link_Add('', 0, $category->{'element_id'});
        }
    }
    ?>
	
<BIG><BIG><B><?php 
    echo $category->{'description'};
    ?>
</B></BIG></BIG>- Number of ports in this category: <?php 
    echo $PortCount;
    ?>
<p>
	Ports marked with a <sup>*</sup> actually reside within another category but
	have <b><?php 
    echo $category->{'name'};
    ?>
</b> listed as a secondary category.

<?php 
    global $ShowAds, $BannerAd;
    if ($ShowAds && $BannerAd) {
        echo "<br><center>\n" . Ad_728x90() . "\n</center>\n";
    }
    echo '<div align="center"><br>';
    freshports_CategoryNextPreviousPage($category->name, $PortCount, $PageNo, $PageSize);
    echo '</div>';
    ?>
	</td></tr>

<?php 
    if ($Debug) {
        echo "\$CategoryID = '{$CategoryID}'<BR>\n";
        echo "GlobalHideLastChange = {$GlobalHideLastChange}<BR>\n";
        echo "\$numrows = {$numrows}<BR>\n";
    }
    $ShowShortDescription = "Y";
    $HTML = freshports_echo_HTML("<TR>\n<TD>\n");
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/port-display.php';
    $port_display = new port_display($db, $User);
    $port_display->SetDetailsCategory();
    for ($i = 0; $i < $numrows; $i++) {
        $port->FetchNth($i);
        $port_display->port = $port;
        $Port_HTML = $port_display->Display();
        $HTML .= $port_display->ReplaceWatchListToken($port->{'onwatchlist'}, $Port_HTML, $port->{'element_id'});
    }
    // end for
    echo $HTML;
    ?>
</TD></TR>
<TR><TD>
<div align="center"><br>
<?php 
    freshports_CategoryNextPreviousPage($category->name, $PortCount, $PageNo, $PageSize);
    ?>
</div> 
</TD></TR>
</TABLE>
  <TD VALIGN="top" WIDTH="*" ALIGN="center">
  <?php 
    echo freshports_SideBar();
    ?>
  </td>
</TR>
</TABLE>

<?php 
    echo freshports_ShowFooter();
    ?>

	</body>
	</html>

	<?php 
}