/** * Add a honeypot field to a form * * We need to display an input field that is hidden from the normal user by display: none; * This may be completed by the spam bot since it thinks it's a field to complete. <p class="th_rh_name_field"> <label for="th_rh_name"><?php _e( 'Only fill in if you are not human', 'registration-honeypot' ); ?></label><br /> <input type="text" name="th_rh_name" id="th_rh_name" class="input" value="" size="25" autocomplete="off" /></label> </p> */ function oik_honeypot_add_honeypot() { $field_name = oik_honeypot_field_name(); //span( "label $field_name" ); //e( "Humans leave this blank" ); //epan(); stag("div", null, null, kv("style", "display:none")); bw_textfield($field_name, 10, "Humans leave this blank", ""); etag("div"); }
/** * Create a postbox widget on the admin pages * * * Notes: Similar to Yoast's potbox (sic) * * */ function oik_box($class = NULL, $id = NULL, $title = NULL, $callback = 'oik_callback') { if ($id == NULL) { $id = $callback; } sdiv("postbox {$class}", $id); sdiv("handlediv", NULL, kv('title', __("Click to toggle"))); br(); ediv(); h3(bw_translate($title), "hndle"); sdiv("inside"); call_user_func($callback); ediv("inside"); ediv("postbox"); }
/** * Create a checkbox input field * * Note: In order to obtain a value when the checkbox is unticked * we add a hidden field with a value of off * See http://iamcam.wordpress.com/2008/01/15/unchecked-checkbox-values/ * When the value is set then the checkbox is checked * * @param string $name the name for the checkbox input field * @param string $value the value of the checkbox - default NOT checked * @param bool whether or not the checkbox should be disabled. default: false */ function icheckbox($name, $value = NULL, $disabled = false) { $it = ihidden($name, "0"); $it .= "<input type=\"checkbox\" "; $it .= "name=\""; $it .= $name; $it .= "\" id=\""; $it .= $name; $it .= '"'; if ($value && $value != "0") { $it .= " checked=\"checked\""; } if ($disabled) { $it .= kv("disabled", "disabled"); } $it .= "/>"; return $it; }
/** * Return a well formed link * * Parameters as for alink() * * @param string $class - the classes for the anchor tag * @param string $url - the fully formed URL e.g. http://www.oik-plugins.com * @param string $linktori - is the text or image * @param string $alt - if NULL will use $linktori * @param string $id - the unique ID for the anchor tag * @param string $extra - anything else that needs to go in the <a> tag. e.g. 'onclick=then some javascript' * @return string the link * */ function retlink($class = NULL, $url, $linktori = NULL, $alt = NULL, $id = NULL, $extra = NULL) { if (is_null($linktori)) { $linktori = $url; } $link = "<a"; $link .= kv("class", $class); // aclass( $class ); $link .= kv("id", $id); // aid( $id ); $link .= kv("href", $url); // ahref( $url ); if (is_null($alt)) { $alt = $linktori; } // Is alt= allowed with XHTML Strict 1.0? // aalt( $alt ); $link .= atitle($alt); if ($extra) { $link .= $extra; } $link .= ">"; if ($linktori) { $link .= $linktori; } $link .= "</a>"; return $link; }
<?php kv('Name', hash_to_subtable($aPointDetails['aNames'])); kv('Type', $aPointDetails['class'] . ':' . $aPointDetails['type']); kv('Last Updated', $aPointDetails['indexed_date']); kv('Admin Level', $aPointDetails['admin_level']); kv('Rank', $aPointDetails['rank_search_label']); if ($aPointDetails['calculated_importance']) { kv('Importance', $aPointDetails['calculated_importance'] . ($aPointDetails['importance'] ? '' : ' (estimated)')); } kv('Coverage', $aPointDetails['isarea'] == 't' ? 'Polygon' : 'Point'); kv('Centre Point', $aPointDetails['lat'] . ',' . $aPointDetails['lon']); kv('OSM', osm_link($aPointDetails)); if ($aPointDetails['wikipedia']) { kv('Wikipedia Calculated', wikipedia_link($aPointDetails)); } kv('Extra Tags', hash_to_subtable($aPointDetails['aExtraTags'])); ?> </table> </div> <div class="col-md-6"> <div id="map"></div> </div> </div> <div class="row"> <div class="col-md-12"> <h2>Address</h2>