diff -r 000000000000 -r 03b0d1493584 web/wp-content/plugins/ggis-subscribe/ggis-subscribe.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/ggis-subscribe/ggis-subscribe.php Wed Dec 23 17:55:33 2009 +0000 @@ -0,0 +1,558 @@ +formAction = 'http://dvector.com/ggis_wp-subscribe.php'; +// $this->formAction = WP_PLUGIN_URL . '/ggis_wp-subscribe.php'; + } + function addHeaderCode(){ + echo ''; + } + + // OUTPUT FUNCTIONS + var $processing_unit_tag; + var $processing_within; + var $unit_count; + var $widget_count; + var $regex; + function the_content_filter($content) { + $this->processing_within = 'p' . get_the_ID(); + $this->unit_count = 0; + + + $regex = '/\[-\s*ggis-subscribe\s*(\d+)?\s*(".*")?\s*-\]/'; +// $regex = '/\[-\s*ggis-subscribe\s+(\d+)(?:\s+.*?)?\s*-\]/'; // [-ggis-subscribe 1 -] +// $regex = '//'; + return preg_replace_callback($regex, array(&$this, 'the_content_filter_callback'), $content); + + $this->processing_within = null; + } + + function widget_text_filter($content) { + $this->widget_count += 1; + $this->processing_within = 'w' . $this->widget_count; + $this->unit_count = 0; + + $regex = '/\[-\s*ggis-subscribe\s*(\d+)?\s*(".*")?\s*-\]/'; + return preg_replace_callback($regex, array(&$this, 'the_content_filter_callback'), $content); + + $this->processing_within = null; + } + + function the_content_filter_callback($matches) { + + // GET AND SET VARIABLES + $list_select = ''; + $listonly = NULL; + $options = unserialize( get_option( 'ggis-Subscribe')); + $options['maillists'] = explode( ',', $options['maillists'] ); + $id = (int) $matches[1]; + + // DETERMINE FORM TYPE + if ( $id == 1 ){ + $listonly = str_replace( '"', '', $matches[2]); + if ( !is_email( $listonly) ){ + $id = 0; + } + }else { + $id = 0; + } + + // FORM HEADERS + $this->unit_count += 1; + $unit_tag = 'ggis-subscribe-f' . $id . '-' . $this->processing_within . '-o' . $this->unit_count; + $this->processing_unit_tag = $unit_tag; + + $form = '
'; + $form .= '
'; + $form .= ''; + $form .= ''; + $form .= ''; + + // CREATE EITHER A HIDDEN FIELD OR SELECT BOX FOR MAILING LIST + if ( $id == 1 ){ + $list_select .= ''; + }else{ + if ( count( $options['maillists']) == 1 ){ + $list_select .= ''; + } else{ + $list_select .= 'Which list?
+ '; + foreach( $this->managertypes as $manager ){ + $list_select .= '