Showing posts with label 30dayStartup. Show all posts
Showing posts with label 30dayStartup. Show all posts
Tuesday, April 24, 2012
Day #11 of a #30 day startup
Well, I got the site up and running over the weekend; you can find it at ChatParla. You can change the langauge wherever you are by clicking English, Deutsche or Castellano (Spanish), Registration to post comments (and threads) is fairly easy, all it needs is a valid email address.
I won't now be able to work exclusively on this project, so it's no longer valid to call it a #30 day startup! Of course there are further enhancements I will make to the site over the course of time eg an admin section, log-in facility with OpenId, further formatting changes etc. Apart from my own time, the only expense I've incurred in setting this up has been a £10 domain registration; I already have some hosting space to run the site.
The language switcher as set up up in Cakephp is not too difficult to reproduce on other types of site, so if you want a call-logging or a web directory that needs different language functionality, please get in contact.
I hope this set of entries has been of interest.
Saturday, April 21, 2012
Day #10 of a #30 day startup
Latest addition to the site functionality has been to enter a "slug" when viewing a thread and associated comments. The "slug" is the title you see on a url eg www.mysite.com/view/2:this-thread-about-London where the slug is "this-thread-about-London". It makes it easier to see what a thread is about from its link, and aids also in SEO terms. For those cakephp programmers who'd like to know how to implement this, I took notes mainly from generate unique slugs and from routing in the cookbook
I'm constantly busy on the site at the moment. Some good news is that I have a domain name now
, and I hope to write more on this in the next blog article.
Friday, April 20, 2012
Day #9 of a #30 day startup
I've made further progress on the site, and have set up the code so that titles can be translated automatically into the respective language, so long as I've inserted those translations into the relevant .po files. The attached screenshot should give an idea of how it looks when viewing in another language. I think I may well get the site up and running early next week, and adapt the site according to feedback. I believe it will already be useful for my own surfing/commenting purposes. Later I hope to include embedded vids from sites like Vimeo or Youtube, but I'd like to get the conversation parts working first.
For those who are developing in Cakephp and want to implement a multi-language site here are two useful links : cakephp book and Localizing Japan.
Wednesday, April 18, 2012
Day #8 of a #30 day startup
A productive day today. I put in the language selector mechanism. By selecting the language a session id will stay in memory, so that if for example you chose the German option, all the comments you see when perusing threads would be the ones made in German. It's also easy enough to change to English or Spanish if you want to look at what people are saying in other languages. I'm not doing the same with the thread header - ideally people will comment on the same discussion point but in their respective language. One thing I will now have to do is modify the code to display titles and help-text in the relevant language, but that shouldn't be too hard to implement. I've got some other functionality planned for the site, but it's looking as though I can migrate to the website sometime next week!
Day #7 of a #30 day startup
Just a very short entry for day 7. I've got to the stage where there are so many code elements (eg new record screens, checking user is entitled to make entries) that need checking and tweaking, that I haven't a lot of time to write articles. Maybe a longer one tomorrow?
I suppose that is my lesson learnt for the day - coding can be long and time-consuming!
Monday, April 16, 2012
Day #6 of a #30 day startup
Today I got into the essential nitty-gritty of writing a web application - allowing registration and log-ins of users, and putting in place authentification of data entry. Luckily I've done this before, and there is also a very helpful section on authorization in the cakephp documentation which makes a lot of the coding fairly straight forward, although the layouts and screen markups still need to be altered to fit screens. Initially I won't be putting restrictions on whoever can register onto the system - indeed there may not be many at all! However I am leaving status codes in the users table as there may well be hackers who create users merely to post spam - at which point I will also utilise the use of such services like Stop forum spam. As stated, to begin with I intend making registration (and consequent posting) as easy as possible. But there will be validation and sanitization of data entered - I'm not quite so reckless!
Friday, April 13, 2012
Day #5 of a #30 day startup
Lesson learnt today: Coding involves learning something new on a regular basis. Again this is something we constantly re-learn, it's what makes coding so fulfilling. The downside is spending hours finding out how to achieve something, that should really only take a few minutes to accomplish. At least the next time, the task is done quickly and effectively.
The functionality of the site is getting better - but there is a lot yet to be done. I won't be posting here over the weekend, but no doubt I'll be looking at the code at some point.
Cakephp finding: Here's something I didn't previously know and has re-kindled my love for the cakephp platform - the counterCache behaviour. In my case it automatically updates the comment_count field in the parent table with the aggregated sum of related comments in the child table. This will save a lot of database calls to bring back number of comments against a posting. And the only code to implement this goes in the Comment model - 'counterCache' => true . Fantastic! (it's described in the Cakephp cookbook )
Thursday, April 12, 2012
Day #4 of a #30 day startup
Lesson learnt today: I still hate css! :)
For those who code in cakephp, and want to highlight the current tab (yet are not extracting menu items from a db table) the following may be of interest.
In the controller function (remember this has to be done for each function that renders the layout and menu element)
if ($category_id==1) {
$this->set('activeTab','General');
} elseif ($category_id==2) {
$this->set('activeTab','Culture');
} elseif ($category_id==3) {
$this->set('activeTab','Tech');
This means that in the element I can set a class for the current tab, via php - unfortunately the sanitisation of code means I can't show it here. Basically the php will echo class="current" within the li> tag if activetab is set to the relevant value.
For those who code in cakephp, and want to highlight the current tab (yet are not extracting menu items from a db table) the following may be of interest.
In the controller function (remember this has to be done for each function that renders the layout and menu element)
if ($category_id==1) {
$this->set('activeTab','General');
} elseif ($category_id==2) {
$this->set('activeTab','Culture');
} elseif ($category_id==3) {
$this->set('activeTab','Tech');
This means that in the element I can set a class for the current tab, via php - unfortunately the sanitisation of code means I can't show it here. Basically the php will echo class="current" within the li> tag if activetab is set to the relevant value.
Wednesday, April 11, 2012
Day #3 of a #30 day startup
Lesson learnt today: take breaks. Long spells of trying to crack a problem are often counter-productive.
This is a lesson I am continually having to re-learn. Last night I was stuck on a minor problem, and spent hours trying to figure it out. As soon as I closed the pc and got ready for my supper drink, I was struck by the thought "why not try option X". First thing this morning I tried "option X" and cracked the problem first time. It won't always work like that, but more often than not a break can give that breath of inspiration you need to crack a poser.
Most of today was getting certain logic to work in the code - for some reason automatic date fields weren't being set, also I needed to view associated comments when viewing a thread. There's a long way to go yet, but I'm inching towards my destination.
Tuesday, April 10, 2012
Day #2 of a #30 day startup
Lesson learnt today? - It's good to have a visual mock-up of what you are heading towards.
I'm writing this entry early today, not because I'd like the afternoon off (chance would be a fine thing) but because I've got an early representation of what a main screen may look like on the site. I already had sketches that I am working to, but a screen mock-up can show us all how the display can look. Already it has indicated to me certain validation restrictions that I will have to include in the coding of the site.
Now, although I'm happy to be described as a programmer or even a web developer, I am not a web designer. Yes, I can change layouts, introduce drop down menus or change the appearance of text. But to make a site overall look professional, it's essential to get layout from a good web designer included - something to consider if you want a website building.
However I stated in my initial post that I'm trying to run this as a lean startup ie not spending money where possible. So I have made use of a css free templates site and chosen this layout http://www.csstemplatesfree.org/preview/Nautica/ It's been written by Luka Cvrk, and if you like his designs (you can find them at Luka's site ) then please patronise his work - he has both free and decently-priced premium templates. I'm not going to stick to everything in that layout - much will have to change as my site develops. But it's good, I feel, to get a glimpse of how the site may look.
PS
CakePhp code tip: To specify which css file and layout to use for a screen, use this line in the function code (for example for index or view) in the controller
$this->layout='yournew_layout';You can then specify the css file you require from that layout file.
Monday, April 9, 2012
Day #1 of a #30 day startup
Well I decided to take the plunge, and monitor the progress of my latest project on this blog.
I've developed and coded websites previously, but this time I thought others thinking of persuing their web idea, may be able to learn from my experiences, if only in avoiding any silly mistakes I make! Of course, if I get knowledgeable folk leaving advice here via the comments facility they will be very welcome!
Where I can it's going to be my own work (no outsourcers employed), and I intend spending as little money as possible on developing and launching the site. Use of opensource software, free tools etc will be the ideal mode of working.
The idea behind the website is to set up a multi-lingual talk-board, initially with English, German and Spanish. I won't use automatic translations, as I'm still not happy with the translations that automatic software produces. However I hope to link (and translate directly) entries on threads in different languages - if we get any users of course!
I'm still unsure as to whether I commit the code to Github, so others can utilise or modify the code - I'll publish my decision here in a later entry.
Name of the website - I haven't chosen yet, nor have I yet obtained a domain. I will develop the site on my local machine, and so for the first week or two there will just be screenshots to observe here.
What have I done today? Set up cakephp 2 on my development machine, created the initial table structure, and used cakephp bake utilities to initialise some screen views - which will all need to change dramatically over the coming days. Hopefully more to come tomorrow.
Subscribe to:
Posts (Atom)