|
From: <ma...@us...> - 2012-01-30 22:45:54
|
Revision: 8842
http://xoops.svn.sourceforge.net/xoops/?rev=8842&view=rev
Author: mageg
Date: 2012-01-30 22:45:48 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
update the module with the avatars plugin
Modified Paths:
--------------
XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php
XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/profile_userinfo.html
XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php
Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php 2012-01-30 22:41:20 UTC (rev 8841)
+++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php 2012-01-30 22:45:48 UTC (rev 8842)
@@ -103,6 +103,9 @@
}
if ($op == 'avatarform') {
+ if (!$xoops->isActiveModule('avatars')) {
+ $xoops->redirect('index.php', 3, _NOPERM);
+ }
$xoops->header('profile_avatar.html');
$xoops->appendConfig('profile_breadcrumbs', array('title' => _US_MYAVATAR));
@@ -110,12 +113,12 @@
if (!empty($oldavatar) && $oldavatar != 'blank.gif') {
$xoops->tpl->assign('old_avatar', XOOPS_UPLOAD_URL . '/' . $oldavatar);
}
- if ($xoops->getConfig('avatar_allow_upload') == 1 && $xoops->user->getVar('posts') >= $xoops->getConfig('avatar_minposts')) {
+ if ($xoops->getModuleConfig('avatars_allowupload', 'avatars') == 1 && $xoops->user->getVar('posts') >= $xoops->getModuleConfig('avatars_postsrequired', 'avatars')) {
$form = new XoopsThemeForm(_US_UPLOADMYAVATAR, 'uploadavatar', XOOPS_URL . '/modules/' . $xoops->module->getVar('dirname', 'n') . '/edituser.php', 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $form->addElement(new XoopsFormLabel(_US_MAXPIXEL, $xoops->getConfig('avatar_width') . ' x ' . $xoops->getConfig('avatar_height')));
- $form->addElement(new XoopsFormLabel(_US_MAXIMGSZ, $xoops->getConfig('avatar_maxsize')));
- $form->addElement(new XoopsFormFile(_US_SELFILE, 'avatarfile', $xoops->getConfig('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'));
@@ -141,6 +144,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()));
}
@@ -160,7 +166,7 @@
'image/gif', 'image/jpeg',
'image/pjpeg', 'image/x-png',
'image/png'
- ), $xoops->getConfig('avatar_maxsize'), $xoops->getConfig('avatar_width'), $xoops->getConfig('avatar_height'));
+ ), $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()) {
@@ -197,6 +203,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()));
}
Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/profile_userinfo.html
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/profile_userinfo.html 2012-01-30 22:41:20 UTC (rev 8841)
+++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/templates/profile_userinfo.html 2012-01-30 22:45:48 UTC (rev 8842)
@@ -36,8 +36,9 @@
<input type="button" value="<{$lang_deleteaccount}>" onclick="submit();" />
</form>
<{/if}>
-
+ <{if $avatars == true}>
<input type="button" value="<{$lang_avatar}>" onclick="location='edituser.php?op=avatarform'" />
+ <{/if}>
<input type="button" value="<{$lang_inbox}>" onclick="location='<{$xoops_url}>/viewpmsg.php'" />
<input type="button" value="<{$lang_logout}>" onclick="location='<{$xoops_url}>/modules/<{$xoops_dirname}>/user.php?op=logout'" />
</form>
Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2012-01-30 22:41:20 UTC (rev 8841)
+++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2012-01-30 22:45:48 UTC (rev 8842)
@@ -118,6 +118,12 @@
$xoops->tpl->assign('userlevel', $thisUser->isActive());
}
+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')));
// Dynamic User Profiles
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|