Changeset 17222


Ignore:
Timestamp:
Sep 6, 2001, 5:02:18 AM (24 years ago)
Author:
bird
Message:

Design notes.

Location:
tags/trunk/tools/database/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/tools/database/www/Odin32DB.phtml

    r17219 r17222  
    8686        $authordll = -1;
    8787}
     88else if (isset($designnoterefcode))
     89{   /* Author by refcode */
     90    $sCategory      = "designnote";
     91    $sCategoryName  = "Design Note";
     92    if ($designnoterefcode != "")
     93        $iRefcode = (int)$designnoterefcode;
     94}
    8895else if (isset($dlls))
    8996{   /* All dlls */
    90     $sCategory      = "dll";
    91     $sCategoryName  = "Dlls";
     97    $sCategory      = "dlls";
     98    $sCategoryName  = "All Dlls";
     99    $sDllType = 'A';
    92100}
    93101else if (isset($internal))
    94102{   /* All Internal Dlls */
    95     $sCategory      = "dll";
     103    $sCategory      = "dlls";
    96104    $sCategoryName  = "Internal Dlls";
     105    $sDllType = 'I';
    97106}
    98107else if (isset($support))
    99108{   /* All dlls */
    100     $sCategory      = "dll";
     109    $sCategory      = "dlls";
    101110    $sCategoryName  = "Support Stuff";
     111    $sDllType = 'S';
    102112}
    103113else if (isset($tools))
    104 {   /* All dlls */
    105     $sCategory      = "dll";
     114{   /* Tools */
     115    $sCategory      = "dlls";
    106116    $sCategoryName  = "Tools";
     117    $sDllType = 'T';
    107118}
    108119else if (isset($apigroups))
     
    115126    $sCategory      = "authors";
    116127    $sCategoryName  = "Authors";
     128}
     129else if (isset($design))
     130{   /* All authors */
     131    $sCategory      = "designnotes";
     132    $sCategoryName  = "Design Notes";
    117133} /* else: root page */
    118134
     
    138154        $fNoData = 1;
    139155        $sName = "!Invalid Refcode!";
     156        Odin32DBSqlError($sql);
    140157    }
    141158    @mysql_free_result($result);
     
    189206        {
    190207            Odin32DBAuthorInfo($db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authordll);
     208            break;
     209        }
     210
     211        case "designnote":
     212        {
     213            Odin32DBDesignNote($db, $iRefcode);
    191214            break;
    192215        }
     
    209232            echo "<font size=3>".
    210233                 "<ul>\n".
    211                  "  <li><b>Module<\n>\n".
     234                 "  <li><b>Modules\n".
    212235                 "      <ul>\n".
    213236                 "         <li><b><a href=\"Odin32DB.phtml?dlls=1\">Odin32 API DLLs</a></b>\n".
     
    218241                 "  <li><b><a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a></b>\n".
    219242                 "  <li><b><a href=\"Odin32DB.phtml?authors=1\">Authors</a></b>\n".
    220                  "  <li><i><a href=\"Odin32DB.phtml?searchapi=1\">Search API (not implemeted)</a></i>\n".
     243                 "  <li><b><a href=\"Odin32DB.phtml?design=1\">Design Notes</a></b>\n".
     244                 "  <!-- <li><i><a href=\"Odin32DB.phtml?searchapi=1\">Search API (not implemeted)</a></i> -->\n".
    221245                 "</ul>\n";
    222246                 "</font>\n";
     
    239263                 "-Enjoy!<br>\n";
    240264
    241             Odin32DBNaslov("All Dlls", "dlls", "");
     265            Odin32DBNaslov($sCategoryName, $sCategory, "");
    242266            $sql = "SELECT\n".
    243267                   "    d.name              AS name,\n".
     
    246270                   "FROM\n".
    247271                   "    dll d\n".
    248                    "    JOIN function f\n".
     272                   "    LEFT OUTER JOIN function f\n".
     273                   "    ON f.dll = d.refcode\n".
    249274                   "WHERE\n".
    250                    "    f.dll = d.refcode\n".
     275                   "    d.type = '".$sDllType."'\n".
    251276                   "GROUP BY d.refcode\n".
    252277                   "ORDER BY d.name\n";
     
    254279            {
    255280                if (mysql_num_rows($result) <= 0)
    256                     echo "<i>No dlls!</i>\n";
     281                    echo "<i>No data in this module category!<br>$sql</i>\n";
    257282                else
    258283                {
     
    364389        }
    365390
     391        case "designnotes":
     392        {
     393            /*
     394             * List all design notes.
     395             */
     396            Odin32DBNavigationTop("","");
     397            Odin32DBNaslov("Welcome to the Odin32 API Database", "welcome", "");
     398            echo "This is the first Beta edition of the Odin32 API Database.<br>\n".
     399                 "There might be dead or non-functioning links. Currently feedback is <i>NOT</i> needed.\n".
     400                 "<p>\n".
     401                 "Please note that the quality of the data avilable is quite poor\n".
     402                 "for the time being. This will improve within some months.<br>\n".
     403                 "-Enjoy!<br>\n";
     404
     405            Odin32DBNaslov($sCategoryName, $sCategory, "");
     406            $sql = "SELECT\n".
     407                   "    dn.refcode          AS refcode,\n".
     408                   "    dn.name             AS name,\n".
     409                   "    dn.seqnbr           AS seqnbr,\n".
     410                   "    dn.level            AS level,\n".
     411                   "    d.name              AS dllname,\n".
     412                   "    f.name              AS filename\n".
     413                   "FROM\n".
     414                   "    designnote dn,\n".
     415                   "    dll d,\n".
     416                   "    file f\n".
     417                   "WHERE   dn.dll = d.refcode\n".
     418                   "    AND dn.file = f.refcode\n".
     419                   "    AND dn.level <= 1\n".
     420                   "ORDER BY d.name, dn.seqnbr, dn.seqnbrnote\n";
     421            if ($result = mysql_query($sql, $db))
     422            {
     423                if (mysql_num_rows($result) <= 0)
     424                    echo "<i>No Design Notes!</i>\n";
     425                else
     426                {
     427                    echo "\n<font size=-1><ul><b>";
     428                    $iLevel = 0;
     429                    while ($aDesignNote = mysql_fetch_array($result))
     430                    {
     431                        if ($aDesignNote["level"] > $iLevel)
     432                           print "    <ul>\n";
     433                        else if ($aDesignNote["level"] < $iLevel)
     434                           print "    </ul>\n";
     435                        $iLevel = $aDesignNote["level"];
     436
     437                        if ($iLevel > 0)
     438                           print "        <li><a href=\"Odin32DB.phtml?designnoterefcode=".$aDesignNote["refcode"].
     439                                 "\">".$aDesignNote["name"]."</a>\n";
     440                        else
     441                           print "    <li><a href=\"Odin32DB.phtml?designnoterefcode=".$aDesignNote["refcode"].
     442                                  "\">".$aDesignNote["seqnbr"].".0 ".$aDesignNote["name"]."</a> (".$aDesignNote["filename"].")\n";
     443
     444                    }
     445                    echo "</ul></b></font>\n";
     446                }
     447            }
     448            else
     449                Odin32DBSqlError($sql);
     450            Odin32DBNavigationBottom("","");
     451            break;
     452        }
     453
    366454        default:
    367455            echo "!IPE!"; //FIXME
  • TabularUnified tags/trunk/tools/database/www/Odin32DBHelpers.php3

    r14539 r17222  
    22182218
    22192219
     2220/**
     2221 * Displays a design not.
     2222 * @returns     void
     2223 * @param       $db             Database handle.
     2224 * @param       $iRefcode       Author reference code.
     2225 * @author  knut st. osmundsen (kosmunds@csc.com)
     2226 * @remark
     2227 */
     2228function Odin32DBDesignNote($db, $iRefcode)
     2229{
     2230    /*
     2231     * Navigation - TOP
     2232     */
     2233    $sExpand    = "authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;
     2234    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
     2235    $sCollapse  = "authorrefcode=".$iRefcode;
     2236    Odin32DBNavigationTop($sExpand, $sCollapse);
     2237
     2238    /*
     2239     * Fetch (vital) data.
     2240     */
     2241    $sql = sprintf("SELECT\n".
     2242                   "    dn.name          AS name,\n".
     2243                   "    dn.note          AS note,\n".
     2244                   "    dn.refcode       AS refcode,\n".
     2245                   "    dn.dll           AS dllrefcode,\n".
     2246                   "    dn.file          AS filerefcode,\n".
     2247                   "    dn.seqnbrnote    AS seqnbnote,\n".
     2248                   "    dn.level         AS level,\n".
     2249                   "    dn.seqnbr        AS seqnbr,\n".
     2250                   "    dn.line          AS line,\n".
     2251                   "    d.name           AS dll,\n".
     2252                   "    f.name           AS file\n".
     2253                   "FROM\n".
     2254                   "    designnote dn,\n".
     2255                   "    dll d,\n".
     2256                   "    file f\n".
     2257                   "WHERE   dn.refcode = %d\n".
     2258                   "    AND dn.dll = d.refcode\n".
     2259                   "    AND dn.file = f.refcode\n".
     2260                   "ORDER BY dn.seqnbrnote\n",
     2261                   $iRefcode);
     2262    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
     2263    {
     2264        /*
     2265         * General
     2266         */
     2267        /*Odin32DBNaslov("General", "general");
     2268        echo "\n<table width=100% border=3 cellpadding=0>\n";
     2269        Odin32DBInfoRow1("Title", $array, "name","","","","");
     2270        Odin32DBInfoRow1("Module", $array, "dll","","","","");
     2271        Odin32DBInfoRow1("File", $array, "file","","","","");
     2272        Odin32DBInfoRow1("Line", $array, "line","","","","");
     2273        Odin32DBInfoRow1("Seq#", $array, "seqnbr","","","","");
     2274        echo "</table>\n";
     2275        */
     2276
     2277        /*
     2278         * Sections.
     2279         */
     2280        $iLevel = 0;
     2281        $sSectionNbr = "";
     2282        do
     2283        {
     2284            /* make section number */
     2285            if ($array["level"] <= 0)
     2286                $sSection = $array["seqnbr"].".0";
     2287            else
     2288            {
     2289                while ($iLevel > 0 && $iLevel < $array["level"])
     2290                {
     2291                    echo "debug ".$iLevel." < ".$array["level"]."<br>\n";
     2292                    $sSection .= '.0';
     2293                    $iLevel = $iLevel + 1;
     2294                }
     2295
     2296                if ($iLevel == 0) $iLevel++;
     2297                while ($iLevel >= $array["level"])
     2298                {
     2299                    $sSection = substr($sSection, 0, strlen($sSection) - strlen(strrchr($sSection, '.')));
     2300                    $iLevel = $iLevel - 1;
     2301                }
     2302                $sSection = $sSection.".".$array["seqnbr"];
     2303            }
     2304            $iLevel = $array["level"];
     2305
     2306            /* print it */
     2307            $sName = $sSection." ".$array["name"];
     2308            Odin32DBNaslov($sName, $sName);
     2309            echo $array["note"]."\n";
     2310
     2311        } while ($array = mysql_fetch_array($result));
     2312
     2313    }
     2314    else
     2315    {
     2316        echo "<p> No data! Invalid refcode? </p>";
     2317        Odin32DBSqlError($sql);
     2318    }
     2319
     2320    /*
     2321     * Navigation - Bottom
     2322     */
     2323    Odin32DBNavigationBottom($sExpand, $sCollapse);
     2324}
     2325
     2326
    22202327
    22212328
Note: See TracChangeset for help on using the changeset viewer.