Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like your <code>if($task == "upload")</code> isn't quite encompassing what you want it to. If you look at the code in a little more human-readable format:</p> <pre><code>&lt;?php $task = (isset($_POST['task']) ? $_POST['task'] : NULL); $is_error = 0; if($task == "remove") { $user-&gt;user_photo_delete(); $user-&gt;user_lastupdate(); exit(); } if($task == "upload") $photo = $user-&gt;user_photo(); { list($img_width, $img_height, $img_type, $attrs) = getimagesize($photo); if($img_width &gt;= 193 &amp;&amp; $img_height &gt;= 290) $user-&gt;user_photo_upload("photo"); $is_error = $user-&gt;is_error; if(!$is_error) { $user-&gt;user_lastupdate(); $photo_width = $misc-&gt;photo_size($user-&gt;user_photo(), "100", "100", "w"); $photo_height = $misc-&gt;photo_size($user-&gt;user_photo(), "100", "100", "h"); $action_media = array(array('media_link' =&gt; $url-&gt;url_create('profile', $user-&gt;user_info['user_username']), 'media_path' =&gt; $user-&gt;user_photo(), 'media_width' =&gt; $photo_width, 'media_height' =&gt; $photo_height)); $actions-&gt;actions_add($user, "editphoto", array($user-&gt;user_info['user_username'], $user-&gt;user_displayname), $action_media, 999999999, TRUE, "user", $user-&gt;user_info['user_id'], $user-&gt;user_info['user_privacy']); } } $field = new se_field("profile", $user-&gt;profile_info); $field-&gt;cat_list(0, 0, 0, "profilecat_id='{$user-&gt;user_info['user_profilecat_id']}'"); $cat_array = $field-&gt;subcats; $smarty-&gt;assign('is_error', $is_error); $smarty-&gt;assign('cats', $cat_array); include "footer.php"; ?&gt; </code></pre> <p>You can see that the <code>$photo = $user-&gt;user_photo();</code> should probably go instead the curly braces. It's always going to execute the code starting with the <code>list()</code> every time.</p> <p>I don't know if that's the issue, but you seem to have the right idea. I don't know what <code>$photo = $user-&gt;user_photo();</code> returns, but the file is stored in <code>$_FILES['image']['tmp_name']</code> (if your input name has type file and name image) and you can get the filesize info with <code>getimagesize($_FILES['image']['tmp_name'])</code> as documented on <a href="http://www.php.net/manual/en/function.move-uploaded-file.php" rel="nofollow">http://www.php.net/manual/en/function.move-uploaded-file.php</a></p> <p>Make sure your form tag has <code>enctype="multipart/form-data"</code> in it or the <code>$_FILES</code> array will be empty.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload