18 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
20 include_once
$GLOBALS['xoops']->path( '/kernel/avatar.php' );
30 function __construct()
32 parent::__construct();
38 $blank_img =
'blank.gif';
40 $blank_img = str_replace(
'avatars/',
'', $this->getVar(
'avatar_file',
'e') );
47 $form->setExtra(
'enctype="multipart/form-data"' );
55 $imgtray_img->setDescription( $maxpixel . $maxsize );
57 $image_array_img = XoopsLists::getImgListAsArray(
XOOPS_UPLOAD_PATH .
'/avatars' );
58 $imageselect_img->addOption(
"$blank_img", $blank_img);
59 foreach ($image_array_img as $image_img) {
60 $imageselect_img->addOption(
"$image_img", $image_img);
62 $imageselect_img->setExtra(
"onchange='showImgSelected(\"xo-avatar-img\", \"avatar_file\", \"avatars\", \"\", \"" .
XOOPS_UPLOAD_URL .
"\")'");
63 $imgtray_img->addElement( $imageselect_img,
false );
64 $imgtray_img->addElement(
new XoopsFormLabel(
'',
"<br /><img src='" .
XOOPS_UPLOAD_URL .
"/avatars/" . $blank_img .
"' name='image_img' id='xo-avatar-img' alt='' />" ) );
67 $imgtray_img->addElement($fileseltray_img);
68 $form->addElement($imgtray_img);
74 if ( $this->isNew() ) {
102 parent::__construct(
$db);
103 $this->className =
'SystemAvatar';
132 $sql =
'SELECT * FROM ' . $this->db->prefix(
'avatar') .
' WHERE avatar_id=' . $id;
136 $numrows = $this->db->getRowsNum(
$result);