Page 7 of 11
Re: Newb advice
Posted: Sat Sep 26, 2009 9:02 am
by jackpf
Why not just use one template for all the pages though?
Re: Newb advice
Posted: Sat Sep 26, 2009 9:36 am
by MiniMonty
jackpf wrote:Why not just use one template for all the pages though?
When I turn my attention back to the front end (forgive the pun) I'll probably
template all the pages. For now at least half of them are just placeholders for
what will become real content.
Re: Newb advice
Posted: Sat Sep 26, 2009 9:41 am
by jackpf
Fair enough. So anyway, did you get them queries sorted out?
Re: Newb advice
Posted: Sat Sep 26, 2009 10:47 am
by MiniMonty
I've sorted most of it but still having all sorts of odd little problems.
If you've got two minutes join up (it's free and you just get an activation email)
then take a look at the "view profile" and "edit profile" links. You'll see all the
errors at the top of the page - also, although users can upload an avatar image
(this works and goes to the right folder) the profile page isn't displaying it properly.
Lots to do... Lots to learn
Best wishes
Monty
Re: Newb advice
Posted: Sat Sep 26, 2009 11:13 am
by jackpf
Try what I suggested with the mysql_fetch_array() warning and undefined indexes.
And I uploaded an avatar, it should be here:
But it's obviously not.
I assume you're using rewrites for this?
What's your directory structure like, and what rewrites (if any) do you have?
Re: Newb advice
Posted: Sat Sep 26, 2009 1:23 pm
by MiniMonty
Aha... your image is there and named correctly but the chmod is set to 600 by
default. Need to write a line to chmod the image once it's up.
No help on this one for a while at least please - must learn to fix simple things on my own !
Re: Newb advice
Posted: Sat Sep 26, 2009 2:42 pm
by MiniMonty
Sorted...
scratched my head about this for a while but them realised that the images that users upload
from here will ALL be called "image01.jpg" so did this:
Code: Select all
$place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "members/$id/".$newname);
chmod ("members/$id/image01.jpg", 0644);
And I'm even learning to indent !
Re: Newb advice
Posted: Sat Sep 26, 2009 3:14 pm
by MiniMonty
OK...
so this code
Code: Select all
if ($_POST['parse_var'] == "pic"){
if (!$_FILES['fileField']['tmp_name']) {
which is used on all the forms on the edit profile page kept causing a "notice" message.
But the script was actually working fine. So I discovered a little trick which I'm sure is
very old hat to you lot - I put a @ symbol after the first bracket which suppresses the message.
This works fine and keeps the page free of messages but is it 'bad form' and a newb error to do it ?
Best wishes
Monty
Re: Newb advice
Posted: Sat Sep 26, 2009 3:16 pm
by Mirge
In a production environment, I turn off all error reporting.
In a development environment, I never suppress notices, warnings, errors... and I show all errors.
My .02 cents...
Re: Newb advice
Posted: Sat Sep 26, 2009 3:20 pm
by jackpf
Yes, it is bad and newby
Use isset() like I'm sure I pointed out before....
Also, why not just use $newname in your chmod? What if the user uploaded a second picture?
Re: Newb advice
Posted: Sat Sep 26, 2009 3:30 pm
by MiniMonty
jackpf wrote:Yes, it is bad and newby
Use isset() like I'm sure I pointed out before....
Also, why not just use $newname in your chmod? What if the user uploaded a second picture?
OK - thought as much. I am a bad newb.
Your isset code does work nicely and I'll go through and change them all to that. Good practice
to get used to using that.
Users can upload more pictures (for other reasons) but the comments system (which is just a dream on a
distant horizon) and the "view profile" page will always look for image01.jpg to display the avatar so I saw
no reason not to do it long hand. Keeps it simple for future reference to the avatar image too.
And it saves space in my aching brain
Best wishes
Monty
Re: Newb advice
Posted: Sat Sep 26, 2009 3:38 pm
by jackpf
L0l, I'd personally prefer it using the relevant variables...but your choice.
And I'm sure that eventually you'll allow users to choose their profile pictures? That's another reason to just do it now...
Re: Newb advice
Posted: Sat Sep 26, 2009 3:45 pm
by MiniMonty
Good point... Changed it.
Re: Newb advice
Posted: Sat Sep 26, 2009 5:16 pm
by jackpf
Re: Newb advice
Posted: Mon Sep 28, 2009 3:38 am
by MiniMonty
Hi all,
just an update to let you know that I (think) I've solved most of the issues with the
site and I could really do with a load of people to sign up and try to break it !
Well, to find bugs and glitches at least
You can now "Blab" from your profile page and see all the member's blabs
at "Bug Blabs" in the menu bar.
Best wishes
Monty