CORE Revision 1.1.45

The links you see here are partly for instructional examples, but mostly for object debugging.

HOME | Coredoc | accordian | single | tile | form | expandytable | gantt | tickets-xml | nest | chart | tabs | prefs | misc | data | table | bandwidth | css | state | database | csv | free | texttable | tickets | multicell | refresh | gauge | cypher | jquery | tableform

Warning:
    mysql_connect() [function.mysql-connect]: Access denied for user 'peak10'@'localhost' (using password: YES)
/home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php, line 120 (Array)

Error:
    Connect: Access denied for user 'peak10'@'localhost' (using password: YES)

core has a bunch of simple functions that make some of the repetitive stuff go away:
  • Date:
  • Date Range:
  • Month:
  • State:
  • Autocomplete textfield (from query) (peak10 full names):

    Error:
        Existing database connection not found

    Warning:
        array_map() [function.array-map]: Argument #2 should be an array
    /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 156 (Array)

    Warning:
        implode() [function.implode]: Invalid arguments passed
    /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 157 (Array)

    Error:
        Existing database connection not found

  • Autocomplete textfield (from array):

    Error:
        Existing database connection not found

    Warning:
        array_map() [function.array-map]: Argument #2 should be an array
    /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 156 (Array)

    Warning:
        implode() [function.implode]: Invalid arguments passed
    /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 157 (Array)

  • Popup from Array:
  • Radio from Array:
    Yes
    No
    Maybe So!
  • HTML text area: ... also many of the standard HTML form types have been abstracted into functions, to allow for future modifications, such as handing them additional parameters to make them compatible with future core functionality.

    SQL functions

    Also, many of the mysql_* functions are abstracted, to make it easier to switch to another database some day. Also, some new features

  • GrabData - Grab a single cell from the database
  • GrabRow - grab an entire row and store it in an assoc array
  • GrabColumn - grab an entire column and store in a single dim array

  • Debug Stuff

    The output of these statements checks the global $DEBUG flag which is set to false on the live sites, so accidental debug information will never show up in the final output

  • PrintR('Mark Rules', 'the label') - works like print_r, except the output is HTML-friendly and wrapped in a box, and optionally labeled. Try PrintR($_REQUEST)
  • the label
    Mark Rules

  • Debug('stuff', __FUNCTION__) - adds a line to the debug log, with optional label. Use __FUNCTION__ to show the function name
  • PrintDebug() - Prints the debug log - see below.
  • PrintBacktrace() - Prints the backtrace stack, in a pretty window. (just a dump of debug_backtrace())

  • Messaging

    These functions will eventually expand to have little graphics. Right now, they're just in a <p id='error'> which you can css.

    Error:
        This is an error

    Warning:
        This is a warning

    Note:
        This is a note


    Mailing

    SendMail() is a wrapper for mail(), which does *not* send emails out if $DEBUG=true, it logs them to /tmp/core.mail.log



    Click to drag Click to collapse Resize Source code
    /home/bartniedner_com/core.bartniedner.com/htdocs/examples/misc.php
    <?
    /**
     * Core Example File
     *
     * @author Mark Young
     * @version $Id: misc.php 212 2007-05-02 17:49:59Z mark.young $
     * @copyright MarkYoung, 19 February, 2007
     * @package examples
     **/
    
    include("head.php");
    Connect(DATA_SHERPA);
    
    ?>
    core has a bunch of simple functions that make some of the repetitive stuff go away:
    <?
    
    
    echo "<li>Date: ";
    DrawDatePicker("date", "2007-10-09");
    echo "<li>Date Range: ";
    DrawDateRangePicker("date");
    echo "<li>Month: ";
    DrawMonthPicker("date");
    echo "<li>State: ";
    DrawStatePopup("state", 'FL');
    
    $query = 'select distinct concat(fname, " ", lname) from users order by lname';
    echo "<li>Autocomplete textfield (from query) (peak10 full names):";
    DrawAutocompleteTextfield('q_auto', $query);
    $array = GrabColumn($query);
    echo "<li>Autocomplete textfield (from array):";
    DrawAutocompleteTextfield('a_auto', $array);
    
    
    $popup = array("0"=>"Yes", "2"=>"No", "3"=>"Maybe So!");
    echo "<li>Popup from Array: ";
    DrawPopupFromArray("what", $popup, '2');
    echo "<li>Radio from Array: ";
    DrawRadioFromArray("what", $popup, '2');
    
    echo "<li>HTML text area: ";
    DrawHTMLArea("html", "Look <b>Ma!</b>.");
    
    
    ?>
    ... also many of the standard HTML form types have been abstracted into functions, to allow
    for future modifications, such as handing them additional parameters to make them compatible
    with future core functionality.
    
    <hr>
    <h1>SQL functions </h1>
    <p>Also, many of the mysql_* functions are abstracted, to make it easier to switch to another database some day.  Also, some new features</p>
    <li>GrabData - Grab a single cell from the database</li>
    <li>GrabRow - grab an entire row and store it in an assoc array</li>
    <li>GrabColumn - grab an entire column and store in a single dim array</li>
    
    <hr>
    <h1>Debug Stuff</h1>
    <p>The output of these statements checks the global $DEBUG flag which is set to false on the live sites, so accidental debug information
    will never show up in the final output</p>
    <li>PrintR('Mark Rules', 'the label') - works like print_r, except the output is HTML-friendly and wrapped in a box, and optionally labeled.  Try PrintR($_REQUEST)</li>
    <? PrintR('Mark Rules', 'the label') ?>
    <li>Debug('stuff', __FUNCTION__) - adds a line to the debug log, with optional label.  Use __FUNCTION__ to show the function name</li>
    <? Debug('stuff', __FUNCTION__); ?>
    <li>PrintDebug() - Prints the debug log - see below.</li>
    <li>PrintBacktrace() - Prints the backtrace stack, in a pretty window.  (just a dump of debug_backtrace())</li>
    
    <hr>
    <h1>Messaging</h1>
    These functions will eventually expand to have little graphics.  Right now, they're just in a &lt;p id='error'&gt; which you can css.
    <?
    PrintError("This is an error");
    PrintWarning("This is a warning");
    PrintNote("This is a note");
    ?>
    
    <hr>
    <h1>Mailing</h1>
    SendMail() is a wrapper for mail(), which does *not* send emails out if $DEBUG=true, it logs them to /tmp/core.mail.log
    <?
    SendMail("mark.young@peak10.com","[CORE] test", "Someone sent a mail message");
    include("foot.php");
    ?>
    

    Debug Log:
    Memory Usage: 518.17k, Number of Queries: 0
    1. [0.0000]db.inc.php File included   include_once, line 21 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
    2. [0.0453]include End head.php   include, line 52 home/bartniedner_com/core.bartniedner.com/htdocs/examples/head.php
    3. [0.0000]Connect mysql://peak10:peakmeup@localhost/peak10   Connect, line 113 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
    4. [0.0004]PrintWarning WARNING: mysql_connect() [function.mysql-connect]: Access denied for user 'peak10'@'localhost' (using password: YES)
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php, line 120 (Array)   PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    5. [0.0000]PrintError ERROR: Connect: Access denied for user 'peak10'@'localhost' (using password: YES)   PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    6. [0.0001]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/cal/calendar.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    7. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/cal/calendar-setup.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    8. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/cal/calendar-en.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    9. [0.0015]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/yui/yahoo-dom-event/yahoo-dom-event.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    10. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/yui/connection/connection-min.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    11. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/yui/animation/animation-min.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    12. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/yui/autocomplete/autocomplete-min.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    13. [0.0000]PrintError ERROR: Existing database connection not found   PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    14. [0.0000]Query $SQL_CURRENT_CONNECTION is not the expected object.    Query, line 210 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
    15. [0.0001]PrintWarning WARNING: array_map() [function.array-map]: Argument #2 should be an array
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 156 (Array)   PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    16. [0.0000]PrintWarning WARNING: implode() [function.implode]: Invalid arguments passed
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 157 (Array)   PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    17. [0.0000]PrintError ERROR: Existing database connection not found   PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    18. [0.0000]Query $SQL_CURRENT_CONNECTION is not the expected object.    Query, line 210 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
    19. [0.0000]PrintError ERROR: Existing database connection not found   PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    20. [0.0000]Query $SQL_CURRENT_CONNECTION is not the expected object.    Query, line 210 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
    21. [0.0000]PrintWarning WARNING: array_map() [function.array-map]: Argument #2 should be an array
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 156 (Array)   PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    22. [0.0000]PrintWarning WARNING: implode() [function.implode]: Invalid arguments passed
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 157 (Array)   PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    23. [0.0000]ErrorHandler in_array() [function.in-array]: Wrong datatype for second argument
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 80 (Array)   ErrorHandler, line 140 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    24. [0.0000]ErrorHandler in_array() [function.in-array]: Wrong datatype for second argument
      /home/bartniedner_com/core.bartniedner.com/htdocs/include/html_functions.php, line 80 (Array)   ErrorHandler, line 140 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    25. [0.0001]LoadJavascript Loaded http://core.bartniedner.com/include/vendor/xinha/htmlarea.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    26. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/xinha_config.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    27. [0.1691]PrintR Mark Rules['the label']   PrintR, line 449 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    28. [0.0000] stuff   , line 65 home/bartniedner_com/core.bartniedner.com/htdocs/examples/misc.php
    29. [0.0000]PrintError ERROR: This is an error   PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    30. [0.0000]PrintWarning WARNING: This is a warning   PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    31. [0.0000]PrintNote NOTE: This is a note   PrintNote, line 363 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    32. [0.1085]include Begin foot.php   include, line 10 home/bartniedner_com/core.bartniedner.com/htdocs/examples/foot.php
    33. [0.0017]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/ajax.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    34. [0.0000]DrawTopPart outputFreeText - Source code
           DrawTopPart, line 205 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
      1. [0.0001]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/jquery.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
      2. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/core.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
      3. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/firebug/firebug.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
      4. [0.0004]DrawBottomPart cached: /tmp/sourcecodeKyD7Gz   DrawBottomPart, line 378 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
      5. [0.0001]DrawBottomPart End
      outputFreeText - Source code   DrawBottomPart, line 381 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php