@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-06-09 16:07:02 | |||
<?php /* Smarty version 2.6.16, created on 2007-07-12 07:12:04 | |||
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())); | |||
@@ -10,7 +10,7 @@ unset($_smarty_tpl_vars); | |||
<fieldset> | |||
<input type="hidden" name="_is_postback" value="1" /> | |||
</fieldset> | |||
<p id="pBeta"><span>This site is in Beta (test) mode, so local authorities near you may not be included in alerts.</span></p> | |||
<ul id="ulSignup" class="form nobullets"> | |||
<li id="liEmail"> | |||
<label for="txtEmail"><span class="number">1</span> Enter your email address</label> | |||
@@ -48,12 +48,16 @@ unset($_smarty_tpl_vars); | |||
</ul> | |||
</fieldset> | |||
</li> | |||
<li id="liSignup"><input type="submit" class="button" value="Create alert >>" /></li> | |||
<li id="liSignup"> | |||
<input type="submit" class="button" value="Create alert >>" /> | |||
<span id="spnBeta">This site is in Beta (test) mode, so all local authorities near you may not be included in alerts.</span> | |||
</li> | |||
</ul> | |||
</form> | |||
<div id="divSiteUpdates"> | |||
<h4>Recent site updates</h4> | |||
<ul class="nobullets"> | |||
<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> | |||
<li><em>February 2007</em> Added loads more councils (inc. Camden and Tower Hamlets)</li> | |||
@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 19:25:31 | |||
<?php /* Smarty version 2.6.16, created on 2007-07-12 07:08:16 | |||
compiled from about.tpl */ ?> | |||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | |||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | |||
@@ -31,7 +31,7 @@ if ($this->_foreach['authorities']['total'] > 0): | |||
<h3 id="contact">Contact</h3> | |||
<p> | |||
You can get in touch at <a href="#">team@planningalerts.com</a> | |||
You can get in touch at <a href="mailto:team@planningalerts.com">team@planningalerts.com</a> | |||
</p> | |||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | |||
@@ -1,5 +1,7 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-25 09:44:13 | |||
<?php /* Smarty version 2.6.16, created on 2007-06-16 16:51:50 | |||
compiled from rss.tpl */ ?> | |||
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); | |||
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'rss.tpl', 12, false),)), $this); ?> | |||
<?php echo '<?xml'; ?> | |||
version="1.0" encoding="UTF-8"<?php echo '?>'; ?> | |||
@@ -16,6 +18,8 @@ if ($this->_foreach['applications']['total'] > 0): | |||
<item> | |||
<title><?php echo $this->_tpl_vars['application']->address; ?> | |||
</title> | |||
<pubDate><?php echo ((is_array($_tmp=$this->_tpl_vars['application']->date_scraped)) ? $this->_run_mod_handler('date_format', true, $_tmp, "%a, %B %e, %Y") : smarty_modifier_date_format($_tmp, "%a, %B %e, %Y")); ?> | |||
</pubDate> | |||
<guid isPermaLink="false"><?php echo $this->_tpl_vars['application']->council_reference; ?> | |||
</guid> | |||
<georss:featurename><?php echo $this->_tpl_vars['application']->address; ?> | |||
@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 12:02:28 | |||
<?php /* Smarty version 2.6.16, created on 2007-07-12 07:08:13 | |||
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,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 2007-07-12 07:12:04 | |||
compiled from header.tpl */ ?> | |||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||
@@ -33,6 +33,9 @@ | |||
<div id="divHeader"> | |||
<h1><a href="/">PlanningAlerts<span>.</span>com</a><small>beta</small></h1> | |||
<h2>Email alerts of planning applications <em>near you</em></h2> | |||
<p id="pStats"><?php echo $this->_tpl_vars['stats']['alert_count']; ?> | |||
alerts sent for <?php echo $this->_tpl_vars['stats']['authority_count']; ?> | |||
local authorities</p> | |||
<img alt="logo" title="logo" src="./images/logo.png" /> | |||
</div> | |||
<div id="divContent"> | |||
@@ -1,6 +1,7 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("DB.php"); | |||
require_once ("stats.php"); | |||
$about_page = new about_page; | |||
@@ -39,7 +40,7 @@ class about_page { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("page_title","About"); | |||
$smarty->assign("menu_item", "about"); | |||
@@ -1,5 +1,6 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("stats.php"); | |||
$api = new api; | |||
@@ -17,7 +18,7 @@ class api { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("page_title","API"); | |||
$smarty->assign("menu_item","api"); | |||
@@ -1,6 +1,8 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("user.php"); | |||
require_once ("stats.php"); | |||
$checkmail_page = new checkmail_page; | |||
class checkmail_page { | |||
@@ -19,7 +21,7 @@ class checkmail_page { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("page_title","Now check your email"); | |||
$smarty->assign("menu_item", "signup"); | |||
//Render | |||
@@ -1,6 +1,8 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("user.php"); | |||
require_once ("stats.php"); | |||
$confirmed_page = new confirmed_page; | |||
class confirmed_page { | |||
@@ -57,7 +59,7 @@ class confirmed_page { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("menu_item", "signup"); | |||
$smarty->assign("page_title","Confirmed"); | |||
$smarty->assign("form_action", $form_action); | |||
@@ -1,4 +1,4 @@ | |||
body {font-family:georgia, serif; text-align:center;line-height:1.8em;margin:0; | |||
body {font-family:georgia, serif; text-align:center;line-height:1.7em;margin:0; | |||
color:#0f0f0f;} | |||
#divPage {width:500px; margin:0 auto;background:white;text-align:left;} | |||
h1 {font-weight:normal; font-size:2.7em;padding-left:115px;padding-bottom:0.2em;padding-top:0.1em;} | |||
@@ -11,21 +11,23 @@ h2 {font-weight:normal;font-size:1em;border-bottom:dotted 1px #808080;padding-le | |||
h2 em {text-decoration:underline} | |||
h3, h4 {color:#96ca2f;font-style:italic;font-weight:normal} | |||
#pStats {padding:0; margin:0;position:absolute; left:115px;bottom:1.5em; | |||
color:#808080; font-size:0.9em;} | |||
#divHeader {margin-top:1.7em;padding-bottom:1em;position:relative;} | |||
#divHeader img {position:absolute;top:-15px;} | |||
/* Menu */ | |||
#divMenu {background:#6E84BD;height:2.3em;font-size:0.7em;} | |||
#divMenu {background:#6E84BD;height:2.2em;font-size:0.7em;} | |||
#divMenu ul {width:500px;margin:0 auto;} | |||
#divMenu ul li {float:right;text-align:center;} | |||
#divMenu ul li a {margin-left:1em;margin-right:1em;display:block; color:white; | |||
text-decoration:none;position:relative; top:-0.2em;} | |||
text-decoration:none;position:relative; top:-0.2em;padding-bottom:4px;} | |||
#divMenu ul li.selected {background:#96ca2f;} | |||
/* Beta note */ | |||
#pBeta {font-size:0.8em; text-align:center;padding:0;margin:0;position:relative; top:-0.4em; | |||
color:#666;} | |||
#pBeta span {background:#fdd9ea;} | |||
#spnBeta {font-size:0.8em; padding:0;margin:0; | |||
color:#666;background:#fdd9ea;line-height:1em; position:relative; top:-5px;} | |||
/* Warnings & errors*/ | |||
#divWarning {background:#fdd9ea;font-size:0.9em;text-align:center; margin-bottom:1em;} | |||
@@ -47,8 +49,9 @@ span.number {font-size:2em;float:left;display:block; | |||
#liPostcode small {position:relative; top:0.6em;padding-left:0.3em;} | |||
#pAlertArea {margin-bottom:0;} | |||
#ulAlertArea {font-size:0.9em;line-height:1.3em;} | |||
#ulAlertArea li {} | |||
#liSignup input.button {font-size:1.5em;margin-top:0.5em;margin-bottom:0.5em;} | |||
#liSignup {padding-top:1em;line-height:1.3em;} | |||
#liSignup input.button {font-size:1.5em;margin-bottom:0.5em;float:left; | |||
margin-right:10px;} | |||
/* Attention grabbers */ | |||
div.attention {text-align:center; padding-top:1em;} | |||
@@ -1,5 +1,6 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("stats.php"); | |||
$faq_page = new faq_page; | |||
@@ -19,7 +20,7 @@ class faq_page { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("page_title","Frequently asked questions"); | |||
$smarty->assign("menu_item", "faq"); | |||
//Render | |||
@@ -1,5 +1,6 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("stats.php"); | |||
$getinvolved_page = new getinvolved_page(); | |||
@@ -20,7 +21,7 @@ class getinvolved_page { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("page_title","Get involved"); | |||
$smarty->assign("menu_item", "getinvolved"); | |||
//Render | |||
@@ -108,7 +108,7 @@ class Applications{ | |||
//by point | |||
function query($x,$y,$d) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, date_scraped, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where application.x > " . $db->quote($x - $d) . " and application.x < " . $db->quote($x + $d) . | |||
@@ -122,7 +122,7 @@ class Applications{ | |||
function query_area($x1,$y1,$x2,$y2) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, date_scraped, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where application.x > " . $db->quote($x1) . " and application.x < " . $db->quote($x2) . | |||
@@ -136,7 +136,7 @@ class Applications{ | |||
//by authority | |||
function query_authority($authority_short_name) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, date_scraped, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where authority.short_name = " . $db->quote($authority_short_name) ." order by date_scraped desc limit 100"; | |||
@@ -160,7 +160,8 @@ class Applications{ | |||
$application->x = $application_results[$i][7]; | |||
$application->y = $application_results[$i][8]; | |||
$application->date_received = $application_results[$i][9]; | |||
$application->authority_name = $application_results[$i][10]; | |||
$application->date_scraped = $application_results[$i][10]; | |||
$application->authority_name = $application_results[$i][11]; | |||
$os = new OSRef($application->x, $application->y); | |||
$latlng = $os->toLatLng(); | |||
@@ -0,0 +1,47 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("DB.php"); | |||
class stats{ | |||
public static function get_stats (){ | |||
//this should really be properly cached at some point. | |||
$return = false; | |||
//is the data already in the session? | |||
if (isset($_SESSION['stats'])){ | |||
$return = $_SESSION['stats']; | |||
}else{ | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$alert_count = 0; | |||
$authority_count = 0; | |||
//Count of applications | |||
$alert_sql = "select value from stats where `key` = 'applications_sent'"; | |||
$results = $db->getAll($alert_sql); | |||
if(sizeof($results) >0){ | |||
$alert_count = $results[0][0]; | |||
} | |||
//Count of authorities | |||
$authority_sql = "select count(authority_id) from authority"; | |||
$results = $db->getAll($authority_sql); | |||
if(sizeof($results) >0){ | |||
$authority_count = $results[0][0]; | |||
} | |||
//save to session | |||
$return = array('alert_count' => $alert_count, 'authority_count' => $authority_count); | |||
$_SESSION['stats'] = $return; | |||
} | |||
return $return; | |||
} | |||
} | |||
?> |
@@ -1,7 +1,7 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("user.php"); | |||
require_once ("stats.php"); | |||
$index_page = new index_page; | |||
@@ -46,6 +46,7 @@ class index_page { | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("menu_item", "signup"); | |||
$smarty->assign("postcode", $this->postcode); | |||
$smarty->assign("email", $this->email); | |||
@@ -53,7 +54,7 @@ class index_page { | |||
$smarty->assign("page_title","Email alerts of planning applications near you"); | |||
$smarty->assign("warnings", $this->warnings); | |||
$smarty->assign("email_warn", $this->email_warn); | |||
$smarty->assign("postcode_warn", $this->postcode_warn); | |||
$smarty->assign("postcode_warn", $this->postcode_warn); | |||
$smarty->assign("onloadscript", $this->onloadscript); | |||
$smarty->assign("small_zone_size",SMALL_ZONE_SIZE); | |||
@@ -30,6 +30,7 @@ | |||
<div id="divHeader"> | |||
<h1><a href="/">PlanningAlerts<span>.</span>com</a><small>beta</small></h1> | |||
<h2>Email alerts of planning applications <em>near you</em></h2> | |||
<p id="pStats">{$stats.alert_count} alerts sent for {$stats.authority_count} local authorities</p> | |||
<img alt="logo" title="logo" src="./images/logo.png" /> | |||
</div> | |||
<div id="divContent"> | |||
@@ -3,7 +3,7 @@ | |||
<fieldset> | |||
<input type="hidden" name="_is_postback" value="1" /> | |||
</fieldset> | |||
<p id="pBeta"><span>This site is in Beta (test) mode, so local authorities near you may not be included in alerts.</span></p> | |||
<ul id="ulSignup" class="form nobullets"> | |||
<li id="liEmail"> | |||
<label for="txtEmail"><span class="number">1</span> Enter your email address</label> | |||
@@ -36,12 +36,16 @@ | |||
</ul> | |||
</fieldset> | |||
</li> | |||
<li id="liSignup"><input type="submit" class="button" value="Create alert >>" /></li> | |||
<li id="liSignup"> | |||
<input type="submit" class="button" value="Create alert >>" /> | |||
<span id="spnBeta">This site is in Beta (test) mode, so all local authorities near you may not be included in alerts.</span> | |||
</li> | |||
</ul> | |||
</form> | |||
<div id="divSiteUpdates"> | |||
<h4>Recent site updates</h4> | |||
<ul class="nobullets"> | |||
<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> | |||
<li><em>February 2007</em> Added loads more councils (inc. Camden and Tower Hamlets)</li> | |||
@@ -7,6 +7,7 @@ | |||
{foreach name="applications" from="$applications" item="application"} | |||
<item> | |||
<title>{$application->address}</title> | |||
<pubDate>{$application->date_scraped|date_format:"%a, %e %b %Y"}</pubDate> | |||
<guid isPermaLink="false">{$application->council_reference}</guid> | |||
<georss:featurename>{$application->address}</georss:featurename> | |||
<georss:point>{$application->lat} {$application->lon}</georss:point> | |||
@@ -1,6 +1,8 @@ | |||
<?php | |||
require_once ("config.php"); | |||
require_once ("user.php"); | |||
require_once ("stats.php"); | |||
$unsubscribe_page = new unsubscribe_page; | |||
class unsubscribe_page { | |||
@@ -51,7 +53,7 @@ class unsubscribe_page { | |||
$smarty = new Smarty; | |||
$smarty->force_compile = true; | |||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | |||
$smarty->assign("stats", stats::get_stats()); | |||
$smarty->assign("menu_item", "signup"); | |||
$smarty->assign("page_title","Unsubscribed"); | |||
$smarty->assign("postcode", $this->postcode); | |||