Thursday, September 18, 2008

Implementing subversion, installing Eclipse PHP

I've reinstalled Eclipse with the thought it will be easier to check stuff in and out of subversion when the time comes. I also realised they have quite a decent debugger, once I'd setup mysql to handle the queries from my desktop, it all works great!

Still trying to work out how to make the debugger "ignore" certain errors (Debugger working for version 5.. but writing for version 4).

BFN

ps. Here is how you find your version of redhat:
uname -a
cat /etc/redhat-release -------(laymans)

Thursday, August 21, 2008

Many hosting options

Basic hosting

Hosting can either be very simple, or very complex. It really depends on a few basic factors.
Are you expecting a dramatic amount of traffic right away? Or a gradual increase from nothing? What kind of scalability do you expect? If you don't know the answers to these questions, have a look at the traffic for some of your competition to get an idea of what you might expect. Is your site going to be database driven? Or mostly a static site?
The other main consideration would be features. Small sites just starting out will do wonderfully with a cheap shared hosting plan. There are literally thousands of options out there, I suggest going with one of the larger corporations though, less chance of them disappearing (along with your site!).
Larger traffic sites can look at co-lo hosting, getting one or more machines hosted at a facility designed to manage the hardware. Very rarely would I suggest you host your sites in house. Only if you have dedicated sys admins, a proper server environment with full backups for power and connectivity. The last thing you want is for a natural disaster, or accident to turn your site off! While these things can happen at other facilities, they are usually designed to keep running even in event of natural disasters.
For truly massive sites (although I don't think you'd be reading this, as you've got teams of people like me to tell you these things) it's exciting to setup clusters of machines, working with masters and slaves (machines) and distributed environments around the world. Good fun! Sadly not relevant for most of us though.

My personal site, which I have a very simple page with very little design or information I host with GoDaddy.com. My only reasoning for going with them as a host, was that my domain was registered there. Please give it more thought than me! I hate the interface trying to get into my account. I have to click through a half dozen pages of ads assaulting me, dreadful interface trying to guess where my next link will pop up. Truly a painful experience. Luckily most of the time I simply ftp straight to the server, and skip that user interface nightmare. I have setup a bunch of "testing" sites there, where I post sites I'm working on for various projects, since I like to keep my home network truly hidden.

Friends and associates have found success hosting personal sites with 1and1.com, although I've never personally used them, I hear they are good!

Please don't judge me by my home page! Ever heard the adage "The cobblers children have no shoes". That's my site! I spend so much time on sites for clients, and for new ideas etc, I never actually update my own. Please have mercy!

BFN

Wednesday, August 20, 2008

What the site is for?

Finding out reasons why the web site will exist (Sales, Marketing etc)

What is your website for? Sometimes that’s easy to see, since you sell your products directly to consumers, or you want them to go see your show. At other times it can be much less clear. What if you want them to go to see the show, but you don’t know how you can work out if it was successful or not. How many people went to the site, and as a direct result of the visit, went to the show.

Setting up these goals at the outset, will give you something to gauge your progress.

Sadly I’ve seen some sites which want everything. TPTB want the site to be profitable, while also increasing awareness about products, while also selling products. This can be done, but it must be understood that making a site profitable through advertising will also send users away from your site, and lessen the time they spend learning about your products. It can be counter productive to do both, so be very careful when deciding the best choice, you may be destroying your profits, customer loyalty and trust, to make a small amount selling ads. It could also be the other way around, where you should definitely focus on site advertising, you have very high traffic, and know that users will continue to use your site for buying your products, it would be a waste not to also offer then advertising, thus increasing overall profit without damaging the brand.



What is this site for? Well, so I can practice some of my fledgling writing skills on the unsuspecting web public. Hopefully one day people will leave comments... :D

BFN

Tuesday, August 19, 2008

Transaction processing, lots to consider

For shop sites, how the transaction will be processed

There is lots of information out there about setting up a shopping cart/store on your site, so I won’t cover those items. I’d like to go over all the _other_ options, and how to get the money from your people!

Some sites, (eg. Amazon.com) have wonderful API’s which allow you as the web developer SO much opportunity to sell stuff. If the things you want to sell are already on Amazon, more’s the better, because not only can you earn money by selling these products, but you can ALSO earn a cut of selling them through Amazon! Neat huh?

There are other store’s which offer similar API’s, as well as some which have affiliate programs worth pursuing. If you don’t have many things to sell, and you’re in the right market segment, then another example is Best Buy. They offer you the ability to earn a small percentage on what people end up buying at their online store, after clicking on a link from you. The only real drawback with them is that there is no API. That means all data about the product, including the link to it, you have to manually find in their tools, and add to your site.

The beauty of using an API, is that you can have your site do all the work for you!

I’m a massive fan of letting the site do all the work.. that’s what they are for right? An API should let you find out a lot of information about the product you wish to sell, after being given only a little. You can send over the UPC, title, or similar identifier, and have the other site tell you everything about it. From the cost, the link for more information, a buy link, an image of it, reviews, and much more. Using just this information you can enrich the content on your own site, without having to do much at all! Plus it can happen real time, so the information the user is seeing the most current possible.


As much as possible writing small add on’s, applications, or server side scripts to take care of any manual task the better. When a user see’s your content changing, they will come back more often, just to see what’s different! Creating a “clearance” or “news” section to a site, then never updating it, is instant site death. If a user comes to your site twice, and doesn’t see this information change, they won’t come back again because they assume it will never change. You don’t have to make it too hard on yourself, especially if you can make that content truly dynamic. If you spend a day a month just creating news items for the next month, then use a content manager to schedule them to come out every few days, suddenly your site appears relevant and up to date, even if that is the only thing on the site which is changing!

Thursday, August 14, 2008

Content Management is important

If you’re not a strong programmer, or don’t have a strong programmer working for you, your best route for a content management system is to just use one off the shelf. There are now tons of really good open source systems out there that can do just about everything. The only drawback with using pre-made over using a custom system, is that you won’t have as much control over the interface, specifically the backend. When I write a custom system, I draw from a basic framework that I have put together over the years, but customize the variables, database tables, and menu’s, so it’s specifically for only that site.
To make things easier for myself though (save time & money) I set all the variables at the top of each page. This way while each page stands alone, if they want to add/edit/remove a field, it can be added quickly and easily.

Security! This is a very important part of your cms. If it’s at all possible, I highly recommend never running this directly on a production server. This makes it harder for disreputable people to find it in the first place, leaving less room for brute force or other attacks.
This being said, if it’s going to be a well known site, you can protect your CMS in two ways, sometimes both. You can use the server (if it’s *nix use .htaccess) so that they can never even get to a login screen. Alternately you can use DB/server side scripting to protect your site. There are positives and drawbacks to both, so this decision should be made at the outset, as to what the security requirements will be.

BFN

Wednesday, August 13, 2008

YouTube XML uploading

YouTube has created a fairly simple way for users to bulk upload videos. I say "fairly" because you actually need to create an XML file with the appropriate contents. As always, I seem to run into problems in the documentation and examples. I understand what it's like to write a big massive piece of documentation, then get so involved in it, you can't see the obvious errors (it's Appendix E not Appendix D).

I'll give a quick example of one thing that I was a little irritated by (because I knew it was going to break, but I had to guess which way was correct, sadly I picked wrong!):
yt:title, Required. The tag specifies the display title of a TV or movie video. This tag may have the same value as the media:title tag.
Subtag of: movie_metadata tv_metadata.
THEN..
tv_metadata, Required etc.
Subtags: id, show_title, episode, episode_title, season

Umm.. yeah.. so it's a subtag of it, but it's not a subtag of it? So it turns out, it's not! But of course I found that out the hard way (trying it).

I know it sounds like I'm getting on their case, but I assume many people read/use these documents, and has no one ever mentioned these problems?

Anyhoo! Book writing is going.. well.. no where! Sadly. Will have to get back on track next week. Tomorrow I'll post another excerpt, then another one next week!

BFN

Tuesday, August 12, 2008

All quiet on the ...

Quiet days yesterday and today. So far just thrown up a page with a couple video's for a PR that's going out today. The main site we're working on is supposed to go up shortly, but they have yet to actually choose a domain for it! Oh well.. chicken or the egg, either way they'll have a site.

Tried to help MS out yesterday (front end developer) with a problem related to the video's on the page. There are basically 5. One in the main spot, and one beneath it which load with the page. When the user clicks on one of the movies to see details (which open in smoothbox) both of them need to stop. This is all working OK, the error occurs because each of those movies has also a trailer link, which then brings each of the (up to 3) trailers into replace the on load trailer. For some reason the variable he was passing to detect which of them was playing, so to know which one to stop, then restart once smoothbox was done, just wasn't working!
I made some suggestions about how to pass the variable differently, but I believe it is still not working. Sometimes the simplest things about the most basic interface can get really hard to make work! Like the smoothbox + ajax error, which is still not resolved. There must be someone out there who's got it to work before, I just have to find out who that is?!

BFN

Friday, August 8, 2008

AJAX and smoothbox - no resolution!

An update on the past few days trying to get smoothbox links to open from a list generated using AJAX. We couldn't solve it. I don't know a great deal about Mootools, but the front end developer seems to think it's basically impossible. I just think we haven't cracked it yet. I created a test page in which I used the AJAX object in Mootools to create the links, but it still wouldn't recognize the 'class="smoothbox"' in the link, just opened it to a new window.

Frustration! Sadly today is the day we show the site to TPTB, so those beautiful smoothbox layovers are off the site, replaced by clunky old school window popups.
I simply can't get it into my head that we can't use AJAX, and Smoothbox together. The front end developer (who for brevity's sake I'll refer to as MS from now on) thinks that it wouldn't matter which framework he used, that it simply won't work. I think we're just missing something still, so if anyone comes across this while searching for a solution, AND finds a solution, please let me know how it works! If for some strange reason we crack it, I'll definitely post again as to how it was solved.

BFN

Thursday, August 7, 2008

Ajax and Smoothbox problem persists

We've tried a ton of different things to get this to work, but it's just not working! Today I will rewrite the ajax to come from mootools framework, instead of my own script, with the hopes that the html returned will be able to use smoothbox.

The closest solution we found, and attempted to implement (unsucessfully) was found in the comments on the smoothbox web page.

# Pietr Says:
2008-04-01 at 10.32 am

There is a problem when you dynamically load content via AJAX into a div or span. If you have a link with the smoothbox class inside, it is not possible anymore to use the smoothbox, as it seems that the new element is not being regcognized as a smoothbox element. The link is just opened in the current window, and not in a smoothbox. How can this be circumvented? (A sort of “reindexing” of the smoothbox elements would be required I think.)

Then:

# Boris Says:
2008-04-01 at 10.33 am

Just run TB_init() after you AJAX call.
---------------------------------------------------

So we tried to run TB_init() in a bunch of different ways, but still no luck! Will update with results.

BFN

Wednesday, August 6, 2008

AJAX and Smoothbox issues

Back to a situation today where the front end developer and I both think it's the "other" person who needs to fix a problem between ajax and smoothbox.

The entire process
User "drags" an item into a "box".
The JavaScript then runs my script thusly:
pickMovie(item.id);
Then my script does this (shortened for brevity's sake):
function pickMovie(int) {
xmlHttpPoll=GetXmlHttpObjecta()
var url="/pickmovie.php?element_id="+int
url=url+"&sid="+Math.random()
xmlHttpPoll.onreadystatechange=stateChangeda
xmlHttpPoll.open("GET",url,true)
xmlHttpPoll.send(null)
}
Basically all it does is capture the ID, and send it to the PHP page. At the PHP page, it does a nice big request from the database, and returns the following:

<li><a href="http://www.blogger.com/titleinfo.php
?id=1&keepThis=true&TB_iframe=true&height=609
&width=761" class="smoothbox">Title</a></li>

So now this is returned to the JavaScript to output like:
function stateChangeda(){
if (xmlHttpPoll.readyState==4 || xmlHttpPoll.readyState=="complete"){
$('demo').setStyle('display', 'none');
$('searchResultsCont').setStyle('display', 'block');
var resultsList = xmlHttpPoll.responseText;
var amp ="&";
var updatedResultsList = resultsList.replace(/&/g,amp);
$('searchResultsUl').innerHTML=updatedResultsList;
}
}
Pretty simple? The output we found had all the &'s turned into &'s. No idea why, but so hence why the front end developer did the replace here.

Doesn't work.. I mean the link works, but it doesn't use the smoothbox script. It works elsewhere on the page, where it is simply written, but not when returned through AJAX.

I'll post more as we learn more!

BFN

Tuesday, August 5, 2008

100 Open Source Presentations...

100 Open Source Presentations From OSCon

Very interesting to see what's new out there! I particularly liked the Developers vs Designers pdf. Way back in the late 90's when Java was "the next big thing" I really thought it would be. I was amazed at what a wonderful language it was (is). While at News Interactive we wrote some internal apps in it, but were unable to find a way to integrate it into the web sites, since Java applets were just not what the users wanted to deal with. With that experience, and being fortunate enough to attend the www7 conference in Brisbane, Australia in 1998 I thought that Java would eventually adapt itself enough to be useful in the web. From what Developers vs Designers pdf talks about, I think the future is once again rosy.

Still.. love PHP now!

I loved the How to be Normal pdf, simply because it explains in a simple, understandable and concise way what I've been trying to show people who _don't_ choose to normalize their database structure since the start! Over the past week I've been debating how best to cover this in the book I've been writing, and I think (without so much of the technical aspects) this will help me get my thoughts together .

Friday deadlines

I am always astonished to hear a deadline has come down from on high, and it's been set to a "Friday". At first I thought perhaps I was some sort of super genius (well that's still possible) but wouldn't that be the absolute worst day of the week for a launch??

Reasons why Friday's are bad launch days (for web sites, and pretty much anything):
  • Everyone has had a long week, and are exhausted at the end of Friday, and all want to go home and rest. People make mistakes when they are tired, and tend not to work as efficiently when they are thinking about all the wonderful plans they have for their weekend, none of which include being at work.
  • What happens if something goes wrong? It either stays broken over the weekend, or the staff have to stay late on Friday plus possibly WORK all weekend. This messes up your relationship with your users, and your staff, a lose lose situation.
  • People often take Friday as a vacation day. There is a chance, some of your staff won't even be there!
Recommendations: There are 4 other days of the week!
Personally my favorite go live date is a Tuesday. You set the deadline for finishing work on the Friday, spend Monday testing/final tweaking, then Tuesday morning you go live. This gives you all day Tuesday to iron out anything else that you didn't see on Monday, while it's early in the week, your staff is still fresh and not tired, and the chances of them cutting into personal time is extremely minimal.
Sometimes though these dates come from TPTB and you can't set Tuesday as your launch. Absolutely determined that it is "done" by Friday. This means you have to squash your timeline, and set the real deadline for Thursday. Have everything done, completely written and tested, then Friday MORNING go live. Spend the day ironing out any last minute bugs, and voila, everything is ready to go for a full weekend, and staff can enjoy it as they rightly deserve.

See how simple this is? It doesn't just work for web site launches either, it is plain out COMMON SENSE people. Think about it!

Sadly I know the only people who read this agree with me already *sigh*. Make a case to your bosses, use all the reasons I've posted and more that you think of!

BFN

Thursday, July 31, 2008

Advertising (How to get people to find your site)

There are a couple different ways you can go about this, plain straight out advertising. Buying ad space on other sites, using print media, making sure your URL is on every other form of advertising you do for your business.

There are less obvious ways to advertise your sites as well. Simple things like following forums about topics relevant to your business, and posting there, keeping your URL in your signature. While that can be a great way to get known, be very sure that the topics you post about are relevant, or you can generate negative publicity, be banned, or kicked out etc. Not really good with the web community, they tend to not let people who abuse their realm kindly.

Start a blog! Make sure again, that it’s interesting and relevant. Don’t start a blog about your cat, and expect people to buy your refrigeration units.

Blogs are best updated daily, or more often. If not people forget to come visit! You can also use the blog as a way to network with other businesses that are complimentary to yours, friends and family. I’ve found that people read/visit blogs most often when they contain images. If you can draw a diagram of something, scan it, do it in Photoshop, or take a picture of a product, people will come back for more.

If you are using a blog to create awareness of your company, I suggest forgoing the quick and easy “ad banners”. Although people are used to seeing them, it can confuse the message. Instead fill the extra column with links to relevant sites, polls, trivia etc. Something to engage the user, without sending them away.

(Apologies for editing/typos etc, I haven't been through to edit anything before I post it. Wanted to throw up as many ideas as I have, when I have them, for final edit later as the book comes together)

Wednesday, July 23, 2008

Frustrated with the state of things..

I decided to start writing a book! Hopefully I'll finish it one day.

Watching what other people write as web applications has started to really irritate me. I can't understand what's so hard about the basic principles. Making an application easy for both the end users, and the people who manage the content (assuming that the content changes). Writing a content manager which shows the results of a table with the label of each column before every record? Seriously unreadable stuff!
Then for laying out the content of a selected record, doing it horizontally across the page instead of down the page.

These people have jobs, and make good money writing these completely unusable systems. I'm the last person to have design experience. I can't design my way out of a paper bag, but I have learned what users like. They like larger fonts, easy to read, plain layouts and fewer pages. For this I'm only referring to content manager interface design, not the front end user interface.

Basically the book will cover the following:
- Finding out reasons why the web site will exist (Sales, Marketing etc)
- Domain name choice (very important!)
- Basic hosting
- For shop sites, how the transaction will be processed
- For marketing sites, best way to get the message across
- Writing an easy to use, content manager, or using a framework or ready made CMS
- Simple rules for Database Design
- Design considerations (I won't actually write this part...)
- Site architecture
- Advertising (On the site.. if you must)
- Advertising (How to get people to find your site)
- Simple analytics (Setting goals for what you want from your site)

I'd like to write a whole extra part which focuses on email marketing, but it's possible that should be a sequel.

In the meantime, I need to get started on my introduction!

Introduction

With a history of over 10 years writing web site and applications, and watching while others struggle with what feels simple to me, I decided to write it all down.
My goal with this book is to make something that anyone with a little know how, and enthusiasm can put together a simple web site that works. Easy to use for both end users, and the people who manage what goes on the site itself.
I will spend more time talking about interface design than anything else, because I feel this is often overlooked when people create websites. Look and feel are very important, but without an easy to use intuitive interface that is all for naught. The focus is to get users to come to your site, and once they are there, enjoy their experience enough to come back. It's possibly you won't complete your goal (sell them something, encourage them to join in marketing campaigns) the first time they visit. If you make the site compelling enough, they can return, and on that visit you have another chance to capture their attention.
Too often I find myself surfing the web, looking for something in particular, only to find I'm rejected by a site. Either it's too hard for me to find what I want to buy/research, or the barrier of entry is too big.
As a user, people get tired of entering their credit cards and login details to tons of different sites. There are alternatives! Some of them better than others, but I'll describe them all, and you can choose the best option for you.

I'm excited to share with you so many details about making a web site that will make it great! What I won't do is describe the exact code to write. Everyone has their own style, and comfort zones, plus when talking about custom CM's, amazon, paypal etc, I'll include the examples the come with the software, but won't go into detail about syntax. There is some assumption that you want to write your web site using open source software. If this is not the case, there is still a lot of valuable information about architecture, interface design and usability that you can use to make web sites correctly.

So who is this person telling you all about how to write a web site right? Hi I'm Jeni. I started writing web sites back in 1996, but have experience writing in other programming languages before that. My first real project writing for users was creating a MUD (Multi User Dimension). Basically it's a text based adventure game. Writing the game involved me in the entire SDLC as well as dealing with users comments and complaints on a daily basis. Definitely it was a lot of fun, but I could see that there were ways the interface was failing for the users.
THEN frames were added to the HTML DTD, and my life changed forever!

...

I wrote a ton more, but I switched to using Open Office, as that way if Blogspot decides to not play nice I'll still have a copy. More on it tomorrow! Must write 1,000 words a day.

BFN

Friday, June 6, 2008

Neat new things on Pearloo

My memory isn't what it used to be, and I'm too lazy to go through old posts to see, but I'll write it like it's new news to you.
Working on a side project called "Pearloo". It's location based social networking. I made that up! Getting tired of explaining what it is in twenty sentences.

I've been doing ajax on my ajax under my ajax, with my ajax. It's getting a bit of a rats nest of includes. I think I'm going to consolidate all my ajax JS files to save some pain and suffering, and think up a decent naming convention for my span results, and for the functions themselves.

Now really only the 'add location' page is kaputt. By that I mean.. I can't make heads or tails of the javascript in it, but it works! Which I guess is the good part, if only I could understand completely WHY it works.

Picked up a new book on C++, so going to have a bash at it again, this time doing some command line style game programming. Looking forward to getting my head around it, as I finish the last Algebra book I studied a while back.

Maybe I should get a book on Calculus next? I mean.. I already know it, but I want to practice it so I don't lose it (any more than I already have that is).

BFN

Wednesday, May 28, 2008

Amazon Price mistake

This was just funny, while researching ice cream and yogurt makers, I came across an entry for a Salton YM9 1-Quart Yogurt Maker which typically cost up to $30 (yogurt makers in general) but I found one on Amazon for: $100,000.00

Not sure if the link will work for long (until it's fixed?)



Too Funny!

Thursday, May 22, 2008

I <3 Oracle

Lies!!

For my own future reference, to get the last inserted ID (being created by the trigger from a sequence because auto increment is non existant) simply do this:

SELECT schema.sequence_name.currval as the_id FROM dual

Yep.. simple eh? I couldn't find that anyplace online, so I'll try and include some descriptive keywords I searched for like last inserted ID, auto_increment, last_number, OK I think that's enough.

Tschüss!

Thursday, May 15, 2008

Why would an upgrade change all the settings?

A couple months ago, we decided that on a single machine, outside our regular development/staging/production environment to setup upgrade to PHP5, so I could test all teh sites, fix any problems, before we go ahead and upgrade all the machines.

I've been so busy since then, only yesterday did I get a chance to glance at the upgraded server. Turns out.. they installed PHP5, and went ahead and disabled mysql, oracle, pear, gd and well.. everything else.

How would I ever possibly be able to use this as a web server running data driven sites?? When I say "upgrade" I usually mean "Just like it is, except the newer version".

I've sent off the email to ask them to actually configure it in the same way as all the other servers, lets see how long this takes before I crack and do it myself.

Tuesday, May 13, 2008

Live Search - auto complete off!

Just for fun, I decided to write a live search version of the main movie DB.

It was much quicker/easier than I thought.. since it's basically just ajax!

I call the ajax->php bit "onkeyup".

Do the DB query, and write it to a list which appears in a div under the form field.

I think it should be harder!!!

Oh and.. autocomplete="off" in the form tag turns off the browser autocomplete.

I'll post snippets another time, although it's pretty darn obvious eh?

Tuesday, April 29, 2008

New project, zapping all my time

Although I'd been pretty quiet work wise for the past few weeks, it's not picked up. Next Wednesday we go live with a new site.
Luckily the site is really only one page. That's not _exactly_ true, but sort of. It's for the classic (1980's-1990's) American Gladiators. Cool stuff.. cept nothing to do programming wise.
I have created a DB table for the video's, game's, downloads and cast. Aside from that there's no other data!

Took about 20 mins to create the admin site, and about 20 more to customize it. Waiting on the front end to start integration.

I just can't think of anything else moderately interesting to post. Tonight I'll be working on my side project, to try and get it out the door faster.

Cheers

Thursday, April 17, 2008

Front end fun - LiveValidation & mooSwitch

Being a back end developer means that most of the time I don't get to do anything fun on the front end (well.. that's relative since I don't really like doing front end stuff). Recently I've been spending a lot more time using AJAX for pages that I don't want to reload. Initially I wasn't liking it one little bit, but now I've come to not mind it so much. Especially since I really don't have to write much in the way of Javascript, except to use it to capture a click and send the data to PHP.

I found two very neat new add ons to use in my forms. One of the I was completely blown away by how simple it is to implement: Live Validation
Their website is very straight forward, and using the functions is incredibly easy. All the examples work, and show you specifically what to add to your forms to use. Right now I'm using the email validation, and the password matching validation. I will continue to do server side form validation, but this is going to make my forms so much more user friendly!

The other is called mooSwitch. In a new form design, the designer wanted the radio buttons to appear as a small toggle/slider. I googled what I was looking for, and this one came up. Within a few minutes, I had my radio buttons being sliders. It does require mootools, but the front end developer is using that already, so no worries.

I've been doing a ton of development recently, but I'll break up my posts over a few days to spread the topics.

Cheers!

Tuesday, April 15, 2008

RSS feed links as error messages

Things have been pretty quiet here of late work wise, so I decided that I was bored with writing error messages for our internal tools. The person who uses the tools 99% of the time had expressed the opinion that error messages such as: There was an error, try again later; are boring, and she prefers the ones I write when I'm mad: It didn't work. BUMMER!.

With this in mind, and knowing her love for a certain blog that talks about celebrities in an unflattering light.. I thought wouldn't it be fun to incorporate links to the blog, with headlines, in the messages. This will aid me in two ways. Firstly she will have something to do while I fix the error. Secondly it will make her like me more, thereby improving communication between our parts of the sites. OK.. maybe the second one isn't the real reason..

I searched for a while trying to find a super simple way of grabbing what I needed. Honestly I don't remember it being this hard last time, but I settled on an example, and some tools from Bobulous.
I'm using the xml regex functions from Bobulous, as well as the make_safe function (good idea, and similar to one I already have).
The resultant code looks like this:

$xml = file_get_contents('http://dlisted.com/rss.xml');
$news_items = element_set('item', $xml);
foreach($news_items as $item) {
$title = value_in('title', $item);
$url = value_in('link', $item);
$item_array[] = array(
'title' => $title,
'url' => $url);
}

if (sizeof($item_array) > 0) {
$count = 0;
$html="";
foreach ($item_array as $item) {
//I removed the link from the next line.. blogger was not pleased
$html .=make_safe($item['title']);
$html .= ', ';
// Limit the output to three news items.
if (++$count == 3) {
break;
}
}
$html .= '<br>';
$funniest_error=$html;
}

Now wherever I want to leave a nice lil title/link for the users, I'll include this page, and put $funniest_error wherever I want the list of 3 links to appear!

Fun!

Thursday, April 10, 2008

Writing a throw away content managed page

The title of this post is a touch confusing, since the page itself is not exactly throw away, but it going to be completely different in the next few months, or whenever we get go ahead for the redesign.

Custom throw away content management is pretty much my specialty now anyhow! Nothing else to code, might as well get on with it.

I'll be using the same includes as the regular tools, and attach the admin page to the nav in the existing tools. It has a sub nav for each section of the page that needs to be managed.
Sub nav as follows:
Main
Secondary
More Movies
Bottom Left
Bottom Middle
Bottom Right

Since the three boxes along the bottom of the page can have any title at all, it's hard to name them except to describe their location.

The main section is going to be a bit tricky (actually secondary will be tricky too).
It consists of a large image, and some javascript to embed some quicktime links with a link to the official site.

Basically just going to create a table for each section, and a main table which links all the pieces together. Not sure yet how to structure that all in an easy to use page for our site content manager.

FUN!

(Will post code snips once I actually write some)

Cheers!

Wednesday, April 9, 2008

Programming instructions.. for my cat feeder..

Yeah seriously.. someone posted this cheat sheet on amazon, and I need to put it here so I don't lose it, and when the batteries die I can reprogram the damn thing.

snip------------>

Cheat Sheet for Programming Le bistro Portion Control Feeder

Press and hold program button, press and hold + button let go of both at the same time. Unit should go to meal time.
Press + and unit moves to meal size
Press + and unit moves to current time.
Press set.
AM will be flashing, if you need PM press + then press set
First number will be flashing
Pressing program moves to the next number
+ changes the number
When the time is correct press set

Unit will go to meal time, press set

Breakfast will be flashing, press program unit will move to the first number
To change the number press +
To move to the next number press program
Do this until the time is set, Press program one more time and the number in the right upper corner will be flashing
1 means yes I want to feed this meal
0 means no I do not want to feed this meal
Select 1 or 0 and press set

Unit will go to meal time press set
Unit will go to Breakfast, press + and it will move to lunch
***to set 12:00 you will need to set 00:00 unit will NOT set 12***
Press program and the first number will start to flash--set the time in the same manner you set Breakfast
Set 1 or 0 to feed or not to feed then press set
Unit will go back to meal time, press set

Unit will go to breakfast, press + will go to lunch press + again and unit will move to dinner
Press program and first number will start to flash, set time in the same manner you set breakfast and lunch.
Set 1 or 0 to feed or not to feed then press set
Unit will go back to meal time, press +

Unit will go to meal size
Press set
1 in the right upper corner will start to flash
1=1/4 cup
2=1/2 cup
3=3/4 cup...etc
Select amount you want to feed.
**** Unit will feed the same amount for each meal***
Press set and unit will go back to meal time
Press and hold program button, press and hold set button let go of both at the same time.

Unit should have the correct time, the amount you selected to feed in the upper right hand corner and the meals you select on the left side.

***00 in the bottom right corner is the number of meals fed***

***To manual feed press set and hold, press + and hold, let go of both buttons at the same time. Unit will feed until you press set and + again

------------>

Woot!

Friday, April 4, 2008

Massive Virtual Hosts file

That would sum up my week.. sorting through a massive and horribly disorganized virtual hosts file. Trying to determine what url's are actually still live, which ones even point to the servers still, and which one's I can redirect or simply delete.

There are over 5000 lines in the file.. Yep! That's a whole heap. I've chopped it into many sub files, so I can work on them piecemeal, and then put them back together and push live.

JOY!

<virtualhost 80="">
ServerName pretendurl.com
ServerAlias www.pretendurl.com
Redirect / http://www.otherurl.com/
</virtualhost>

Tuesday, March 18, 2008

Twitter Mashup

After seeing the interesting mashup app that the folks over at Commuter Feed have created, I think that Matt's idea for our project (Pearloo) is doable. Since our project is it's beta and first version will not have the ability to receive phone txt msg's (sms) from the users, we were hoping to use twitter.

This may be a simple way for users of Pearloo to send in updates for their account. The only real problem then is how we can have them add something, and interpret it correctly to add the update. This problem also exists for if the users were to send updates via sms. Still not sure how this will work, but we're thinking about it.. hard!

Cheers!

Serendipity

New foray

My other blogs have all died. I'd go as far to say one was actually murdered? My most popular one of course. This one is going to be different. Last one failed because I let myself post about a lot more than just the matter at hand.

This is going to be 99% about a new web application that I'm writing, and any other applications I may write along the way.

The same day I start this blog, I will also start a blog about Science Fiction, tv shows, movies, and books. I'm a great SciFi fan, so hopefully that will stop any "bleed over" to this blog.

Cheers!

--Serendipity