Changeset 56622


Ignore:
Timestamp:
Aug 31, 2009, 2:57:23 AM (11 years ago)
Author:
jmpp@…
Message:

Glue code to show per port licensing information on the ports.php page, disabled for the time being
until problem 1) explained in r56620 is worked out and the revised PortIndex2MySQL.tcl script is run
at least once on the server with the 'create_tables' variable set to true, to create the necessary table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/ports.php

    r48228 r56622  
    4747                <option value="variant"<?php if ($by == 'variant') { print ' selected="selected"'; } ?>>Variant</option>
    4848                <option value="platform"<?php if ($by == 'platform') { print ' selected="selected"'; } ?>>Platform</option>
     49<!--                <option value="license"<?php if ($by == 'license') { print ' selected="selected"'; } ?>>License</option> -->
    4950            </select>
    5051            <input type="text" name="substr" size="40" />
     
    110111            $criteria = "pl.portfile = p.name AND pl.platform = '" . mysql_real_escape_string($substr) . "'";
    111112            break;
     113/*
     114        case 'license':
     115            $tables .= ", $portsdb_name.licenses AS lc";
     116            $criteria = "lc.portfile = p.name AND lc.license = '" . mysql_real_escape_string($substr) . "'";
     117            break;
     118*/
    112119        case 'all':
    113120            $criteria = '';
     
    171178                print htmlspecialchars($row['description']) . '<br />';
    172179               
     180                /* Licenses */
     181                $nquery = "SELECT license FROM $portsdb_name.licenses WHERE portfile='" . mysql_real_escape_string($row['name']) .
     182                "' ORDER BY license";
     183                $nresult = mysql_query($nquery);
     184                if ($nresult && mysql_num_rows($nresult) > 0) {
     185                    print '<i>Licenses:</i> ';
     186                    while ($nrow = mysql_fetch_row($nresult)) {
     187                        print "<a href=\"$_SERVER[PHP_SELF]?by=license&amp;substr=" . urlencode($nrow[0]) . '">'
     188                        . htmlspecialchars($nrow[0]) . '</a> ';
     189                    }
     190                    print "<br />";
     191                }
     192
    173193                /* Maintainers */
    174194                $nquery = "SELECT maintainer FROM $portsdb_name.maintainers WHERE portfile='" . mysql_real_escape_string($row['name']) .
     
    240260                    }
    241261                }
     262
    242263                print '<br /><br /></dd>';
    243                
    244264            } /* while (listing of macthing ports) */
    245265            print '</dl>';
Note: See TracChangeset for help on using the changeset viewer.