Archive for March, 2010

Ereads.com has launched!  

Posted at 6:45 am in Announcements

After hundreds of hours of programming, designing, and data entry, the ereads website launched yesterday.

About Ereads

E-Reads is a trail-blazing reprinter of out-of-print genre and general fiction and nonfiction by leading authors. Their books are available in all e-book formats and paperback. E-Reads was founded by literary agent, Richard Curtis.

About the Website: Before

Ereads.com used to be a blog website with ASP pages supporting a book catalog. Google’s “Blogger” was used to publish the blog and the books were updated via an simple ASP content management system. The old design had an out-dated look and only offered the bare minimum detail on books published by E-Reads. Another challenge was that E-Reads had all their book meta data in various spreadsheets on a local file server. It was a flawed system, but one that worked well for years.

About the Website: The Plan

The plan was to build a new website that was powered by a database with all the scattered meta data. It sounded simple enough, but there was a ton of work to do. First we needed to come up with a design for the website and a logical design for how the database would function. Production Manager, Nathan Fernald, was given the task of coming up with a new design, while I was charged with building the database and designing the engine.

About the Website: The Blood, Sweat, and Tears

After compiling all the data from various spreadsheets we found that we were missing about 60% of the data on over 1500 titles. Since the company was started 11 years ago buy an entirely different staff, we had no way to recover the missing data other than manual data entry. I built a CMS that had a database to fit all the meta data, imported all the excel spreadsheets, and began the attack on all the missing information. We had to add covers, isbns, sample chapters, retailers, contracts, missing authors and various other data into the system. In the end of all the work, the database grew to 90 thousand rows of data.

About the website: The Launch

Ereads.com is now powered by wordpress as well as a powerful new PHP engine (built by me :bows:). The CMS allows our staff to post books with sample chapters and an unlimited amount of retailer links. The blog had been designed to run faster and allow guest bloggers to make appearances from time to time.  Functions that the CMS provide are: production management, meta data exporting, contract tracking, rouge data filtering, a robust book search engine, and much more.

Thanks again to everyone who participated in this project.

Written by Anthony Damasco on March 27th, 2010   5 comments  

Sponsor:

A simple way to hide your wordpress website until launch.  

Posted at 11:05 am in Programming,Technology

Recently I had to revamp a website for a client. The website was using Word Press to power it and so I had to do some template editing that would make the website look very broken while I was experimenting. What I did was stop Word Press from running at all unless a get request happened.

To do this you must first find “index.php” in the root folder on your blog. It should look empty aside from loading the blog header. Then you paste in this code:

<?php
$display = $_GET['display'];

if ($display !== “yes”) {
echo ‘Post a polite message letting the user know that the site is being worked on, you may use HTML in this space’;
exit();
}

?>

After saving and uploading your modified index page, you will only see the message that you are echoing. If you want to see the wordpress blog you need to include ?display=yes at the end of your URL.

example: http://mysite.com/blog/?display=yes

Now you are free to experiment with the CSS without worrying about any users seeing the website break. If you have any questions about this, ask them in the comments.

-AD

Written by Anthony Damasco on March 24th, 2010   16 comments  

Software Review : Ccleaner – A free way to clean up a windows machine.  

Posted at 5:55 am in Reviews,Software,Technology

Ccleaner is the real deal. It’s a free software that offers a lot of great computer cleaning tools. Ccleaner has become part of my routine when doing maintenance to computers. Here’s the CNET review:

Although it lacks a few of the bells and whistles found in other PC-cleaning applications, this free program offers more than enough features to make it a worthy download. CCleaner’s interface is logically designed and makes it easy to wipe away your tracks from Internet Explorer, Firefox, Opera, and Google Chrome from various Windows system areas, and from some third-party applications.

CCleaner doesn’t support the large number of extraneous programs that some competitors do, but it can erase traces from such popular programs as Spybot – Search & Destroy and WinZip. CCleaner now offers secure file erasing along with a Registry-cleaning utility that quickly scans for invalid entries before removing them. CCleaner can even back up your Registry before removal, in case it accidentally removes a crucial component, and the download includes a rudimentary feature for uninstalling any program on your machine.

Since this free application handles the majority of PC-cleaning chores and offers a nice extra, we strongly recommend CCleaner to all users, except those who need robust tools to remove supersensitive data.

Features:

  1. Cleans out temp files for all browsers on your computer.
  2. Cleans out temp data from software installations
  3. Scans and fixes registry errors
  4. Offers a faster way to view “add and remove programs” without having to use the slow working windows tool.
  5. Allows you to quickly edit the startup software without having to access msconfig

I fully recommend this software to anyone to wants to have their computers running faster in no time.

-AD

——> Download

Written by Anthony Damasco on March 15th, 2010   7 comments  

Send A txt msg to any phone from your email.  

Posted at 3:36 pm in General,Technology

Do you need to send a text message out, but your phone is outta commission? Or are you out of texts? Cell phone carriers forward incoming emails to the phones. Here is a list of email domains based on the carrier:

Alltel [10-digit phone number]@message.alltel.com
Example: 1234567890@message.alltel.com
AT&T (formerly Cingular) [10-digit phone number]@txt.att.net
[10-digit phone number]@mms.att.net (MMS)
[10-digit phone number]@cingularme.com
Example: 1234567890@txt.att.net
Boost Mobile [10-digit phone number]@myboostmobile.com
Example: 1234567890@myboostmobile.com
Nextel (now Sprint Nextel) [10-digit telephone number]@messaging.nextel.com
Example: 1234567890@messaging.nextel.com
Sprint PCS (now Sprint Nextel) [10-digit phone number]@messaging.sprintpcs.com
[10-digit phone number]@pm.sprint.com (MMS)
Example: 1234567890@messaging.sprintpcs.com
T-Mobile [10-digit phone number]@tmomail.net
Example: 1234567890@tmomail.net
US Cellular [10-digit phone number]email.uscc.net (SMS)
[10-digit phone number]@mms.uscc.net (MMS)
Example: 1234567890@email.uscc.net
Verizon [10-digit phone number]@vtext.com
[10-digit phone number]@vzwpix.com (MMS)
Example: 1234567890@vtext.com
Virgin Mobile USA [10-digit phone number]@vmobl.com
Example: 1234567890@vmobl.com
7-11 Speakout (USA GSM) number@cingularme.com
Airtel (Karnataka, India) number@airtelkk.com
Airtel Wireless (Montana, USA) number@sms.airtelmontana.com
Alaska Communications Systems number@msg.acsalaska.com
Aql number@text.aql.com
AT&T Enterprise Paging number@page.att.net
BigRedGiant Mobile Solutions number@tachyonsms.co.uk
Bell Mobility & Solo Mobile (Canada) number@txt.bell.ca
BPL Mobile (Mumbai, India) number@bplmobile.com
Cellular One (Dobson) number@mobile.celloneusa.com
Cingular (Postpaid) number@cingularme.com
Centennial Wireless number@cwemail.com
Cingular (GoPhone prepaid) number@cingularme.com (SMS)
Claro (Brasil) number@clarotorpedo.com.br
Claro (Nicaragua) number@ideasclaro-ca.com
Comcel number@comcel.com.co
Cricket number@sms.mycricket.com (SMS)
CTI number@sms.ctimovil.com.ar
Emtel (Mauritius) number@emtelworld.net
Fido (Canada) number@fido.ca
General Communications Inc. number@msg.gci.net
Globalstar (satellite) number@msg.globalstarusa.com
Helio number@messaging.sprintpcs.com
Illinois Valley Cellular number@ivctext.com
Iridium (satellite) number@msg.iridium.com
Iusacell number@rek2.com.mx
i wireless number.iws@iwspcs.net
Koodo Mobile (Canada) number@msg.koodomobile.com
LMT (Latvia) number@sms.lmt.lv
Meteor (Ireland) number@sms.mymeteor.ie
Mero Mobile (Nepal) 977number@sms.spicenepal.com
MetroPCS number@mymetropcs.com
Movicom (Argentina) number@sms.movistar.net.ar
Mobitel (Sri Lanka) number@sms.mobitel.lk
Movistar (Colombia) number@movistar.com.co
MTN (South Africa) number@sms.co.za
MTS (Canada) number@text.mtsmobility.com
Nextel (United States) number@messaging.nextel.com
Nextel (Argentina) TwoWay.11number@nextel.net.ar
Orange Polska (Poland) 9digit@orange.pl
Personal (Argentina) number@alertas.personal.com.ar
Plus GSM (Poland) +48number@text.plusgsm.pl
President’s Choice (Canada) number@txt.bell.ca
Qwest number@qwestmp.com
Rogers (Canada) number@pcs.rogers.com
SL Interactive (Australia) number@slinteractive.com.au
Sasktel (Canada) number@sms.sasktel.com
Setar Mobile email (Aruba) 297+number@mas.aw
Suncom number@tms.suncom.com
T-Mobile (Austria) number@sms.t-mobile.at
T-Mobile (UK) number@t-mobile.uk.net
Telus Mobility (Canada) number@msg.telus.com
Thumb Cellular number@sms.thumbcellular.com
Tigo (Formerly Ola) number@sms.tigo.com.co
Tracfone (prepaid) number@mmst5.tracfone.com
Unicel number@utext.com
Virgin Mobile (Canada) number@vmobile.ca
Vodacom (South Africa) number@voda.co.za
Vodafone (Italy) number@sms.vodafone.it
YCC number@sms.ycc.ru
MobiPCS (Hawaii only) number@mobipcs.net

- AD

Written by Anthony Damasco on March 11th, 2010   12 comments  

PHP Function: remove special characters from post data  

Posted at 6:33 am in PHP Functions,Programming,Tutorials

Since I began programming 6 years ago I always had trouble with collecting data from forms. Users tend to copy and paste data into them, capturing special characters in the process. The special chars then end up in the mysql data as some random garbage, then it appears on the website as weird symbols.

A while back I asked a programmer friend of mine if he had a function that would help out with this. He did! I’ve been using it with the last 9 applications that I built, and it works every time.

Here is the function code:

if (!function_exists('cleanText')) {

function cleanText($str){

$str = str_replace("Ñ" ,"&#209;", $str);
//$str =  preg_replace('/Ñ/g',"|&#209;|", $str);

//echo "Text BEGIN ".$str."  --- ".bin2hex ("Ñ")."\n<BR>";     // d1

/*
for($i = 0 ; $i < strlen($str) ; $i++){
echo "".$str{$i}."  - ". bin2hex ( $str{$i})."<BR>";
}
*/

$str = str_replace("ñ" ,"&#241;", $str);
$str = str_replace("ñ" ,"&#241;", $str);
$str = str_replace("Á","&#193;", $str);
$str = str_replace("á","&#225;", $str);
$str = str_replace("É","&#201;", $str);
$str = str_replace("é","&#233;", $str);

$str = str_replace("ú","&#250;", $str);

$str = str_replace("ù","&#249;", $str);
$str = str_replace("Í","&#205;", $str);
$str = str_replace("í","&#237;", $str);
$str = str_replace("Ó","&#211;", $str);
$str = str_replace("ó","&#243;", $str);
$str = str_replace("“","&#8220;", $str);

$str = str_replace("”","&#8221;", $str);

$str = str_replace("‘","&#8216;", $str);
$str = str_replace("’","&#8217;", $str);
$str = str_replace("—","&#8212;", $str);

$str = str_replace("–","&#8211;", $str);
$str = str_replace("™","&trade;", $str);
$str = str_replace("ü","&#252;", $str);
$str = str_replace("Ü","&#220;", $str);
$str = str_replace("Ê","&#202;", $str);
$str = str_replace("ê","&#238;", $str);
$str = str_replace("Ç","&#199;", $str);
$str = str_replace("ç","&#231;", $str);
$str = str_replace("È","&#200;", $str);
$str = str_replace("è","&#232;", $str);
$str = str_replace("•","&#149;" , $str);

return $str;

}
}

?>

Stick this in code in a page called “functions.php” and include it at the top of the page.  It uses str_replace to replace special characters. You can add and remove characters easily by coping $str = str_replace(“•”,”&#149;” , $str); and just replacing the character and the code when necessary.

Here’s a snip of it in action

HMTL Form:

<form method="post" action="clean_data.php">
<input type="text" name="textfield">
<input name="submit" type="submit" />
</form>
clean_data.php:
<?php

include "includes/functions.php";

// Get post Data from form
$textfield = $_POST["textfield"];

// Clean Data
$textfield= cleanText($textfield);

echo $textfield;

?>

And that’s all there is to it. If you have any questions, post them in the comments of this post.

-AD

List of Special Characters

Written by Anthony Damasco on March 11th, 2010   3 comments  

Intro to PHP: 01 “the echo”  

Posted at 4:20 pm in Programming,Technology,Tutorials

If your just getting into PHP you first need to know how it works. PHP actually creates HTML on the server side before the user loads the page. PHP is in charge of checking for arguments, getting data from databases and sending emails. PHP is also capable of much more if modules are installed on the server.

Getting your feet wet:

What you need to know:

  • HTML
  • FTP
  • An understanding of how web servers work.

PHP lets us do things that HTML does not. Let’s go through some basics.

<?php

echo “some stuff!”;

?>

To tell the webserver that you are using PHP you need to start with a <?php. You follow it with your code, then close it with ?>. Using echo tells PHP that we want to spit something into the HTML. You can echo anything. Javascripts, style sheets, anchor tags, and anything else that is valid in HTML.

what makes this important is the arguments that you use in PHP.

<?php

if ($this_variable==”HAPPY”) {

echo ‘<link rel=”stylesheet” type=”text/css” href=”css/SUPER_HAPPY_STYLE.css”>’;

}

else {

echo ‘<link rel=”stylesheet” type=”text/css” href=”css/SUPER_SADFACE_STYLE.css”>’;

}

?>

What the argument above is doing is checking a variable, and if it’s set to “Happy” then it will tell the page to use the happy style sheet, if its not, set it to the sad style sheet. This little snip of code could be used to let your visitors change the websites theme. I’ll cover variables next time!

-AD

More on Echo

Print vs Echo

Written by Anthony Damasco on March 9th, 2010   4 comments  


Facebook
Follow damasconet on Twitter