How to embed user photo upload form in a page of Drupal 7 site I want to embed user photo(avatar) upload form in a node page like this: node--37.tpl.php so a user can change or upload their profile picture by visiting a particular node.
Can't understand what to do, reading some api documentation like function form_load_include with no luck.Also i found an amazing snippet here but how to use it as a form?

$uid = 3;
$account = user_load($uid);

// suppose that a source user picture is located in the 'sites/default/files/upics'     directory.
// get image information
$image_path = 'public://upics/userpic.jpg';
$image_info = image_get_info($image_path);

// create file object
$file = new StdClass();
$file-&gt;uid = $uid;
$file-&gt;uri = $image_path;
$file-&gt;filemime = $image_info['mime_type'];
$file-&gt;status = 0; // Yes! Set status to 0 in order to save temporary file.
$file-&gt;filesize = $image_info['file_size'];

// standard Drupal validators for user pictures
$validators = array(
  'file_validate_is_image' =&gt; array(),
  'file_validate_image_resolution' =&gt; array(variable_get('user_picture_dimensions',     '85x85')),
  'file_validate_size' =&gt; array(variable_get('user_picture_file_size', '30') * 1024),
);

// here all the magic :)  
$errors = file_validate($file, $validators);
if (empty($errors)) {
  file_save($file);
  $edit['picture'] = $file;
  user_save($account, $edit);
}


Please give me some ideas to get started, your help is really appreciated.
Thanks
You can do it like this:


Open node--37.tpl.php
locate the container(div) where should be placed a form and use drupal_get_form() function.


example:

&lt;div class="some-class"&gt;
&lt;?php print render(drupal_get_form('MY_FORM_ID')); ?&gt;
&lt;/div&gt;