The Arcive of vBulletin Modifications Site. |
|
[HDI] Set Up My Custom Field to check if the value is proper. Details »»
|
|||||||||||||||||||||||||||
|
[HDI] Set Up My Custom Field to check if the value is proper.
Developer Last Online: Apr 2014
Recently, I added a tiny hack to my site for the avatars.
Basically, I don't allow people to upload avatars to my site anymore. So I created a custom field and the user has to type the URL of the avatar that he wants to use. However, there is one problem for about 50% of the users. There are some users who copy their hard drive path and some users who use a path that doesn't work. I know in php I would use file_exists($userinfo[field8]) to check for the existance of an image but when I tried that it didn't appear to working. How can I check that $post[field8] contains a working path? Here is the hack: admin/functions.php Inserted around line # 181: if ($post[field8]) { $post[field8] = "<img width=\"50\" height=\"50\" src=\"" . $post[field8] . "\" border=\"0\">"; } Any suggestions? Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
file_exists() does not work on remote files, so you can't use that. Try using file() with implode() instead.
|
![]() |
|
|