From: <ma...@us...> - 2012-01-30 22:48:10
|
Revision: 8844 http://xoops.svn.sourceforge.net/xoops/?rev=8844&view=rev Author: mageg Date: 2012-01-30 22:48:03 +0000 (Mon, 30 Jan 2012) Log Message: ----------- update of the core with the avatars plugin Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/admin/preferences.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_userinfo.html XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/16/avatar_custom.png XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/16/avatar_system.png XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar.png XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar_custom.png XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar_system.png Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2012-01-30 22:46:09 UTC (rev 8843) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2012-01-30 22:48:03 UTC (rev 8844) @@ -241,6 +241,9 @@ } if ($op == 'avatarform') { + if (!$xoops->isActiveModule('avatars')) { + $xoops->redirect('index.php', 3, _NOPERM); + } $xoops->header(); echo '<a href="userinfo.php?uid=' . $xoops->user->getVar('uid') . '">' . _US_PROFILE . '</a> <span class="bold">»»</span> ' . _US_UPLOADMYAVATAR . '<br /><br />'; $oldavatar = $xoops->user->getVar('user_avatar'); @@ -248,12 +251,12 @@ echo '<div class="pad10 txtcenter floatcenter0"><h4 class="red bold">' . _US_OLDDELETED . '</h4>'; echo '<img src="' . XOOPS_UPLOAD_URL . '/' . $oldavatar . '" alt="" /></div>'; } - if ($xoopsConfigUser['avatar_allow_upload'] == 1 && $xoops->user->getVar('posts') >= $xoopsConfigUser['avatar_minposts']) { + if ($xoops->getModuleConfig('avatars_allowupload', 'avatars') == 1 && $xoops->user->getVar('posts') >= $xoops->getModuleConfig('avatars_postsrequired', 'avatars')) { $form = new XoopsThemeForm(_US_UPLOADMYAVATAR, 'uploadavatar', 'edituser.php', 'post', true); $form->setExtra('enctype="multipart/form-data"'); - $form->addElement(new XoopsFormLabel(_US_MAXPIXEL, $xoopsConfigUser['avatar_width'] . ' x ' . $xoopsConfigUser['avatar_height'])); - $form->addElement(new XoopsFormLabel(_US_MAXIMGSZ, $xoopsConfigUser['avatar_maxsize'])); - $form->addElement(new XoopsFormFile(_US_SELFILE, 'avatarfile', $xoopsConfigUser['avatar_maxsize']), true); + $form->addElement(new XoopsFormLabel(_US_MAXPIXEL, $xoops->getModuleConfig('avatars_imagewidth', 'avatars') . ' x ' . $xoops->getModuleConfig('avatars_imageheight', 'avatars'))); + $form->addElement(new XoopsFormLabel(_US_MAXIMGSZ, $xoops->getModuleConfig('avatars_imagefilesize', 'avatars'))); + $form->addElement(new XoopsFormFile(_US_SELFILE, 'avatarfile', $xoops->getModuleConfig('avatars_imagefilesize', 'avatars')), true); $form->addElement(new XoopsFormHidden('op', 'avatarupload')); $form->addElement(new XoopsFormHidden('uid', $xoops->user->getVar('uid'))); $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); @@ -280,6 +283,9 @@ } if ($op == 'avatarupload') { + if (!$xoops->isActiveModule('avatars')) { + $xoops->redirect('index.php', 3, _NOPERM); + } if (!$xoops->security->check()) { $xoops->redirect('index.php', 3, _US_NOEDITRIGHT . "<br />" . implode('<br />', $xoops->security->getErrors())); exit(); @@ -302,7 +308,7 @@ 'image/jpeg' , 'image/pjpeg' , 'image/x-png' , - 'image/png'), $xoopsConfigUser['avatar_maxsize'], $xoopsConfigUser['avatar_width'], $xoopsConfigUser['avatar_height']); + 'image/png'), $xoops->getModuleConfig('avatars_imagefilesize', 'avatars'), $xoops->getModuleConfig('avatars_imagewidth', 'avatars'), $xoops->getModuleConfig('avatars_imageheight', 'avatars')); if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { $uploader->setPrefix('cavt'); if ($uploader->upload()) { @@ -339,6 +345,9 @@ } if ($op == 'avatarchoose') { + if (!$xoops->isActiveModule('avatars')) { + $xoops->redirect('index.php', 3, _NOPERM); + } if (!$xoops->security->check()) { $xoops->redirect('index.php', 3, _US_NOEDITRIGHT . "<br />" . implode('<br />', $xoops->security->getErrors())); exit(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php 2012-01-30 22:46:09 UTC (rev 8843) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php 2012-01-30 22:48:03 UTC (rev 8844) @@ -173,10 +173,6 @@ $dbm->insert('config', " VALUES (21, 0, 2, 'activation_type', '_MD_AM_ACTVTYPE', '0', '_MD_AM_ACTVTYPEDSC', 'select', 'int', 8)"); $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', " . $gruops['XOOPS_GROUP_ADMIN'] . ", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)"); $dbm->insert('config', " VALUES (23, 0, 2, 'uname_test_level', '_MD_AM_UNAMELVL', '0', '_MD_AM_UNAMELVLDSC', 'select', 'int', 12)"); - $dbm->insert('config', " VALUES (24, 0, 2, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '0', '_MD_AM_AVATARALWDSC', 'yesno', 'int', 14)"); - $dbm->insert('config', " VALUES (27, 0, 2, 'avatar_width', '_MD_AM_AVATARW', '120', '_MD_AM_AVATARWDSC', 'textbox', 'int', 16)"); - $dbm->insert('config', " VALUES (28, 0, 2, 'avatar_height', '_MD_AM_AVATARH', '120', '_MD_AM_AVATARHDSC', 'textbox', 'int', 18)"); - $dbm->insert('config', " VALUES (29, 0, 2, 'avatar_maxsize', '_MD_AM_AVATARMAX', '35000', '_MD_AM_AVATARMAXDSC', 'textbox', 'int', 20)"); $dbm->insert('config', " VALUES (30, 0, 1, 'adminmail', '_MD_AM_ADMINML', '" . addslashes($adminmail) . "', '_MD_AM_ADMINMLDSC', 'textbox', 'text', 3)"); $dbm->insert('config', " VALUES (31, 0, 2, 'self_delete', '_MD_AM_SELFDELETE', '0', '_MD_AM_SELFDELETEDSC', 'yesno', 'int', 22)"); $dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', 'flat', '_MD_AM_COMMODEDSC', 'select', 'text', 34)"); @@ -193,7 +189,6 @@ $dbm->insert('config', " VALUES (43, 0, 3, 'meta_robots', '_MD_AM_METAROBOTS', 'index,follow', '_MD_AM_METAROBOTSDSC', 'select', 'text', 2)"); $dbm->insert('config', " VALUES (44, 0, 5, 'enable_search', '_MD_AM_DOSEARCH', '1', '_MD_AM_DOSEARCHDSC', 'yesno', 'int', 0)"); $dbm->insert('config', " VALUES (45, 0, 5, 'keyword_min', '_MD_AM_MINSEARCH', '5', '_MD_AM_MINSEARCHDSC', 'textbox', 'int', 1)"); - $dbm->insert('config', " VALUES (46, 0, 2, 'avatar_minposts', '_MD_AM_AVATARMP', '0', '_MD_AM_AVATARMPDSC', 'textbox', 'int', 15)"); $dbm->insert('config', " VALUES (47, 0, 1, 'enable_badips', '_MD_AM_DOBADIPS', '0', '_MD_AM_DOBADIPSDSC', 'yesno', 'int', 40)"); $dbm->insert('config', " VALUES (48, 0, 3, 'meta_rating', '_MD_AM_METARATING', 'general', '_MD_AM_METARATINGDSC', 'select', 'text', 4)"); $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', 'XOOPS', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)"); Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/16/avatar_custom.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/16/avatar_custom.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/16/avatar_system.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/16/avatar_system.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar_custom.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar_custom.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar_system.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/images/icons/32/avatar_system.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/admin/preferences.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/admin/preferences.php 2012-01-30 22:46:09 UTC (rev 8843) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/admin/preferences.php 2012-01-30 22:48:03 UTC (rev 8844) @@ -96,17 +96,6 @@ define("_MD_AM_ALLOWHTML", "Allow HTML tags in user comments?"); define("_MD_AM_DEBUGMODE", "Debug mode"); define("_MD_AM_DEBUGMODEDSC", "Several debug options. A running website should have this turned off."); -define("_MD_AM_AVATARALLOW", "Allow custom avatar upload?"); -define("_MD_AM_AVATARALWDSC", ""); -define("_MD_AM_AVATARMP", "Minimum posts required"); -define("_MD_AM_AVATARMPDSC", "Enter the minimum number of posts required to upload a custom avatar"); -define("_MD_AM_AVATARW", "Avatar image max width (pixel)"); -define("_MD_AM_AVATARWDSC", ""); -define("_MD_AM_AVATARH", "Avatar image max height (pixel)"); -define("_MD_AM_AVATARHDSC", ""); -define("_MD_AM_AVATARMAX", "Avatar image max filesize (byte)"); -define("_MD_AM_AVATARMAXDSC", ""); -define("_MD_AM_AVATARCONF", "Custom avatar settings"); define("_MD_AM_CHNGUTHEME", "Change all users' theme"); define("_MD_AM_NOTIFYTO", "Select group to which new user notification mail will be sent"); define("_MD_AM_NOTIFYTODSC", ""); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_userinfo.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_userinfo.html 2012-01-30 22:46:09 UTC (rev 8843) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_userinfo.html 2012-01-30 22:48:03 UTC (rev 8844) @@ -7,7 +7,9 @@ <table class="width70 aligncenter bnone"> <tr class="txtcenter"> <td><input type="button" value="<{$lang_editprofile}>" onclick="location='edituser.php'" /> + <{if $avatars == true}> <input type="button" value="<{$lang_avatar}>" onclick="location='edituser.php?op=avatarform'" /> + <{/if}> <input type="button" value="<{$lang_inbox}>" onclick="location='viewpmsg.php'" /> <{if $user_candelete == true}> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2012-01-30 22:46:09 UTC (rev 8843) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2012-01-30 22:48:03 UTC (rev 8844) @@ -78,6 +78,12 @@ $xoops->tpl->assign('user_uid', $thisUser->getVar('uid')); } +if ($xoops->isActiveModule('avatars')) { + $xoops->tpl->assign('avatars', true); +}else{ + $xoops->tpl->assign('avatars', false); +} + $xoops->tpl->assign('xoops_pagetitle', sprintf(_US_ALLABOUT, $thisUser->getVar('uname'))); $xoops->tpl->assign('lang_allaboutuser', sprintf(_US_ALLABOUT, $thisUser->getVar('uname'))); $xoops->tpl->assign('lang_avatar', _US_AVATAR); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |