Version Description
Download this release
Release Info
| Developer | westonruter |
| Plugin | |
| Version | 0.9.5 |
| Comparing to | |
| See all releases | |
Code changes from version 0.9.4 to 0.9.5
- localization/user-photo-tr_TR.mo +0 -0
- localization/user-photo-tr_TR.po +171 -0
- readme.txt +14 -4
- user-photo.php +23 -11
localization/user-photo-tr_TR.mo
ADDED
|
Binary file
|
localization/user-photo-tr_TR.po
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
msgid ""
|
| 2 |
+
msgstr ""
|
| 3 |
+
"Project-Id-Version: user-photo\n"
|
| 4 |
+
"POT-Creation-Date: \n"
|
| 5 |
+
"PO-Revision-Date: 2009-08-26 16:10+0200\n"
|
| 6 |
+
"Last-Translator: Muzo B <muzo178@gmail.com>\n"
|
| 7 |
+
"Language-Team: Muzo B <muzo178@gmail.com>\n"
|
| 8 |
+
"MIME-Version: 1.0\n"
|
| 9 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
| 10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
| 11 |
+
"X-Poedit-Language: Turkish\n"
|
| 12 |
+
"X-Poedit-Country: TURKEY\n"
|
| 13 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
| 14 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
| 15 |
+
"X-Poedit-Basepath: /home/paco/user-photo/\n"
|
| 16 |
+
"X-Poedit-SearchPath-0: /home/paco/user-photo\n"
|
| 17 |
+
|
| 18 |
+
#: /home/paco/user-photo/user-photo.php:35
|
| 19 |
+
msgid "User Photo plugin not usable on this system because image resizing is not available, specifically the imagecopyresampled() and related functions. It has been deactivated."
|
| 20 |
+
msgstr "User Photo eklentisi bu sistemde çalışamıyor çünkü imagecopyresampled() fonksiyonu yok. Eklenti etkisizleştirildi."
|
| 21 |
+
|
| 22 |
+
#: /home/paco/user-photo/user-photo.php:137
|
| 23 |
+
msgid "Unable to delete photo."
|
| 24 |
+
msgstr "Resim silinemedi."
|
| 25 |
+
|
| 26 |
+
#: /home/paco/user-photo/user-photo.php:158
|
| 27 |
+
msgid "The uploaded file exceeds the max upload size."
|
| 28 |
+
msgstr "Yüklediğiniz dosya maksimum yükleme boyutunun üzerinde."
|
| 29 |
+
|
| 30 |
+
#: /home/paco/user-photo/user-photo.php:161
|
| 31 |
+
msgid "The uploaded file was only partially uploaded."
|
| 32 |
+
msgstr "Dosya kısmen yüklenebildi."
|
| 33 |
+
|
| 34 |
+
#: /home/paco/user-photo/user-photo.php:164
|
| 35 |
+
msgid "No file was uploaded."
|
| 36 |
+
msgstr "Dosya yüklenemedi."
|
| 37 |
+
|
| 38 |
+
#: /home/paco/user-photo/user-photo.php:167
|
| 39 |
+
msgid "Missing a temporary folder."
|
| 40 |
+
msgstr "Geçiçi dosya yok."
|
| 41 |
+
|
| 42 |
+
#: /home/paco/user-photo/user-photo.php:170
|
| 43 |
+
msgid "Failed to write file to disk."
|
| 44 |
+
msgstr "Dosya diske yazılmadı."
|
| 45 |
+
|
| 46 |
+
#: /home/paco/user-photo/user-photo.php:173
|
| 47 |
+
msgid "File upload stopped by extension."
|
| 48 |
+
msgstr "Dosya yüklemesi eklenti tarafından durduruldu."
|
| 49 |
+
|
| 50 |
+
#: /home/paco/user-photo/user-photo.php:176
|
| 51 |
+
msgid "File upload failed due to unknown error."
|
| 52 |
+
msgstr "Dosya yüklemesinde bilinmeyen bir sebepten dolayı hata oluştu."
|
| 53 |
+
|
| 54 |
+
#: /home/paco/user-photo/user-photo.php:180
|
| 55 |
+
#, php-format
|
| 56 |
+
msgid "The file “%s” was not uploaded. Did you provide the correct filename?"
|
| 57 |
+
msgstr "“%s” adlı dosya yüklenemedi. Doğru dosya adı girdiğinize emin misiniz?"
|
| 58 |
+
|
| 59 |
+
#: /home/paco/user-photo/user-photo.php:182
|
| 60 |
+
#, php-format
|
| 61 |
+
msgid "The uploaded file type “%s” is not allowed."
|
| 62 |
+
msgstr "“%s” dosyasının dosya türü izin verilen dosya türlerinin dışında."
|
| 63 |
+
|
| 64 |
+
#: /home/paco/user-photo/user-photo.php:195
|
| 65 |
+
#: /home/paco/user-photo/user-photo.php:541
|
| 66 |
+
msgid "Unable to get image dimensions."
|
| 67 |
+
msgstr "Resim boyutları algılanamadı."
|
| 68 |
+
|
| 69 |
+
#: /home/paco/user-photo/user-photo.php:211
|
| 70 |
+
msgid "The userphoto upload content directory does not exist and could not be created. Please ensure that you have write permissions for the /wp-content/uploads/ directory."
|
| 71 |
+
msgstr "Userphoto yükleme dizini oluşturulamadı. /wp-content/uploads/ dizini için izinlerin doğru olduğundan emin olun."
|
| 72 |
+
|
| 73 |
+
#: /home/paco/user-photo/user-photo.php:222
|
| 74 |
+
msgid "Unable to move the file to the user photo upload content directory."
|
| 75 |
+
msgstr "Dosya userphoto yükleme dizinine taşınamadı."
|
| 76 |
+
|
| 77 |
+
#: /home/paco/user-photo/user-photo.php:358
|
| 78 |
+
msgid "Your Photo"
|
| 79 |
+
msgstr "Resminiz"
|
| 80 |
+
|
| 81 |
+
#: /home/paco/user-photo/user-photo.php:358
|
| 82 |
+
msgid "User Photo"
|
| 83 |
+
msgstr "Kullanıcı Resmi"
|
| 84 |
+
|
| 85 |
+
#: /home/paco/user-photo/user-photo.php:370
|
| 86 |
+
msgid "Your profile photo has been submitted for review."
|
| 87 |
+
msgstr "Profil resminiz onaylanmak üzere bekliyor."
|
| 88 |
+
|
| 89 |
+
#: /home/paco/user-photo/user-photo.php:372
|
| 90 |
+
msgid "Your chosen profile photo has been rejected."
|
| 91 |
+
msgstr "Profil resminiz onaylanmadı."
|
| 92 |
+
|
| 93 |
+
#: /home/paco/user-photo/user-photo.php:375
|
| 94 |
+
msgid "Reason: "
|
| 95 |
+
msgstr "Sebep:"
|
| 96 |
+
|
| 97 |
+
#: /home/paco/user-photo/user-photo.php:388
|
| 98 |
+
msgid "Upload image file:"
|
| 99 |
+
msgstr "Resim dosyası yükle:"
|
| 100 |
+
|
| 101 |
+
#: /home/paco/user-photo/user-photo.php:392
|
| 102 |
+
#, php-format
|
| 103 |
+
msgid "max upload size %s"
|
| 104 |
+
msgstr "maksimum yükleme boyutu: %s"
|
| 105 |
+
|
| 106 |
+
#: /home/paco/user-photo/user-photo.php:400
|
| 107 |
+
msgid "Approval status:"
|
| 108 |
+
msgstr "Onay durumu:"
|
| 109 |
+
|
| 110 |
+
#: /home/paco/user-photo/user-photo.php:402
|
| 111 |
+
msgid "pending"
|
| 112 |
+
msgstr "beklemede"
|
| 113 |
+
|
| 114 |
+
#: /home/paco/user-photo/user-photo.php:403
|
| 115 |
+
msgid "rejected"
|
| 116 |
+
msgstr "reddedildi."
|
| 117 |
+
|
| 118 |
+
#: /home/paco/user-photo/user-photo.php:404
|
| 119 |
+
msgid "approved"
|
| 120 |
+
msgstr "onaylandı"
|
| 121 |
+
|
| 122 |
+
#: /home/paco/user-photo/user-photo.php:408
|
| 123 |
+
msgid "The photo is inappropriate."
|
| 124 |
+
msgstr "Uygunsuz resim."
|
| 125 |
+
|
| 126 |
+
#: /home/paco/user-photo/user-photo.php:413
|
| 127 |
+
msgid "Delete photo?"
|
| 128 |
+
msgstr "Resmi silmek ister misiniz?"
|
| 129 |
+
|
| 130 |
+
#: /home/paco/user-photo/user-photo.php:455
|
| 131 |
+
msgid "Options saved."
|
| 132 |
+
msgstr "Ayarlar kaydedildi."
|
| 133 |
+
|
| 134 |
+
#: /home/paco/user-photo/user-photo.php:466
|
| 135 |
+
msgid "Maximum dimension: "
|
| 136 |
+
msgstr "Maksimum boyut:"
|
| 137 |
+
|
| 138 |
+
#: /home/paco/user-photo/user-photo.php:472
|
| 139 |
+
msgid "Thumbnail dimension: "
|
| 140 |
+
msgstr "Küçük resim boyutu:"
|
| 141 |
+
|
| 142 |
+
#: /home/paco/user-photo/user-photo.php:478
|
| 143 |
+
msgid "JPEG compression: "
|
| 144 |
+
msgstr "JPEG sıkıştırma:"
|
| 145 |
+
|
| 146 |
+
#: /home/paco/user-photo/user-photo.php:484
|
| 147 |
+
msgid "Notify this administrator by email when user photo needs approval: "
|
| 148 |
+
msgstr "Kullanıcı resmi onaylama işlemi için bu bu yöneticiyi uyar:"
|
| 149 |
+
|
| 150 |
+
#: /home/paco/user-photo/user-photo.php:506
|
| 151 |
+
msgid "Require user photo moderation for all users at or below this level: "
|
| 152 |
+
msgstr "Bu seviyenin altındaki kullanıcıların resimlerini moderasyona al:"
|
| 153 |
+
|
| 154 |
+
#: /home/paco/user-photo/user-photo.php:524
|
| 155 |
+
msgid "Update options »"
|
| 156 |
+
msgstr "Ayarları güncelle »"
|
| 157 |
+
|
| 158 |
+
#: /home/paco/user-photo/user-photo.php:551
|
| 159 |
+
msgid "Filetype not supported."
|
| 160 |
+
msgstr "Bu dosya türü kabul edilmiyor"
|
| 161 |
+
|
| 162 |
+
#: /home/paco/user-photo/user-photo.php:565
|
| 163 |
+
msgid "Unrecognized image format."
|
| 164 |
+
msgstr "Dosya türü tanınmıyor."
|
| 165 |
+
|
| 166 |
+
#: /home/paco/user-photo/user-photo.php:597
|
| 167 |
+
#: /home/paco/user-photo/user-photo.php:602
|
| 168 |
+
#: /home/paco/user-photo/user-photo.php:607
|
| 169 |
+
msgid "Thumbnail path invalid"
|
| 170 |
+
msgstr "Küçük resim dizini geçersiz"
|
| 171 |
+
|
readme.txt
CHANGED
|
@@ -1,13 +1,15 @@
|
|
| 1 |
=== User Photo ===
|
| 2 |
-
Contributors:
|
| 3 |
Tags: users, photos, images
|
| 4 |
-
Tested up to:
|
| 5 |
-
Stable tag:
|
| 6 |
|
| 7 |
Allows a user to associate a photo with their account and for this photo to be displayed in their posts and comments.
|
| 8 |
|
| 9 |
== Description ==
|
| 10 |
|
|
|
|
|
|
|
| 11 |
Allows a user to associate a profile photo with their account through their "Your Profile" page. Admins may
|
| 12 |
add a user profile photo by accessing the "Edit User" page. Uploaded images are resized to fit the dimensions specified
|
| 13 |
on the options page; a thumbnail image correspondingly is also generated.
|
|
@@ -113,11 +115,19 @@ If you value this plugin, *please donate* to ensure that it may continue to be m
|
|
| 113 |
|
| 114 |
== Changelog ==
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
= 2009-02-13 =
|
| 117 |
|
| 118 |
* Added Catalan localization. Thanks Robert!
|
| 119 |
|
| 120 |
-
*2009-02-28 =
|
| 121 |
|
| 122 |
* Added Italian localization. Thanks Federico!
|
| 123 |
|
| 1 |
=== User Photo ===
|
| 2 |
+
Contributors: westonruter
|
| 3 |
Tags: users, photos, images
|
| 4 |
+
Tested up to: 3.0.5
|
| 5 |
+
Stable tag: 0.9.5
|
| 6 |
|
| 7 |
Allows a user to associate a photo with their account and for this photo to be displayed in their posts and comments.
|
| 8 |
|
| 9 |
== Description ==
|
| 10 |
|
| 11 |
+
***Make sure you upgrade to version 0.9.5!***
|
| 12 |
+
|
| 13 |
Allows a user to associate a profile photo with their account through their "Your Profile" page. Admins may
|
| 14 |
add a user profile photo by accessing the "Edit User" page. Uploaded images are resized to fit the dimensions specified
|
| 15 |
on the options page; a thumbnail image correspondingly is also generated.
|
| 115 |
|
| 116 |
== Changelog ==
|
| 117 |
|
| 118 |
+
= 2011-02-17: 0.9.5 =
|
| 119 |
+
|
| 120 |
+
* Fixing major security issue (credit ADVtools SARL).
|
| 121 |
+
|
| 122 |
+
= 2009-7-28 =
|
| 123 |
+
|
| 124 |
+
* Fixed a small bug relating to line 453 changing "home" to "siteurl". Thanks Piotr!
|
| 125 |
+
|
| 126 |
= 2009-02-13 =
|
| 127 |
|
| 128 |
* Added Catalan localization. Thanks Robert!
|
| 129 |
|
| 130 |
+
* 2009-02-28 =
|
| 131 |
|
| 132 |
* Added Italian localization. Thanks Federico!
|
| 133 |
|
user-photo.php
CHANGED
|
@@ -3,11 +3,11 @@
|
|
| 3 |
Plugin Name: User Photo
|
| 4 |
Plugin URI: http://wordpress.org/extend/plugins/user-photo/
|
| 5 |
Description: Allows users to associate photos with their accounts by accessing their "Your Profile" page. Uploaded images are resized to fit the dimensions specified on the options page; a thumbnail image is also generated. New template tags introduced are: <code>userphoto_the_author_photo</code>, <code>userphoto_the_author_thumbnail</code>, <code>userphoto_comment_author_photo</code>, and <code>userphoto_comment_author_thumbnail</code>. Uploaded images may be moderated by administrators.
|
| 6 |
-
Version: 0.9.
|
| 7 |
-
Author: <a href="http://weston.ruter.net/">Weston Ruter</a
|
| 8 |
|
| 9 |
Original code by Weston Ruter <http://weston.ruter.net> at Shepherd Interactive <http://shepherd-interactive.com>.
|
| 10 |
-
Continued development and maintenance by Dave Wagner <http://dev.dave-wagner.com/>
|
| 11 |
|
| 12 |
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
|
| 13 |
This program is free software; you can redistribute it and/or modify
|
|
@@ -47,6 +47,7 @@ $userphoto_validtypes = array(
|
|
| 47 |
"image/png" => true,
|
| 48 |
"image/x-png" => true
|
| 49 |
);
|
|
|
|
| 50 |
|
| 51 |
define('USERPHOTO_PENDING', 0);
|
| 52 |
define('USERPHOTO_REJECTED', 1);
|
|
@@ -316,6 +317,7 @@ function userphoto_thumbnail($user, $before = '', $after = '', $attributes = arr
|
|
| 316 |
|
| 317 |
function userphoto_profile_update($userID){
|
| 318 |
global $userphoto_validtypes;
|
|
|
|
| 319 |
global $current_user;
|
| 320 |
|
| 321 |
$userdata = get_userdata($userID);
|
|
@@ -376,10 +378,15 @@ function userphoto_profile_update($userID){
|
|
| 376 |
$error = __("File upload failed due to unknown error.", 'user-photo');
|
| 377 |
}
|
| 378 |
}
|
| 379 |
-
else if(!$_FILES['userphoto_image_file']['size'])
|
| 380 |
$error = sprintf(__("The file “%s” was not uploaded. Did you provide the correct filename?", 'user-photo'), $_FILES['userphoto_image_file']['name']);
|
| 381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
$error = sprintf(__("The uploaded file type “%s” is not allowed.", 'user-photo'), $_FILES['userphoto_image_file']['type']);
|
|
|
|
| 383 |
|
| 384 |
$tmppath = $_FILES['userphoto_image_file']['tmp_name'];
|
| 385 |
|
|
@@ -414,8 +421,10 @@ function userphoto_profile_update($userID){
|
|
| 414 |
#umask($umask);
|
| 415 |
|
| 416 |
if(!$error){
|
| 417 |
-
|
| 418 |
-
$
|
|
|
|
|
|
|
| 419 |
$imagepath = $dir . '/' . $imagefile;
|
| 420 |
$thumbfile = preg_replace("/(?=\.\w+$)/", '.thumbnail', $imagefile);
|
| 421 |
$thumbpath = $dir . '/' . $thumbfile;
|
|
@@ -448,7 +457,7 @@ function userphoto_profile_update($userID){
|
|
| 448 |
$admin = get_userdata($admin_notified);
|
| 449 |
@wp_mail($admin->user_email,
|
| 450 |
"User Photo for " . $userdata->display_name . " Needs Approval",
|
| 451 |
-
get_option("
|
| 452 |
}
|
| 453 |
}
|
| 454 |
else {
|
|
@@ -460,9 +469,12 @@ function userphoto_profile_update($userID){
|
|
| 460 |
update_usermeta($userID, "userphoto_thumb_file", $thumbfile);
|
| 461 |
update_usermeta($userID, "userphoto_thumb_width", $thumbinfo[0]);
|
| 462 |
update_usermeta($userID, "userphoto_thumb_height", $thumbinfo[1]);
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
|
|
|
|
|
|
|
|
|
| 466 |
}
|
| 467 |
}
|
| 468 |
}
|
| 3 |
Plugin Name: User Photo
|
| 4 |
Plugin URI: http://wordpress.org/extend/plugins/user-photo/
|
| 5 |
Description: Allows users to associate photos with their accounts by accessing their "Your Profile" page. Uploaded images are resized to fit the dimensions specified on the options page; a thumbnail image is also generated. New template tags introduced are: <code>userphoto_the_author_photo</code>, <code>userphoto_the_author_thumbnail</code>, <code>userphoto_comment_author_photo</code>, and <code>userphoto_comment_author_thumbnail</code>. Uploaded images may be moderated by administrators.
|
| 6 |
+
Version: 0.9.5
|
| 7 |
+
Author: <a href="http://weston.ruter.net/">Weston Ruter</a>
|
| 8 |
|
| 9 |
Original code by Weston Ruter <http://weston.ruter.net> at Shepherd Interactive <http://shepherd-interactive.com>.
|
| 10 |
+
Continued development and maintenance by Dave Wagner (cptnwinky) <http://dev.dave-wagner.com/>
|
| 11 |
|
| 12 |
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
|
| 13 |
This program is free software; you can redistribute it and/or modify
|
| 47 |
"image/png" => true,
|
| 48 |
"image/x-png" => true
|
| 49 |
);
|
| 50 |
+
$userphoto_validextensions = array('jpeg', 'jpg', 'gif', 'png');
|
| 51 |
|
| 52 |
define('USERPHOTO_PENDING', 0);
|
| 53 |
define('USERPHOTO_REJECTED', 1);
|
| 317 |
|
| 318 |
function userphoto_profile_update($userID){
|
| 319 |
global $userphoto_validtypes;
|
| 320 |
+
global $userphoto_validextensions;
|
| 321 |
global $current_user;
|
| 322 |
|
| 323 |
$userdata = get_userdata($userID);
|
| 378 |
$error = __("File upload failed due to unknown error.", 'user-photo');
|
| 379 |
}
|
| 380 |
}
|
| 381 |
+
else if( !$_FILES['userphoto_image_file']['size'] ){
|
| 382 |
$error = sprintf(__("The file “%s” was not uploaded. Did you provide the correct filename?", 'user-photo'), $_FILES['userphoto_image_file']['name']);
|
| 383 |
+
}
|
| 384 |
+
else if( !preg_match("/\.(" . join('|', $userphoto_validextensions) . ")$/i", $_FILES['userphoto_image_file']['name']) ){
|
| 385 |
+
$error = sprintf(__("The file extension “%s” is not allowed. Must be one of: %s.", 'user-photo'), preg_replace('/.*\./', '', $_FILES['userphoto_image_file']['name']), join(', ', $userphoto_validextensions));
|
| 386 |
+
}
|
| 387 |
+
else if( @!$userphoto_validtypes[$_FILES['userphoto_image_file']['type']] ){
|
| 388 |
$error = sprintf(__("The uploaded file type “%s” is not allowed.", 'user-photo'), $_FILES['userphoto_image_file']['type']);
|
| 389 |
+
}
|
| 390 |
|
| 391 |
$tmppath = $_FILES['userphoto_image_file']['tmp_name'];
|
| 392 |
|
| 421 |
#umask($umask);
|
| 422 |
|
| 423 |
if(!$error){
|
| 424 |
+
$oldimagefile = basename($userdata->userphoto_image_file);
|
| 425 |
+
$oldthumbfile = basename($userdata->userphoto_thumb_file);
|
| 426 |
+
#$imagefile = preg_replace('/^.+(?=\.\w+$)/', $userdata->user_nicename, strtolower($_FILES['userphoto_image_file']['name']));
|
| 427 |
+
$imagefile = "$userID." . preg_replace('{^.+?\.(?=\w+$)}', '', strtolower($_FILES['userphoto_image_file']['name']));
|
| 428 |
$imagepath = $dir . '/' . $imagefile;
|
| 429 |
$thumbfile = preg_replace("/(?=\.\w+$)/", '.thumbnail', $imagefile);
|
| 430 |
$thumbpath = $dir . '/' . $thumbfile;
|
| 457 |
$admin = get_userdata($admin_notified);
|
| 458 |
@wp_mail($admin->user_email,
|
| 459 |
"User Photo for " . $userdata->display_name . " Needs Approval",
|
| 460 |
+
get_option("siteurl") . "/wp-admin/user-edit.php?user_id=" . $userdata->ID . "#userphoto");
|
| 461 |
}
|
| 462 |
}
|
| 463 |
else {
|
| 469 |
update_usermeta($userID, "userphoto_thumb_file", $thumbfile);
|
| 470 |
update_usermeta($userID, "userphoto_thumb_width", $thumbinfo[0]);
|
| 471 |
update_usermeta($userID, "userphoto_thumb_height", $thumbinfo[1]);
|
| 472 |
+
|
| 473 |
+
//Delete old thumbnail if it has a different filename (extension)
|
| 474 |
+
if($oldimagefile != $imagefile)
|
| 475 |
+
@unlink($dir . '/' . $oldimagefile);
|
| 476 |
+
if($oldthumbfile != $thumbfile)
|
| 477 |
+
@unlink($dir . '/' . $oldthumbfile);
|
| 478 |
}
|
| 479 |
}
|
| 480 |
}
|
