12/05/2012
- When passing arguments to a [shortcode] e.g. date_div $d="12/5/2012", $f="H:i:s", the string values passed must be contained in double quotes not single quotes. Variable names can be as short as 1 character, e.g. $d = ... If passing integer values or true or false, omit the double quotes. BEWARE WHEN EDITING PAGES THAT CONTAIN SHORTCODES THAT THE TinyMCE EDITOR LIKES TO INSINUATE nano-spell SPAN TAGS IN BAD PLACES THAT MUST BE REMOVED OR THE SHORTCODE WILL FAIL ON THE PUBLIC-FACING SITE!!!.
12/05/2012
- Table _jazz_cache was created with entries for each existing page populated using the following query: "INSERT INTO _jazz_cache SELECT ID as page_id, id, 'under construction...' AS cache FROM _jazz". This table is also going to need a DATETIME 'sunset' column, so that each cache or snapshot of each page will auto-refresh at the appropriate interval. All of this is designed to cut down drastically on page build time when the GoDaddy PHP engine is bogged down for reasons the VPC webmaster cannot foresee or control...
12/09/2012
- Importing character entities like & nbsp; or & copy; with documentFragment->appendXML() - part of the PHP domDocument library - will throw errors unless these character entities have been explicitly declared by amending the DTD as in:
- <!ENTITY copy "& copy;">
- <!ENTITY nbsp "& nbsp;">
- <!ENTITY iexcl "& iexcl;">
- <!ENTITY yuml "& yuml;">
- <!ENTITY cent "& cent;">
12/23/2012
-
A long overdue correction for the message board tables (all 5 of them) is to create a msg_uid column and a parentID column for each (done) and then to populate that second column with the proper parentID, making use of the datestamp column 1:1 relationship that already exists between parent:child messages in each table. The query below is a start:
SELECT messagesww.msg_uid, messagesww.datestamp, messagesww.parentM, messagesww.parentID, msgs2.msg_uid
FROM messagesww
LEFT JOIN messagesww msgs2 ON messagesww.parentM = msgs2.datestamp
WHERE messagesww.parentM <> '0000-00-00 00:00:00'
AND NOT ISNULL( msgs2.msg_uid )
ORDER BY `messagesww`.`datestamp` ASCBelow is an example of the query that gets the update done:UPDATE messagesww msgs
INNER JOIN messagesww msgs2
ON msgs.parentM = msgs2.datestamp
SET msgs.parentID = msgs2.msg_uidSimply build/run the UDPATE query above 5 times, for each of the 5 message board tables (messages, messagesdmt, messagesqw, messagesrc, and messagesww.
01/12/2013
- Copy/Paste from a WORD document to XHTML requires some manual tweaking in most instances, since WORD even 2010 contains lots of extraneous markup and character entities like the ellipse & tippil ; that the XMLDOM doesn't understand. With a little patience it can usually be done.
01/13/2013
- There are a couple of things to watch for when textnodes are inserted into the DOM. For one thing, an node's nodeValue is non-standard (a PHP convenience), so avoid the use of:
$obj->nodeValue = "";
as much as possible. One big reason is that PHP will NOT throw an error if you try to set nodeValue on a non-object.
The other thing to keep in mind is that the code indenting feature in PHP's domDocument$this->xhtml->preserveWhiteSpace = false;
doesn't seem to bother to indent textNodes, so once you add a textNode to an element, whether you do it using ...->nodeValue = or ...->appendChild() or ...->insertBefore(), the code indenting feature is NOT applied to it.
$this->xhtml->formatOutput = true;
SO IN GENERAL, AVOID (e.g.):$this->getEl("build_report")->nodeValue = "Build time: {$time3} seconds.";
AVOID (SPECIFICALLY) CLEARING A NODE'S CONTENTS AS FOLLOWS:$this->getEl("content")->nodeValue = "";
PREFERRED METHOD FOR ADDING TEXT TO AN EXISTING NODE:$this->getEl("build_report")->appendChild( $this->xhtml->createTextNode("Build time: {$time3} seconds.") );
02/03/2013
- When a page like the Bow and Stern Archive, or the Limerick Contest want/need to display markedly different content depending on which $_GET/$_REQUEST variables are passed, there are 3 main things I can/will manipulate. One of them is the custom privilege/permission level that may need to be applied, for example everyone/world may read limericks but only members-in-good-standing may compose a limerick. I also in the Bow/Stern Archive show how the breadcrumbs can be custom modified, and the H2 element.
02/06/2013
- On the legacy site, I see (or don’t see) what Chris mentioned, namely the absence of a tweet from AJ based on his message board post that he purportedly flagged. This is an unexpected glitch I will need to investigate - as time allows. Technology is great...til something breaks.
02/06/2013
- On the legacy site, each record in the trips/events table has a 'tweeted' date field, which starts out empty/null. When a visitor to the website displays the trips list that page contains code which checks the table to see if there are any upcoming events that have yet to generate a self-promoting tweet, and if so then the self-promoting tweet goes out auto-magically. Then, as you would expect, the 'tweeted' flag for that/those events gets updated in the table to avoid multiple auto-tweets on a given event. This will need to be preserved in the new site.
02/06/2013
- The auto-magic process (working through Sept 2012 but possibly broken in 2013 for reasons I can’t explain) in which our Facebook page and our VPCNews twitter account were linked will need to be fixed/preserved.
02/24/2013
- For reasons I can't fathom, the nesting of code that normally occurs when PHP's DomDocument outputs a built page sometimes fails. A good example of this in on the landing page for pool sessions. I wasted a lot of time the past 24 hours trying and trying to peel away content/nodes to see if I could get theto nest and failed, and after a while you just shrug your shoulders and give up. It's all still valid XHTML, it's just ugly in code view.
04/01/2015
- FULLTEXT search is extremely useful but tricky. I first got it working on the Paypal reconciliation page in an AJAX call, where firstname/lastname/email are the only MATCH() fields. That worked beautifully. However, when I tried adding the phone, city, or street1 fields in an AJAX call in "Manage the Roster" the PDO engine balked. I finally discerned it's b/c FULLTEXT MATCH() insists that the collation on all the fields in the fieldlist be the same, but in some tables/rows (100+ rows) the collation was still latin1_swedish_ci. So, I backed up the DB and followed the advice here (http://stackoverflow.com/a/27772624), which I am hoping will let me finish the work on "Manage the Roster" and also apply a similar search methodology in a "Lookup" tab on "Paddler to Paddler", something Paul Carlile in particular misses...
04/16/2015
- The use of $_SESSION['location_trail'] to resort/redirect to the last "valid" page after the login or logout page has been accessed is unsophisticated, in that we store there only the integer value of $_GET['id'], and not the entire $_SERVER['query_string']. There are only 3 pages on the site where we find references to $_SESSION['location_trail'] (index.php, SMART_FORMS_2038.php, and enable_login_form_new.php. At some point perhaps we will want to make these redirects more sophisticated.
04/16/2015
- When in the page editor (id=123) with the needed admin privileges, there are too many button choices at the bottom and at least one of them: "Save" does not work, it just does a print_r() from SMART_FORM_2038.php
06/07/2015
- We finally have nailed down a method by which page content living in dom_assets/shortcodes delivered by AJAX (whether JSON or XHTML) demands authentication. Not every AJAX enabled page will need this, but many will/do. The functions.php top-level page now contains: function authenticate_ajax_user($jz_privileges) {} which will "Uh oh..."/exit when $_SESSION['user']['my_access'] is not set. A list of shortcode pages so enabled follows:
- Paddler to Paddler (22)
06/06/2015
- Best practice for echo'ing well-formed XHTML using AJAX, is demonstrated in: shortcodes/paddler_to_paddler.php. Essentially we populate the node (a.k.a. $doc->xhtml->documentElement) of a stripped down domDocument with a single child node that contains everything we've dynamically built, then...
$doc = new DOC_SHELL(); $doc->ajax(); list($firstchild) = stuff_stuff_oop( $doc->xhtml->documentElement, array("div") // OR "span" OR "p" OR EVEN "table" ); // POPULATE TO YOUR HEART'S CONTENT: $firstchild echo $doc->xhtml->saveXML( $doc->xhtml->documentElement->firstChild ); exit;
11/10/2020
- If adding new pages to the site that deserve to appear in the dropdown navigation, make note of the ID of the newly created page, and then edit the site>navigation>json_nav.json file (using valid JSON syntax) to insinuate the new page. Links to pages in the nav that are "dead", e.g. the "Northest Creeking" page, can be hidden from the nav by setting the "hide" property to true.