Jump to content



Photo
- - - - -

link user id to image


This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1   dotcom012

dotcom012
  • Members
  • 95 posts

Posted 17 July 2012 - 02:42

Is there a way to link the user that is logged in to a certian image that they upload. This way, if they log back in, that image will come back up.

Thanks

#2   ecartz

ecartz
  • Members
  • 1,968 posts

Posted 17 July 2012 - 06:07

This isn't supported in the core fuctionality. You could try looking for a contribution, but this doesn't strike me as a common need.

There are also challenges associated with allowing customers to upload images to your server. It's certainly technically possible, but there are security and other concerns. You might consider allowing users to select from a set of images instead. Or have them email you the images and you add them to the accounts.
Always backup before making changes.

#3   dotcom012

dotcom012
  • Members
  • 95 posts

Posted 17 July 2012 - 17:41

Thanks for you reply. I have set up all the PHP needed for customers to upload items into my store with descriptions, names, dates and other needed information. I was really in need of finding out how to pull the user or email address that peroson is logged in with out of the file and add it to the database just for the simple fact of tracking who uploads what, that and be able to have a search option for different users and their work.

#4   ecartz

ecartz
  • Members
  • 1,968 posts

Posted 25 July 2012 - 07:48


  if (tep_session_is_registered('customer_id')) {

	// do stuff with $customer_id

  }

If customer_id is registered in the session, you can simply use it. To associate a customer_id with a product, you would either add a customer_id column to the products table or make a new table. If every product has a customer, you would want to add a column to the product table. If products can have multiple customer_id values, you need to add a new table. If some products have a single customer_Id and others have none, you can do it either way. The new table is the more flexible approach, but you might not need that flexibility.
Always backup before making changes.