Skip to content

Instantly share code, notes, and snippets.

@andrewteg
andrewteg / query.php
Last active Oct 8, 2019
MS4W Version 4.0 Query From .MAP File Sample
View query.php
<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");
@andrewteg
andrewteg / pmpro-register-helper-fields.php
Created Jul 1, 2016
A Paid Memberships Pro Register Helper Extension Example (pmpro-register-helper-fields)
View pmpro-register-helper-fields.php
<?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
You can’t perform that action at this time.