Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 1e7c108bd100072032e6f9fab227c9c1c9ecab13 0 parents
@abhinemani abhinemani authored
Showing with 60 additions and 0 deletions.
  1. +37 −0 cc-mkplc.php
  2. +3 −0  index.php
  3. +20 −0 readme.txt
37 cc-mkplc.php
@@ -0,0 +1,37 @@
+<?php
+/*
+Plugin Name: Civic Commons Marketplace
+Plugin URI: http://www.walkscore.com/professional/word-press.php
+Description:Provides simple shortcodes to embed Civic Commons Marketplace information on your wordpress blog
+Version: 0.1
+Author: Abhi Nemani
+Author URI: http://www.civiccommons.org
+License: GPL2
+*/
+
+
+/* USAGE
+ Shortcodes: [cc-mkplc]
+*/
+
+
+// [walk-score-map id="ws-id" address="" size="" orientation=""]
+add_shortcode( 'cc-mkplc', 'cc_mkplc_sc' );
+
+function cc_mkplc_sc( $atts, $content = null ) {
+
+ $default_atts = array(
+ 'address' => null,
+ 'height' => "300px",
+ );
+
+ //get shortcode attributes
+ extract( shortcode_atts( $default_atts, $atts ) );
+
+ //convert application name to ID
+ $url = "http://marketplace.civiccommons.org/api/v1/views/application_api.xml?filters[keywords]=".$address;
+ $xml = simplexml_load_file($url);
+ $id = $xml->item->nid;
+
+ return "<iframe src='http://50.19.214.65/cc-mkplc-widget/widget.html#" . $id . "' width='610px;' height='" . $height . "' frameborder='0' scrolling='no'></iframe>"; }
+ ?>
3  index.php
@@ -0,0 +1,3 @@
+<?php
+// Silence is golden.
+?>
20 readme.txt
@@ -0,0 +1,20 @@
+=== The Civic Commons Marketplace Wordpress Plugin ===
+
+This plugin enables you to embed links and information about Civic Technology from the Civic Commons Marketplace.
+
+=== Walk Score Plugin ===
+Contributors: mahalie, walkscore
+License: GPLv2
+
+**Shortcode Usage**
+
+The plugin makes the following shortcode available.
+
+`[cc-mkplc address="ANY-APP-NAME-GOES-HERE"]`
+
+
+**Shortcode Examples**
+
+Display a map of the White House, USA:
+
+`[cc-mkplc address="Drupal"]`

0 comments on commit 1e7c108

Please sign in to comment.
Something went wrong with that request. Please try again.