Browse Source

streetwire message

master
memespring 15 years ago
parent
commit
746345739c
8 changed files with 83 additions and 6 deletions
  1. +1
    -1
      data/%%3A^3A4^3A4E0A75%%checkmail.tpl.php
  2. +3
    -1
      data/%%45^45E^45E480CD%%index.tpl.php
  3. +1
    -1
      data/%%A4^A42^A42CC6E6%%confirm_email_text.tpl.php
  4. +1
    -1
      data/%%F7^F75^F752BDC0%%getinvolved.tpl.php
  5. +1
    -1
      data/%%F7^F7F^F7F34188%%header.tpl.php
  6. +19
    -0
      docs/templates/news_mail.tpl
  7. +1
    -1
      tools/application_mailer.php
  8. +56
    -0
      tools/news_mailer.php

+ 1
- 1
data/%%3A^3A4^3A4E0A75%%checkmail.tpl.php View File

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2007-06-09 16:07:33
<?php /* Smarty version 2.6.16, created on 2008-09-09 09:15:00
compiled from checkmail.tpl */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));


+ 3
- 1
data/%%45^45E^45E480CD%%index.tpl.php View File

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2008-02-21 14:24:04
<?php /* Smarty version 2.6.16, created on 2008-09-28 20:51:25
compiled from index.tpl */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));
@@ -57,6 +57,8 @@ unset($_smarty_tpl_vars);
<div id="divSiteUpdates">
<h4>Recent site updates</h4>
<ul class="nobullets">
<li><em>May 2008</em>Now has 250 Local authorities covered</li>
<li><em>July 2007</em>Shortlisted for New Statesman New Media Award</li>
<li><em>July 2007</em>Added 21 councils inc. Lewisham, New Forest National Park and Edinburgh </li>
<li><em>April 2007</em>Added 50 more councils.<li>
<li><em>March 2007</em> Added an API and a few more councils (inc. Islington and Hackney)</li>


+ 1
- 1
data/%%A4^A42^A42CC6E6%%confirm_email_text.tpl.php View File

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2007-06-09 16:07:32
<?php /* Smarty version 2.6.16, created on 2008-09-09 09:15:00
compiled from confirm_email_text.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'textformat', 'confirm_email_text.tpl', 1, false),)), $this); ?>


+ 1
- 1
data/%%F7^F75^F752BDC0%%getinvolved.tpl.php View File

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2007-07-21 09:12:43
<?php /* Smarty version 2.6.16, created on 2008-09-09 09:08:27
compiled from getinvolved.tpl */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));


+ 1
- 1
data/%%F7^F7F^F7F34188%%header.tpl.php View File

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2008-02-21 14:24:04
<?php /* Smarty version 2.6.16, created on 2008-09-28 20:51:25
compiled from header.tpl */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


+ 19
- 0
docs/templates/news_mail.tpl View File

@@ -0,0 +1,19 @@
{textformat style='email'}
Hello,

This is a one off email to let you know about a new local information website I've built on top of PlanningAlerts:

http://www.streetwire.org

StreetWire is like PlanningAlerts for every kind of local information. As well as planning applications, it will tell you about licensing applications, crime, events and local news near you.

You can also share news with your neighbours, so If you know some little tipbit of local news, or want to tell your neighbours about an event it helps conenct you with your neighbours.

You can signup here:

http://www.streetwire.org

All the best,

Richard Pope (volunteer PlanningAlerts.com)
{/textformat}

+ 1
- 1
tools/application_mailer.php View File

@@ -18,7 +18,7 @@

//Run
function run (){
$db = DB::connect(DB_CONNECTION_STRING);
//Grab all the users


+ 56
- 0
tools/news_mailer.php View File

@@ -0,0 +1,56 @@
<?php

require_once('tools_ini.php');
require_once('application.php');
require_once('DB.php');

//initialise
$news_mailer = new news_mailer();
$news_mailer->run();

//class
class news_mailer {

//Run
function run (){

$db = DB::connect(DB_CONNECTION_STRING);

//Grab all the users
$sql = "select user_id, email, postcode, bottom_left_x, bottom_left_y, top_right_x, top_right_y, alert_area_size, confirm_id
from user
where confirmed = 1 and user_id = 5959";

$user_results = $db->getAll($sql);
print "Found " . sizeof($user_results) . " to email ";

if(sizeof($user_results) > 0){
//Loop though users
for ($i=0; $i < sizeof($user_results); $i++){

//Smarty template
$smarty = new Smarty;
$smarty->force_compile = true;
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;
//Get the email text
$email_text = $smarty->fetch(SMARTY_TEMPLATE_DIRECTORY . 'news_mail.tpl');
//Send the email
if($email_text !=""){
send_text_email($user_results[$i][1], EMAIL_FROM_NAME, EMAIL_FROM_ADDRESS, "StreetWire - a new service from PlanningAlerts", $email_text);
}

}

}

}

}
}

?>

Loading…
Cancel
Save