|
From: <dj...@us...> - 2013-07-18 17:29:51
|
Revision: 11843
http://sourceforge.net/p/xoops/svn/11843
Author: djculex
Date: 2013-07-18 17:29:48 +0000 (Thu, 18 Jul 2013)
Log Message:
-----------
Bugfix: Css adjusting
Bugfix: reinventing relocates (user/noUser)
Bugfix: Privacy settings masking unnessesarily. Reinvented
Bugfix: Register message not showing
Bugfix: Setting missing in friends and profile
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/profile.php
XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
XoopsModules/smallworld/trunk/smallworld/class/wall.php
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/css/smallworld.css
XoopsModules/smallworld/trunk/smallworld/friends.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/js/wall.js
XoopsModules/smallworld/trunk/smallworld/language/english/main.php
XoopsModules/smallworld/trunk/smallworld/loadmore.php
XoopsModules/smallworld/trunk/smallworld/message_ajax.php
XoopsModules/smallworld/trunk/smallworld/permalink.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/register.php
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_friends_template.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_index.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
XoopsModules/smallworld/trunk/smallworld/userprofile.php
Added Paths:
-----------
XoopsModules/smallworld/trunk/smallworld/images/join.jpg
Modified: XoopsModules/smallworld/trunk/smallworld/class/profile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/profile.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/class/profile.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -254,8 +254,7 @@
$xoopsTpl->assign('website', $website);
$xoopsTpl->assign('addsomeinfo', _SMALLWORLD_ADDSOMEINFO);
$xoopsTpl->assign('pagename','profile');
- } else{
- }
+ }
}
Modified: XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -135,6 +135,7 @@
}
}
+
/**
* @Get user image based on uid
* @param int $uid
@@ -160,8 +161,7 @@
$ext = explode(".",$image);
if (@!in_array(strtolower ($ext[1]), $type) || $image == '') {
- $avt = new XoopsUser($uid);
- $avatar = $avt->user_avatar();
+ $avatar = '';
} else {
$avatar = $image;
}
Modified: XoopsModules/smallworld/trunk/smallworld/class/wall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -123,7 +123,7 @@
if(!empty($data)) {
return $data;
}
- }
+ }
/**
* @Get user image based on uid
@@ -150,8 +150,7 @@
$ext = explode(".",$image);
if (@!in_array(strtolower ($ext[1]), $type) || $image == '') {
- $avt = new XoopsUser($uid);
- $avatar = $avt->user_avatar();
+ $avatar = '';
} else {
$avatar = $image;
}
@@ -300,7 +299,7 @@
}
/**
- * @Check is user is friend
+ * @Check if user is friend
* @param int $userid
* @param string $type
* @param int $comid
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -25,8 +25,12 @@
global $xoopsUser, $xoopsModule,$xoopsLogger,$xoopsTpl;
$xoopsLogger->activated = false;
$page = 'index';
-if ($xoopsUser) {
- $id = $xoopsUser->getVar('uid');
+$check = new SmallWorldUser;
+$id = $xoopsUser->getVar('uid');
+$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
+
+if ($profile >= 2) {
+
$Xuser = new XoopsUser($id);
$username = $Xuser->getVar('uname');
$Wall = new Wall_Updates();
@@ -51,6 +55,9 @@
$data=$Wall->Insert_Comment($id,$msg_id,$comment);
if($data) {
+ // Is comments's user a friend ?
+ $frC = $check->friendcheck($id,$cdata['uid_fk']);
+
$USC = array();
$USC['posts'] = 0;
$USC['comments'] = 0;
@@ -71,7 +78,9 @@
$wc['msg_id_fk'] = $data['msg_id_fk'];
$wc['com_id'] = $data['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['comment']),$data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1 || $frC[0] == 2) ?
+ smallworld_tolink(htmlspecialchars_decode($data['comment']),$data['uid_fk']):
+ _SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($data['created']);
$wc['username'] = $data['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/css/smallworld.css
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/css/smallworld.css 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/css/smallworld.css 2013-07-18 17:29:48 UTC (rev 11843)
@@ -50,6 +50,8 @@
margin: 0 2px;
position: relative;
top: 4px;
+ height:16px;
+ width:16px
}
.smallworld_imageownermenu ul {
Modified: XoopsModules/smallworld/trunk/smallworld/friends.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/friends.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/friends.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -169,7 +169,12 @@
$xoopsTpl->append('nousersfollowingme',_SMALLWORLD_NOUSERS);
}
- // Get usermenu to template
+ // Create form for private settings
+ $form = new SmallWorldForm;
+ $usersettings = $form->usersettings ($yourid, $selected=null);
+ $xoopsTpl->assign('usersetting', $usersettings);
+
+ // Get usermenu to template
$menu_home = "<a href='".XOOPS_URL."/modules/smallworld/'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/house.png'>"._SMALLWORLD_HOME."</a>";
$menu_profile = "<a href='".XOOPS_URL."/modules/smallworld/userprofile.php?username=".$Xusername."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/user_silhouette.png'>"._SMALLWORLD_PROFILEINDEX."</a>";
$menu_gallery = "<a href='".XOOPS_URL."/modules/smallworld/galleryshow.php?username=".$Xusername."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/picture.png'>"._SMALLWORLD_GALLERY."</a>";
Added: XoopsModules/smallworld/trunk/smallworld/images/join.jpg
===================================================================
(Binary files differ)
Index: XoopsModules/smallworld/trunk/smallworld/images/join.jpg
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/images/join.jpg 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/images/join.jpg 2013-07-18 17:29:48 UTC (rev 11843)
Property changes on: XoopsModules/smallworld/trunk/smallworld/images/join.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -49,6 +49,7 @@
if ($xoopsUser) {
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$xoopsTpl->assign('isadminuser', 'YES');
+ $profile = 2;
}else {
$xoopsTpl->assign('isadminuser', 'NO');
}
@@ -92,16 +93,14 @@
//Get friends invitations
$getInvitations = ($xoopsUser) ? $check->getRequests ($id) : 0;
- if (!empty($updatesarray)) {
- foreach ($updatesarray as $data) {
-
+ if (!empty($updatesarray)) {
+ foreach ($updatesarray as $data) {
$USW = array();
- $USW['posts'] = 0;
- $USW['comments'] = 0;
-
- if ($xoopsUser) {
-
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) || $data['uid_fk'] == $id) {
+ $USW['posts'] = 0;
+ $USW['comments'] = 0;
+
+ if ($xoopsUser) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
$USW['posts'] = 1;
$USW['comments'] = 1;
} else {
@@ -113,75 +112,84 @@
$USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
}
- $wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
- $wm['message'] = Smallworld_cleanup($wm['message']);
- $wm['created'] = smallworld_time_stamp($data['created']);
- $wm['username'] = $data['username'];
- $wm['uid_fk'] = $data['uid_fk'];
- $wm['priv'] = $data['priv'];
- $wm['avatar'] = $Wall->Gravatar($data['uid_fk']);
- $wm['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wm['avatar']);
- $wm['avatar_size'] = smallworld_getImageSize(80, 100, $wm['avatar_link']);
- $wm['avatar_highwide'] = smallworld_imageResize($wm['avatar_size'][0], $wm['avatar_size'][1], 50);
- $wm['vote_up'] = $Wall->countVotes ('msg', 'up', $data['msg_id']);
- $wm['vote_down'] = $Wall->countVotes ('msg', 'down', $data['msg_id']);
- $wm['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk'];
- $wm['compl_msg_lnk'] .= "&updid=".$data['msg_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
- $wm['sharelinkurl'] = XOOPS_URL."/modules/smallworld/smallworldshare.php?ownerid=".$data['uid_fk'];
- $wm['sharelinkurl'] .= "&updid=".$data['msg_id']."";
- $wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
- $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
- $wm['linkimage'] = XOOPS_URL."/modules/smallworld/images/link.png";
- $wm['permalink'] = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id'];
- $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
- $wm['commentsarray'] = $Wall->Comments($data['msg_id']);
- $xoopsTpl->append('walldata', $wm);
- if (!empty($wm['commentsarray'])){
- foreach($wm['commentsarray'] as $cdata) {
-
- $USC = array();
- $USC['posts'] = 0;
- $USC['comments'] = 0;
-
- if ($xoopsUser) {
+ $wm['msg_id'] = $data['msg_id'];
+ $wm['orimessage'] = ($USW['posts'] == 1 || $profile >= 2) ?
+ str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
+ $wm['message'] = ($USW['posts'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['message'] = Smallworld_cleanup($wm['message']);
+ $wm['created'] = smallworld_time_stamp($data['created']);
+ $wm['username'] = $data['username'];
+ $wm['uid_fk'] = $data['uid_fk'];
+ $wm['priv'] = $data['priv'];
+ $wm['avatar'] = $Wall->Gravatar($data['uid_fk']);
+ $wm['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wm['avatar']);
+ $wm['avatar_size'] = smallworld_getImageSize(80, 100, $wm['avatar_link']);
+ $wm['avatar_highwide'] = smallworld_imageResize($wm['avatar_size'][0], $wm['avatar_size'][1], 50);
+ $wm['vote_up'] = $Wall->countVotes ('msg', 'up', $data['msg_id']);
+ $wm['vote_down'] = $Wall->countVotes ('msg', 'down', $data['msg_id']);
+ $wm['sharelinkurl'] = XOOPS_URL."/modules/smallworld/smallworldshare.php?ownerid=".$data['uid_fk'];
+ $wm['sharelinkurl'] .= "&updid=".$data['msg_id']."";
+ $wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
+ } else {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],1);
+ }
+
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ } else {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],1, $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ }
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
+ $wm['linkimage'] = XOOPS_URL."/modules/smallworld/images/link.png";
+ $wm['permalink'] = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id'];
+ $wm['commentsarray'] = $Wall->Comments($data['msg_id']);
+ $xoopsTpl->append('walldata', $wm);
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $cdata['uid_fk'] == $id) {
- $USC['posts'] = 1;
- $USC['comments'] = 1;
- } else {
- $USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
- }
- }
-
- if (!$xoopsUser) {
- $USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
- }
-
- $wc['msg_id_fk'] = $cdata['msg_id_fk'];
- $wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
- $wc['comment'] = Smallworld_cleanup($wc['comment']);
- $wc['time'] = smallworld_time_stamp($cdata['created']);
- $wc['username'] = $cdata['username'];
- $wc['uid'] = $cdata['uid_fk'];
- $wc['myavatar'] = $Wall->Gravatar($id);
- $wc['myavatar_link'] = $myavatarlink;
- $wc['avatar_size'] = smallworld_getImageSize(80, 100, $wc['myavatar_link']);
- $wc['avatar_highwide'] = smallworld_imageResize($wc['avatar_size'][0], $wc['avatar_size'][1], 35);
- $wc['cface'] = $Wall->Gravatar($cdata['uid_fk']);
- $wc['avatar_link'] = smallworld_getAvatarLink ($cdata['uid_fk'], $wc['cface']);
- $wc['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".Smallworld_getOwnerFromComment($cdata['msg_id_fk']);
- $wc['compl_msg_lnk'] .= "&updid=".$cdata['msg_id_fk']."#".$cdata['com_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
- $wc['vote_up'] = $Wall->countVotesCom ('com', 'up', $cdata['msg_id_fk'],$cdata['com_id']);
- $wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $cdata['msg_id_fk'],$cdata['com_id']);
- $xoopsTpl->append('comm', $wc);
- }
- }
-
- }
- }
+ if (!empty($wm['commentsarray'])){
+ foreach($wm['commentsarray'] as $cdata) {
+ $USC = array();
+ $USC['posts'] = 0;
+ $USC['comments'] = 0;
+
+ if ($xoopsUser) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $cdata['uid_fk'] == $id) {
+ $USC['posts'] = 1;
+ $USC['comments'] = 1;
+ } else {
+ $USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
+ }
+ }
+
+ if (!$xoopsUser) {
+ $USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
+ }
+
+ $wc['msg_id_fk'] = $cdata['msg_id_fk'];
+ $wc['com_id'] = $cdata['com_id'];
+ $wc['comment'] = ($USC['comments'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):
+ _SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = Smallworld_cleanup($wc['comment']);
+ $wc['time'] = smallworld_time_stamp($cdata['created']);
+ $wc['username'] = $cdata['username'];
+ $wc['uid'] = $cdata['uid_fk'];
+ $wc['myavatar'] = $Wall->Gravatar($id);
+ $wc['myavatar_link'] = $myavatarlink;
+ $wc['avatar_size'] = smallworld_getImageSize(80, 100, $wc['myavatar_link']);
+ $wc['avatar_highwide'] = smallworld_imageResize($wc['avatar_size'][0], $wc['avatar_size'][1], 35);
+ $wc['cface'] = $Wall->Gravatar($cdata['uid_fk']);
+ $wc['avatar_link'] = smallworld_getAvatarLink ($cdata['uid_fk'], $wc['cface']);
+ $wc['vote_up'] = $Wall->countVotesCom ('com', 'up', $cdata['msg_id_fk'],$cdata['com_id']);
+ $wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $cdata['msg_id_fk'],$cdata['com_id']);
+ $xoopsTpl->append('comm', $wc);
+ }
+ }
+ }
+ }
+
if ($profile >= 2) {
$xoopsTpl->assign('menu_startpage',$menu_startpage);
$xoopsTpl->assign('menu_home',$menu_home);
@@ -205,9 +213,9 @@
redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
}
- if ($profile == 1 && $set['access'] <= 1) {
- redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
- }
+ // if ($profile == 1 && $set['access'] <= 1) {
+ // redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
+ // }
if ($profile == 0 && $set['access'] == 0) {
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
Modified: XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-07-18 17:29:48 UTC (rev 11843)
@@ -46,7 +46,7 @@
// GET pop for recentactivities
xoops_smallworld('#smallworld_recentactivities').on('click',function(e) {
- if (Smallworld_userHasProfile == 0) {
+ if (Smallworld_userHasProfile <= 1) {
alert (SmallworldDialogNotUser);
return false;
}
@@ -72,7 +72,7 @@
// Attach colorbox.js to selector in register.php and edit_profile.php
// If other page / no presence of #smallworld_regform1 then exit function and continue
- xoops_smallworld(function() {
+ xoops_smallworld(document).ready(function() {
if (xoops_smallworld('#smallworld_regform1').length) { // implies *not* zero
xoops_smallworld('#smallworld_regform1').show();
xoops_smallworld( "#smallworld_regform1" ).dialog({
@@ -83,6 +83,7 @@
position: 'center',
open: function(event, ui) {
smallworld_DoValStart ();
+ xoops_smallworld("input#realname").val();
xoops_smallworld(".ui-widget-overlay").css({
background: 'none repeat scroll 0 0 #222222',
opacity: 0.89
@@ -92,7 +93,7 @@
xoops_smallworld('#smallworld_regform1').hide();
},
close: function(event, ui) {
- location.href = 'index.php';
+ location.href = 'publicindex.php';
}
});
};
@@ -186,22 +187,31 @@
// If user does not have a profile in smallworld then goto register.
// If user has already a profile then goto edit profile dialog
- if (Smallworld_userHasProfile === 0) {
- var buttons = {};
- buttons[_smallworldContinueToReg] = function() {
- location.href = smallworld_url+'register.php';
+ if (Smallworld_userHasProfile <= 1) {
+ var buttons = {};
+ buttons[_smallworldContinueToReg] = function() {
+ location.href = smallworld_url+'register.php';
+ }
+ buttons[_smallworldCancel] = function() {
+ xoops_smallworld( this ).dialog( "close" );
+ location.href = smallworld_url+'publicindex.php';
+ }
+ buttons[_smallworldClose] = function() {
+ xoops_smallworld( this ).dialog( "close" );
+ location.href = smallworld_url+'publicindex.php';
+ }
+
+ xoops_smallworld('#smallworld_notyetusercontent').dialog({
+ minWidth: 500,
+ show: "blind",
+ hide: "explode",
+ width: "550px",
+ close: function(event, ui) {
+ location.href = smallworld_url+'publicindex.php';
+ },
+ buttons: buttons
+ });
}
- buttons[_smallworldCancel] = function() {
- xoops_smallworld( this ).dialog( "close" );
- }
- xoops_smallworld('#smallworld_notyetregistered').dialog({
- minWidth: 500,
- show: "blind",
- hide: "explode",
- width: "550px",
- buttons: buttons
- });
- }
// Attach jquery-ui datepicker to form.
xoops_smallworld("#birthday" ).datepicker({
@@ -323,6 +333,7 @@
// if @ is pressed
if (event.keyCode === 50) {
xoops_smallworld(this).autocomplete({
+ disabled: false,
minLength: 3,
source : function (request, response) {
xoops_smallworld.ajax({
@@ -369,6 +380,8 @@
return false;
}
});
+ } else {
+ xoops_smallworld(this).autocomplete({ disabled: true });
}
});
});
@@ -889,6 +902,7 @@
xoops_smallworld('.smallworld_commentcontainer').each(function(){
var hiddenElements = xoops_smallworld(this).children('div:gt(1)').hide();
+ //var counts = xoops_smallworld(this).children().size();
if (hiddenElements.size() > 0) {
var showCaption = _smallworldCommentsMoreMore;
xoops_smallworld(this).children('div:gt(1)').hide();
@@ -1087,7 +1101,8 @@
};
function smallworld_DoValStart () {
- // Attact validation to registeration parts in register form
+ xoops_smallworld(document).ready(function() {
+ // Attact validation to registeration parts in register form
if (smallworldvalidationstrenght != 0) {
xoops_smallworld("#smallworld_profileform-next-0").hide();
xoops_smallworld("#smallworld_profileform-next-1").hide();
@@ -1187,6 +1202,7 @@
xoops_smallworld('#smallworld_profileform-next-0').show();
xoops_smallworld('#smallworld_profileform-next-1').show();
}
+ });
return false;
}
Modified: XoopsModules/smallworld/trunk/smallworld/js/wall.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/wall.js 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/js/wall.js 2013-07-18 17:29:48 UTC (rev 11843)
@@ -68,7 +68,7 @@
// commentopen
xoops_smallworld('body').on("click", '.smallworld_commentopen', function(e) {
e.preventDefault();
- if (Smallworld_userHasProfile == 0) {
+ if (Smallworld_userHasProfile <= 1) {
alert (SmallworldDialogNotUser);
return false;
}
@@ -131,7 +131,7 @@
xoops_smallworld("body").on('click', '.smallworld_stcomment_vote',
function(e) {
e.preventDefault();
- if (Smallworld_userHasProfile == 0) {
+ if (Smallworld_userHasProfile <= 1) {
alert (SmallworldDialogNotUser);
return false;
}
@@ -180,7 +180,7 @@
xoops_smallworld("body").on('click', '.smallworld_comment_complaint',
function(e) {
e.preventDefault();
- if (Smallworld_userHasProfile == 0) {
+ if (Smallworld_userHasProfile <= 1) {
alert (SmallworldDialogNotUser);
return false;
}
Modified: XoopsModules/smallworld/trunk/smallworld/language/english/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -197,13 +197,13 @@
define("_SMALLWORLD_ROTHER","Other");
define("_SMALLWORLD_SUBMIT","Save");
define("_SMALLWORLD_EMAILADRESSES","E-mail adress(es)");
-define ("_SMALLWORLD_SHOWIFPUBLICORPRIVATE","Privacy settings. What to show if wall is public");
+define ("_SMALLWORLD_SHOWIFPUBLICORPRIVATE","Privacy settings. Unchecked items is visible by smallworld users only.<br> Checked is visible by all users if wall is public. ");
define ("_SMALLWORLD_SHOWMYPOSTS","Show my posts");
define ("_SMALLWORLD_SHOWMYCOMMENTS","Show my comments");
define ("_SMALLWORLD_NOTIFYME","Notify me on posts / references etc");
define ("_SMALLWORLD_MENU_PRIVSET","Pri. Settings");
-define ("_SMALLWORLD_MESSAGE_PRIVSETPOSTS","Posts from this user are only visible for followers or friends...Please register.");
-define ("_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS","Comments from this user are only visible for followers or friends...Please register.");
+define ("_SMALLWORLD_MESSAGE_PRIVSETPOSTS","Posts from this user are only visible for smallworld users...<a href='register.php'>Please register.</a>");
+define ("_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS","Comments from this user are only visible for smallworld users...Please <a href='register.php'>register.</a>");
// dropdown screen names
define("_SMALLWORLD_SCREENNAME_AIM","MSN (uname) ");
Modified: XoopsModules/smallworld/trunk/smallworld/loadmore.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -51,6 +51,8 @@
$username = ($id > 0) ? $Xuser->getVar('uname'):'';
$dBase = new SmallWorldDB;
$check = new SmallWorldUser;
+$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
+
//
if ($id > 0) {
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
@@ -77,106 +79,112 @@
}else {
$followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
}
-if ($page == 'index') {
- $updatesarray = ($id > 0) ? $Wall->Updates($_POST['last'], $id, $followers) : $Wall->Updates($_POST['last'], $followers);
-} elseif ($page == 'profile') {
- $updatesarray = ($id > 0) ? $Wall->Updates($_POST['last'], $userid, $userid) : $Wall->Updates($_POST['last'], $userid);
-} elseif ($page == 'publicindex') {
- $updatesarray = $Wall->Updates($_POST['last'], $followers);
-}
-//Srinivas Tamada http://9lessons.info
- //Loading Comments link with load_updates.php
- foreach ($updatesarray as $data) {
- $USW = array();
-
- $USW['posts'] = 0;
- $USW['comments'] = 0;
-
- if ($xoopsUser) {
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
- $USW['posts'] = 1;
- $USW['comments'] = 1;
- } else {
- $USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
- }
+ if ($page == 'index') {
+ $updatesarray = ($id > 0) ? $Wall->Updates($_POST['last'], $id, $followers) : $Wall->Updates($_POST['last'], $followers);
+ } elseif ($page == 'profile') {
+ $updatesarray = ($id > 0) ? $Wall->Updates($_POST['last'], $userid, $userid) : $Wall->Updates($_POST['last'], $userid);
+ } elseif ($page == 'publicindex') {
+ $updatesarray = $Wall->Updates($_POST['last'], $followers);
+ }
+
+ if (!empty($updatesarray)) {
+ foreach ($updatesarray as $data) {
+ $USW = array();
+ $USW['posts'] = 0;
+ $USW['comments'] = 0;
+
+ if ($xoopsUser) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
+ $USW['posts'] = 1;
+ $USW['comments'] = 1;
+ } else {
+ $USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
+ }
+ }
+
+ if (!$xoopsUser) {
+ $USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
+ }
+
+ $wm['msg_id'] = $data['msg_id'];
+ $wm['orimessage'] = ($USW['posts'] == 1 || $profile >= 2) ?
+ str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
+ $wm['message'] = ($USW['posts'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['message'] = Smallworld_cleanup($wm['message']);
+ $wm['created'] = smallworld_time_stamp($data['created']);
+ $wm['username'] = $data['username'];
+ $wm['uid_fk'] = $data['uid_fk'];
+ $wm['priv'] = $data['priv'];
+ $wm['avatar'] = $Wall->Gravatar($data['uid_fk']);
+ $wm['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wm['avatar']);
+ $wm['avatar_size'] = smallworld_getImageSize(80, 100, $wm['avatar_link']);
+ $wm['avatar_highwide'] = smallworld_imageResize($wm['avatar_size'][0], $wm['avatar_size'][1], 50);
+ $wm['vote_up'] = $Wall->countVotes ('msg', 'up', $data['msg_id']);
+ $wm['vote_down'] = $Wall->countVotes ('msg', 'down', $data['msg_id']);
+ $wm['sharelinkurl'] = XOOPS_URL."/modules/smallworld/smallworldshare.php?ownerid=".$data['uid_fk'];
+ $wm['sharelinkurl'] .= "&updid=".$data['msg_id']."";
+ $wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
+ } else {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],1);
}
- if (!$xoopsUser) {
- $USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
- }
-
- $wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
- $wm['message'] = Smallworld_cleanup($wm['message']);
- $wm['created'] = smallworld_time_stamp($data['created']);
- $wm['username'] = $data['username'];
- $wm['uid_fk'] = $data['uid_fk'];
- $wm['priv'] = $data['priv'];
- $wm['avatar'] = $Wall->Gravatar($data['uid_fk']);
- $wm['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wm['avatar']);
- $wm['avatar_size'] = smallworld_getImageSize(80, 100, $wm['avatar_link']);
- $wm['avatar_highwide'] = smallworld_imageResize($wm['avatar_size'][0], $wm['avatar_size'][1], 50);
- $wm['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk'];
- $wm['compl_msg_lnk'] .= "&updid=".$data['msg_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
- $wm['vote_up'] = $Wall->countVotes ('msg', 'up', $data['msg_id']);
- $wm['vote_down'] = $Wall->countVotes ('msg', 'down', $data['msg_id']);
- $wm['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk'];
- $wm['compl_msg_lnk'] .= "&updid=".$data['msg_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
- $wm['sharelinkurl'] = XOOPS_URL."/modules/smallworld/smallworldshare.php?ownerid=".$data['uid_fk'];
- $wm['sharelinkurl'] .= "&updid=".$data['msg_id']."";
- $wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
- $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
- $wm['linkimage'] = XOOPS_URL."/modules/smallworld/images/link.png";
- $wm['permalink'] = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id'];
- $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
- $wm['commentsarray'] = $Wall->Comments($data['msg_id']);
- $tpl->append('walldata', $wm);
-
- if (!empty($wm['commentsarray'])){
- foreach($wm['commentsarray'] as $cdata) {
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ } else {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],1, $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ }
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
+ $wm['linkimage'] = XOOPS_URL."/modules/smallworld/images/link.png";
+ $wm['permalink'] = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id'];
+ $wm['commentsarray'] = $Wall->Comments($data['msg_id']);
+ $tpl->append('walldata', $wm);
- $USC = array();
- $USC['posts'] = 0;
- $USC['comments'] = 0;
-
- if ($xoopsUser) {
+ if (!empty($wm['commentsarray'])){
+ foreach($wm['commentsarray'] as $cdata) {
+ $USC = array();
+ $USC['posts'] = 0;
+ $USC['comments'] = 0;
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $cdata['uid_fk'] == $id) {
- $USC['posts'] = 1;
- $USC['comments'] = 1;
- } else {
+ if ($xoopsUser) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $cdata['uid_fk'] == $id) {
+ $USC['posts'] = 1;
+ $USC['comments'] = 1;
+ } else {
+ $USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
+ }
+ }
+
+ if (!$xoopsUser) {
$USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
- }
- }
+ }
- if (!$xoopsUser) {
- $USC = json_decode($dBase->GetSettings($cdata['uid_fk']), true);
+ $wc['msg_id_fk'] = $cdata['msg_id_fk'];
+ $wc['com_id'] = $cdata['com_id'];
+ $wc['comment'] = ($USC['comments'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):
+ _SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = Smallworld_cleanup($wc['comment']);
+ $wc['time'] = smallworld_time_stamp($cdata['created']);
+ $wc['username'] = $cdata['username'];
+ $wc['uid'] = $cdata['uid_fk'];
+ $wc['myavatar'] = $Wall->Gravatar($id);
+ $wc['myavatar_link'] = $myavatarlink;
+ $wc['avatar_size'] = smallworld_getImageSize(80, 100, $wc['myavatar_link']);
+ $wc['avatar_highwide'] = smallworld_imageResize($wc['avatar_size'][0], $wc['avatar_size'][1], 35);
+ $wc['cface'] = $Wall->Gravatar($cdata['uid_fk']);
+ $wc['avatar_link'] = smallworld_getAvatarLink ($cdata['uid_fk'], $wc['cface']);
+ $wc['vote_up'] = $Wall->countVotesCom ('com', 'up', $cdata['msg_id_fk'],$cdata['com_id']);
+ $wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $cdata['msg_id_fk'],$cdata['com_id']);
+ $tpl->append('comm', $wc);
}
-
- $wc['msg_id_fk'] = $cdata['msg_id_fk'];
- $wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
- $wc['comment'] = Smallworld_cleanup($wc['comment']);
- $wc['time'] = smallworld_time_stamp($cdata['created']);
- $wc['username'] = $cdata['username'];
- $wc['uid'] = $cdata['uid_fk'];
- $wc['myavatar'] = $myavatar;
- $wc['myavatar_link']= $myavatarlink;
- $wc['avatar_size'] = smallworld_getImageSize(80, 100, $wc['myavatar_link']);
- $wc['avatar_highwide'] = smallworld_imageResize($wc['avatar_size'][0], $wc['avatar_size'][1], 35);
- $wc['cface'] = $Wall->Gravatar($cdata['uid_fk']);
- $wc['avatar_link'] = smallworld_getAvatarLink ($cdata['uid_fk'], $wc['cface']);
- $wc['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".Smallworld_getOwnerFromComment($cdata['msg_id_fk']);
- $wc['compl_msg_lnk'] .= "&updid=".$cdata['msg_id_fk']."#".$cdata['com_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
- $wc['vote_up'] = $Wall->countVotesCom ('com', 'up', $cdata['msg_id_fk'],$cdata['com_id']);
- $wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $cdata['msg_id_fk'],$cdata['com_id']);
- $tpl->append('comm', $wc);
-
- }
- }
- }
+ }
+ }
+ }
+
$tpl->assign('sCountResp',count($updatesarray));
$tpl->assign('msgtoshow',$hm);
Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -27,10 +27,12 @@
$xoopsLogger->activated = false;
//error_reporting(E_ALL);
$page = 'index';
+$id = $xoopsUser->getVar('uid');
+$check = new SmallWorldUser;
+$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
-
-if ($xoopsUser) {
- $id = $xoopsUser->getVar('uid');
+if ($profile >= 2) {
+
$Xuser = new XoopsUser($id);
$username = $Xuser->getVar('uname');
$Wall = new Wall_Updates();
@@ -57,14 +59,12 @@
$insdata=$Wall->Insert_Update($id,$update,$priv);
if($insdata) {
//$updatesarray=$Wall->Updates('a', $id, $followers,$page);
- foreach ($insdata as $data) {
-
- $USW = array();
- $USW['posts'] = 0;
- $USW['comments'] = 0;
+ foreach ($insdata as $data) {
+ $USW = array();
+ $USW['posts'] = 0;
+ $USW['comments'] = 0;
- if ($xoopsUser) {
-
+ if ($xoopsUser) {
if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
$USW['posts'] = 1;
$USW['comments'] = 1;
@@ -78,8 +78,8 @@
}
$wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['orimessage'] = ($USW['posts'] == 1 || $profile >= 2) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
+ $wm['message'] = ($USW['posts'] == 1 || $profile >= 2) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -100,8 +100,17 @@
$wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
$wm['linkimage'] = XOOPS_URL."/modules/smallworld/images/link.png";
$wm['permalink'] = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id'];
- $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
- $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
+ } else {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],1);
+ }
+
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ } else {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],1, $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ }
$wm['commentsarray'] = $Wall->Comments($data['msg_id']);
//Send mail if tagged
@@ -113,13 +122,11 @@
if (!empty($wm['commentsarray'])){
foreach($wm['commentsarray'] as $cdata) {
-
$USC = array();
$USC['posts'] = 0;
$USC['comments'] = 0;
- if ($xoopsUser) {
-
+ if ($xoopsUser) {
if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $cdata['uid_fk'] == $id) {
$USC['posts'] = 1;
$USC['comments'] = 1;
@@ -134,7 +141,9 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):
+ _SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/permalink.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -85,8 +85,7 @@
$USW['posts'] = 0;
$USW['comments'] = 0;
- if ($xoopsUser) {
-
+ if ($xoopsUser) {
if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
$USW['posts'] = 1;
$USW['comments'] = 1;
@@ -100,8 +99,10 @@
}
$wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['orimessage'] = ($USW['posts'] == 1 || $profile >= 2) ?
+ str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
+ $wm['message'] = ($USW['posts'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -116,8 +117,17 @@
$wm['sharelinkurl'] = XOOPS_URL."/modules/smallworld/smallworldshare.php?ownerid=".$data['uid_fk'];
$wm['sharelinkurl'] .= "&updid=".$data['msg_id']."";
$wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
- $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
- $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
+ } else {
+ $wm['sharelink'] = $Wall->GetSharing ($wm['msg_id'],1);
+ }
+
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ } else {
+ $wm['sharediv'] = $Wall->GetSharingDiv ($wm['msg_id'],1, $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ }
$wm['commentsarray'] = $Wall->Comments($data['msg_id']);
$xoopsTpl->append('walldata', $wm);
@@ -128,7 +138,6 @@
$USC['comments'] = 0;
if ($xoopsUser) {
-
if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $cdata['uid_fk'] == $id) {
$USC['posts'] = 1;
$USC['comments'] = 1;
@@ -143,7 +152,9 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1 || $profile >= 2) ?
+ smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):
+ _SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/publicindex.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-07-18 16:50:51 UTC (rev 11842)
+++ XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-07-18 17:29:48 UTC (rev 11843)
@@ -20,7 +20,9 @@
**/
include_once("../../mainfile.php");
- if ($xoopsUser) {
+ $page = basename ($_SERVER['PHP_SELF'],".php");
+
+ if ($xoopsUser && $page != 'publicindex') {
$xoopsOption['template_main'] = 'smallworld_index.html';
} else {
$xoopsOption['template_main'] = 'smallworld_publicindex.html';
@@ -30,33 +32,29 @@
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/publicWall.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php");
global $xoopsUser, $xoTheme,$xoopsConfig,$xoopsLogger;
- $xoopsLogger->activated = false;
- /*error_reporting(E_ALL);*/
+ $xoopsLogger->activated = true;
+ error_reporting(E_ALL);
- $page = basename(str_replace('.php', '', __FILE__));
+
$set = smallworld_checkPrivateOrPublic ();
$dBase = new SmallWorldDB;
$check = new SmallWorldUser;
$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
+ $username = ($xoopsUser) ? $xoopsUser->getVar('uname'):'';
$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
$module_handler =& xoops_gethandler('module');
$module = $module_handler->getByDirname('smallworld');
$config_handler =& xoops_gethandler('config');
- $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
-
-
-
- $pub = smallworld_checkUserPubPostPerm ();
-
+ $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+ $pub = smallworld_checkUserPubPostPerm ();
$wall = new Public_Wall_Updates;
$updates = $wall->updates(0, $pub);
-
-
-
+
if ($id > 0) {
$xoopsTpl->assign('ownerofpage', $id);
+ $xoopsTpl->assign('myusername',$username);
}
if ($xoopsUser) {
@@ -72,14 +70,12 @@
$form = new SmallWorldForm;
$usersettings = $form->usersettings ($id, $selected=null);
$xoopsTpl->assign('usersetting', $usersettings);
-/* if (!$xoopsUser && $set['access']==1) {
-*/
$xuser = new SmallWorldProfile;
$menu_home = "<a href='".XOOPS_URL."/modules/smallworld/'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/house.png'>"._SMALLWORLD_HOME."</a>";
+ $menu_register = ($profile < 2) ? "<a href='".XOOPS_URL."/modules/smallworld/register.php'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/join.jpg'>"._MB_SYSTEM_RNOW."</a>":'';
-
$updatesarray=$wall->updates(0, $pub);
$myavatar = $wall->Gravatar($id);
@@ -87,17 +83,16 @@
$myavatar_size = smallworld_getImageSize(80, 100, $myavatarlink);
$myavatar_highwide = smallworld_imageResize($myavatar_size[0], $myavatar_size[1], 100);
$user_img = "<img src='".smallworld_getAvatarLink($id, $myavatar)."' id='smallworld_user_img' ".$myavatar_highwide."/>";
-
+
if (!empty($updatesarray)) {
- foreach ($updatesarray as $data) {
-
+ foreach ($updatesarray as $data) {
+
$USW = array();
- $USW['posts'] = 0;
- $USW['comments'] = 0;
-
- if ($xoopsUser) {
-
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) || $data['uid_fk'] == $id) {
+ $USW['posts'] = 0;
+ $USW['comments'] = 0;
+
+ if ($xoopsUser) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
$USW['posts'] = 1;
$USW['comments'] = 1;
} else {
@@ -108,81 +103,96 @@
if (!$xoopsUser) {
$USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
}
-
- $wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
- $wm['message'] = Smallworld_cleanup($wm['message']);
- $wm['created'] = smallworld_time_stamp($data['created']);
- $wm['username'] = $data['username'];
- $wm['uid_fk'] = $data['uid_fk'];
- $wm['priv'] = $data['priv'];
- $wm['avatar'] = $wall->Gravatar($data['uid_fk']);
- $wm['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wm['avatar']);
- $wm['avatar_size'] = smallworld_getImageSize(80, 100, $wm['avatar_link']);
- $wm['avatar_highwide'] = smallworld_imageResize($wm['avatar_size'][0], $wm['avatar_size'][1], 50);
- $wm['vote_up'] = $wall->countVotes ('msg', 'up', $data['msg_id']);
- $wm['vote_down'] = $wall->countVotes ('msg', 'down', $data['msg_id']);
- $wm['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk'];
- $wm['compl_msg_lnk'] .= "&updid=".$data['msg_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
- $wm['sharelinkurl'] = XOOPS_URL."/modules/smallworld/smallworldshare.php?ownerid=".$data['uid_fk'];
- $wm['sharelinkurl'] .= "&updid=".$data['msg_id']."";
- $wm['usernameTitle'] = $wm['username']._SMALLWORLD_UPDATEONSITEMETA.$xoopsConfig['sitename'];
- $wm['sharelink'] = $wall->GetSharing ($wm['msg_id'],$wm['priv']);
- $wm['linkimage'] = XOOPS_URL."/modules/smallworld/images/link.png";
- $wm['permalink'] = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id'];
- $wm['sharediv'] = $wall->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
- $wm['commentsarray'] = $wall->Comments($data['msg_id']);
- $xoopsTpl->append('walldata', $wm);
-
- if (!empty($wm['commentsarray'])){
- f...
[truncated message content] |