コード例 #1
0
 protected final function setETag()
 {
     $etag = etag($this->response->body);
     $this->response->setETagHeader($etag);
     if ($this->request->hasMatchingETag($etag)) {
         $this->response->statusCode = 304;
         $this->response->body = null;
     }
 }
コード例 #2
0
ファイル: oik-honeypot.php プロジェクト: bobbingwide/oik-libs
 /**
 * 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");
 }
コード例 #3
0
ファイル: oik-ms.php プロジェクト: bobbingwide/oik-ms
/** 
 * Display/process the Copy options form
 */
function oik_ms_settings()
{
    p("Use this form to copy oik options values from a site of your choice.");
    p("You should only need to do this once per new site.");
    oik_ms_copy_site_settings();
    bw_form();
    stag("table", "widefat");
    $sites = oik_ms_site_list();
    bw_select("oik_ms_site", "Source site", null, array("#options" => $sites));
    $alts = array(0 => "options", 1 => "more options (alt=1)", 2 => "more options 2 ( alt=2)");
    bw_select("oik_ms_alt_source", "Source options set", null, array("#options" => $alts));
    bw_select("oik_ms_alt_target", "Target options set", null, array("#options" => $alts));
    etag("table");
    p(isubmit("_oik_ms_copy_options", "Copy options from site", null, "button-secondary"));
    etag("form");
}
コード例 #4
0
ファイル: bobbforms.php プロジェクト: bobbingwide/oik-lib
 /**
  * Display a table row or table head row when $tdtag = "th"
  *
  * If we want it to do something other than create a table then we will need 
  * to redefine bw_td() and bw_th() 
  * 
  * @param array $td_array 
  * @param string $trtag "tr" or ?
  * @param string $tdtag "td" or "th" or ? 
  */
 function bw_tablerow($td_array = array(), $trtag = "tr", $tdtag = "td")
 {
     if (count($td_array)) {
         stag($trtag);
         foreach ($td_array as $td) {
             if ($tdtag == "th") {
                 bw_th($td);
             } else {
                 bw_td($td);
             }
         }
         etag($trtag);
     }
 }
コード例 #5
0
ファイル: bobbfunc.php プロジェクト: bobbingwide/oik-lib
 /**
  * Produce a cite tag
  * 
  * Renamed from cite() which has been deprecated
  */
 function _bw_cite($text, $class = NULL, $id = NULL)
 {
     stag("cite", $class, $id);
     e($text);
     etag("cite");
 }
コード例 #6
0
ファイル: oik-blogs.php プロジェクト: bobbingwide/oik-ms
/**
 * Display a blog option or shortcode
 * 
 */
function bw_display_blog_field($shortcode, $tag = "div", $use_shortcode = true)
{
    stag($tag);
    if ($use_shortcode) {
        e(do_shortcode("[{$shortcode}]"));
    } else {
        bw_get_option($shortcode);
        e($shortcode);
    }
    etag("e{$tag}");
}
コード例 #7
0
 /**
  * Display the edit settings form
  */
 function oik_plugins_edit_settings()
 {
     global $bw_plugin;
     bw_form();
     stag("table", "wide-fat");
     bw_tablerow(array("plugin", $bw_plugin['plugin'] . ihidden('plugin', $bw_plugin['plugin'])));
     bw_textfield("server", 100, "server", stripslashes($bw_plugin['server']));
     bw_textfield("apikey", 26, "apikey?", $bw_plugin["apikey"]);
     etag("table");
     p(isubmit("_oik_plugins_edit_settings", "Change plugin", null, "button-primary"));
     etag("form");
 }
コード例 #8
0
ファイル: js.php プロジェクト: nopticon/rockr
	fatal_error();
}

$filepath = ROOT . 'template/js/' . $filename . '.js';
if (!@file_exists($filepath)) {
	fatal_error();
}

// 304 Not modified response header
$last_modified = filemtime($filepath);
$f_last_modified = gmdate('D, d M Y H:i:s', $last_modified) . ' GMT';

$http_if_none_match = v_server('HTTP_IF_NONE_MATCH');
$http_if_modified_since = v_server('HTTP_IF_MODIFIED_SINCE');

$etag_server = etag($filepath);
$etag_client = str_replace('-gzip', '', $http_if_none_match);

header('Last-Modified: ' . $f_last_modified);
header('ETag: ' . $etag_server);

if ($etag_client == $etag_server && $f_last_modified == $http_if_modified_since) {
	header('HTTP/1.0 304 Not Modified');
	header('Content-Length: 0');
	exit;
}

require_once(ROOT . 'interfase/jsmin.php');

$is_firefox = (strstr($user->browser, 'Gecko')) ? true : false;
$is_ie = (strstr($user->browser, 'IE')) ? true : false;
コード例 #9
0
/**
 * Settings for the jQuery Nivo slider  
 *
 * Extract from jQuery Nivo slider below
 * The setting selection field has been set for each line marked with an 'x' 

      x	effect: 'random',
      x	slices: 15,
      x	boxCols: 8,
      x	boxRows: 4,
      x animSpeed: 500,
      x	pauseTime: 3000,
      	startSlide: 0,
      x	directionNav: true,
      x	directionNavHide: true,
      x	controlNav: true,
      x	controlNavThumbs: false,
        controlNavThumbsFromRel: false,
      	controlNavThumbsSearch: '.jpg',
      	controlNavThumbsReplace: '_thumb.jpg',
      	keyboardNav: true,
      x	pauseOnHover: true,
      x	manualAdvance: false,
      x	captionOpacity: 0.8,
      	prevText: 'Prev',
      	nextText: 'Next',
      	randomStart: false,
      	beforeChange: function(){},
      	afterChange: function(){},
      	slideshowEnd: function(){},
        lastSlide: function(){},
        afterLoad: function(){}
*/
function oik_nivo_slider_options()
{
    bw_form("options.php");
    $option = "bw_nivo_slider";
    $options = get_option($option);
    stag('table class="form-table"');
    bw_flush();
    settings_fields('oik_nivo_options');
    $effect_options = array('random', 'sliceDownRight', 'sliceDownLeft', 'sliceUpRight', 'sliceUpLeft', 'sliceUpDown', 'sliceUpDownLeft', 'fold', 'fade', 'boxRandom', 'boxRain', 'boxRainReverse', 'boxRainGrow', 'boxRainGrowReverse', 'slideInLeft', 'slideInRight');
    $effect_options_assoc = bw_assoc($effect_options);
    bw_select_arr($option, "Effect (effect=<i>effect</i>)", $options, 'effect', array("#options" => $effect_options_assoc));
    bw_textfield_arr($option, "Slices", $options, 'slices', 2);
    bw_textfield_arr($option, "Box cols", $options, 'boxCols', 2);
    bw_textfield_arr($option, "Box rows", $options, 'boxRows', 2);
    bw_textfield_arr($option, "Anim speed", $options, 'animSpeed', 4);
    bw_textfield_arr($option, "Pause time (pause=<i>nnnn</i>)", $options, 'pauseTime', 4);
    bw_checkbox_arr($option, "Control nav (nav=n|y)", $options, 'controlNav');
    bw_checkbox_arr($option, "Control nav thumbs (thumbs=n|y)", $options, 'controlNavThumbs');
    //bw_textfield_arr( $option, "Control nav thumbs search", $options, 'controlNavThumbsSearch', 20 );
    //bw_textfield_arr( $option, "Control nav thumbs replace", $options, 'controlNavThumbsReplace', 20 );
    bw_checkbox_arr($option, "Direction nav", $options, 'directionNav');
    bw_checkbox_arr($option, "Direction nav hide", $options, 'directionNavHide');
    bw_checkbox_arr($option, "Pause on hover", $options, 'pauseOnHover');
    bw_checkbox_arr($option, "Manual advance (manual=n|y)", $options, 'manualAdvance');
    bw_textfield_arr($option, "Caption opacity", $options, 'captionOpacity', 4);
    //bw_tablerow( array( "", "<input type=\"submit\" name=\"ok\" value=\"Save changes\" class=\"button-primary\"/>") );
    etag("table");
    e(isubmit("ok", __("Save changes", "oik"), null, "button-primary"));
    etag("form");
    bw_flush();
}
コード例 #10
0
ファイル: trac29608.php プロジェクト: bobbingwide/trac29608
/**
 * Produce a hex dump of the generated HTML
 * 
 * @param string $content
 */
function trac_29608_dump($content)
{
    oik_require("includes/hexdump.php", "trac29608");
    $dump = hexdump($content);
    stag("code");
    e($dump);
    etag("code");
}
コード例 #11
0
ファイル: oik-lib.php プロジェクト: bobbingwide/oik-lib
/**
* Display the registered libraries
*
* Nothing fancy here as we cannot alter the settings
* So we just convert each OIK_lib in the OIK_libs class to an array of fields
* 
* We can display $oik_libs->libraries, $oik_libs->loaded_libraries and $oik_libs->checked_libraries
*
* If deps is an assoc array then we only get the '*' - so we copy the value of args['deps']
* which we know is set

*
	                   [library] => oik_boot
                   [src] => C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\libs\oik_boot.php
                   [deps] => 
                   [version] => 2.6
                   [init_function] => 
                   [args] => Array
*
*/
function oik_lib_display_libraries()
{
    p("Registered libraries, showing the versions and dependencies.");
    $oik_libs = oik_libs();
    //bw_trace2( $oik_libs, "oik_libs" );
    //$oik_libs->display_libs();
    $libraries = $oik_libs->libraries;
    stag("table", "wide-fat");
    $labels = bw_as_array(__("Library,Source,Dependencies,Version,Args", 'oik-lib'));
    bw_tablerow($labels, "tr", "th");
    foreach ($libraries as $lib => $data) {
        //print_r( $lib );
        //bw_trace2( $data, "data" );
        //$data->deps();
        $data->deps = $data->args['deps'];
        unset($data->error);
        bw_tablerow($data);
    }
    etag("table");
}