|
From: <dj...@us...> - 2013-04-17 15:22:35
|
Revision: 11399
http://sourceforge.net/p/xoops/svn/11399
Author: djculex
Date: 2013-04-17 15:22:31 +0000 (Wed, 17 Apr 2013)
Log Message:
-----------
NEW : Usersettings displaying post / comments
NEW : Startpage displaying admin descided posts (blog ?)
Change : Reinventing admin desc. users to show in startpage
Change : Various language defines. All added in default english (see your language)
Bugfix : No bigcaps convert username -> false check by username
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/class/profile.php
XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/language/danish/main.php
XoopsModules/smallworld/trunk/smallworld/language/english/main.php
XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php
XoopsModules/smallworld/trunk/smallworld/language/french/main.php
XoopsModules/smallworld/trunk/smallworld/language/french_iso/main.php
XoopsModules/smallworld/trunk/smallworld/language/russian/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/preloads/core.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/smallworldshare.php
XoopsModules/smallworld/trunk/smallworld/userprofile.php
XoopsModules/smallworld/trunk/smallworld/xoops_version.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -679,8 +679,8 @@
$i = $xoopsDB->getRowsNum($result);
if ($i < 1) {
$posts = serialize(array(
- 'posts' => 0,
- 'comments' => 0
+ 'posts' => 0,
+ 'comments' => 0
)
);
$this->saveSettings ($userid, $posts);
Modified: XoopsModules/smallworld/trunk/smallworld/class/profile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/profile.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/class/profile.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -46,7 +46,7 @@
$result = $xoopsDB->queryF($cdb);
$cnt = $xoopsDB->getRowsNum($result);
while ($r = $xoopsDB->fetchArray($result)) {
- $uname = ucwords($r['username']);
+ $uname = $r['username'];
$realname = $r['realname'];
$membersince = date("d-m-Y",$user->user_regdate());
$birthday = Smallworld_UsToEuroDate($r['birthday']);
Modified: XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -74,11 +74,9 @@
$set = smallworld_checkPrivateOrPublic ();
$mods = implode(",",Smallworld_array_flatten(array_unique($moderators),0));
$inspected = $this->inspected();
+ $perm = smallworld_GetModuleOption('smallworldshowPoPubPage');
+ $i=0;
- $i=0;
- //Get array of users permitted to post on public index page (normally admin moderators etc etc)
-
-
if ($last == 0) {
$query = "SELECT M.msg_id, M.uid_fk, M.priv, M.message, M.created, U.username FROM ".$xoopsDB->prefix('smallworld_messages')
. " M, ".$xoopsDB->prefix('smallworld_user')." U WHERE M.uid_fk=U.userid and M.uid_fk in (".$mods.") and M.uid_fk NOT IN (".$inspected.") and M.priv = '0'";
@@ -106,7 +104,7 @@
return false;
} else {
while ($row = $xoopsDB->fetchArray($result)) {
- $data[]=$row;
+ $data[]=$row;
}
if(!empty($data)) {
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -32,6 +32,7 @@
$Wall = new Wall_Updates();
$tpl = new XoopsTpl();
$mail = new smallworld_mail;
+ $dBase = new SmallWorldDB;
if(isSet($_POST['comment'])) {
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
@@ -49,10 +50,30 @@
$data=$Wall->Insert_Comment($id,$msg_id,$comment);
if($data) {
- $wc['msg_id_fk'] = $data['msg_id_fk'];
+
+ $USC = array();
+ $USC['posts'] = 0;
+ $USC['comments'] = 0;
+
+ if ($xoopsUser) {
+
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
+ $USC['posts'] = 1;
+ $USC['comments'] = 1;
+ } else {
+ $USC = json_decode($dBase->GetSettings($data['uid_fk']), true);
+ }
+ }
+
+ if (!$xoopsUser) {
+ $USC = json_decode($dBase->GetSettings($data['uid_fk']), true);
+ }
+
+ $wc['msg_id_fk'] = $data['msg_id_fk'];
$wc['com_id'] = $data['com_id'];
- $wc['comment'] = nl2br(smallworld_tolink(htmlspecialchars_decode($data['comment']), $data['uid']));
- $wc['time'] = smallworld_time_stamp($data['created']);
+ $wc['comment'] = ($USC['comments'] == 1) ? nl2br(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'];
$wc['uid'] = $data['uid_fk'];
$wc['myavatar'] = $myavatar;
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -978,8 +978,25 @@
}
return $opt;
}
-
+
/**
+ * @return array of groups
+ * return array
+ *
+ */
+ function smallworld_xv_getGroupd () {
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $myts =& MyTextSanitizer::getInstance();
+ $sql = "SELECT userid, username FROM ".$db->prefix('smallworld_user')." ORDER BY username";
+ $result = $db->query($sql);
+ while ($r = $db->fetchArray($result)) {
+ $data[$r['userid']] = $r['username'];
+ }
+ $ndata = array_merge(array(0 => _MI_SMALLWORLD_ALL), $data);
+ return $ndata;
+ }
+
+ /**
* Set javascript vars to theme using various values
* Return void
*/
@@ -1073,3 +1090,21 @@
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
}
}
+
+ /**
+ * Check if permission is et for userid to post publicly
+ * @return array
+ */
+
+ function smallworld_checkUserPubPostPerm () {
+ global $xoopsUser,$xoopsModule;
+ $check = new SmallWorldUser;
+ $UserPerPub = smallworld_GetModuleOption('smallworldshowPoPubPage');
+ $allUsers = $check->allUsers();
+ if ($UserPerPub[0] != 0) {
+ $pub = $UserPerPub;
+ } else {
+ $pub = $check->allUsers();
+ }
+ return $pub;
+ }
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -51,10 +51,10 @@
if ($xoopsUser) {
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$xoopsTpl->assign('isadminuser', 'YES');
+ }else {
+ $xoopsTpl->assign('isadminuser', 'NO');
}
- } else {
- $xoopsTpl->assign('isadminuser', 'NO');
- }
+ }
// Create form for private settings
$form = new SmallWorldForm;
@@ -69,7 +69,8 @@
if ($profile > 0) {
$xuser = new SmallWorldProfile;
$xuser->ShowUser($id);
- $menu_home = "<a href='".XOOPS_URL."/modules/smallworld/'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/house.png'>"._SMALLWORLD_HOME."</a>";
+ $menu_startpage = "<a href='".XOOPS_URL."/modules/smallworld/publicindex.php'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/highrise.png'>"._SMALLWORLD_STARTPAGE."</a>";
+ $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=".$username."'><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=".$username."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/picture.png'>"._SMALLWORLD_GALLERY."</a>";
$menu_friends = "<a href='".XOOPS_URL."/modules/smallworld/friends.php?username=".$username."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/group.png'>"._SMALLWORLD_FRIENDSPAGE."</a>";
@@ -78,7 +79,7 @@
// Things to do with wall
$Wall = ($profile > 0) ? new Wall_Updates() : new Public_Wall_Updates;
if (!$xoopsUser && $set['access'] == 1) {
- $pub = $check->allUsers();
+ $pub = smallworld_checkUserPubPostPerm ();
$updatesarray = $Wall->updates(0, $pub);
} else {
// Follow array here
@@ -118,9 +119,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) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
- $wm['message'] = str_replace(array('<','>'),array('<','>'), $wm['message']);
- $wm['created'] = smallworld_time_stamp($data['created']);
+ $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ //$wm['message'] = str_replace(array('<script','</script>'),array('<code><scipt','</script></code>'), $wm['message']);
+ $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'];
@@ -136,10 +138,11 @@
$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']);
+ $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) {
@@ -164,6 +167,7 @@
$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'];
@@ -184,13 +188,14 @@
}
}
if ($profile > 0) {
+ $xoopsTpl->assign('menu_startpage',$menu_startpage);
$xoopsTpl->assign('menu_home',$menu_home);
$xoopsTpl->assign('menu_profile',$menu_profile);
$xoopsTpl->assign('menu_friends',$menu_friends);
$xoopsTpl->assign('menu_gallery',$menu_gallery);
}
- $xoopsTpl->assign('myusername',$username);
- $xoopsTpl->assign('pagename','index');
+ $xoopsTpl->assign('myusername',$username);
+ $xoopsTpl->assign('pagename','index');
$xoopsTpl->assign('check',1);
$xoopsTpl->assign('myavatar',$myavatar);
$xoopsTpl->assign('myavatarlink',$myavatarlink);
@@ -209,7 +214,8 @@
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+
} elseif ($profile <= 0 && $set['access'] == 0) {
redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
} else {
Modified: XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js 2013-04-17 15:22:31 UTC (rev 11399)
@@ -1,4 +1,4 @@
-/* http://keith-wood.name/bookmark.html
+/*! http://keith-wood.name/bookmark.html
Sharing bookmarks for jQuery v1.4.0.
Written by Keith Wood (kbwood{at}iinet.com.au) March 2008.
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
Modified: XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-04-17 15:22:31 UTC (rev 11399)
@@ -494,6 +494,7 @@
xoops_smallworld(function() {
xoops_smallworld('#smallworld_user_img').css('cursor', 'pointer');
xoops_smallworld('#smallworld_user_img').css('margin', '0 auto');
+ xoops_smallworld('#smallworld_user_img').css('display', 'block');
xoops_smallworld('#smallworld_user_img').on('click',function(event) {
var url = xoops_smallworld(this).attr('src');
image = "<img src ='"+url+"' />";
Modified: XoopsModules/smallworld/trunk/smallworld/language/danish/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/danish/main.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/language/danish/main.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -196,6 +196,12 @@
define("_SMALLWORLD_ROTHER","Andet");
define("_SMALLWORLD_SUBMIT","Gem");
define("_SMALLWORLD_EMAILADRESSES","E-mail adresse(r)");
+define ("_SMALLWORLD_SHOWIFPUBLICORPRIVATE","Privatindstillinger. Hvad skal vises for anonyme brugere?");
+define ("_SMALLWORLD_SHOWMYPOSTS","Vis mine indlæg");
+define ("_SMALLWORLD_SHOWMYCOMMENTS","Vis mine kommentarer");
+define ("_SMALLWORLD_MENU_PRIVSET","Priv. indstil.");
+define ("_SMALLWORLD_MESSAGE_PRIVSETPOSTS","Indlæg fra denne bruger vises kun for følgere/venner. Registrer venligst!");
+define ("_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS","Kommentarer fra denne bruger vises kun for følgere/venner. Registrer venligst!");
// Dropdown skærmnavne
define("_SMALLWORLD_SCREENNAME_AIM","MSN (uname) ");
Modified: XoopsModules/smallworld/trunk/smallworld/language/english/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -311,6 +311,7 @@
define("_SMALLWORLD_JS_COMPLAINT_ALREADY_SENT","You have already made a complaint for this post!");
/*----------- Indexpage menu --------------*/
+define ("_SMALLWORLD_STARTPAGE","Start page");
define("_SMALLWORLD_HOME","Home");
define("_SMALLWORLD_PROFILEINDEX","Profile");
define("_SMALLWORLD_FRIENDSPAGE","Friends");
Modified: XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -94,4 +94,12 @@
define ('_MI_SMALLWORLD_PRIVATEMODULE','Show public posts ?');
define ('_MI_SMALLWORLD_PRIVATEMODULE_DESC','If "yes" then all visiters can read posts marked "public" by authorized author. Commenting/posting/editing etc are all still inactive until logged in.');
+// Limit users access to public posting
+
+define ('_MI_SHOWPUBLICPAGE', 'Limit the posting to public to these users.');
+define ('_MI_SHOWPUBLICPAGE_DESC', 'Default is "All users" wich means that all users will have their "public" posts shown on publicindex.php.<br>
+ If you use a limiter and not newer users are shown here, do a smallworld module update in administration to <br>
+ show the latest users.
+ ');
+define ('_MI_SMALLWORLD_ALL', 'All users');
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/language/french/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/french/main.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/language/french/main.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -196,6 +196,12 @@
define("_SMALLWORLD_ROTHER","Autres");
define("_SMALLWORLD_SUBMIT","Enregistrer");
define("_SMALLWORLD_EMAILADRESSES","Adresse(s) éléctronique(s)");
+define ("_SMALLWORLD_SHOWIFPUBLICORPRIVATE","Privacy settings. What to show if wall is public");
+define ("_SMALLWORLD_SHOWMYPOSTS","Show my posts");
+define ("_SMALLWORLD_SHOWMYCOMMENTS","Show my comments");
+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.");
// dropdown screen names
define("_SMALLWORLD_SCREENNAME_AIM","MSN");
Modified: XoopsModules/smallworld/trunk/smallworld/language/french_iso/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/french_iso/main.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/language/french_iso/main.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -196,6 +196,12 @@
define("_SMALLWORLD_ROTHER","Autres");
define("_SMALLWORLD_SUBMIT","Enregistrer");
define("_SMALLWORLD_EMAILADRESSES","Adresse(s) éléctronique(s)");
+define ("_SMALLWORLD_SHOWIFPUBLICORPRIVATE","Privacy settings. What to show if wall is public");
+define ("_SMALLWORLD_SHOWMYPOSTS","Show my posts");
+define ("_SMALLWORLD_SHOWMYCOMMENTS","Show my comments");
+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.");
// dropdown screen names
define("_SMALLWORLD_SCREENNAME_AIM","MSN");
Modified: XoopsModules/smallworld/trunk/smallworld/language/russian/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/russian/main.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/language/russian/main.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -211,6 +211,12 @@
define("_SMALLWORLD_SCREENNAME_YOUTUBE","Youtube (uname) ");
define("_SMALLWORLD_ADDMORE","Добавить еще");
define("_SMALLWORLD_REMOVE","Удалить");
+define ("_SMALLWORLD_SHOWIFPUBLICORPRIVATE","Privacy settings. What to show if wall is public");
+define ("_SMALLWORLD_SHOWMYPOSTS","Show my posts");
+define ("_SMALLWORLD_SHOWMYCOMMENTS","Show my comments");
+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.");
/*------------ Schools ----------*/
Modified: XoopsModules/smallworld/trunk/smallworld/loadmore.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -26,6 +26,7 @@
include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/arrays.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/publicWall.php");
$set = smallworld_checkPrivateOrPublic ();
+$pub = smallworld_checkUserPubPostPerm ();
$hm = smallworld_GetModuleOption('msgtoshow');
$last = mysql_real_escape_string($_POST['last']);
@@ -33,7 +34,7 @@
global $xoopsUser, $xoTheme, $xoopsTpl,$xoopsLogger;
$xoopsLogger->activated = false;
-/* error_reporting(E_ALL); */
+ /* error_reporting(E_ALL); */
$tpl = new XoopsTpl();
$id = ($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
if ($id <= 0 || $page == 'publicindex' && $set['access'] = 1) {
@@ -53,21 +54,25 @@
//
if ($id > 0) {
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+ $pub = $check->allUsers();
$tpl->assign('isadminuser', 'YES');
}
} else {
$tpl->assign('isadminuser', 'NO');
+ $pub = smallworld_checkUserPubPostPerm ();
}
$myavatar = $Wall->Gravatar($id);
$myavatarlink = smallworld_getAvatarLink($id, $myavatar);
$myavatar_size = smallworld_getImageSize(80, 100, $myavatarlink);
$myavatar_highwide = smallworld_imageResize($myavatar_size[0], $myavatar_size[1], 35);
-
+
+
+
if ($id <= 0 && $set['access'] == 1 ) {
- $pub = $check->allUsers();
+ //$pub = $check->allUsers();
$followers = $pub;
} elseif ($id > 0 && $set['access'] == 1 && $page == 'publicindex') {
- $pub = $check->allUsers();
+ //$pub = $check->allUsers();
$followers = $pub;
}else {
$followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
@@ -101,15 +106,16 @@
$USW = json_decode($dBase->GetSettings($data['uid_fk']), true);
}
- $wm['msg_id'] = $data['msg_id'];
+ $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) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
- $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['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'];
@@ -122,7 +128,9 @@
$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']);
+ $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);
@@ -149,7 +157,8 @@
$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'] = ($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'];
Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -35,6 +35,7 @@
$username = $Xuser->getVar('uname');
$Wall = new Wall_Updates();
$tpl = new XoopsTpl();
+ $dBase = new SmallWorldDB;
if(isSet($_POST['update'])) {
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
@@ -56,15 +57,35 @@
if($insdata) {
//$updatesarray=$Wall->Updates('a', $id, $followers,$page);
foreach ($insdata as $data) {
- $wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']);
- $wm['message'] = nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']));
- $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']);
+
+ $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) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
+ $wm['message'] = ($USW['posts'] == 1) ? nl2br(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'];
@@ -76,25 +97,47 @@
$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['sharelink'] = $Wall->GetSharing ($wm['msg_id'],$wm['priv']);
$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) {
- $wc['msg_id_fk'] = $cdata['msg_id_fk'];
- $wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']), $cdata['uid_fk']));
- $wc['time'] = smallworld_time_stamp($cdata['created']);
- $wc['username'] = $cdata['username'];
- $wc['uid'] = $cdata['uid_fk'];
- $wc['myavatar'] = $myavatar;
- $wc['myavatar_link']= $myavatarlink;
+
+ $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) ? 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'] = $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['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']);
Modified: XoopsModules/smallworld/trunk/smallworld/permalink.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -23,34 +23,47 @@
include_once(XOOPS_ROOT_PATH."/header.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php");
-global $xoopsUser, $xoTheme;
- if ($xoopsUser) {
-
+global $xoopsUser, $xoTheme, $xoopsLogger, $xoopsModule;
+
+ $xoopsLogger->activated = false;
+ /* error_reporting(E_ALL); */
+
+ $module_handler =& xoops_gethandler('module');
+ $module = $module_handler->getByDirname('smallworld');
+ $config_handler =& xoops_gethandler('config');
+ $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+
+ $set = smallworld_checkPrivateOrPublic ();
+ $check = new SmallWorldUser;
+ $pub = smallworld_checkUserPubPostPerm ();
+ $dBase = new SmallWorldDB;
+
if (isset($_GET['updid']) AND isset($_GET['ownerid'])) {
- $updID = $_GET['updid'];
- $ownerID = $_GET['ownerid'];
+ $updID = $_GET['updid'];
+ $ownerID = $_GET['ownerid'];
} else {
- redirect_header(XOOPS_URL . "/modules/smallworld/index.php", 5, _SMALLWORLD_UPDATEID_NOT_EXIST);
+ redirect_header(XOOPS_URL . "/modules/smallworld/index.php", 5, _SMALLWORLD_UPDATEID_NOT_EXIST);
}
- $id = $xoopsUser->getVar('uid');
- $user = new XoopsUser($id);
- if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
- $xoopsTpl->assign('isadminuser', 'YES');
- $xoopsTpl->assign('ownerofpage', $id);
- }
-
- $username = $user->getVar('uname');
- $check = new SmallWorldUser;
+
+ $id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
+ $user = ($xoopsUser) ? new XoopsUser($id) : 0;
+
+ if ($xoopsUser) {
+ if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+ $pub = $check->allUsers();
+ $xoopsTpl->assign('isadminuser', 'YES');
+ $xoopsTpl->assign('ownerofpage', $id);
+ } else {
+ $xoopsTpl->assign('isadminuser', 'NO');
+ }
+ }
+ $username = ($xoopsUser) ? $user->getVar('uname'):"";
+
$friend = $check->friendcheck($id,$ownerID);
- if ($friend[0] != 0) {
+
$profile = $check->checkIfProfile($id);
- if ($profile > 0) {
- $xuser = new SmallWorldProfile;
- $xuser->ShowUser($id);
- $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=".$username."'><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=".$username."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/picture.png'>"._SMALLWORLD_GALLERY."</a>";
- $menu_friends = "<a href='".XOOPS_URL."/modules/smallworld/friends.php?username=".$username."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/group.png'>"._SMALLWORLD_FRIENDSPAGE."</a>";
+ $menu_startpage = "<a href='".XOOPS_URL."/modules/smallworld/publicindex.php'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/highrise.png'>"._SMALLWORLD_STARTPAGE."</a>";
+ $menu_home = "<a href='".XOOPS_URL."/modules/smallworld/'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/house.png'>"._SMALLWORLD_HOME."</a>";
// Things to do with wall
$Wall = new Wall_Updates();
@@ -68,10 +81,28 @@
//Loading Comments link with load_updates.php
if (!empty($updatesarray)) {
foreach ($updatesarray as $data) {
- if (in_array($data['uid_fk'], $followers) || $id == $ownerID || $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+ $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'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message']));
- $wm['message'] = smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']);
+ $wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
+ $wm['message'] = ($USW['posts'] == 1) ? nl2br(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'];
@@ -92,9 +123,28 @@
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'] = smallworld_tolink(htmlspecialchars_decode($cdata['comment']), $cdata['uid_fk']);
+ $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'];
@@ -109,22 +159,18 @@
$xoopsTpl->append('comm', $wc);
}
}
- }
}
}
- $xoopsTpl->assign('menu_home',$menu_home);
- $xoopsTpl->assign('menu_profile',$menu_profile);
- $xoopsTpl->assign('menu_friends',$menu_friends);
- $xoopsTpl->assign('menu_gallery',$menu_gallery);
+
+ $xoopsTpl->assign('menu_startpage',$menu_startpage);
+ $xoopsTpl->assign('menu_home',$menu_home);
$xoopsTpl->assign('myusername',$username);
$xoopsTpl->assign('pagename','index');
$xoopsTpl->assign('check',1);
$xoopsTpl->assign('myavatar',$myavatar);
$xoopsTpl->assign('myavatarlink',$myavatarlink);
$xoopsTpl->assign('myavatar_highwide',$myavatar_highwide);
- } elseif ($profile == 0) {
- $check->chkUser ();
- }
+
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
@@ -132,11 +178,6 @@
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
- } else {
- redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
- }
- } else {
- redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
- }
+
include(XOOPS_ROOT_PATH."/footer.php");
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/preloads/core.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -34,7 +34,6 @@
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/base/jquery.ui.all.css');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
-
//Check xoops version. If bigger than 2.5.0 then include by internal jquery plugins
$ver = explode(" ", XOOPS_VERSION);
@@ -46,8 +45,9 @@
} else {
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.min.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jqueryui.min.js');
+ //$xoTheme->addScript("http://code.jquery.com/jquery-migrate-1.1.1.js");
}
-
+
//Get variables
smallworld_SetCoreScript ();
Modified: XoopsModules/smallworld/trunk/smallworld/publicindex.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -20,15 +20,20 @@
**/
include_once("../../mainfile.php");
-$xoopsOption['template_main'] = 'smallworld_publicindex.html';
+ if ($xoopsUser) {
+ $xoopsOption['template_main'] = 'smallworld_index.html';
+ } else {
+ $xoopsOption['template_main'] = 'smallworld_publicindex.html';
+ }
include_once(XOOPS_ROOT_PATH."/header.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php");
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 = true;
- error_reporting(E_ALL);
+ $xoopsLogger->activated = false;
+ /*error_reporting(E_ALL);*/
+ $page = basename(str_replace('.php', '', __FILE__));
$set = smallworld_checkPrivateOrPublic ();
$module_handler =& xoops_gethandler('module');
@@ -38,12 +43,26 @@
$dBase = new SmallWorldDB;
$check = new SmallWorldUser;
- $pub = $check->allUsers();
+
+ $pub = smallworld_checkUserPubPostPerm ();
+
$wall = new Public_Wall_Updates;
$updates = $wall->updates(0, $pub);
$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
+ if ($id > 0) {
+ $xoopsTpl->assign('ownerofpage', $id);
+ } else {
+ }
+ if ($xoopsUser) {
+ if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+ $pub = $check->allUsers();
+ $xoopsTpl->assign('isadminuser', 'YES');
+ }
+ } else {
+ $xoopsTpl->assign('isadminuser', 'NO');
+ }
/* if (!$xoopsUser && $set['access']==1) {
*/
@@ -57,7 +76,8 @@
$myavatar = $wall->Gravatar($id);
$myavatarlink = smallworld_getAvatarLink($id, $myavatar);
$myavatar_size = smallworld_getImageSize(80, 100, $myavatarlink);
- $myavatar_highwide = smallworld_imageResize($myavatar_size[0], $myavatar_size[1], 35);
+ $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) {
@@ -83,7 +103,7 @@
$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) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
- $wm['message'] = str_replace(array('<','>'),array('<','>'), $wm['message']);
+ $wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
$wm['uid_fk'] = $data['uid_fk'];
@@ -100,10 +120,12 @@
$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);
-
+ $xoopsTpl->append('walldata', $wm);
+
if (!empty($wm['commentsarray'])){
foreach($wm['commentsarray'] as $cdata) {
@@ -128,6 +150,7 @@
$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'];
@@ -141,14 +164,15 @@
$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);
+ $xoopsTpl->append('comm', $wc);
}
}
}
}
$xoopsTpl->assign('menu_home',$menu_home);
- $xoopsTpl->assign('pagename','index');
+ $xoopsTpl->assign('avatar', $user_img);
+ $xoopsTpl->assign('pagename','publicindex');
$xoopsTpl->assign('check',1);
$xoopsTpl->assign('access',$set['access']);
Modified: XoopsModules/smallworld/trunk/smallworld/smallworldshare.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/smallworldshare.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/smallworldshare.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -26,7 +26,7 @@
global $xoopsUser, $xoTheme, $xoopsConfig, $xoopsTpl, $xoopsLogger;
$xoopsLogger->activated = false;
-//error_reporting(E_ALL);
+/*error_reporting(E_ALL);*/
if (isset($_GET['updid']) && isset($_GET['ownerid'])) {
$updID = $_GET['updid'];
@@ -48,8 +48,7 @@
foreach ($updatesarray as $data) {
$wm['msg_id'] = $data['msg_id'];
$wm['orimessage'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message']));
- $wm['message'] = str_replace(array('<','>'),array('<','>'),$data['message']);
- $wm['message'] = Smallworld_cleanup(htmlspecialchars_decode($data['message']), $data['uid_fk']);
+ $wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
$wm['uid_fk'] = $data['uid_fk'];
Modified: XoopsModules/smallworld/trunk/smallworld/userprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -88,7 +88,7 @@
if ($fl[0] == 1) {
$following_text = _SMALLWORLD_JSON_FLNO_TEXT;
}
-
+
// Get requests
$getInvitations = $check->getRequests ($yourid);
@@ -111,14 +111,15 @@
//Loading Comments link with load_updates.php
if (!empty($updatesarray)) {
foreach ($updatesarray as $data) {
- $wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']);
- $wm['message'] = nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']));
- $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['msg_id'] = $data['msg_id'];
+ $wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']);
+ $wm['message'] = nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']));
+ $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);
@@ -130,6 +131,8 @@
$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);
@@ -140,6 +143,7 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
$wc['comment'] = nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']), $cdata['uid_fk']));
+ $wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
$wc['uid'] = $cdata['uid_fk'];
@@ -163,7 +167,8 @@
// 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_startpage = "<a href='".XOOPS_URL."/modules/smallworld/publicindex.php'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/highrise.png'>"._SMALLWORLD_STARTPAGE."</a>";
+ $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>";
$menu_friends = "<a href='".XOOPS_URL."/modules/smallworld/friends.php?username=".$Xusername."'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/group.png'>"._SMALLWORLD_FRIENDSPAGE."</a>";
@@ -185,7 +190,8 @@
$birthday_today_text .= " "._SMALLWORLD_BDAY_TODAY." ";
$birthday_today_text .= "<img width='20px' heigh='20px' src='images/bdayballoons_r.png'/>";
- $xoopsTpl->assign('menu_home',$menu_home);
+ $xoopsTpl->assign('menu_startpage',$menu_startpage);
+ $xoopsTpl->assign('menu_home',$menu_home);
$xoopsTpl->assign('menu_profile',$menu_profile);
$xoopsTpl->assign('menu_friends',$menu_friends);
$xoopsTpl->assign('menu_gallery',$menu_gallery);
Modified: XoopsModules/smallworld/trunk/smallworld/xoops_version.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2013-04-17 15:06:30 UTC (rev 11398)
+++ XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2013-04-17 15:22:31 UTC (rev 11399)
@@ -282,6 +282,19 @@
$modversion['config'][$i]['valuetype'] = 'int';
$modversion['config'][$i]['default'] = 1;
+/**
+* Authorized groups to upload
+*/
+$i++;
+$obj = smallworld_xv_getGroupd ();
+$modversion['config'][$i]['name'] = 'smallworldshowPoPubPage';
+$modversion['config'][$i]['title'] = '_MI_SHOWPUBLICPAGE';
+$modversion['config'][$i]['description'] = '_MI_SHOWPUBLICPAGE_DESC';
+$modversion['config'][$i]['formtype'] = 'select_multi';
+$modversion['config'][$i]['valuetype'] = 'array';
+$modversion['config'][$i]['default'] = 0;
+$modversion['config'][$i]['options'] = array_flip($obj);
+
// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
|