4 Replies - 1089 Views - Last Post: 23 October 2008 - 10:42 AM Rate Topic: -----

#1 RLDir  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-October 08

Amateur coder looking to tackle professional problem, looking for some

Posted 20 October 2008 - 05:28 PM

Okay, I am an amateur coder in many ways; I have been 'coding' in multiple languages for over a decade, but aside from HTML and CSS, and SQL, I have always limited myself to borrowing and modifying and/or hacking existing code to make it work for my needs (whether stealing the code from open source programs, or using tutorials/books to get code snippets). I have toyed with PHP, Perl, Python, C. C++. and others such as javascript, Java, VisualBasic, etc. I have a decent working knowledge of coding in general, but I know I couldn't just sit down and start designing a new program from scratch based on what I know. I have tried books and online tutorials and even a few actual classes; and while I learn from each, I have never yet had the drive to actually master any languae to the point where I can just start writing fresh code for myself.

I now have a few projects I would like to do this with; I have decided I would finally like to have something I can look at and say that I made it from scratch, not something cobbled together from others' work edited for my uses. And so I would like to get some general advice for one of these projects.

I think based on my limited knowledge ofthe various languages, PHP is best forme to code in for now...I know a little more of it than I do of others. The first piece of advice I would like is in the editing software. I have used notepad (okay but no longer something I would use), Frontpage (never again, thanks!) and Dreamweaver (I am on CS3 and love it for HTML/CSS work, but it seems to me to be just 'okay' for PHP...?). I have read of a few others online like Notepad2, Notepad++, RapidPHP, and PHP Designer 2008. And I am sure others exist out there.

I know that usually there is no one 'best' choice, it depends somewhat on your tastes and whatnot - but what would you recommend I use?

Okay, aside from that, here is what I hope to accomplish with my latest project, a grand plan that I hope I can actually create...I would welcome advice on how to break this down into separate pieces and what to work on first, etc.

The overall site will be a community with four (or five) different groups. As a quick overview;
  • Group A is a paid advertiser; able to post ads to sell stuff or provide services/etc.
  • Group B is a second type of paid advertiser; instead of posting daily (or hourly, etc.) ads to sell stuff or provide services, they can use banners for advertising.
  • Group C is like Group B, but they provide services to the advertisers (website design, photography, other classified ads sites, etc.) - their banner ads are only visible to members of Group A and B.
  • Group D is a non-advertising paid member who can access some of the more advanced community features, such as writing or viewing in-depth reviews of advertisers and their products, etc.
  • Group E are non-paying members who can more or less only view live and/or banner ads, and see the overall rating of an advertiser (but not the details of the reviews).
In some cases, one member may join multiple groups - a member may want both live ads and banner ads and so join both groups A and B; they may also provide some service to other advertisers and join group C. Members of Group C may also pay to be in Group D; but group E is certainly exclusive as non-paying... so the combinations would be: a, a+b, a+c, a+b+c, b, b+c, c, c+d, d, or e. I don't know if that makes any difference, but...?

So, 5 types of members; I assume one or more SQL databases and/or tables will be used - I am contemplating an individual database for each member, with tables used to define some of the profile stuff; that's probably beyond the advice I am asking for here though.

For the setup of the site itself, I need a classified advertising system, as well as multiple forums, and semi-intelligent banner advertising; showing banners based on the group type of the member viewing, as well as location, possibly even profile specific info such as gender and age.

On top of that, I want to add basic forums and possibly a live chat - on these I may end up using one of the virtually endless number of premade systems out there; but if I can manage to build my own and incorporate it all into one functioning global community site it would be all the better.

I also want a ratings/reviews section, where the paying members can review the advertisers and their products, based on a small number of criteria (performance, cost, honestly, speed, etc.).non-paying members only get to see the overall score for each area, paid members can see the number of votes, the time frame for those votes (oldest and newest), as well as read any in-depth comments posted as part of those reviews.

Additionally, I want a searchable directory of all advertisers, where the paid members can search based on any one or more of the profile keywords.

There are a few more details, but this is the general layout and functionality of the site I envision as a whole. I would appreciate any feedback and advice you may have for me as I enter the planning stages and start looking into how to start coding it!

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Amateur coder looking to tackle professional problem, looking for some

#2 pemcconnell  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 54
  • View blog
  • Posts: 472
  • Joined: 05-August 08

Re: Amateur coder looking to tackle professional problem, looking for some

Posted 21 October 2008 - 07:56 AM

For a project ofo that size I would advise you put it on hold for a bit, and learn as much HTML, CSS, SQL, PHP and Javascript as you can - atleast until you are at a relitively high level.

Once you are a confident coder, you will need to find a designer to work with - being in control of the programming will allow you to manage your project and control the work you want the designer to do.

The project doesn't seem complicated, so between yourself and a designer, the work could be done in a week, with a further week put in for tweaking, bug testing and graphical updates.

Dreamweaver is a perfect PHP edittor in my opinion as the syntax highlighting is excellent - it also quickly allows you to search all the code in every page in your site which is very useful. The only thing is that it can be quite expensive for someone who doesn't get paid to code, so a freeware alternative might be better. I've used the Dreamweaver series for my PHP work for 5/6 years now and I've never had a complaint.

For any project (again in my opinion) you should always have just the one database, and use tables for each aspect of your project.

MOD:
should this be moved to 'Request a Service'?
Was This Post Helpful? 0
  • +
  • -

#3 RLDir  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-October 08

Re: Amateur coder looking to tackle professional problem, looking for some

Posted 21 October 2008 - 11:26 AM

View Postpemcconnell, on 21 Oct, 2008 - 07:56 AM, said:

For a project ofo that size I would advise you put it on hold for a bit, and learn as much HTML, CSS, SQL, PHP and Javascript as you can - atleast until you are at a relitively high level.

Once you are a confident coder, you will need to find a designer to work with - being in control of the programming will allow you to manage your project and control the work you want the designer to do.

The project doesn't seem complicated, so between yourself and a designer, the work could be done in a week, with a further week put in for tweaking, bug testing and graphical updates.

Dreamweaver is a perfect PHP edittor in my opinion as the syntax highlighting is excellent - it also quickly allows you to search all the code in every page in your site which is very useful. The only thing is that it can be quite expensive for someone who doesn't get paid to code, so a freeware alternative might be better. I've used the Dreamweaver series for my PHP work for 5/6 years now and I've never had a complaint.

For any project (again in my opinion) you should always have just the one database, and use tables for each aspect of your project.

MOD:
should this be moved to 'Request a Service'?

Thanks for the advice.

I guess I should have been a bit clearer on my skills... I own my own website design business and have had this as my sole income for 7 years now. I have VERY strong HTML (and CSS) skills, and I am not too concerned about my knowledge of SQL - I can definitely get the job done.

And as to Dreamweaver being expensive, I already have a multi-console license for the Adobe CS3 master collection and may soon be getting one for CS4, so it is no problem on that end. I just thought it felt a little light in the code-hinting and syntax highlighting areas; but maybe that is just because I really don't know a ton of PHP...

I probably even have what some would call 'basic' skills with just about every other coding language out there; but I don't feel comfortable at this point in saying I do, since (as I qualified above) the extent of my 'coding' has been borrowing or outright stealing bits and pieces of code and hacking them together.

The help I am asking for is advice on the way to approach this to code the PHP from scratch. I already have the overall design and work flow of the website completed and laid out. I really only need to get the coding done, but as I said I would really like to use this as my spring board to start writing my own code from scratch, and I am just not sure where would be best to start.

That said, I have gone ahead and started anyway, just writing a small PHP file with some functions in it that would be more or less globally used.

The first one I wrote was a protect function to help prevent SQL injection or other code injection - I think based on stuff I have copied in the past that this is accurate, and I think I know why; but if not I would love to be corrected!
function protect($data){
	$data = mysql_real_escape_string($data);
	$data = strip_tags($data);
	$data = addslashes($data);
	return $data;
}

The second I wrote is a generic connection script, I often see the server and username, etc. set up as discreet variables; I figure as long as I understand what each one is, and as long as I am using this one function globally to connect, it can't hurt to hard-code them in, right? Again, if there is a good reason not to, please let me know!
function connection(){
	$con = mysql_connect(localhost, RLDir, password) or die(mysql_error());
	$db =  mysql_select_db(RLDirDB, $con);
}

And for now that is all I have. Not much, I know, but I was sort-of waiting for some responses here before I got too involved into it...I'll keep doing a little here and there and posting updates; but advice and input is very welcome!
Was This Post Helpful? 0
  • +
  • -

#4 pemcconnell  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 54
  • View blog
  • Posts: 472
  • Joined: 05-August 08

Re: Amateur coder looking to tackle professional problem, looking for some

Posted 22 October 2008 - 01:14 AM

View PostRLDir, on 21 Oct, 2008 - 11:26 AM, said:

View Postpemcconnell, on 21 Oct, 2008 - 07:56 AM, said:

For a project ofo that size I would advise you put it on hold for a bit, and learn as much HTML, CSS, SQL, PHP and Javascript as you can - atleast until you are at a relitively high level.

Once you are a confident coder, you will need to find a designer to work with - being in control of the programming will allow you to manage your project and control the work you want the designer to do.

The project doesn't seem complicated, so between yourself and a designer, the work could be done in a week, with a further week put in for tweaking, bug testing and graphical updates.

Dreamweaver is a perfect PHP edittor in my opinion as the syntax highlighting is excellent - it also quickly allows you to search all the code in every page in your site which is very useful. The only thing is that it can be quite expensive for someone who doesn't get paid to code, so a freeware alternative might be better. I've used the Dreamweaver series for my PHP work for 5/6 years now and I've never had a complaint.

For any project (again in my opinion) you should always have just the one database, and use tables for each aspect of your project.

MOD:
should this be moved to 'Request a Service'?

Thanks for the advice.

I guess I should have been a bit clearer on my skills... I own my own website design business and have had this as my sole income for 7 years now. I have VERY strong HTML (and CSS) skills, and I am not too concerned about my knowledge of SQL - I can definitely get the job done.

And as to Dreamweaver being expensive, I already have a multi-console license for the Adobe CS3 master collection and may soon be getting one for CS4, so it is no problem on that end. I just thought it felt a little light in the code-hinting and syntax highlighting areas; but maybe that is just because I really don't know a ton of PHP...

I probably even have what some would call 'basic' skills with just about every other coding language out there; but I don't feel comfortable at this point in saying I do, since (as I qualified above) the extent of my 'coding' has been borrowing or outright stealing bits and pieces of code and hacking them together.

The help I am asking for is advice on the way to approach this to code the PHP from scratch. I already have the overall design and work flow of the website completed and laid out. I really only need to get the coding done, but as I said I would really like to use this as my spring board to start writing my own code from scratch, and I am just not sure where would be best to start.

That said, I have gone ahead and started anyway, just writing a small PHP file with some functions in it that would be more or less globally used.

The first one I wrote was a protect function to help prevent SQL injection or other code injection - I think based on stuff I have copied in the past that this is accurate, and I think I know why; but if not I would love to be corrected!
function protect($data){
	$data = mysql_real_escape_string($data);
	$data = strip_tags($data);
	$data = addslashes($data);
	return $data;
}

The second I wrote is a generic connection script, I often see the server and username, etc. set up as discreet variables; I figure as long as I understand what each one is, and as long as I am using this one function globally to connect, it can't hurt to hard-code them in, right? Again, if there is a good reason not to, please let me know!
function connection(){
	$con = mysql_connect(localhost, RLDir, password) or die(mysql_error());
	$db =  mysql_select_db(RLDirDB, $con);
}

And for now that is all I have. Not much, I know, but I was sort-of waiting for some responses here before I got too involved into it...I'll keep doing a little here and there and posting updates; but advice and input is very welcome!


Ahh - sorry I jumped the gun and thought you were a hobbyist coder or something like that.

Well, if you want my advice as to how you should go ahead with the project, my own structure goes as follows:

1. Design the homepage in Photoshop, split and cut.
2. Create the site folder structure, along with the XHTML and CSS template (Just for the index.php and global site styles)
3. Create the database architecture.
4. Split the index.php templates code up, so that all my 'constants' are in their own individule files, i.e.
<?php
require_once('Includes/header.inc.php');
require_once('Includes/topnav.inc.php');
require_once('Includes/menu.inc.php');
?>
<!--PAGE CONTENT HERE-->
<?php
require_once('Includes/footer.inc.php');
?>


5. Create the globals.inc.php, db_connect.inc.php and functions.inc.php files and place it in your Includes folder. Then require them all at the top of your index.php template.
6. Popuplate those files with any globals i need, any functions that I know I'll be using and the database connection.
7. Save the index.php file as a new file - template.php. Repeat this for any unique sections (Such as contact_us.php, products.php etc.. - basically anything that will have some hardcoded content)
8. If I want clean URLs I would set up the folder structure to suit, and place a copied version of my index.php in each.
9. Develop the admin (CMS) system.
10. Pull info from database out to menu's and footer. (Constants).
11. Add any functionality I need to the menu (e.g. is it expandable).
// That is the sites template complete //
12. In the section where my page content will output place a simple SELECT FROM LIMIT 1 and pull any dynamic page content I need.
// That is now a fully functional site.

The area where you'll probibly spend most of your time is the unique, mostly hard-coded pages, but program away until your site template is complete, and then tackle the big sections of the site - it means you'll learn a decent bit of PHP before you hit the tricky stuff.

And give us a shout if you get stuck at any stage,

Good luck dude.

This post has been edited by pemcconnell: 22 October 2008 - 01:15 AM

Was This Post Helpful? 0
  • +
  • -

#5 RLDir  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-October 08

Re: Amateur coder looking to tackle professional problem, looking for some

Posted 23 October 2008 - 10:42 AM

All good info, thanks. That is similar to how I approach most projects myself.

What I am really looking for insight into and advice on accomplishing is the actual PHP coding though. Things like;

I have most of the pages and styles developed in a template form as HTML - I will use that to determine how those pages are actually generated (and populated) via PHP.
- I don't know if that was a smart step or if I wasted time and should have waited and done it in PHP.

I am putting together a file named RLD_Functions.php which stores my global functions; or what I think will be global functions. (For now, I have the above two functions, protect and connect, and 3 unwritten functions I am working on writing - login (a simple login script which can handle logging in fr all types of members, and determining what access rights they have to various areas of the site), writecookie (sets a cookie to keep users logged in for 2 weeks), removecookies (deletes all cookies set by this site, if any - such as if a user clicks 'this is a public computer' or somesuch).
- I am not sure if I should group it as I am, or split it up, or...?

I am not certain which order is the most efficient to code the site; should I focus on such globals first and hope I cover everything, going back to revise/apend as needed? Or should I focus on the core pages first and then work on which functions are exclusive to one pr two pages and which are more or less global, and I know exactly what variables get passed when?

These and similar are the questions I would love to have addressed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1