Changeset 15457 for trunk/www/includes


Ignore:
Timestamp:
Dec 12, 2005, 6:57:00 PM (15 years ago)
Author:
matt
Message:

Submitted by: matt@
Reviewed by: mij@

Adding a function to automate the update of the
number of ports available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/includes/functions.inc

    r15333 r15457  
    11<?php
    22
    3 # $Id: functions.inc,v 1.5 2005/12/06 18:25:03 mww Exp $
     3# $Id: functions.inc,v 1.6 2005/12/12 18:56:58 matt Exp $
    44# Copyright (c) 2003, OpenDarwin
    55
     
    276276}
    277277
    278 
     278######################################################################
     279
     280# print the number or available ports
     281function print_available_ports() {
     282        global $connect;
     283       
     284        $result = mysql_query("SELECT count(*) from darwinports.portfiles");
     285        if ($result) {
     286                $row = mysql_fetch_array($result);
     287                $count = $row[0];
     288                echo $count;
     289        } else {
     290                $count = 0;
     291        }
     292}
    279293
    280294?>
Note: See TracChangeset for help on using the changeset viewer.