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)
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
<?
/**
* 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 <p id='error'> 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
[0.0000]db.inc.php File included include_once, line 21 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
[0.0453]include End head.php include, line 52 home/bartniedner_com/core.bartniedner.com/htdocs/examples/head.php
[0.0000]Connect mysql://peak10:peakmeup@localhost/peak10 Connect, line 113 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
[0.0004]PrintWarningWARNING: 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
[0.0000]PrintErrorERROR: Connect: Access denied for user 'peak10'@'localhost' (using password: YES) PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[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
[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
[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
[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
[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
[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
[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
[0.0000]PrintErrorERROR: Existing database connection not found PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[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
[0.0001]PrintWarningWARNING: 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
[0.0000]PrintWarningWARNING: 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
[0.0000]PrintErrorERROR: Existing database connection not found PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[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
[0.0000]PrintErrorERROR: Existing database connection not found PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[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
[0.0000]PrintWarningWARNING: 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
[0.0000]PrintWarningWARNING: 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
[0.0000]ErrorHandlerin_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
[0.0000]ErrorHandlerin_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
[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
[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
[0.1691]PrintR Mark Rules['the label'] PrintR, line 449 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[0.0000] stuff , line 65 home/bartniedner_com/core.bartniedner.com/htdocs/examples/misc.php
[0.0000]PrintErrorERROR: This is an error PrintError, line 344 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[0.0000]PrintWarningWARNING: This is a warning PrintWarning, line 380 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[0.0000]PrintNoteNOTE: This is a note PrintNote, line 363 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
[0.1085]include Begin foot.php include, line 10 home/bartniedner_com/core.bartniedner.com/htdocs/examples/foot.php
[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
[0.0000]DrawTopPartoutputFreeText - Source code DrawTopPart, line 205 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
[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
[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
[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
[0.0004]DrawBottomPart cached: /tmp/sourcecodeKyD7Gz DrawBottomPart, line 378 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
[0.0001]DrawBottomPart End
outputFreeText - Source code DrawBottomPart, line 381 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php