Changeset 15457 for trunk/www/ru


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/ru/includes/functions.inc

    r8271 r15457  
    11<?php
    22
    3 # $Id: functions.inc,v 1.1 2004/09/13 23:01:04 matt Exp $
     3# $Id: functions.inc,v 1.2 2005/12/12 18:56:59 matt Exp $
    44# Copyright (c) 2003, OpenDarwin
    55
     
    254254}
    255255
     256######################################################################
     257
     258# print the number or available ports
     259function print_available_ports() {
     260        global $connect;
     261       
     262        $result = mysql_query("SELECT count(*) from darwinports.portfiles");
     263        if ($result) {
     264                $row = mysql_fetch_array($result);
     265                $count = $row[0];
     266                echo $count;
     267        } else {
     268                $count = 0;
     269        }
     270}
     271
    256272?>
Note: See TracChangeset for help on using the changeset viewer.