PDA

View Full Version : WOOT! New site




GunnyFreedom
01-01-2010, 12:23 AM
Just finished laying out the structure on my root domain, and am in the process of filling out the content. Since I'm doing everything myself it's sure taking it's ever-luvin time. If anybody is familiar with Drupal CMS or webmastering in general, be advised that at some point soon I will be shopping for a webmaster to maintain and dress the content. That, of course, is something that can be done remotely. This help will be absolutely necessary as I start to focus exclusively on canvass, lit, and events.

http://glenbradley.net/

The only thing that's not quite right so far is the little "contact form" up top. I am going to have to dig into the PHP source to learn where it's pointing in order to enable it. The "Get Involved" button is, for the moment, a dummy.

Pericles
01-01-2010, 12:25 AM
Very nice start, there Marine.

GunnyFreedom
01-01-2010, 12:32 AM
Found it buried in the PHP sources, but there does not seem to be a script to go along with the misspelled class...


<form>
<label>Get Involved</label>
<input type="text" maxlength="128" size="15" value="Email Address" title="Enter the Email Address" class="email" onblur="if(this.value=='') this.value='Email Address'" onfocus="if(this.value =='Email Address' ) this.value=''" /><input type="text" maxlength="128" size="15" value="Zip Code" title="Enter the Zip Code" class="zip" onblur="if(this.value=='') this.value='Zip Code'" onfocus="if(this.value =='Zip Code' ) this.value=''" /><input type="submit" src="" class="singup" value="" />
</form>

I'll go ahead and post the entire file -- it says "php" but it is clearly in HTML -- if some code-shark here can help me modify it to make the top form field actually WORK (and I will be fixing the misspelled "singup" in any case) then I will be eternally grateful!



<?php
// $Id: page.tpl.php,v 1.25 2008/01/24 09:42:53 Leo Exp $
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title ?></title>
<meta http-equiv="Content-Style-Type" content="text/css" />
<?php print $head ?>
<?php print $styles ?>
<?php print $scripts ?>

<script type="text/javascript" src="<?php print base_path().path_to_theme() ?>/js/jquery-1.3.2.min.js"></script>
<script src="<?php print base_path().path_to_theme() ?>/js/jquery.prettyPhoto.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php print base_path().path_to_theme() ?>/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />

<!--[if lt IE 7]>
<script type="text/javascript" src="<?php print base_path().path_to_theme() ?>/ie_png.js"></script>
<script type="text/javascript">
ie_png.fix('.png');
</script>
<![endif]-->

</head>

<body id="body">
<div class="min-width png">
<div id="main">
<div id="header">
<div class="head-row1">
<form>
<label>Get Involved</label>
<input type="text" maxlength="128" size="15" value="Email Address" title="Enter the Email Address" class="email" onblur="if(this.value=='') this.value='Email Address'" onfocus="if(this.value =='Email Address' ) this.value=''" /><input type="text" maxlength="128" size="15" value="Zip Code" title="Enter the Zip Code" class="zip" onblur="if(this.value=='') this.value='Zip Code'" onfocus="if(this.value =='Zip Code' ) this.value=''" /><input type="submit" src="" class="singup" value="" />
</form>
</div>
<div class="head-row2">
<div class="col1">
<?php if ($logo) : ?>
<a href="<?php print $front_page ?>" title="<?php print t('Home') ?>"><img src="<?php print($logo) ?>" alt="<?php print t('Home') ?>" class="logo" /></a>
<?php endif; ?>
<?php if ($site_name) : ?>
<h1 class="site-name"><a href="<?php print $front_page ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a></h1>
<?php endif; ?>
<?php if ($site_slogan) : ?>
<div class="slogan"><?php print($site_slogan) ?></div>
<?php endif;?>
<?php if ($mission != ""): ?>
<div id="mission"><?php print $mission ?></div>
<?php endif; ?>
</div>
<div class="col2">
<div class="search-box">
<?php if ($search_box): print $search_box; endif; ?>
</div>
</div>
</div>
<div class="head-row3">
<div class="menu-left">
<div class="menu-right">
<?php if (isset($primary_links)) : ?>
<div class="pr-menu">
<?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?>
</div>
<?php endif; ?>
<a href="http://glenbradley.net/node/17"><?php print theme_image(path_to_theme().'/images/donate.gif', '', '', array('class'=>'donate')) ?></a>
</div>
</div>
</div>

</div>

<div id="cont">
<div class="cont-inner">
<div class="bg-line">

<?php if ($left != ""): ?>
<div id="left-col">
<div class="ind">
<div class="width">
<?php print $left?>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($right != ""): ?>
<div id="right-col">
<div class="ind">
<div class="width">
<?php print $right?>
</div>
</div>
</div>
<?php endif; ?>
<div id="cont-col">
<div class="ind">

<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?>
<?php if ($title): print '
<h2'. ($tabs ? ' class="with-tabs title"' : '') .'>'. $title .'</h2>
'; endif; ?>
<?php if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif; ?>
<?php if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif; ?>

<?php if ($show_messages && $messages != ""): ?>
<?php print $messages ?>
<?php endif; ?>

<?php if ($help != ""): ?>
<div id="help"><?php print $help ?></div>
<?php endif; ?>

<!-- start main content -->
<?php print $content; ?>

</div>
</div>

</div>
</div>
<div class="corner-bot-left png">
<div class="corner-bot-right png">
<div class="border-bot"><div></div></div>
</div>
</div>
</div>
<?php if ($is_front && $custom != "") : ?>
<div id="custom">
<div class="ind">
<div class="bg-cust">
<?php print $custom; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div id="footer">
<div class="foot">
<?php if ($footer_message || $footer) : ?>
<span><?php print $footer_message;?>&nbsp;<!--{%FOOTER_LINK} --></span>
<?php endif; ?>
</div>
</div>
<!-- coded by Leo -->
</div>

<?php print $closure;?>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});
});
</script>
</body>
</html>

GunnyFreedom
01-01-2010, 12:37 AM
Very nice start, there Marine.

Thanks brother!

Once I get that pesky form field up top working, I'll be able to get back to content creation. As it stands, it has grown to a burr under my saddle that I can't quite shake....

Too %$#* bad I'm not a java-coder, I could have just entered the script from scratch and attached the right class name and be done with it. :(

newbitech
01-01-2010, 12:44 AM
Gunny, I am more than willing to collaborate with you on your site. I have some solid background in CMS apps like Drupal, Joomla, Wordpress etc etc..

If you hit any issues or looking for any specifics let me know. I am always available and I am more than willing to work out barters etc..

I'm looking to add some more site work to my portfolio, and I'd be willing to exchange work for testimonials. You know how to find me!

Bman
01-01-2010, 12:59 AM
I'm certainly not a web programmer. I can usually find my way around and am in agreement that you are missing a script. Do you intend for your form replys to go to your email or a database? Regardless what I see missing is...

<FORM action="www.yoursite.com/put_this_information_where_I_want_it.php" method="post">

If you want it to go to your email, well, it's not hard to make a php script to do that, but they are unsafe unless you know what you are doing, I don't. Places like godaddy, if they host your site, supply with the proper script to get the form sent to your email account. If it is going to a database you need it to post to a script that will write the information to the database.

GunnyFreedom
01-01-2010, 01:03 AM
Gunny, I am more than willing to collaborate with you on your site. I have some solid background in CMS apps like Drupal, Joomla, Wordpress etc etc..

If you hit any issues or looking for any specifics let me know. I am always available and I am more than willing to work out barters etc..

I'm looking to add some more site work to my portfolio, and I'd be willing to exchange work for testimonials. You know how to find me!

Hey thanks!

A lot of the grunt-work has already been done -- the template was a purchased political template, and I heavily modified it. (for instance, it came with a US flag as integral to the banner image. The replacement with the NC flag was all photoshop magic)

I have sunk about 16-20 hours of solid work to get it to where it is right now -- ready for serious content creation. Of course there are a lot of things that need to be "cleaned up" and I still want to add the WYSIWYG editor module like I did for the Vance County NC GOP Drupal I created here (http://vancencgop.com/) for my mother...(who on account of Ron Paul is the county chairman in Vance County.)

I sure don't have much to exchange at this point in time. I just started a massive donation broadcast with a letter I posted here. I've gotten massive loads of positive feedback -- but no new donors from it yet. Between Christmas and the economy, most all of the campaign cash is held amongst the country club set. Fortunately, the person who demurred earlier on fundraising manager is slowly but surely moving in the direction of taking the position.

In any case, I will do what I can, but right now that's not very much. Mind you, right now I still have some time to work the site myself. Tonight I will be out putting some signs up, and the canvass schedule gets really heavy towards the latter half of January and then goes non-stop until the election.

I just need to crack this form submission nut for the "Get Involved" field and I'll be good for now...

GunnyFreedom
01-01-2010, 01:16 AM
I'm certainly not a web programmer. I can usually find my way around and am in agreement that you are missing a script. Do you intend for your form replys to go to your email or a database? Regardless what I see missing is...

<FORM action="www.yoursite.com/put_this_information_where_I_want_it.php" method="post">

If you want it to go to your email, well, it's not hard to make a php script to do that, but they are unsafe unless you know what you are doing, I don't. Places like godaddy, if they host your site, supply with the proper script to get the form sent to your email account. If it is going to a database you need it to post to a script that will write the information to the database.

Thanks! At this point i don't care where it goes, as long as it goes SOMEWHERE that I can access the data. Either that or I need to remove it. Having that field is very nice for people who want to get involved but don't want to drill through the site to find out how. But not having the field at all would be way way better than having the field and it does nothing. Having NO field is a neutral. having a broken field is a negative. Having a working field is a strong positive, so I will try and actually get it to work if possible.

I have one of those fancy "fantastico deluxe" enabled hosting accounts, with a full backend, so there are php servers etc available...mind you I'll have to "best guess" the path.

I am more than willing to use a script adjacent to the form itself, which I have seen more than once. I'm just not a coder -- AT ALL -- so I'd be guessing from ground zero. HTML I can deal with, scripting not so much. I'm sure it's easy, but I just never learned any language except Pascal, and it's a bit late in the game to start now.

Security I'm not so worried about, frankly, I do not at this time expect too much ugliness in THIS particular campaign. My opponent may be a country-club Democrat, but she is...timid... for the most part.


ETA -- for the moment, I can comment it out...
ETAA -- OK, commented out, so at least I don't torque off any potential helpers...
ETAYA -- Just added a "Click Here to sign up for e-mail updates" in place of the much better looking form field...

Bman
01-01-2010, 01:29 AM
You'll certainly need to talk to someone better than me. I once made a mail script and it worked until Godaddy sent me a message that they disabled it and gave me the script they wanted me to use.

Here's what you want

http://www.freewebmasterhelp.com/tutorials/php/5

and

http://www.freewebmasterhelp.com/tutorials/php/6


This is how you get your form to work. You point the form to a certain php script or such. The php script you sent it to takes the POST information and applies it to the variables in the script. Then the mail command takes those variables and has them sent to the email account you have specified through your server. Like I said there are security issues (i have no real idea what they are, it's just what I've been told), and depending on who runs your server you may not be allowed to run a mail script.

GunnyFreedom
01-01-2010, 02:07 AM
You'll certainly need to talk to someone better than me. I once made a mail script and it worked until Godaddy sent me a message that they disabled it and gave me the script they wanted me to use.

Here's what you want

http://www.freewebmasterhelp.com/tutorials/php/5

and

http://www.freewebmasterhelp.com/tutorials/php/6


This is how you get your form to work. You point the form to a certain php script or such. The php script you sent it to takes the POST information and applies it to the variables in the script. Then the mail command takes those variables and has them sent to the email account you have specified through your server. Like I said there are security issues (i have no real idea what they are, it's just what I've been told), and depending on who runs your server you may not be allowed to run a mail script.

Thanks! Yeah, that's pretty much exactly what I need, though as you might have guessed, the existing php scripts are hidden below the root level. I mean, if it were my own in-house dedicated server, this would be easy, I think... 8-(

GunnyFreedom
01-01-2010, 02:31 AM
YES! That worked! field is back, and POST e-mail is working great! Thanks for the assist Bman!

Bman
01-01-2010, 04:02 AM
YES! That worked! field is back, and POST e-mail is working great! Thanks for the assist Bman!

Anytime Gunny.

t0rnado
01-01-2010, 04:18 AM
I was just checking out your site and I noticed that a person could just click "Go!" and still get be forwarded to the "Thanks for your interest! The form has submitted successfully. Please hit the back button on your browser to return to the page you just left." page.

You add some code that checks if all the variables are set. The isset() function should help


if(isset($email) && isset($name) && isset($zipcode))
{
//Store everything in the database
}
else
{
//Your error message
}

GunnyFreedom
01-01-2010, 05:02 AM
I was just checking out your site and I noticed that a person could just click "Go!" and still get be forwarded to the "Thanks for your interest! The form has submitted successfully. Please hit the back button on your browser to return to the page you just left." page.

You add some code that checks if all the variables are set. The isset() function should help


if(isset($email) && isset($name) && isset($zipcode))
{
//Store everything in the database
}
else
{
//Your error message
}


OK, thanks -- I think I can handle that. I've already got a "spamcheck" in the code. I'll post what I have already, and then how I think your code here will fit in, and you can correct me if I'm way off base (never having fiddled with PHP before...)

Existing PHP function:



<?
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field))
{
die("Invalid Input!");
}
}

$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$zip=$_POST['zip'];
checkOK($zip);
$to="nchouse49@glenbradley.net";
$message="$name just filled in your Get Involved form. They live in:\n$zip\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n"))
{
echo "Thanks for your interest! The form has submitted successfully. Please hit the back button on your browser to return to the page you just left.";
}
else
{
echo "There was a problem sending the mail. Please hit the back button and check that you filled in the form correctly.";
}
?>

Proposed modification to PHP function:

(does PHP let you nest if-then-else statements using the curly brackets? I honestly do not know)



<?
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field))
{
die("Invalid Input!");
}
}

$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$zip=$_POST['zip'];
checkOK($zip);
$to="nchouse49@glenbradley.net";
$message="$name just filled in your Get Involved form. They live in:\n$zip\n\nTheir e-mail address was: $email";
if(isset($email) && isset($name) && isset($zip))
{
if(mail($to,"Comments From Your Site",$message,"From: $email\n"))
{
echo "Thanks for your interest! The form has submitted successfully. Please hit the back button on your browser to return to the page you just left.";
}
else
{
echo "There was a problem sending the mail. Please hit the back button and check that you have filled in the form correctly.";
}
}
else
{
echo "There was a problem sending the mail: There appears to be blank fields in the form. Please hit the back button and check that you have filled in the form correctly.";
}
?>

I am guessing that you can use curly brackets to nest if-then-else statements, that that should be proper. But like I said, the only coding I have ever done in my life is a little bit of Pascal in High School ohhh... round about 1990, 1991... LOL

I'm thinking maybe I should leave the check-for-blank off for the zip code though, if I het a name and an e-mail...hell, I should probably only check for filled on the e-mail field. Hmm... have to think a bit. Though really it is a good idea to have all three...

Thanks!

t0rnado
01-01-2010, 06:26 AM
That should work correctly and yes, you can nest logic statements. Also, I'd suggest setting up a SQL database that stores all of the names, emails, and zipcodes. Then you can just mass mail everyone in the database instead of having to do it manually.

GunnyFreedom
01-01-2010, 07:29 AM
That should work correctly and yes, you can nest logic statements. Also, I'd suggest setting up a SQL database that stores all of the names, emails, and zipcodes. Then you can just mass mail everyone in the database instead of having to do it manually.

MUHUHUHAHAHA!!! (Maybe I shoulda been a coder...)

problem: The first code mod did not work, as the values "Name" and "Email Address" qualified under "isset" enough to transmit the e-mail.

solution: preg_match let me match a regular expression so that I could compare what the values were with what they should have been.

further solution: used !preg_match so that I did not have to swap around TRUE and FALSE. Ended up with:



if(!preg_match("/Email Address/",$email) && !preg_match("/Name/",$name))
{
if(mail($to,"Comments From Your Site",$message,"From: $email\n"))
{
echo "Thanks for your interest! The form has submitted successfully. Please hit the back button on your browser to return to the page you just left.";
}
else
{
echo "There was a problem sending the mail. Please hit the back button and check that you have filled in the form correctly.";
}
}
else
{
echo "There was a problem sending the mail: There appears to be blank fields in the form. Please hit the back button and check that you have filled in the form correctly.";
}



ETA -- logically, using NOT (!preg_match) I should probably change && to || otherwise it will only return an error if BOTH are not set. Using && it means that if EITHER is set it will call "success." Hmm..

PHP is a pretty easy code this language...

ETAA -- no, in order to return "TRUE" I'll want && instead of || -- as I have it now, it will ONLY return "true" if BOTH values have been unset, otherwise it will always return false. So && is the correct operator.

ETAYA -- I would have wanted to use OR || if I hadn't used NOT ! on the preg_match operator. ie "if a OR b matches unset then (true) fail, else success.

LOL sorry I always get a little excited at learning new stuff.

Austrian Econ Disciple
01-01-2010, 07:30 AM
Nice site Gunny, keep up the good work. I'll have to take more than a cursory look later and critique (And yes, policy and philosophy critique :p)

One quick one: Just abolish eminent domain. This "vote" or referendum merely replaces the State owning your property to everyone else. If instead you mean the State buying the property voluntarily, you should clarify (Then again, you know my feelings on that....the State creates nothing and has no money, only that which it takes). Curious on your wording here....

GunnyFreedom
01-01-2010, 07:47 AM
Nice site Gunny, keep up the good work. I'll have to take more than a cursory look later and critique (And yes, policy and philosophy critique :p)

One quick one: Just abolish eminent domain. This "vote" or referendum merely replaces the State owning your property to everyone else. If instead you mean the State buying the property voluntarily, you should clarify (Then again, you know my feelings on that....the State creates nothing and has no money, only that which it takes). Curious on your wording here....

Annexation is not exactly the same as eminent domain though... they may be related but they are not the same.

The question is about whether a city can expand it's boundaries into a community. On some level, incorporated ares such as townships and cities really do need to expand. By establishing a referendum for boundary expansion it will satisfy both needs. one, the need for people/communities to avoid unwanted cities expanding over top of them, and two, the need for cities to expand.

This will avoid the practice of expanding cities over communities that do not want them (townships which expand to increase revenue generation only) while still permitting townships and cities to expand over places where they are actually needed (the citizens in the community want municipal services)

If it were actually a pure question of eminent domain, I would agree with you wholeheartedly.

FindLiberty
01-01-2010, 08:02 AM
Site looks nice, good job!

GunnyFreedom
01-01-2010, 08:13 AM
Annexation is not exactly the same as eminent domain though... they may be related but they are not the same.



OK, I fixed the explanation on the site to make it more understandable:


Forced annexation is a very controversial policy in North Carolina related to eminent domain. Eminent Domain assumes that the citizen does not own their own property, but the municipality, county, and State does.

The policy of forced annexation allows cities and townships in North Carolina to to expand their borders to encompass communities whether they want to be a part of that city or not: to "annex" people's property against their will, thus increasing their taxes, and placing them under onerous local regulations.

Many cases of forced annexation can be traced to a simple desire for cities to increase their tax base. Often they will annex rural communities who already have all of the services which the municipality offers, and the quality of the community in question will decline.

Other times, annexation is necessary, and desired by the citizens in the communities being annexed. There can be no question but that sometimes cities and townships need to expand, and to entirely prevent all growth of a municipality can lead to stagnation.

Glen Bradley opposes forced annexation but supports voluntary annexation, and will introduce legislation to mandate that no community can be annexed without a properly certified and victorious ballot referendum of the people themselves who are facing annexation by a growing city or township.

GunnyFreedom
01-01-2010, 08:14 AM
Site looks nice, good job!

Awesome! thanks. :)

In a few hours (after twiddling with the site through the night) I'll be downing a 5hr energy and going to plant some signs. :D