Skip to content

Instantly share code, notes, and snippets.

@andrewteg
andrewteg / pmpro-register-helper-fields.php
Created July 1, 2016 13:35
A Paid Memberships Pro Register Helper Extension Example (pmpro-register-helper-fields)
<?php
/*
Plugin Name: Register Helper Example
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Register Helper Initialization Example
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
@andrewteg
andrewteg / query.php
Last active October 8, 2019 03:33
MS4W Version 4.0 Query From .MAP File Sample
<html><head><title>query sample</title></head><body><PRE>
<?php
include("C:/ms4w/apps/phpmapscriptng-swig/include/mapscript.php"); // required SWIG include (contains constants for PHP7)
// sample filter strings to search on... OFFICIAL_N is name of field in Attribute Table for Layer
$filter_string = '("[OFFICIAL_N]" == "Gallery")'; //exact (use ==) - case-sensitive
$filter_string = '("[OFFICIAL_N]" ~* "^ga.*")'; //starts Ga (^ for starting) not case-sensitive
$filter_string = '("[OFFICIAL_N]" ~* ".*GA.*")'; //like Ga (.* maybe not needed?!?) not case-sensitive
$map = new mapObj("/ms4w/maps/file.map");