Changeset 15457 for trunk/www


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

Submitted by: matt@
Reviewed by: mij@

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

Location:
trunk/www
Files:
8 edited

Legend:

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

    r8291 r15457  
    1         <?php
    2 
    3 # $Id: functions.inc,v 1.2 2004/09/14 18:05:17 matt Exp $
     1<?php
     2
     3# $Id: functions.inc,v 1.3 2005/12/12 18:56:59 matt Exp $
    44# Copyright (c) 2004, OpenDarwin
    55
     
    250250                        }
    251251                }
     252
     253######################################################################
     254
     255# print the number or available ports
     256function print_available_ports() {
     257        global $connect;
    252258       
    253         ?>
     259        $result = mysql_query("SELECT count(*) from darwinports.portfiles");
     260        if ($result) {
     261                $row = mysql_fetch_array($result);
     262                $count = $row[0];
     263                echo $count;
     264        } else {
     265                $count = 0;
     266        }
     267}
     268       
     269?>
  • trunk/www/es/index.php

    r8291 r15457  
    1313                        Darwin, Mac OS X, FreeBSD o Linux.</p>
    1414
    15                         <p>En la actualidad hay unos cuantos cientos de <a href="/es/ports/">portes</a>
     15                        <p>En la actualidad hay <? print_available_ports(); ?> <a href="/es/ports/">portes</a>
    1616                        completados y usables, mientras que más son agregados regularmente. Usted
    1717                        puede conocer sobre los portes recientemente añadidos al susbcribirse a la
  • trunk/www/fr/includes/functions.inc

    r15334 r15457  
    11<?php
    22
    3 # $Id: functions.inc,v 1.8 2005/12/06 18:40:32 matt Exp $
     3# $Id: functions.inc,v 1.9 2005/12/12 18:56:59 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?>
  • trunk/www/fr/index.php

    r14358 r15457  
    1818       
    1919        <p>
    20         Il y a actuellement environ 2800 <a href="/fr/ports/">ports</a> opérationnels et
    21         disponibles, mais d'autres seront bientôt ajoutés régulièrement. Vous pouvez
     20        Il y a actuellement <? print_available_ports(); ?> <a href="/fr/ports/">ports</a>opérationnels
     21        et disponibles, mais d'autres seront bientôt ajoutés régulièrement. Vous pouvez
    2222        prendre connaissance des ports récemment ajoutés en souscrivant à la liste de
    2323        discussion <a href="http://www.opendarwin.org/mailman/listinfo/cvs-darwinports-all">
  • 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?>
  • trunk/www/index.php

    r14354 r15457  
    1515        <a href="http://developer.apple.com/darwin/projects/darwin/">Darwin</a>)</p>
    1616
    17       <p>There are currently about 2800 completed and usable <a
     17      <p>There are currently about <? print_available_ports(); ?> completed and usable <a
    1818        href="/ports/">ports</a>, with more being added on a regular basis.
    1919        You can track recently added ports by subscribing to the <a
  • trunk/www/it/includes/functions.inc

    r15388 r15457  
    11<?php
    22
    3 # $Id: functions.inc,v 1.3 2005/12/09 15:20:31 riccardo Exp $
     3# $Id: functions.inc,v 1.4 2005/12/12 18:56:59 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?>
  • 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.