|
From: <dj...@us...> - 2013-03-13 12:56:49
|
Revision: 11217
http://sourceforge.net/p/xoops/svn/11217
Author: djculex
Date: 2013-03-13 12:56:46 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
Update: Updating changelog.txt, lang_diff.txt and reverting version to 1.15 but upping RC to 11
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt
XoopsModules/smallworld/trunk/smallworld/xoops_version.php
Modified: XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-03-13 12:27:43 UTC (rev 11216)
+++ XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-03-13 12:56:46 UTC (rev 11217)
@@ -1,4 +1,52 @@
------------------------------
+Changelog v.1.15 RC 11
+------------------------------
+12. marts 2013 Revision: 10227 - 10226
+
+NEW: Added upgraded image upload
+NEW: Added upgraded mail class
+NEW: class/publicWall.php, publicindex.php, templates for public postings
+
+Bugfix: Missing image
+Bugfix: Making new jquery work with existing code
+Bugfix: Show correct user stats in admin/index.php
+Bugfix: Display correct size of undefined avatar in comments
+Change: Allow display of public posts for all users
+Change: Correcting code style, removing comments etc etc
+
+Language additions: js/variables.js, modinfo.php
+
+------------------------------
+Changelog v.1.15 RC 10
+------------------------------
+11. februar 2013 Revision: 10205 - 10222
+
+New: Upgraded jquery.min.js and jqueryui.min.js to new versions.
+New: Added vendor and cors folders containg extra plugins to be used with multi uploader plugin
+New: Upgraded uploadHandler.php and edited img_upload.php and imgupload.php to use new class
+New: Style and js for upgraded oembed plugin 1.0.5RC -> 1.1.0RC
+New: Added Css for bootstrap, jquery ui and no-script for uploader plugin
+
+Update: Upgraded multi upload plugin from 4.2 -> 5.21
+
+Bugfix: Href is now javascript:void(0) on email, screenname, jobs and school in register.php. Dynamics are caught on class or div using jquery
+Bugfix: Include language files on coreload to repress missing define messages
+Bugfix: Embedcode is failing when image extension is uppercase
+Bugfix: Replaced function to remove span, divs from dom in registration.
+Bugfix: Temporary fix to use jquery.history.js using depresated $.browser() function.
+Bugfix: Added extra margin
+
+change: Up to version 2.16 RC
+Change: Jquery replacing $.live() funcion with $.on()
+Change: If xoops version is >= 2.4.0 include frameworks else load from js folder
+Change: Added commented include to migrate -> for development issues
+Change: changed style to show automatic post when uploading images to be justified instead of centered
+Change: Replaced depreseated functions to be used with new frameworks
+Change: Replacing depreseated jquery functions 1.8.11 -> 1.9+ (live->on, change->bind etc).
+
+Delete: remove unused upload plugin files
+
+------------------------------
Changelog v.1.15 RC 9
------------------------------
25 June 2012 Revision 9645 - 9713
Modified: XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt 2013-03-13 12:27:43 UTC (rev 11216)
+++ XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt 2013-03-13 12:56:46 UTC (rev 11217)
@@ -9,6 +9,12 @@
* Modified
===============================
+2013/03/12: Version 1.15 RC11
+===============================
+htdocs/modules/smallworld/english/js/variables.js
++ var SmallworldDialogNotUser = 'You must be registered to do this!!';
+
+===============================
2012/04/29: Version 1.15 RC5
===============================
htdocs/modules/smallworld/english/main.php
Modified: XoopsModules/smallworld/trunk/smallworld/xoops_version.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2013-03-13 12:27:43 UTC (rev 11216)
+++ XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2013-03-13 12:56:46 UTC (rev 11217)
@@ -20,11 +20,11 @@
**/
$modversion['name'] = _MI_SMALLWORLD_MODULE_NAME;
-$modversion['version'] = 1.19;
+$modversion['version'] = 1.15;
$modversion['description'] = _MI_SMALLWORLD_MODULE_DESC;
$modversion['author'] = "Michael Albertsen";
$modversion['nickname'] = 'Culex';
-$modversion['credits'] = "Mariane, Mrsculex, Mamba, Rune, Zth, Cesag, Flipse";
+$modversion['credits'] = "Mariane, Mrsculex, Mamba, Rune, Zth, Cesag, Flipse, Dante";
$modversion['module_website_name'] = 'www.culex.dk';
$modversion['module_website_url'] = 'www.culex.dk';
$modversion['license'] = 'GNU GPL';
|
|
From: <dj...@us...> - 2013-03-31 23:15:40
|
Revision: 11331
http://sourceforge.net/p/xoops/svn/11331
Author: djculex
Date: 2013-03-31 23:15:37 +0000 (Sun, 31 Mar 2013)
Log Message:
-----------
NEW : Upgraded jquery.colorbox.js to v1.4.6
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/css/colorbox.css
XoopsModules/smallworld/trunk/smallworld/js/jquery.colorbox.js
Modified: XoopsModules/smallworld/trunk/smallworld/css/colorbox.css
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/css/colorbox.css 2013-03-31 23:13:08 UTC (rev 11330)
+++ XoopsModules/smallworld/trunk/smallworld/css/colorbox.css 2013-03-31 23:15:37 UTC (rev 11331)
@@ -6,46 +6,88 @@
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
-#cboxLoadedContent{overflow:auto;}
+#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
-.cboxPhoto{float:left; margin:auto; border:0; display:block;}
+.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
+#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
-#cboxOverlay{background:#000;}
-#colorbox{}
- #cboxTopLeft{width:14px; height:14px; background:url(../images/controls.png) no-repeat 0 0;}
- #cboxTopCenter{height:14px; background:url(../images/bordercb.png) repeat-x top left;}
- #cboxTopRight{width:14px; height:14px; background:url(../images/controlscb.png) no-repeat -36px 0;}
- #cboxBottomLeft{width:14px; height:43px; background:url(../images/controlscb.png) no-repeat 0 -32px;}
- #cboxBottomCenter{height:43px; background:url(../images/bordercb.png) repeat-x bottom left;}
- #cboxBottomRight{width:14px; height:43px; background:url(../images/controlscb.png) no-repeat -36px -32px;}
- #cboxMiddleLeft{width:14px; background:url(../images/controlscb.png) repeat-y -175px 0;}
- #cboxMiddleRight{width:14px; background:url(../images/controlscb.png) repeat-y -211px 0;}
- #cboxContent{background:#fff; overflow:visible;}
+#cboxOverlay{background:url(../images/overlay.png) repeat 0 0;}
+#colorbox{outline:0;}
+ #cboxTopLeft{width:21px; height:21px; background:url(../images/controls.png) no-repeat -101px 0;}
+ #cboxTopRight{width:21px; height:21px; background:url(../images/controls.png) no-repeat -130px 0;}
+ #cboxBottomLeft{width:21px; height:21px; background:url(../images/controls.png) no-repeat -101px -29px;}
+ #cboxBottomRight{width:21px; height:21px; background:url(../images/controls.png) no-repeat -130px -29px;}
+ #cboxMiddleLeft{width:21px; background:url(../images/controls.png) left top repeat-y;}
+ #cboxMiddleRight{width:21px; background:url(../images/controls.png) right top repeat-y;}
+ #cboxTopCenter{height:21px; background:url(../images/border.png) 0 0 repeat-x;}
+ #cboxBottomCenter{height:21px; background:url(../images/border.png) 0 -29px repeat-x;}
+ #cboxContent{background:#fff; overflow:hidden;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
- #cboxLoadedContent{margin-bottom:5px;}
- #cboxLoadingOverlay{background:url(../images/loading_backgroundcb.png) no-repeat center center;}
- #cboxLoadingGraphic{background:url(../images/loadingcb.gif) no-repeat center center;}
- #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
- #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
+ #cboxLoadedContent{margin-bottom:28px;}
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
+ #cboxLoadingOverlay{background:url(../images/loading_background.png) no-repeat center center;}
+ #cboxLoadingGraphic{background:url(../images/loading.gif) no-repeat center center;}
+
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(../images/controlscb.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
- #cboxPrevious{left:0px; background-position: -51px -25px;}
- #cboxPrevious:hover{background-position:-51px 0px;}
- #cboxNext{left:27px; background-position:-75px -25px;}
- #cboxNext:hover{background-position:-75px 0px;}
- #cboxClose{right:0; background-position:-100px -25px;}
- #cboxClose:hover{background-position:-100px 0px;}
-
- .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
- .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
- .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
- .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}
\ No newline at end of file
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
+ #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
+
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
+ #cboxPrevious:hover{background-position:-75px -25px;}
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
+ #cboxNext:hover{background-position:-50px -25px;}
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(../images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
+ #cboxClose:hover{background-position:-25px -25px;}
+
+/*
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
+*/
+.cboxIE #cboxTopLeft,
+.cboxIE #cboxTopCenter,
+.cboxIE #cboxTopRight,
+.cboxIE #cboxBottomLeft,
+.cboxIE #cboxBottomCenter,
+.cboxIE #cboxBottomRight,
+.cboxIE #cboxMiddleLeft,
+.cboxIE #cboxMiddleRight {
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
+}
+
+/*
+ The following provides PNG transparency support for IE6
+ Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
+*/
+.cboxIE6 #cboxTopLeft{background:url(../images/ie6/borderTopLeft.png);}
+.cboxIE6 #cboxTopCenter{background:url(../images/ie6/borderTopCenter.png);}
+.cboxIE6 #cboxTopRight{background:url(../images/ie6/borderTopRight.png);}
+.cboxIE6 #cboxBottomLeft{background:url(../images/ie6/borderBottomLeft.png);}
+.cboxIE6 #cboxBottomCenter{background:url(../images/ie6/borderBottomCenter.png);}
+.cboxIE6 #cboxBottomRight{background:url(../images/ie6/borderBottomRight.png);}
+.cboxIE6 #cboxMiddleLeft{background:url(../images/ie6/borderMiddleLeft.png);}
+.cboxIE6 #cboxMiddleRight{background:url(../images/ie6/borderMiddleRight.png);}
+
+.cboxIE6 #cboxTopLeft,
+.cboxIE6 #cboxTopCenter,
+.cboxIE6 #cboxTopRight,
+.cboxIE6 #cboxBottomLeft,
+.cboxIE6 #cboxBottomCenter,
+.cboxIE6 #cboxBottomRight,
+.cboxIE6 #cboxMiddleLeft,
+.cboxIE6 #cboxMiddleRight {
+ _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
+}
Modified: XoopsModules/smallworld/trunk/smallworld/js/jquery.colorbox.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/jquery.colorbox.js 2013-03-31 23:13:08 UTC (rev 11330)
+++ XoopsModules/smallworld/trunk/smallworld/js/jquery.colorbox.js 2013-03-31 23:15:37 UTC (rev 11331)
@@ -1,125 +1,143 @@
-// ColorBox v1.3.19 - jQuery lightbox plugin
-// (c) 2011 Jack Moore - jacklmoore.com
-// License: http://www.opensource.org/licenses/mit-license.php
+/*!
+ jQuery ColorBox v1.4.6 - 2013-03-19
+ (c) 2013 Jack Moore - jacklmoore.com/colorbox
+ license: http://www.opensource.org/licenses/mit-license.php
+*/
(function ($, document, window) {
- var
- // Default settings object.
- // See http://jacklmoore.com/colorbox for details.
- defaults = {
- transition: "elastic",
- speed: 300,
- width: false,
- initialWidth: "600",
- innerWidth: false,
- maxWidth: false,
- height: false,
- initialHeight: "450",
- innerHeight: false,
- maxHeight: false,
- scalePhotos: true,
- scrolling: true,
- inline: false,
- html: false,
- iframe: false,
- fastIframe: true,
- photo: false,
- href: false,
- title: false,
- rel: false,
- opacity: 0.9,
- preloading: true,
- current: "image {current} of {total}",
- previous: "previous",
- next: "next",
- close: "close",
- open: false,
- returnFocus: true,
- reposition: true,
- loop: true,
- slideshow: false,
- slideshowAuto: true,
- slideshowSpeed: 2500,
- slideshowStart: "start slideshow",
- slideshowStop: "stop slideshow",
- onOpen: false,
- onLoad: false,
- onComplete: false,
- onCleanup: false,
- onClosed: false,
- overlayClose: true,
- escKey: true,
- arrowKey: true,
- top: false,
- bottom: false,
- left: false,
- right: false,
- fixed: false,
- data: undefined
- },
+ var
+ // Default settings object.
+ // See http://jacklmoore.com/colorbox for details.
+ defaults = {
+ transition: "elastic",
+ speed: 300,
+ width: false,
+ initialWidth: "600",
+ innerWidth: false,
+ maxWidth: false,
+ height: false,
+ initialHeight: "450",
+ innerHeight: false,
+ maxHeight: false,
+ scalePhotos: true,
+ scrolling: true,
+ inline: false,
+ html: false,
+ iframe: false,
+ fastIframe: true,
+ photo: false,
+ href: false,
+ title: false,
+ rel: false,
+ opacity: 0.9,
+ preloading: true,
+ className: false,
+
+ // alternate image paths for high-res displays
+ retinaImage: false,
+ retinaUrl: false,
+ retinaSuffix: '@2x.$1',
+
+ // internationalization
+ current: "image {current} of {total}",
+ previous: "previous",
+ next: "next",
+ close: "close",
+ xhrError: "This content failed to load.",
+ imgError: "This image failed to load.",
+
+ open: false,
+ returnFocus: true,
+ reposition: true,
+ loop: true,
+ slideshow: false,
+ slideshowAuto: true,
+ slideshowSpeed: 2500,
+ slideshowStart: "start slideshow",
+ slideshowStop: "stop slideshow",
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i,
+
+ onOpen: false,
+ onLoad: false,
+ onComplete: false,
+ onCleanup: false,
+ onClosed: false,
+ overlayClose: true,
+ escKey: true,
+ arrowKey: true,
+ top: false,
+ bottom: false,
+ left: false,
+ right: false,
+ fixed: false,
+ data: undefined
+ },
- // Abstracting the HTML and event identifiers for easy rebranding
- colorbox = 'colorbox',
- prefix = 'cbox',
- boxElement = prefix + 'Element',
-
- // Events
- event_open = prefix + '_open',
- event_load = prefix + '_load',
- event_complete = prefix + '_complete',
- event_cleanup = prefix + '_cleanup',
- event_closed = prefix + '_closed',
- event_purge = prefix + '_purge',
-
- // Special Handling for IE
- isIE = !$.support.opacity && !$.support.style, // IE7 & IE8
- isIE6 = isIE && !window.XMLHttpRequest, // IE6
- event_ie6 = prefix + '_IE6',
+ // Abstracting the HTML and event identifiers for easy rebranding
+ colorbox = 'colorbox',
+ prefix = 'cbox',
+ boxElement = prefix + 'Element',
+
+ // Events
+ event_open = prefix + '_open',
+ event_load = prefix + '_load',
+ event_complete = prefix + '_complete',
+ event_cleanup = prefix + '_cleanup',
+ event_closed = prefix + '_closed',
+ event_purge = prefix + '_purge',
+
+ // Special Handling for IE
+ isIE = !$.support.leadingWhitespace, // IE6 to IE8
+ isIE6 = isIE && !window.XMLHttpRequest, // IE6
+ event_ie6 = prefix + '_IE6',
- // Cached jQuery Object Variables
- $overlay,
- $box,
- $wrap,
- $content,
- $topBorder,
- $leftBorder,
- $rightBorder,
- $bottomBorder,
- $related,
- $window,
- $loaded,
- $loadingBay,
- $loadingOverlay,
- $title,
- $current,
- $slideshow,
- $next,
- $prev,
- $close,
- $groupControls,
-
- // Variables for cached values or use across multiple functions
- settings,
- interfaceHeight,
- interfaceWidth,
- loadedHeight,
- loadedWidth,
- element,
- index,
- photo,
- open,
- active,
- closing,
- loadingTimer,
- publicMethod,
- div = "div",
- init;
+ // Cached jQuery Object Variables
+ $overlay,
+ $box,
+ $wrap,
+ $content,
+ $topBorder,
+ $leftBorder,
+ $rightBorder,
+ $bottomBorder,
+ $related,
+ $window,
+ $loaded,
+ $loadingBay,
+ $loadingOverlay,
+ $title,
+ $current,
+ $slideshow,
+ $next,
+ $prev,
+ $close,
+ $groupControls,
+ $events = $('<a/>'),
+
+ // Variables for cached values or use across multiple functions
+ settings,
+ interfaceHeight,
+ interfaceWidth,
+ loadedHeight,
+ loadedWidth,
+ element,
+ index,
+ photo,
+ open,
+ active,
+ closing,
+ loadingTimer,
+ publicMethod,
+ div = "div",
+ className,
+ requests = 0,
+ init;
// ****************
// HELPER FUNCTIONS
// ****************
-
+
// Convience function for creating new jQuery objects
- function $tag(tag, id, css) {
+ function $tag(tag, id, css) {
var element = document.createElement(tag);
if (id) {
@@ -131,12 +149,18 @@
}
return $(element);
- }
+ }
+
+ // Get the window height using innerHeight when available to avoid an issue with iOS
+ // http://bugs.jquery.com/ticket/6724
+ function winheight() {
+ return window.innerHeight ? window.innerHeight : $(window).height();
+ }
// Determine the next and previous members in a group.
function getIndex(increment) {
- var
- max = $related.length,
+ var
+ max = $related.length,
newIndex = (index + increment) % max;
return (newIndex < 0) ? max + newIndex : newIndex;
@@ -144,38 +168,63 @@
// Convert '%' and 'px' values to integers
function setSize(size, dimension) {
- return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
}
// Checks an href to see if it is a photo.
- // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
- function isImage(url) {
- return settings.photo || /\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(url);
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
+ function isImage(settings, url) {
+ return settings.photo || settings.photoRegex.test(url);
}
-
+
+ function retinaUrl(settings, url) {
+ return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url;
+ }
+
+ function trapFocus(e) {
+ if ('contains' in $box[0] && !$box[0].contains(e.target)) {
+ e.stopPropagation();
+ $box.focus();
+ }
+ }
+
// Assigns function results to their respective properties
function makeSettings() {
- var i;
- settings = $.extend({}, $.data(element, colorbox));
-
+ var i,
+ data = $.data(element, colorbox);
+
+ if (data == null) {
+ settings = $.extend({}, defaults);
+ if (console && console.log) {
+ console.log('Error: cboxElement missing settings object');
+ }
+ } else {
+ settings = $.extend({}, data);
+ }
+
for (i in settings) {
if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
- settings[i] = settings[i].call(element);
+ settings[i] = settings[i].call(element);
}
}
-
- settings.rel = settings.rel || element.rel || 'nofollow';
+
+ settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
settings.href = settings.href || $(element).attr('href');
settings.title = settings.title || element.title;
-
- if (typeof settings.href === "string") {
- settings.href = $.trim(settings.href);
- }
+
+ if (typeof settings.href === "string") {
+ settings.href = $.trim(settings.href);
+ }
}
function trigger(event, callback) {
- $.event.trigger(event);
- if (callback) {
+ // for external use
+ $(document).trigger(event);
+
+ // for internal use
+ $events.trigger(event);
+
+ if ($.isFunction(callback)) {
callback.call(element);
}
}
@@ -186,37 +235,52 @@
timeOut,
className = prefix + "Slideshow_",
click = "click." + prefix,
+ clear,
+ set,
start,
- stop,
- clear;
+ stop;
if (settings.slideshow && $related[1]) {
+ clear = function () {
+ clearTimeout(timeOut);
+ };
+
+ set = function () {
+ if (settings.loop || $related[index + 1]) {
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
+ }
+ };
+
start = function () {
$slideshow
- .text(settings.slideshowStop)
+ .html(settings.slideshowStop)
.unbind(click)
- .bind(event_complete, function () {
- if (settings.loop || $related[index + 1]) {
- timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
- }
- })
- .bind(event_load, function () {
- clearTimeout(timeOut);
- })
- .one(click + ' ' + event_cleanup, stop);
+ .one(click, stop);
+
+ $events
+ .bind(event_complete, set)
+ .bind(event_load, clear)
+ .bind(event_cleanup, stop);
+
$box.removeClass(className + "off").addClass(className + "on");
- timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
};
stop = function () {
- clearTimeout(timeOut);
+ clear();
+
+ $events
+ .unbind(event_complete, set)
+ .unbind(event_load, clear)
+ .unbind(event_cleanup, stop);
+
$slideshow
- .text(settings.slideshowStart)
- .unbind([event_complete, event_load, event_cleanup, click].join(' '))
+ .html(settings.slideshowStart)
+ .unbind(click)
.one(click, function () {
publicMethod.next();
start();
});
+
$box.removeClass(className + "on").addClass(className + "off");
};
@@ -226,8 +290,8 @@
stop();
}
} else {
- $box.removeClass(className + "off " + className + "on");
- }
+ $box.removeClass(className + "off " + className + "on");
+ }
}
function launch(target) {
@@ -243,7 +307,13 @@
if (settings.rel !== 'nofollow') {
$related = $('.' + boxElement).filter(function () {
- var relRelated = $.data(this, colorbox).rel || this.rel;
+ var data = $.data(this, colorbox),
+ relRelated;
+
+ if (data) {
+ relRelated = $(this).data('rel') || data.rel || this.rel;
+ }
+
return (relRelated === settings.rel);
});
index = $related.index(element);
@@ -255,39 +325,77 @@
}
}
+ $overlay.css({
+ opacity: parseFloat(settings.opacity),
+ cursor: settings.overlayClose ? "pointer" : "auto",
+ visibility: 'visible'
+ }).show();
+
+
+ if (className) {
+ $box.add($overlay).removeClass(className);
+ }
+ if (settings.className) {
+ $box.add($overlay).addClass(settings.className);
+ }
+ className = settings.className;
+
+ $close.html(settings.close).show();
+
if (!open) {
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
- $box.show();
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
+ $box.css({visibility:'hidden', display:'block'});
- if (settings.returnFocus) {
- $(element).blur().one(event_closed, function () {
- $(this).focus();
- });
- }
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden').appendTo($content);
+
+ // Cache values needed for size calculations
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
+ loadedHeight = $loaded.outerHeight(true);
+ loadedWidth = $loaded.outerWidth(true);
- // +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
- $overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
// Opens inital empty ColorBox prior to content being loaded.
settings.w = setSize(settings.initialWidth, 'x');
settings.h = setSize(settings.initialHeight, 'y');
publicMethod.position();
-
+
if (isIE6) {
$window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
- $overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
+ $overlay.css({width: $window.width(), height: winheight(), top: $window.scrollTop(), left: $window.scrollLeft()});
}).trigger('resize.' + event_ie6);
}
+ slideshow();
+
trigger(event_open, settings.onOpen);
$groupControls.add($title).hide();
+
+ $box.focus();
- $close.html(settings.close).show();
+ // Confine focus to the modal
+ // Uses event capturing that is not supported in IE8-
+ if (document.addEventListener) {
+
+ document.addEventListener('focus', trapFocus, true);
+
+ $events.one(event_closed, function () {
+ document.removeEventListener('focus', trapFocus, true);
+ });
+ }
+
+ // Return focus on closing
+ if (settings.returnFocus) {
+ $events.one(event_closed, function () {
+ $(element).focus();
+ });
+ }
}
- publicMethod.load(true);
+ load();
}
}
@@ -298,18 +406,23 @@
init = false;
$window = $(window);
- $box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
+ $box = $tag(div).attr({
+ id: colorbox,
+ 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : '',
+ role: 'dialog',
+ tabindex: '-1'
+ }).hide();
$overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
+ $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic"));
$wrap = $tag(div, "Wrapper");
$content = $tag(div, "Content").append(
- $loaded = $tag(div, "LoadedContent", 'width:0; height:0; overflow:hidden'),
- $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic")),
$title = $tag(div, "Title"),
$current = $tag(div, "Current"),
- $next = $tag(div, "Next"),
- $prev = $tag(div, "Previous"),
- $slideshow = $tag(div, "Slideshow").bind(event_open, slideshow),
- $close = $tag(div, "Close")
+ $prev = $tag('button', "Previous"),
+ $next = $tag('button', "Next"),
+ $slideshow = $tag('button', "Slideshow"),
+ $loadingOverlay,
+ $close = $tag('button', "Close")
);
$wrap.append( // The 3x3 Grid that makes up ColorBox
@@ -340,19 +453,19 @@
// Add ColorBox's event bindings
function addBindings() {
+ function clickHandler(e) {
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
+ // See: http://jacklmoore.com/notes/click-events/
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
+ e.preventDefault();
+ launch(this);
+ }
+ }
+
if ($box) {
if (!init) {
init = true;
- // Cache values needed for size calculations
- interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
- interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
- loadedHeight = $loaded.outerHeight(true);
- loadedWidth = $loaded.outerWidth(true);
-
- // Setting padding to remove the need to do size conversions during the animation step.
- $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});
-
// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
$next.click(function () {
publicMethod.next();
@@ -376,7 +489,7 @@
e.preventDefault();
publicMethod.close();
}
- if (open && settings.arrowKey && $related[1]) {
+ if (open && settings.arrowKey && $related[1] && !e.altKey) {
if (key === 37) {
e.preventDefault();
$prev.click();
@@ -387,14 +500,15 @@
}
});
- $('.' + boxElement, document).on('click', function (e) {
- // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
- // See: http://jacklmoore.com/notes/click-events/
- if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
- e.preventDefault();
- launch(this);
- }
- });
+ if ($.isFunction($.fn.on)) {
+ // For jQuery 1.7+
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
+ } else {
+ // For jQuery 1.3.x -> 1.6.x
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
+ // This is not here for jQuery 1.9, it's here for legacy users.
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
+ }
}
return true;
}
@@ -419,18 +533,16 @@
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
var $this = this;
- options = options || {};
-
- appendHTML();
+ options = options || {};
+
+ appendHTML();
if (addBindings()) {
- if (!$this[0]) {
- if ($this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
- return $this;
- }
- // if no selector was given (ie. $.colorbox()), create a temporary element to work with
+ if ($.isFunction($this)) { // assume a call to $.colorbox
$this = $('<a/>');
- options.open = true; // assume an immediate open
+ options.open = true;
+ } else if (!$this[0]) { // colorbox being applied to empty collection
+ return $this;
}
if (callback) {
@@ -441,70 +553,79 @@
$.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
}).addClass(boxElement);
- if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
+ if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
launch($this[0]);
}
}
-
+
return $this;
};
publicMethod.position = function (speed, loadedCallback) {
- var
- top = 0,
- left = 0,
- offset = $box.offset(),
- scrollTop = $window.scrollTop(),
- scrollLeft = $window.scrollLeft();
-
- $window.unbind('resize.' + prefix);
+ var
+ css,
+ top = 0,
+ left = 0,
+ offset = $box.offset(),
+ scrollTop,
+ scrollLeft;
+
+ $window.unbind('resize.' + prefix);
- // remove the modal so that it doesn't influence the document width/height
- $box.css({top: -9e4, left: -9e4});
+ // remove the modal so that it doesn't influence the document width/height
+ $box.css({top: -9e4, left: -9e4});
- if (settings.fixed && !isIE6) {
+ scrollTop = $window.scrollTop();
+ scrollLeft = $window.scrollLeft();
+
+ if (settings.fixed && !isIE6) {
offset.top -= scrollTop;
offset.left -= scrollLeft;
- $box.css({position: 'fixed'});
- } else {
- top = scrollTop;
- left = scrollLeft;
- $box.css({position: 'absolute'});
- }
+ $box.css({position: 'fixed'});
+ } else {
+ top = scrollTop;
+ left = scrollLeft;
+ $box.css({position: 'absolute'});
+ }
// keeps the top and left positions within the browser's viewport.
- if (settings.right !== false) {
- left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
- } else if (settings.left !== false) {
- left += setSize(settings.left, 'x');
- } else {
- left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
- }
-
- if (settings.bottom !== false) {
- top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
- } else if (settings.top !== false) {
- top += setSize(settings.top, 'y');
- } else {
- top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
- }...
[truncated message content] |
|
From: <dj...@us...> - 2013-03-31 23:21:56
|
Revision: 11334
http://sourceforge.net/p/xoops/svn/11334
Author: djculex
Date: 2013-03-31 23:21:54 +0000 (Sun, 31 Mar 2013)
Log Message:
-----------
NEW : Adding settings forms
NEW : functions to grap all active users for settings
Change : Reverting get users to xoops_version
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/forms.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/forms.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/forms.php 2013-03-31 23:19:35 UTC (rev 11333)
+++ XoopsModules/smallworld/trunk/smallworld/class/forms.php 2013-03-31 23:21:54 UTC (rev 11334)
@@ -280,6 +280,43 @@
$text .= '</tr></table>';
return $text;
}
+
+ /**
+ * @create a radio select
+ * @param string $name
+ * @param array $options
+ * @param string $selected (optional)
+ * @return string
+ */
+ function usersettings ($userid)
+ {
+ global $xoopsUser, $xoopsDB;
+
+ $form = "<div style='display:none'><div class='smallworld_usersetings'>";
+ $form .= "<fieldset><legend>"._SMALLWORLD_SHOWIFPUBLICORPRIVATE."</legend>";
+ $form .= "<form id='perset'>";
+ if ($xoopsUser) {
+ $sql = "SELECT value FROM ".$xoopsDB->prefix('smallworld_settings')." WHERE userid = ".intval($userid);
+ $result = $xoopsDB->queryF($sql);
+ $i = $xoopsDB->getRowsNum($result);
+ $v = array();
+ if ($i >= 1) {
+ while ($row = $xoopsDB->fetchArray($result)) {
+ $v = unserialize(stripslashes($row['value']));
+ $pv = ($v['posts'] == '1') ? ' checked="checked"' : '';
+ $cv = ($v['comments'] == '1') ? ' checked="checked"' : '';
+ $form .= '<input type="checkbox" name="usersettings[]" id="posts" value="'.$v['posts'].'" '.$pv.'> '._SMALLWORLD_SHOWMYPOSTS.'<br/>';
+ $form .= '<input type="checkbox" name="usersettings[]" id="comments" value="'.$v['comments'].'" '.$cv.'> '._SMALLWORLD_SHOWMYCOMMENTS.'<br/>';
+ }
+ } else {
+ $form .= '<input type="checkbox" name="usersettings[]" id="posts" value="0"> '._SMALLWORLD_SHOWMYPOSTS.'<br/>';
+ $form .= '<input type="checkbox" name="usersettings[]" id="comments" value="0"> '._SMALLWORLD_SHOWMYCOMMENTS.'<br/>';
+ }
+ }
+ $form .= "<br><input type='submit' id='smallworld_privsave' value='"._SMALLWORLD_SUBMIT."' class='smallworld_finish'/>";
+ $form .= "</form></fieldset></div></div>";
+ return $form;
+ }
}
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-03-31 23:19:35 UTC (rev 11333)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-03-31 23:21:54 UTC (rev 11334)
@@ -978,25 +978,7 @@
}
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->queryF($sql);
- $data = array();
- while ($r = $db->fetchArray($result)) {
- $data[$r['userid']] = $r['username'];
- }
- return $data;
- }
-
+
/**
* Set javascript vars to theme using various values
* Return void
@@ -1087,5 +1069,7 @@
$xoTheme->addScript("http://maps.google.com/maps/api/js?sensor=false&language="._LANGCODE);
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete_now.js');
+
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
}
}
|
|
From: <dj...@us...> - 2013-03-31 23:56:13
|
Revision: 11335
http://sourceforge.net/p/xoops/svn/11335
Author: djculex
Date: 2013-03-31 23:56:08 +0000 (Sun, 31 Mar 2013)
Log Message:
-----------
NEW : adding smallworld_settings to sql file. If using old version accessing admin will automaticly add this if not existing
NEW : Adding streamlines code to class publicUplades to show only public posts
NEW : Adding user privacy settings to templates, index, user page etc etc
UPDATE : upgrading file uploader
UPDATE : Updating jquery.Oembed
UPDATE : jQuery.countdown to v1.5.10
Bugfix : Fileuploader onClick reaction
Bugfix : Adjusting various css selectors
Bugfix : Changing || to && in javascript check for existing image
Bugfix : Removing maxsize from update textarea. Maximum is now undefined so basically you could post the ikea catelogue there
Bugfix : Sharepage will only be usable on public posts
Bugfix : Including Sizzle.js to jquery 1.9.1 to refactor depreseated functionality
NEW LANGUAGE FILES
main.php
---------
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.");
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/admin/index.php
XoopsModules/smallworld/trunk/smallworld/admin/main.php
XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
XoopsModules/smallworld/trunk/smallworld/class/user.php
XoopsModules/smallworld/trunk/smallworld/class/wall.php
XoopsModules/smallworld/trunk/smallworld/css/smallworld.css
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js
XoopsModules/smallworld/trunk/smallworld/js/jquery.countdown.js
XoopsModules/smallworld/trunk/smallworld/js/jquery.history.js
XoopsModules/smallworld/trunk/smallworld/js/jquery.min.js
XoopsModules/smallworld/trunk/smallworld/js/main.js
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/js/wall.js
XoopsModules/smallworld/trunk/smallworld/language/danish/modinfo.php
XoopsModules/smallworld/trunk/smallworld/language/english/main.php
XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php
XoopsModules/smallworld/trunk/smallworld/language/french/modinfo.php
XoopsModules/smallworld/trunk/smallworld/language/french_iso/modinfo.php
XoopsModules/smallworld/trunk/smallworld/language/russian/modinfo.php
XoopsModules/smallworld/trunk/smallworld/loadmore.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/smallworldshare.php
XoopsModules/smallworld/trunk/smallworld/sql/mysql.sql
XoopsModules/smallworld/trunk/smallworld/templates/getStat.html
XoopsModules/smallworld/trunk/smallworld/templates/getlastcom.html
XoopsModules/smallworld/trunk/smallworld/templates/getlastmsg.html
XoopsModules/smallworld/trunk/smallworld/templates/getmore.html
XoopsModules/smallworld/trunk/smallworld/templates/getmorepublic.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_index.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_permalink.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_share.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_edittemplate.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_regtemplate.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
XoopsModules/smallworld/trunk/smallworld/userprofile.php
XoopsModules/smallworld/trunk/smallworld/xoops_version.php
Added Paths:
-----------
XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php
XoopsModules/smallworld/trunk/smallworld/css/uploader/index.html
XoopsModules/smallworld/trunk/smallworld/js/cors/index.html
XoopsModules/smallworld/trunk/smallworld/js/uploader/index.html
XoopsModules/smallworld/trunk/smallworld/js/vendor/index.html
XoopsModules/smallworld/trunk/smallworld/settings.php
XoopsModules/smallworld/trunk/smallworld/templates/settings.html
Modified: XoopsModules/smallworld/trunk/smallworld/admin/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/admin/index.php 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -197,5 +197,4 @@
echo $indexAdmin->addNavigation('index.php');
echo $indexAdmin->renderIndex();
-include "admin_footer.php";
-?>
\ No newline at end of file
+include "admin_footer.php";
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/admin/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/admin/main.php 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/admin/main.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -184,4 +184,3 @@
$xoTheme->addScript(XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js');
xoops_cp_footer();
-?>
Added: XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php (rev 0)
+++ XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -0,0 +1,41 @@
+<?php
+// Upgrade functions used when adding or altering tables etc between versions
+/**
+ * Function to do the creatind
+ *
+ */
+function smallworld_doUpgrade () {
+ global $xoopsDB, $xoopsUser;
+ varcharToBlog ();
+ if (smallworld_DoTableExists($xoopsDB->prefix('smallworld_settings'))) {
+ // Table exists
+ Return false;
+ } else {
+ // Table does not exist -> create
+
+ $sql = "CREATE TABLE IF NOT EXISTS ".$xoopsDB->prefix('smallworld_settings')." (";
+ $sql .= "`id` int(11) NOT NULL AUTO_INCREMENT,";
+ $sql .= "`userid` int(11) NOT NULL,";
+ $sql .= "`value` text NOT NULL,";
+ $sql .= "PRIMARY KEY (`id`)";
+ $sql .= ") ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";
+ $result = $xoopsDB->queryF($sql);
+ }
+}
+
+function smallworld_DoTableExists($tablename) {
+ global $xoopsDB;
+ $result = $xoopsDB->queryF("SHOW TABLES LIKE '$tablename'");
+ return ($xoopsDB->getRowsNum($result) > 0);
+}
+
+/**
+ * Alter table messages from varchar(200) to text()
+ * @return void
+ */
+function varcharToBlog () {
+ global $xoopsDB;
+ $sql ="ALTER TABLE ".$xoopsDB->prefix('smallworld_messages')." CHANGE message message TEXT";
+ $result = $xoopsDB->queryF($sql);
+}
+?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -39,7 +39,29 @@
}
}
+
/**
+ * Get arry of users being inspected
+ *
+ *
+ */
+
+ function inspected () {
+ global $xoopsDB;
+ $sql = "SELECT userid FROM ".$xoopsDB->prefix('smallworld_admin'). " WHERE (inspect_start+inspect_stop) > ".time()."";
+ $result = $xoopsDB->queryF($sql);
+ $data = array();
+ while ($row = $xoopsDB->fetchArray($result)) {
+ $data[]=$row;
+ }
+ if (!empty($data)) {
+ $sub = implode(",",Smallworld_array_flatten(array_unique($data),0));
+ } else {
+ $sub = 0;
+ }
+ return $sub;
+ }
+ /**
* @Get array of updates
* @param int $last
* @param int $uid
@@ -47,49 +69,29 @@
* @return array
*/
public function Updates($last,$moderators) {
- global $xoopsUser, $xoopsDB, $moduleConfig;
+ global $xoopsUser, $xoopsDB, $moduleConfig, $xoopsLogger;
$hm = smallworld_GetModuleOption('msgtoshow');
$set = smallworld_checkPrivateOrPublic ();
$mods = implode(",",Smallworld_array_flatten(array_unique($moderators),0));
+ $inspected = $this->inspected();
+
$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.priv = '0'";
+ . " 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'";
} elseif ($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.priv = '0' and M.msg_id < '".$last."'";
+ . " U WHERE M.uid_fk=U.userid and M.uid_fk in (".$mods.") and M.uid_fk NOT IN (".$inspected.") and M.priv = '0' and M.msg_id < '".$last."'";
} elseif ($last == 'a') {
$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.priv = '0'";
+ . " U WHERE M.uid_fk=U.userid and M.uid_fk in (".$mods.") and M.uid_fk NOT IN (".$inspected.") and M.priv = '0'";
}
-
- if (is_array($moderators)){
- foreach ($moderators as $k => $v) {
- if ($last>0) {
- $query .= " OR M.uid_fk=U.userid and M.uid_fk= '".$v."' and M.priv= '0' and M.msg_id < '".$last."'";
- } elseif ($last == 0) {
- $query .= " OR M.uid_fk=U.userid and M.uid_fk= '".$v."' and M.priv= '0' ";
- } elseif ($last == 'a') {
- $query .= " OR M.uid_fk=U.userid and M.uid_fk= '".$v."' and M.priv= '0' ";
- }
- $i++;
- }
- }
- if (!is_array($moderators)) {
- if ($last > 0) {
- $query .= " OR M.uid_fk=U.userid and M.uid_fk= '".$moderators."' and M.priv= '0' and M.msg_id < '".$last."'";
- } elseif ($last == 0) {
- $query .= " OR M.uid_fk=U.userid and M.uid_fk= '".$moderators."' and M.priv= '0' ";
- } elseif ($last == 'a') {
- $query .= " OR M.uid_fk=U.userid and M.uid_fk= '".$moderators."' and M.priv= '0' ";
- }
- }
-
+
if ($last>0) {
$query .= " order by created DESC LIMIT ".$hm;
} elseif ($last == 'a') {
@@ -121,9 +123,10 @@
public function Comments($msg_id)
{
global $xoopsUser, $xoopsDB;
+ $inspected = $this-> inspected();
$query = "SELECT C.msg_id_fk, C.com_id, C.uid_fk, C.comment, C.created, U.username FROM "
. $xoopsDB->prefix('smallworld_comments')." C, ".$xoopsDB->prefix('smallworld_user')
- . " U WHERE C.uid_fk=U.userid and C.msg_id_fk='".$msg_id."' order by C.com_id asc ";
+ . " U WHERE C.uid_fk=U.userid and C.msg_id_fk='".$msg_id."' and C.uid_fk NOT IN (".$inspected.") order by C.com_id asc ";
$result = $xoopsDB->queryF($query);
$i = $xoopsDB->getRowsNum($result);
while ($row = $xoopsDB->fetchArray($result)) {
Modified: XoopsModules/smallworld/trunk/smallworld/class/user.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -188,9 +188,26 @@
function spousexist($name) {
global $xoopsUser, $xoopsDB;
$sql = "SELECT * FROM ".$xoopsDB->prefix('smallworld_user')." WHERE username = '".$name."'";
- $result = $xoopsDB->queryf($sql);
+ $result = $xoopsDB->queryF($sql);
$i = $xoopsDB->getRowsNum($result);
return $i;
}
+
+ /**
+ * Get all users
+ * @return array
+ */
+
+ function allUsers () {
+ global $xoopsDB;
+ $sql = "SELECT userid FROM ".$xoopsDB->prefix('smallworld_user')." ORDER BY userid";
+ $result = $xoopsDB->queryF($sql);
+ while ($r = $xoopsDB->fetchArray($result)) {
+ $data[]=$r;
+ }
+ if (!empty($data)) {
+ return Smallworld_array_flatten($data,0);
+ }
+ }
}
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/class/wall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -43,9 +43,8 @@
global $xoopsUser, $xoopsDB, $moduleConfig;
$hm = smallworld_GetModuleOption('msgtoshow');
$set = smallworld_checkPrivateOrPublic ();
- $pub = smallworld_GetModuleOption('smallworldshowPoPubPage', $repmodule='smallworld');
- $nfollow = array_unique(array_merge($pub, $followers));
- $followers = Smallworld_array_flatten($nfollow,0);
+ $followers = (is_array($followers)) ? $followers : array($followers);
+ $followers = array_unique(Smallworld_array_flatten($followers,0));
$i=0;
if ($last == 0) {
@@ -378,7 +377,9 @@
*/
public function UpdatesSharelink($updid,$ownerID)
{
- global $xoopsUser, $xoopsDB, $moduleConfig;
+ global $xoopsUser, $xoopsDB, $moduleConfig, $xoopsLogger;
+ $xoopsLogger->activated = false;
+ //error_reporting(E_ALL);
$query = "SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM "
. $xoopsDB->prefix('smallworld_messages')." M, ".$xoopsDB->prefix('smallworld_user')
. " U WHERE M.uid_fk=U.userid and M.uid_fk='".$ownerID."' and M.priv = 0";
Modified: XoopsModules/smallworld/trunk/smallworld/css/smallworld.css
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/css/smallworld.css 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/css/smallworld.css 2013-03-31 23:56:08 UTC (rev 11335)
@@ -786,7 +786,7 @@
min-height:50px;
word-wrap:break-word;
overflow:hidden;
- padding:5px;
+ padding:0 5px 0;
display:block;
font-size:11px;
width:75%;
@@ -1070,10 +1070,10 @@
font-family: Verdana;
font-size: 12px;
font-weight: bold;
- left: 20%;
margin: 25px 0 5px;
padding: 25px 10px;
position: relative;
+ text-align: center;
}
.hasCountdown {
@@ -1244,9 +1244,10 @@
background-color: transparent;
border: none;
}
-/* -------------- count down -------------- */
+/* -------------- countdown -------------- */
.hasCountdown {
-width: 350px;
+width: 250px;
+margin: 15px 15% 0;
}
.countdown_rtl {
direction: rtl;
Added: XoopsModules/smallworld/trunk/smallworld/css/uploader/index.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/css/uploader/index.html (rev 0)
+++ XoopsModules/smallworld/trunk/smallworld/css/uploader/index.html 2013-03-31 23:56:08 UTC (rev 11335)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2013-03-31 23:56:08 UTC (rev 11335)
@@ -23,23 +23,24 @@
include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php");
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/publicWall.php");
-global $xoopsUser, $xoTheme,$xoopsConfig,$xoopsLogger;
- $xoopsLogger->activated = true;
-/* error_reporting(E_ALL); */
+global $xoopsUser, $xoTheme,$xoopsConfig,$xoopsLogger, $xoopsModule;
$set = smallworld_checkPrivateOrPublic ();
if ($xoopsUser) {
$xoopsOption['template_main'] = 'smallworld_index.html';
-} elseif (!$xoopsUser || $set['access'] == 1) {
+} elseif (!$xoopsUser && $set['access'] == 1) {
$xoopsOption['template_main'] = 'smallworld_publicindex.html';
} else {
redirect_header(XOOPS_URL . "/user.php", 5, _NOPERM);
}
include_once(XOOPS_ROOT_PATH."/header.php");
- if ($set['access'] == 1) {
+ $xoopsLogger->activated = false;
+ /* error_reporting(E_ALL); */
+ if ($xoopsUser || $set['access'] == 1) {
$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
$user = new XoopsUser($id);
-
+ $dBase = new SmallWorldDB;
+
// Check if inspected userid -> redirect to userprofile and show admin countdown
$inspect = Smallworld_isInspected ($id);
if ($inspect['inspect'] == 'yes') {
@@ -54,7 +55,13 @@
} else {
$xoopsTpl->assign('isadminuser', 'NO');
}
-
+
+ // Create form for private settings
+ $form = new SmallWorldForm;
+ $usersettings = $form->usersettings ($id, $selected=null);
+ $xoopsTpl->assign('usersetting', $usersettings);
+
+
$username = $user->getVar('uname');
$check = new SmallWorldUser;
$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
@@ -69,9 +76,9 @@
}
// Things to do with wall
- $Wall = ($xoopsUser) ? new Wall_Updates() : new Public_Wall_Updates;
+ $Wall = ($profile > 0) ? new Wall_Updates() : new Public_Wall_Updates;
if (!$xoopsUser && $set['access'] == 1) {
- $pub = smallworld_GetModuleOption('smallworldshowPoPubPage', $repmodule='smallworld');
+ $pub = $check->allUsers();
$updatesarray = $Wall->updates(0, $pub);
} else {
// Follow array here
@@ -90,9 +97,28 @@
//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"), '',Smallworld_stripWordsKeepUrl($data['message']));
- $wm['message'] = nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']));
+
+ $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'] = str_replace(array('<','>'),array('<','>'), $wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -112,13 +138,32 @@
$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']);
- $xoopsTpl->append('walldata', $wm);
+ $xoopsTpl->append('walldata', $wm);
- if (!empty($wm['commentsarray'])){
+ if (!empty($wm['commentsarray'])){
foreach($wm['commentsarray'] as $cdata) {
- $wc['msg_id_fk'] = $cdata['msg_id_fk'];
+
+ $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'] = nl2br(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['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
$wc['uid'] = $cdata['uid_fk'];
@@ -132,12 +177,12 @@
$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);
}
}
+
}
}
-
if ($profile > 0) {
$xoopsTpl->assign('menu_home',$menu_home);
$xoopsTpl->assign('menu_profile',$menu_profile);
@@ -162,11 +207,13 @@
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
$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');
- } elseif ($set['access'] == 0) {
- redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
+ } elseif ($profile <= 0 && $set['access'] == 0) {
+ redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
+ } else {
+ redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
}
-include(XOOPS_ROOT_PATH."/footer.php");
-?>
\ No newline at end of file
+include(XOOPS_ROOT_PATH."/footer.php");
\ No newline at end of file
Added: XoopsModules/smallworld/trunk/smallworld/js/cors/index.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/cors/index.html (rev 0)
+++ XoopsModules/smallworld/trunk/smallworld/js/cors/index.html 2013-03-31 23:56:08 UTC (rev 11335)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js 2013-03-31 23:21:54 UTC (rev 11334)
+++ XoopsModules/smallworld/trunk/smallworld/js/jquery.bookmark.js 2013-03-31 23:56:08 UTC (rev 11335)
@@ -7,10 +7,10 @@
/* Allow your page to be shared with various bookmarking sites.
Attach the functionality with options like:
- xoops_smallworld('div selector').bookmark({sites: ['delicious', 'digg']});
+ $('div selector').bookmark({sites: ['delicious', 'digg']});
*/
-(function(xoops_smallworld) { // Hide scope, no xoops_smallworld conflict
+(function($) { // Hide scope, no $ conflict
var PROP_NAME = 'bookmark';
@@ -77,14 +77,20 @@
url: 'http://cgi.fark.com/cgi/fark/submit.pl?new_url={u}&new_comment={t}'},
'google': {display: 'Google', icon: 12, lang: 'en', category: 'bookmark',
url: 'http://www.google.com/bookmarks/mark?op=edit&bkmk={u}&title={t}'},
+ 'googlereader': {display: 'Google Reader', icon: 13, lang: 'en', category: 'tools',
+ url: 'http://www.google.com/reader/link?url={u}&title={t}&srcTitle={u}'},
'hotmail': {display: 'Hotmail', icon: 14, lang: 'en', category: 'mail',
url: 'http://www.hotmail.msn.com/secure/start?action=compose&to=&body={u}&subject={t}'},
'linkedin': {display: 'LinkedIn', icon: 15, lang: 'en', category: 'social',
url: 'http://www.linkedin.com/shareArticle?mini=true&url={u}&title={t}&ro=false&summary={d}&source='},
+ 'mixx': {display: 'Mixx', icon: 16, lang: 'en', category: 'news',
+ url: 'http://www.mixx.com/submit/story?page_url={u}&title={t}'},
'multiply': {display: 'Multiply', icon: 17, lang: 'en', category: 'social',
url: 'http://multiply.com/gus/journal/compose/addthis?body=&url={u}&subject={t}'},
'myspace': {display: 'MySpace', icon: 18, lang: 'en', category: 'social',
url: 'http://www.myspace.com/Modules/PostTo/Pages/?u={u}&t={t}'},
+ 'netvibes': {display: 'Netvibes', icon: 19, lang: 'en', category: 'news',
+ url: 'http://www.netvibes.com/share?url={u}&title={t}'},
'newsvine': {display: 'Newsvine', icon: 20, lang: 'en', category: 'news',
url: 'http://www.newsvine.com/_wine/save?u={u}&h={t}'},
'reddit': {display: 'reddit', icon: 21, lang: 'en', category: 'news',
@@ -95,8 +101,12 @@
url: 'http://www.technorati.com/faves?add={u}'},
'tipd': {display: 'Tip\'d', icon: 24, lang: 'en', category: 'news',
url: 'http://tipd.com/submit.php?url={u}'},
+ 'tumblr': {display: 'tumblr', icon: 25, lang: 'en', category: 'blog',
+ url: 'http://www.tumblr.com/share?v=3&u={u}&t={t}'},
'twitter':{display: 'twitter', icon: 26, lang: 'en', category: 'blog',
url: 'http://twitter.com/home?status={t}%20{u}'},
+ 'windows': {display: 'Windows Live', icon: 27, lang: 'en', category: 'bookmark',
+ url: 'https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url={u}&title={t}'},
'wishlist': {display: 'Amazon WishList', icon: 28, lang: 'en', category: 'shopping',
url: 'http://www.amazon.com/wishlist/add?u={u}&t={t}'},
'yahoo': {display: 'Yahoo Bookmarks', icon: 29, lang: 'en', category: 'bookmark',
@@ -110,7 +120,7 @@
}
}
-xoops_smallworld.extend(Bookmark.prototype, {
+$.extend(Bookmark.prototype, {
/* Class name added to elements to indicate already configured with bookmarking. */
markerClassName: 'hasBookmark',
@@ -153,7 +163,7 @@
@param target (element) the bookmark container
@param settings (object) the settings for this container */
_attachBookmark: function(target, settings) {
- target = xoops_smallworld(target);
+ target = $(target);
if (target.hasClass(this.markerClassName)) {
return;
}
@@ -167,7 +177,7 @@
(string) a single setting name
@param value (any) the single setting's value */
_changeBookmark: function(target, settings, value) {
- target = xoops_smallworld(target);
+ target = $(target);
if (!target.hasClass(this.markerClassName)) {
return;
}
@@ -183,30 +193,30 @@
@param target (element) the bookmark container
@param settings (object) the settings for this container */
_updateBookmark: function(target, settings) {
- var oldSettings = xoops_smallworld.data(target[0], PROP_NAME) || xoops_smallworld.extend({}, this._defaults);
+ var oldSettings = $.data(target[0], PROP_NAME) || $.extend({}, this._defaults);
settings = extendRemove(oldSettings, settings || {});
- xoops_smallworld.data(target[0], PROP_NAME, settings);
+ $.data(target[0], PROP_NAME, settings);
var sites = settings.sites;
if (sites.length == 0) { // All sites
- xoops_smallworld.each(xoops_smallworld.bookmark._sites, function(id) {
+ $.each($.bookmark._sites, function(id) {
sites.push(id);
});
sites.sort();
}
else {
- xoops_smallworld.each(sites, function(index, value) {
+ $.each(sites, function(index, value) {
var lang = value.match(/lang:(.*)/); // Select by language
if (lang) {
- xoops_smallworld.each(xoops_smallworld.bookmark._sites, function(id, site) {
- if (site.lang == lang[1] && xoops_smallworld.inArray(id, sites) == -1) {
+ $.each($.bookmark._sites, function(id, site) {
+ if (site.lang == lang[1] && $.inArray(id, sites) == -1) {
...
[truncated message content] |
|
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...
[truncated message content] |
|
From: <dj...@us...> - 2013-04-17 15:42:27
|
Revision: 11400
http://sourceforge.net/p/xoops/svn/11400
Author: djculex
Date: 2013-04-17 15:42:17 +0000 (Wed, 17 Apr 2013)
Log Message:
-----------
changelog.txt, lang_diff.txt, xoops_version.php etc
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt
XoopsModules/smallworld/trunk/smallworld/xoops_version.php
Added Paths:
-----------
XoopsModules/smallworld/trunk/smallworld/images/highrise.png
XoopsModules/smallworld/trunk/smallworld/images/link.png
Modified: XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-04-17 15:22:31 UTC (rev 11399)
+++ XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-04-17 15:42:17 UTC (rev 11400)
@@ -1,4 +1,18 @@
------------------------------
+Changelog v.1.15 RC 12
+------------------------------
+12. marts 2013 Revision: 11328 - 11396
+
+NEW : Usersettings displaying post / comments
+NEW : Startpage displaying admin descided posts (blog ?)
+NEW : Adding permalink url to posts and adjusting embed html
+Bugfix : No bigcaps convert username -> false check by username
+Bugfix : Fixing onClick for bookmarks 1.40
+Bugfix: Adjusting css and adding additional for styling XoopsCode
+Change : Reinventing admin desc. users to show in startpage
+Change : Various language defines. All added in default english (see your language)
+
+------------------------------
Changelog v.1.15 RC 11
------------------------------
12. marts 2013 Revision: 10227 - 10226
Modified: XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt 2013-04-17 15:22:31 UTC (rev 11399)
+++ XoopsModules/smallworld/trunk/smallworld/docs/lang_diff.txt 2013-04-17 15:42:17 UTC (rev 11400)
@@ -9,6 +9,17 @@
* Modified
===============================
+2013/04/17: Version 1.15 RC12
+===============================
+htdocs/modules/smallworld/english/main.php
++ 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.");
++ define ("_SMALLWORLD_STARTPAGE","Start page");
+===============================
2013/03/12: Version 1.15 RC11
===============================
htdocs/modules/smallworld/english/js/variables.js
Added: XoopsModules/smallworld/trunk/smallworld/images/highrise.png
===================================================================
(Binary files differ)
Index: XoopsModules/smallworld/trunk/smallworld/images/highrise.png
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/images/highrise.png 2013-04-17 15:22:31 UTC (rev 11399)
+++ XoopsModules/smallworld/trunk/smallworld/images/highrise.png 2013-04-17 15:42:17 UTC (rev 11400)
Property changes on: XoopsModules/smallworld/trunk/smallworld/images/highrise.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/smallworld/trunk/smallworld/images/link.png
===================================================================
(Binary files differ)
Index: XoopsModules/smallworld/trunk/smallworld/images/link.png
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/images/link.png 2013-04-17 15:22:31 UTC (rev 11399)
+++ XoopsModules/smallworld/trunk/smallworld/images/link.png 2013-04-17 15:42:17 UTC (rev 11400)
Property changes on: XoopsModules/smallworld/trunk/smallworld/images/link.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/smallworld/trunk/smallworld/xoops_version.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2013-04-17 15:22:31 UTC (rev 11399)
+++ XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2013-04-17 15:42:17 UTC (rev 11400)
@@ -34,7 +34,7 @@
$modversion['release_date'] = '2011/12/24';
$modversion['help'] = 'page=help';
$modversion['min_php'] = '5.2';
-$modversion['min_xoops'] = '2.56';
+$modversion['min_xoops'] = '2.55';
$modversion['min_admin'] = '1.1';
$modversion['min_db'] = array('mysql' => '5.0.5', 'mysqli' => '5.0.5');
$modversion['system_menu'] = 1;
|
|
From: <dj...@us...> - 2013-04-19 21:06:20
|
Revision: 11407
http://sourceforge.net/p/xoops/svn/11407
Author: djculex
Date: 2013-04-19 21:06:16 +0000 (Fri, 19 Apr 2013)
Log Message:
-----------
Bugfix : Parsing links double
Bugfix : Removing nl2br (module.sanitizer already does this)
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/include/functions.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/userprofile.php
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -71,7 +71,7 @@
$wc['msg_id_fk'] = $data['msg_id_fk'];
$wc['com_id'] = $data['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['comment']),$data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1) ? 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/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -54,13 +54,8 @@
// Sanitize string
function Smallworld_cleanup_string($text)
{
- // $text = htmlspecialchars($text, ENT_QUOTES);
- $myts = MyTextSanitizer::getInstance();
- $text = $myts->displayTarea($text, 1, 1, 1, 1);
- $text = str_replace("\n\r", "\n", $text);
- $text = str_replace("\r\n", "\n", $text);
- $text = str_replace("\n", "<br />", $text);
- $text = str_replace("\"", "'", $text);
+ $myts = MyTextSanitizer::getInstance();
+ $text = $myts->displayTarea($text, $html = 1, $smiley = 1, $xcode = 1, $image = 1, $br = 1);
return $text;
}
@@ -270,14 +265,6 @@
} else {
$text = html_entity_decode($text,ENT_QUOTES,"UTF-8");
$text = " " . $text;
- $text = preg_replace('/(((f|ht){1}tp:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
- '<a href="\\1">\\1</a>', $text);
- $text = preg_replace('/(((f|ht){1}tps:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
- '<a href="\\1">\\1</a>', $text);
- $text = preg_replace('/([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
- '\\1<a href="\\2">\\2</a>', $text);
- $text = preg_replace('/([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})/i',
- '<a href="mailto:\\1">\\1</a>', $text);
$text = str_replace('UPLIMAGE', '', $text);
}
return $text;
Modified: XoopsModules/smallworld/trunk/smallworld/loadmore.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -108,7 +108,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'] = ($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'];
@@ -157,7 +157,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'] = ($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'];
Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -78,7 +78,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'] = ($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'];
@@ -127,7 +127,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'] = ($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'];
Modified: XoopsModules/smallworld/trunk/smallworld/permalink.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -101,7 +101,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'] = ($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'];
@@ -143,7 +143,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'] = ($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'];
Modified: XoopsModules/smallworld/trunk/smallworld/publicindex.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -102,7 +102,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'] = ($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'];
@@ -149,7 +149,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'] = ($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'];
Modified: XoopsModules/smallworld/trunk/smallworld/userprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -113,7 +113,7 @@
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['message'] = 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'];
@@ -142,7 +142,7 @@
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['comment'] = 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'];
|
|
From: <dj...@us...> - 2013-05-22 13:01:53
|
Revision: 11573
http://sourceforge.net/p/xoops/svn/11573
Author: djculex
Date: 2013-05-22 13:01:51 +0000 (Wed, 22 May 2013)
Log Message:
-----------
Change: Sql messages from varchar to text
Bugfix: Fixing appearance of admin
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/admin/about.php
XoopsModules/smallworld/trunk/smallworld/sql/mysql.sql
Modified: XoopsModules/smallworld/trunk/smallworld/admin/about.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/admin/about.php 2013-05-22 07:38:03 UTC (rev 11572)
+++ XoopsModules/smallworld/trunk/smallworld/admin/about.php 2013-05-22 13:01:51 UTC (rev 11573)
@@ -23,16 +23,17 @@
xoops_cp_header();
global $xoTheme;
+
+
+$aboutAdmin = new ModuleAdmin();
+
+echo $aboutAdmin->addNavigation('about.php');
+echo $aboutAdmin->renderAbout('', false);
+
$xoTheme->addStylesheet(
XOOPS_URL . '/modules/smallworld/css/SmallworldAdmin.css'
);
$xoTheme->addScript(
XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js'
);
-
-$aboutAdmin = new ModuleAdmin();
-
-echo $aboutAdmin->addNavigation('about.php');
-echo $aboutAdmin->renderAbout('', false);
-
include 'admin_footer.php';
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/sql/mysql.sql
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/sql/mysql.sql 2013-05-22 07:38:03 UTC (rev 11572)
+++ XoopsModules/smallworld/trunk/smallworld/sql/mysql.sql 2013-05-22 13:01:51 UTC (rev 11573)
@@ -24,7 +24,7 @@
PRIMARY KEY (`com_id`),
KEY `msg_id_fk` (`msg_id_fk`),
KEY `uid_fk` (`uid_fk`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE `smallworld_followers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -55,14 +55,14 @@
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE `smallworld_messages` (
- `msg_id` int(11) NOT NULL auto_increment,
- `message` varchar(200) default NULL,
- `uid_fk` int(11) default NULL,
- `priv` int(1) NOT NULL default '1',
- `created` int(11) default '1269249260',
- PRIMARY KEY (`msg_id`),
+ `msg_id` int(11) NOT NULL AUTO_INCREMENT,
+ `message` text,
+ `uid_fk` int(11) DEFAULT NULL,
+ `priv` int(1) NOT NULL DEFAULT '1',
+ `created` int(11) DEFAULT '1269249260',
+ PRIMARY KEY (`msg_id`),
KEY `uid_fk` (`uid_fk`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=225 ;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE `smallworld_user` (
`id` int(5) unsigned NOT NULL auto_increment,
@@ -152,4 +152,4 @@
`userid` int(11) NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
|
From: <dj...@us...> - 2013-05-22 13:04:59
|
Revision: 11574
http://sourceforge.net/p/xoops/svn/11574
Author: djculex
Date: 2013-05-22 13:04:57 +0000 (Wed, 22 May 2013)
Log Message:
-----------
NEW: Adding tagging
Bugfix: Fixing selector for like/dislike
Bugfix: Check permissions return array
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/forms.php
XoopsModules/smallworld/trunk/smallworld/class/mail.php
XoopsModules/smallworld/trunk/smallworld/class/profile.php
XoopsModules/smallworld/trunk/smallworld/class/user.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/forms.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/forms.php 2013-05-22 13:01:51 UTC (rev 11573)
+++ XoopsModules/smallworld/trunk/smallworld/class/forms.php 2013-05-22 13:04:57 UTC (rev 11574)
@@ -305,12 +305,15 @@
$v = unserialize(stripslashes($row['value']));
$pv = ($v['posts'] == '1') ? ' checked="checked"' : '';
$cv = ($v['comments'] == '1') ? ' checked="checked"' : '';
+ $nv = ($v['notify'] == '1') ? ' checked="checked"' : '';
$form .= '<input type="checkbox" name="usersettings[]" id="posts" value="'.$v['posts'].'" '.$pv.'> '._SMALLWORLD_SHOWMYPOSTS.'<br/>';
$form .= '<input type="checkbox" name="usersettings[]" id="comments" value="'.$v['comments'].'" '.$cv.'> '._SMALLWORLD_SHOWMYCOMMENTS.'<br/>';
+ $form .= '<input type="checkbox" name="usersettings[]" id="notify" value="'.$v['notify'].'" '.$nv.'> '._SMALLWORLD_NOTIFYME.'<br/>';
}
} else {
$form .= '<input type="checkbox" name="usersettings[]" id="posts" value="0"> '._SMALLWORLD_SHOWMYPOSTS.'<br/>';
$form .= '<input type="checkbox" name="usersettings[]" id="comments" value="0"> '._SMALLWORLD_SHOWMYCOMMENTS.'<br/>';
+ $form .= '<input type="checkbox" name="usersettings[]" id="notify" value="0"> '._SMALLWORLD_NOTIFYME.'<br/>';
}
}
$form .= "<br><input type='submit' id='smallworld_privsave' value='"._SMALLWORLD_SUBMIT."' class='smallworld_finish'/>";
Modified: XoopsModules/smallworld/trunk/smallworld/class/mail.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/mail.php 2013-05-22 13:01:51 UTC (rev 11573)
+++ XoopsModules/smallworld/trunk/smallworld/class/mail.php 2013-05-22 13:04:57 UTC (rev 11574)
@@ -157,6 +157,20 @@
$toMail = $ToUser->getVar('email');
}
+ elseif ($event == 'tag') {
+ $subject = _SMALLWORLD_MAIL_FRIENDTAGGEDYOU.$xoopsConfig['sitename'];
+ $tpl = new XoopsTpl();
+ $tpl->assign('toUser',$RecieveName);
+ $tpl->assign('fromUser',$SendName);
+ $tpl->assign('date',$date);
+ $tpl->assign('link',$link);
+ $tpl->assign('sitename',$xoopsConfig['sitename']);
+
+ $lnk = XOOPS_ROOT_PATH .'/modules/smallworld/language/'.$xoopsConfig['language'].'/mailTpl/mail_tag.html';
+ $message = $tpl->fetch($lnk);
+ $mail->Body = $message;
+ $toMail = $ToUser->getVar('email');
+ }
$mail->IsMail();
$mail->IsHTML(true);
Modified: XoopsModules/smallworld/trunk/smallworld/class/profile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/profile.php 2013-05-22 13:01:51 UTC (rev 11573)
+++ XoopsModules/smallworld/trunk/smallworld/class/profile.php 2013-05-22 13:04:57 UTC (rev 11574)
@@ -68,11 +68,7 @@
$education = "<a href='javascript:void(0)' id='_smallworld_educationmore'>".$educationArray[0]." ("._SMALLWORLD_MORE.")</a>";
$lng = $r['birthplace_lng'];
$latt = $r['birthplace_lat'];
- if($moduleConfig['geolocate'] != 1) {
- $country = "<img src='".$r['birthplace_country']."'/>";
- } else {
- $country = $r['birthplace_country'];
- }
+ $country = $r['birthplace_country'];
$rank = $user->rank();
$rank_title = $rank['title'];
if (isset($rank['image'])) {
Modified: XoopsModules/smallworld/trunk/smallworld/class/user.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-05-22 13:01:51 UTC (rev 11573)
+++ XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-05-22 13:04:57 UTC (rev 11574)
@@ -35,6 +35,18 @@
$sql = "SELECT * FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = ".$userID;
$result = $xoopsDB->queryF($sql);
$i = $xoopsDB->getRowsNum($result);
+ if ($xoopsUser) {
+ // If xoopsuser but no smallworld profile
+ if ($i == 0) {
+ $i = 1;
+ } else {
+ // if xoopsuser and has profile
+ $i = 2;
+ }
+ } else {
+ // if not xoopsUser ie anonymous user
+ $i = 0;
+ }
return $i;
}
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-05-22 13:01:51 UTC (rev 11573)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-05-22 13:04:57 UTC (rev 11574)
@@ -267,7 +267,7 @@
$text = " " . $text;
$text = str_replace('UPLIMAGE', '', $text);
}
- return $text;
+ return linkify_twitter_status($text);
}
function Smallworld_stripWordsKeepUrl($text)
@@ -975,11 +975,16 @@
$db =& XoopsDatabaseFactory::getDatabaseConnection();
$myts =& MyTextSanitizer::getInstance();
$sql = "SELECT userid, username FROM ".$db->prefix('smallworld_user')." ORDER BY userid";
- $result = $db->query($sql);
- while ($r = $db->fetchArray($result)) {
- $data[$r['userid']] = $r['username'];
+ $result = $db->queryF($sql);
+ $num = $db->getRowsNum($result);
+ if ($num == 0) {
+ $ndata = array(0 => _MI_SMALLWORLD_ALL);
+ } else {
+ while ($r = $db->fetchArray($result)) {
+ $data[$r['userid']] = $r['username'];
+ }
+ $ndata = array_merge(array(0 => _MI_SMALLWORLD_ALL), $data);
}
- $ndata = array_merge(array(0 => _MI_SMALLWORLD_ALL), $data);
return $ndata;
}
@@ -996,12 +1001,7 @@
if ($module) {
$moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
}
-
- // check geolocation style
- if(isset($moduleConfig['geolocate'])) {
- $geolocate = $moduleConfig['geolocate'];
- }
-
+
// IF logged in define xoops / smallworld user id
$myid = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
@@ -1041,7 +1041,7 @@
if (!strstr($urltest, 'www.')) {
$xoops_url = str_replace( 'www.', '', $xoops_url );
}
-
+
// Set javascript vars but only if not already defined.
// Check prevents multible loads
$script = "if (myID === undefined) {"."\n";
@@ -1051,14 +1051,13 @@
$script .= "var myID = " . $myid . ";\n";
$script .= "var userHasProfile = " . $ChkProf . ";\n";
$script .= "var smallworldTakeOverLinks = " . $takeoverlinks . ";\n";
- $script .= "var geoL = " . $geolocate . ";\n";
$script .= "var geocomplete = '';\n";
$script .= "var smallworldVerString = '" . $smallworldUV . "';\n";
$script .= "var smallworlduseverification = new Array();\n";
$script .= "smallworlduseverification = smallworldVerString.split(',');\n";
$script .= "var hasmessages = " . $count_invit . ";\n";
$script .= "var smallworldvalidationstrenght = " . $validate . ";\n";
- $script .= "var smallworld_getFriendsMsgComCount = " . $getUserMsgNum . ";\n";
+ $script .= "var smallworld_getFriendsMsgComCount = " . $getUserMsgNum . ";\n";
$script .= "var $ = jQuery();\n";
$script .= "} else {"."\n";
$script .= "\n";
@@ -1066,20 +1065,13 @@
$xoTheme->addScript('','',$script);
// Include geolocate styling
- if ($geolocate != 1) {
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/geoname.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/geoname_now.js');
- } else {
- $xoTheme->addScript("http://maps.google.com/maps/api/js?sensor=false&language="._LANGCODE);
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete_now.js');
-
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
- }
+ $xoTheme->addScript("https://maps.googleapis.com/maps/api/js?sensor=false&language="._LANGCODE);
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete_now.js');
}
/**
- * Check if permission is et for userid to post publicly
+ * Check if permission is set for userid to post publicly
* @return array
*/
@@ -1095,3 +1087,58 @@
}
return $pub;
}
+ /**
+ * Change @username to urls
+ * @param string $status_text
+ * @return string $status_text
+ */
+ function linkify_twitter_status($status_text) {
+ // linkify twitter users
+ //$keywords = preg_split("/[\s,]+/", "hypertext language, programming");
+ $status_text = preg_replace(
+ '/(^|\s)@(\w+)/',
+ '\1<a href="'.XOOPS_URL . '/modules/smallworld/userprofile.php?username=\2">' . '@\2</a> ',
+ $status_text
+ );
+
+ return $status_text;
+ }
+
+ /**
+ * Extract users from @tags
+ * @param $txt
+ * @return array @users
+ **/
+ function smallworld_getUidFromName ($name)
+ {
+ global $xoopsDB;
+ $sql = "Select userid from ".$xoopsDB->prefix('smallworld_user')." where username = '".$name."'";
+ $result = $xoopsDB->queryF($sql);
+ while ($r = $xoopsDB->fetchArray($result)) {
+ $id = $r['userid'];
+ }
+ return $id;
+ }
+
+ /**
+ * Extract users from @tags
+ * @param $txt
+ * @return array @users
+ **/
+ function smallworld_getTagUsers ($txt, $sender, $permalink='')
+ {
+ $dBase = new SmallWorldDB;
+ $mail = new smallworld_mail;
+ preg_match_all("/@([a-zA-Z0-9]+|\\[[a-zA-Z0-9]+\\])/", $txt, $matches);
+ $users = array_unique($matches[1]);
+ foreach ($users as $users) {
+ $uid = smallworld_getUidFromName ($users);
+ $notify = json_decode($dBase->GetSettings($uid), true);
+ if (isset ($notify['notify'])) {
+ if ($notify['notify'] != 0) {
+ $mail->sendMails ($sender, $uid, 'tag', $link=$permalink, array($txt));
+ }
+ }
+
+ }
+ }
|
|
From: <dj...@us...> - 2013-05-22 13:08:34
|
Revision: 11575
http://sourceforge.net/p/xoops/svn/11575
Author: djculex
Date: 2013-05-22 13:08:31 +0000 (Wed, 22 May 2013)
Log Message:
-----------
NEW: Language defines for tagging and image uploader
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/language/english/main.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-05-22 13:04:57 UTC (rev 11574)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-05-22 13:08:31 UTC (rev 11575)
@@ -664,6 +664,7 @@
$sql = "INSERT INTO ".$xoopsDB->prefix('smallworld_settings')." (id,userid,value) VALUES ('', '".$id."', '".$posts."')";
}
$result = $xoopsDB->queryF($sql);
+ $this->GetSettings ($id);
}
/**
@@ -680,7 +681,8 @@
if ($i < 1) {
$posts = serialize(array(
'posts' => 0,
- 'comments' => 0
+ 'comments' => 0,
+ 'notify' => 1
)
);
$this->saveSettings ($userid, $posts);
Modified: XoopsModules/smallworld/trunk/smallworld/language/english/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-05-22 13:04:57 UTC (rev 11574)
+++ XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-05-22 13:08:31 UTC (rev 11575)
@@ -112,6 +112,7 @@
define("_SMALLWORLD_ACTION","Action");
define("_SMALLWORLD_UPDATEID_NOT_EXIST","The message does not exist. Going back to index");
define("_SMALLWORLD_NOUSER_ERROR","No such user found. Taking you back to index page");
+define("_SMALLWORLD_ERROR","Error");
/* ------------- Registerform ---------------------- */
@@ -199,6 +200,7 @@
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_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.");
@@ -269,6 +271,12 @@
define("_SMALLWORLD_IMAGES_STARTALL","Start All");
define("_SMALLWORLD_IMAGES_CANCELALL","Cancel All");
define("_SMALLWORLD_IMAGES_DELETEALL","Delete All");
+define("_SMALLWORLD_IMAGES_ADDFILES","Add files...");
+define("_SMALLWORLD_IMAGES_DEMONOTES","Demo notes");
+define("_SMALLWORLD_IMAGES_INSTRUCTIONS","<li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited).</li>
+ <li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
+ <li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li>
+ <li>You can <strong>drag & drop</strong> files from your desktop on this webpage with Google Chrome, Mozilla Firefox and Apple Safari.</li>");
/*-------------- Image gallery -------------*/
define("_SMALLWORLD_ALBUMTITLETEXT","Close album");
@@ -366,6 +374,9 @@
define("_SMALLWORLD_COMP_MSG_LNK_DESC","Click here to see affected message");
define("_SMALLWORLD_MAIL_NEWFRIENDFOLLOWER","New friend request or new user following you at ");
+define("_SMALLWORLD_MAIL_FRIENDTAGGEDYOU","A friend tagged you at ");
+
+
/* ------------ Inspection & countdown ---------------- */
define("_SMALLWORLD_INSPEC_DESC","Admin has taken this account down for inspection.<br/><br/>Estimated inspection time will finish in");
define("_SMALLWORLD_INSPEC_DESC2","Try again at this time.");
|
|
From: <dj...@us...> - 2013-05-22 13:25:34
|
Revision: 11576
http://sourceforge.net/p/xoops/svn/11576
Author: djculex
Date: 2013-05-22 13:25:30 +0000 (Wed, 22 May 2013)
Log Message:
-----------
Bugfix: Problem with installation
Bugfix: undeclared methods
Bugfix: Permissions set and read
Bugfix: reading geolocate correct
NEW: Inplementing settings for post/comment/notify
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/editimages.php
XoopsModules/smallworld/trunk/smallworld/editprofile.php
XoopsModules/smallworld/trunk/smallworld/friendinvite.php
XoopsModules/smallworld/trunk/smallworld/friends.php
XoopsModules/smallworld/trunk/smallworld/galleryshow.php
XoopsModules/smallworld/trunk/smallworld/img_upload.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/js/jquery.min.js
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/js/ui.geo_autocomplete.js
XoopsModules/smallworld/trunk/smallworld/js/ui.geo_autocomplete_now.js
XoopsModules/smallworld/trunk/smallworld/message_ajax.php
XoopsModules/smallworld/trunk/smallworld/partnersearch.php
XoopsModules/smallworld/trunk/smallworld/permalink.php
XoopsModules/smallworld/trunk/smallworld/preloads/core.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/register.php
XoopsModules/smallworld/trunk/smallworld/settings.php
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_friends_template.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_images_edittemplate.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_index.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_imgupload.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_regtemplate.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
XoopsModules/smallworld/trunk/smallworld/userprofile.php
XoopsModules/smallworld/trunk/smallworld/xoops_version.php
Added Paths:
-----------
XoopsModules/smallworld/trunk/smallworld/language/english/mailTpl/mail_tag.html
Removed Paths:
-------------
XoopsModules/smallworld/trunk/smallworld/js/geoname.js
XoopsModules/smallworld/trunk/smallworld/js/geoname_now.js
XoopsModules/smallworld/trunk/smallworld/templates/settings.html
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -85,8 +85,13 @@
$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', $data['msg_id_fk'],$data['com_id']);
- $wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $data['msg_id_fk'],$data['com_id']);
- $tpl->append('comments', $wc);
+ $wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $data['msg_id_fk'],$data['com_id']);
+
+ //Send mail if tagged
+ $permalink = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id_fk'];
+ smallworld_getTagUsers ($wc['comment'],$wc['uid'], $permalink);
+
+ $tpl->append('comments', $wc);
$tpl->assign('myusername',$username);
$tpl->assign('pagename',$page);
Modified: XoopsModules/smallworld/trunk/smallworld/editimages.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editimages.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/editimages.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -38,7 +38,7 @@
$check = new SmallWorldUser;
$profile = $check->CheckIfProfile($userID);
if ($profile > 0) {
- $xoopsTpl->assign('check',1);
+ $xoopsTpl->assign('check',$profile);
$item = new SmallWorldForm;
$db = new SmallWorldDB;
@@ -52,7 +52,7 @@
}
$xoopsTpl->append('editimages',$editimages);
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
+ //$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
} else {
redirect_header("index.php", 1);
}
Modified: XoopsModules/smallworld/trunk/smallworld/editprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -37,295 +37,295 @@
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
- if ($profile > 0) {
- $xoopsTpl->assign('check',1);
- $item = new SmallWorldForm;
- $db = new SmallWorldDB;
-
- $cdb = "SELECT * FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".$id."'";
- $result = $xoopsDB->queryF($cdb);
- $cnt = $xoopsDB->getRowsNum($result);
- while ($r = $xoopsDB->fetchArray($result)) {
- // ------------ PERSONAL INFO ------------ //
-
- // Real name
- if (smallworldGetValfromArray ('realname', 'smallworldusethesefields') != 0) {
- $realname = $item->input('realname', 'realname', 'realname',$size=30, $preset=$r['realname']);
- $xoopsTpl->append('realname',$realname);
- } else {
- $xoopsTpl->assign('show_realname','no');
- }
-
- // Dropdown for gender
- if (smallworldGetValfromArray ('gender', 'smallworldusethesefields') != 0) {
- $gender = $item->dropdown('gender',$arr0,$r['gender']);
- $xoopsTpl->append('gender', $gender);
- } else {
- $xoopsTpl->assign('show_gender','no');
- }
-
- // Selectbox for "interested in gender(s)"
- if (smallworldGetValfromArray ('interestedin', 'smallworldusethesefields') != 0) {
- $nr = unserialize($r['intingender']);
- $intInGender = $item->RetrieveRadio('intingender',$arr01,$nr, $selected=null);
- $xoopsTpl->append('intingender',$intInGender);
- } else {
- $xoopsTpl->assign('show_interestedin','no');
- }
-
- // Dropdown for marital status
- if (smallworldGetValfromArray ('relationshipstatus', 'smallworldusethesefields') != 0) {
- $relationshipstatus = $item->dropdown('relationship',$arr02,0);
- $xoopsTpl->append('relationshipstatus',$relationshipstatus);
-
+ if ($profile == 2) {
+ $xoopsTpl->assign('check',$profile);
+ $item = new SmallWorldForm;
+ $db = new SmallWorldDB;
+
+ $cdb = "SELECT * FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".$id."'";
+ $result = $xoopsDB->queryF($cdb);
+ $cnt = $xoopsDB->getRowsNum($result);
+ while ($r = $xoopsDB->fetchArray($result)) {
+ // ------------ PERSONAL INFO ------------ //
+
+ // Real name
+ if (smallworldGetValfromArray ('realname', 'smallworldusethesefields') != 0) {
+ $realname = $item->input('realname', 'realname', 'realname',$size=30, $preset=$r['realname']);
+ $xoopsTpl->append('realname',$realname);
+ } else {
+ $xoopsTpl->assign('show_realname','no');
+ }
+
+ // Dropdown for gender
+ if (smallworldGetValfromArray ('gender', 'smallworldusethesefields') != 0) {
+ $gender = $item->dropdown('gender',$arr0,$r['gender']);
+ $xoopsTpl->append('gender', $gender);
+ } else {
+ $xoopsTpl->assign('show_gender','no');
+ }
+
+ // Selectbox for "interested in gender(s)"
+ if (smallworldGetValfromArray ('interestedin', 'smallworldusethesefields') != 0) {
+ $nr = unserialize($r['intingender']);
+ $intInGender = $item->RetrieveRadio('intingender',$arr01,$nr, $selected=null);
+ $xoopsTpl->append('intingender',$intInGender);
+ } else {
+ $xoopsTpl->assign('show_interestedin','no');
+ }
+
+ // Dropdown for marital status
+ if (smallworldGetValfromArray ('relationshipstatus', 'smallworldusethesefields') != 0) {
+ $relationshipstatus = $item->dropdown('relationship',$arr02,0);
+ $xoopsTpl->append('relationshipstatus',$relationshipstatus);
+
- // Partner. Only shown if marital status is married, it's complicated, engaged)
- $partner = $item->input('partner', 'partner', 'partner',$size='30', stripslashes($r['partner']));
- $xoopsTpl->append('partner',$partner);
- } else {
- $xoopsTpl->assign('show_relationshipstatus','no');
- }
-
- if (smallworldGetValfromArray ('lookingfor', 'smallworldusethesefields') != 0) {
- $nr1 = unserialize($r['searchrelat']);
- $searchrelat = $item->RetrieveRadio('searchrelat',$arr03,$nr1, $selected=null);
- $xoopsTpl->append('searchrelat',$searchrelat);
- } else {
- $xoopsTpl->assign('show_lookingfor','no');
- }
-
- if (smallworldGetValfromArray ('birthday', 'smallworldusethesefields') != 0) {
- // Select Birthday dd-mm-Y
- $birthday = $item->input('birthday', 'birthday', 'birthday',$size='12', $preset=stripslashes(Smallworld_UsToEuroDate($r['birthday'])));
- $xoopsTpl->append('birthdaydate',$birthday);
- } else {
- $xoopsTpl->assign('show_birthday','no');
- }
-
- // Select Hometown or Enter new
- if (smallworldGetValfromArray ('birthplace', 'smallworldusethesefields') != 0) {
- $birthplace = $item->input('birthplace', 'birthplace', 'birthplace',$size='50', $preset=stripslashes($r['birthplace']));
- $xoopsTpl->append('birthplace',$birthplace);
- } else {
- $xoopsTpl->assign('show_birthplace','no');
- }
-
- // Dropdown politics
- if (smallworldGetValfromArray ('politicalview', 'smallworldusethesefields') != 0) {
- $politic = $item->dropdown('politic',$arr04,0);
- $xoopsTpl->append('politic',$politic);
- } else {
- $xoopsTpl->assign('show_political','no');
- }
-
- // Dropdown Religion
- if (smallworldGetValfromArray ('religiousview', 'smallworldusethesefields') != 0) {
- $religion = $item->dropdown('religion',$arr05,0);
- $xoopsTpl->append('religion',$religion);
- } else {
- $xoopsTpl->assign('show_religion','no');
- }
-
- // ------------ CONTACT INFO ------------ //
- // Add email test
- if (smallworldGetValfromArray ('emails', 'smallworldusethesefields') != 0) {
- $nr2 = unserialize($r['emailtype']);
- $emailtext = '';
- foreach ($nr2 as $k => $v) {
- $nr2id = "email-".$k;
- $emailtext .= $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,$addmore=null,$preset=stripslashes($v),$nr2id);
- // $emailtext .= $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,$addmore=null,$preset=stripslashes($v));
- $emailtext .= "<span class='smallworld_remove' id='emailremove'><a href='javascript:removelnk (\"#emailremovelnk\",\"input#email\",\"email\");' id='emailremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
- }
- $emailtext .= "<a class='smallworld_addemail' href='javascript:void();' id='emailAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
- $xoopsTpl->append('emailtext',$emailtext);
- } else {
- $xoopsTpl->assign('show_emails','no');
- }
-
-
- //Add screen names (usernames for facebook etc etc)
- if (smallworldGetValfromArray ('screennames', 'smallworldusethesefields') != 0) {
- $nr3 = unserialize($r['screenname_type']);
- $nr4 = unserialize($r['screenname']);
- $count1 = count($nr3);
- $cnt1 = 0;
-
- // Drop down for screen names
- $screenname ="";
- foreach ($nr3 as $k => $v) {
- if ($cnt1 < $count1-1) {$addmore1 ="";} else {$addmore1 = _SMALLWORLD_ADDMORE;}
- $screenname .= $item->dropdown_add('smallworld_add','screenname', 'screenname_type', '.smallworld_clone',$arr06,$addmore1,$selected=stripslashes($nr4[$k]),$preset=stripslashes($v));
- $screenname .= "<span class='smallworld_remove' id='screennameremove'>";
- $screenname .= "<a href='javascript:removelnk (\"#screennameremovelnk\",\"span#screenname\",\"screenname\");' id='screennameremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
- $cnt1++;
- }
- $screenname .= "<a class='smallworld_addscreenname' href='javascript:void(0);' id='screennameAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
- $xoopsTpl->append('screenname',$screenname);
- } else {
- $xoopsTpl->assign('show_screennames','no');
- }
-
- // Mobilephone
- if (smallworldGetValfromArray ('mobile', 'smallworldusethesefields') != 0) {
- $mobile = $item->input('mobile','mobile','mobile',12,$preset=stripslashes($r['mobile']));
- $xoopsTpl->append('mobile',$mobile);
- } else {
- $xoopsTpl->assign('show_mobile','no');
- }
-
- // Landphone
- if (smallworldGetValfromArray ('landphone', 'smallworldusethesefields') != 0) {
- $phone = $item->input('phone','phone','phone',12,$preset=stripslashes($r['phone']));
- $xoopsTpl->append('phone',$phone);
- } else {
- $xoopsTpl->assign('show_landphone','no');
- }
-
- // Adress
- if (smallworldGetValfromArray ('streetadress', 'smallworldusethesefields') != 0) {
- $adress = $item->input('adress','adress','adress',$size='50',$preset=stripslashes($r['adress']));
- $xoopsTpl->append('adress',$adress);
- } else {
- $xoopsTpl->assign('show_adress','no');
- }
-
- if (smallworldGetValfromArray ('presentcity', 'smallworldusethesefields') != 0) {
- $present_city = $item->input('present_city', 'present_city', 'present_city',50, $preset=stripslashes($r['present_city']));
- $xoopsTpl->append('present_city',$present_city);
-
- $present_country = $item->input('present_country', 'present_country', 'present_country',$size='50', $preset=stripslashes($r['present_country']));
- $xoopsTpl->append('present_country',$present_country);
- } else {
- $xoopsTpl->assign('show_city','no');
- }
-
- if (smallworldGetValfromArray ('website', 'smallworldusethesefields') == 0) {
- $xoopsTpl->assign('show_website','no');
- }
-
- // ------------ INTERESTS ------------ //
-
- // Textarea for interests
- //textarea($name, $id, $title, $rows, $cols, $class)
- if (smallworldGetValfromArray ('interests', 'smallworldusethesefields') != 0) {
- $interests = $item->textarea('interests','interests',_SMALLWORLD_INTERESTS,1,20,'favourites',$preset=stripslashes($r['interests']));
- $xoopsTpl->append('interests',$interests);
- } else {
- $xoopsTpl->assign('show_interests','no');
- }
-
- // Textarea for Music
- if (smallworldGetValfromArray ('favouritemusic', 'smallworldusethesefields') != 0) {
- $music = $item->textarea('music','music',_SMALLWORLD_MUSIC,1,20,'favourites',$preset=stripslashes($r['music']));
- $xoopsTpl->append('music',$music);
- } else {
- $xoopsTpl->assign('show_music','no');
- }
-
- // Textarea for Tvshow
- if (smallworldGetValfromArray ('favouritetvshows', 'smallworldusethesefields') != 0) {
- $tvshow = $item->textarea('tvshow','tvshow',_SMALLWORLD_TVSHOW,1,20,'favourites',$preset=stripslashes($r['tvshow']));
- $xoopsTpl->append('tvshow',$tvshow);
- } else {
- $xoopsTpl->assign('show_tv','no');
- }
-
- // Textarea for Movie
- if (smallworldGetValfromArray ('favouritemovies', 'smallworldusethesefields') != 0) {
- $movie = $item->textarea('movie','movie',_SMALLWORLD_MOVIE,1,20,'favourites',$preset=stripslashes($r['movie']));
- $xoopsTpl->append('movie',$movie);
- } else {
- $xoopsTpl->assign('show_movies','no');
- }
-
- // Textarea for Books
- if (smallworldGetValfromArray ('favouritebooks', 'smallworldusethesefields') != 0) {
- $books = $item->textarea('books','books',_SMALLWORLD_BOOKS,1,20,'favourites',$preset=stripslashes($r['books']));
- $xoopsTpl->append('books',$books);
- } else {
- $xoopsTpl->assign('show_books','no');
- }
-
- // Textarea for About me
- if (smallworldGetValfromArray ('aboutme', 'smallworldusethesefields') != 0) {
- $aboutme = $item->textarea('aboutme','aboutme',_SMALLWORLD_ABOUTME,2,20,'favourites',$preset=stripslashes($r['aboutme']));
- $xoopsTpl->append('aboutme',$aboutme);
- } else {
- $xoopsTpl->assign('show_aboutme','no');
- }
-
-
- // ------------ SCHOOL ------------ //
-
- //School name
- if (smallworldGetValfromArray ('education', 'smallworldusethesefields') != 0) {
- $nr5 = unserialize($r['school_type']);
- $nr6 = unserialize($r['school']);
- $nr7 = unserialize($r['schoolstart']);
- $nr8 = unserialize($r['schoolstop']);
- $school = "";
- foreach ($nr5 as $k => $v) {
- $school .= $item->school_add ('smallworld_add3', 'school', 'school_type',
- '.smallworld_clone3', $arr7, _SMALLWORLD_ADDMORE, $selected=stripslashes($nr6[$k]),$preset=$v, $selectedstart=date("Y",$nr7[$k]),$selectedstop=date("Y",$nr8[$k]));
- $school .= "<span class='smallworld_remove2' id='schoolremove'>";
- $school .= "<a href='javascript:removelnk (\"#schoolremovelnk\",\"div#school\",\"school\");' id='schoolremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
- }
- $school .= "<a class='smallworld_addschool' href='javascript:void(0);' id='schoolAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
- $xoopsTpl->append('school',$school);
- } else {
- $xoopsTpl->assign('show_school','no');
- }
-
- //Jobs
- if (smallworldGetValfromArray ('employment', 'smallworldusethesefields') != 0) {
- $nr9 = unserialize($r['employer']);
- $nr10 = unserialize($r['position']);
- $nr11 = unserialize($r['jobstart']);
- $nr12 = unserialize($r['jobstop']);
- $nr13 = unserialize(stripslashes($r['description']));
- $job="";
- foreach ($nr9 as $k=>$v) {
- $job .= $item->job('smallworld_add4', 'job', 'job_type', '.smallworld_clone4', _SMALLWORLD_ADDMORE, $employer=stripslashes($v), $position=stripslashes($nr10[$k]),
- $selectedstart=date("Y",$nr11[$k]), $selectedstop=date("Y",$nr12[$k]),$description=$nr13[$k]);
- $job .= "<span class='smallworld_remove3' id='jobremove'>";
- $job .= "<a href='javascript:removelnk (\"#jobremovelnk\",\"div#job\",\"job\");' id='jobremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
- }
- $job .= "<a class='smallworld_addjob' href='javascript:void(0);' id='jobAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
- $xoopsTpl->append('job',$job);
- } else {
- $xoopsTpl->assign('show_jobs','no');
- }
-
- // Create hidden forms for birthcity
- $birthplace_lat = $item->hidden('birthplace_lat','birthplace_lat',$preset=stripslashes($r['birthplace_lat']));
- $birthplace_lng = $item->hidden('birthplace_lng','birthplace_lng',$preset=stripslashes($r['birthplace_lng']));
- $birthplace_country = $item->hidden('birthplace_country','birthplace_country',$preset=stripslashes($r['birthplace_country']));
- $xoopsTpl->append('birthplace_lat',$birthplace_lat);
- $xoopsTpl->append('birthplace_lng',$birthplace_lng);
- $xoopsTpl->append('birthplace_country',$birthplace_country);
-
- // Create hidden forms for present city
- $present_lat = $item->hidden('present_lat','present_lat',$preset=stripslashes($r['present_lat']));
- $present_lng = $item->hidden('present_lng','present_lng',$preset=stripslashes($r['present_lng']));
- $xoopsTpl->append('present_lat',$present_lat);
- $xoopsTpl->append('present_lng',$present_lng);
-
- $xoopsTpl->append('smallworld_register_title',_SMALLWORLD_REGRISTATION_TITLE);
- $xoopsTpl->assign('smallworld_beforesubmit',_SMALLWORLD_TEXTBEFORESUBMIT);
- $xoopsTpl->assign('smallworld_save',_SMALLWORLD_SUBMIT);
- $xoopsTpl->assign('smallworld_user_website',$r['website']);
-
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validate.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validation.functions.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.stepy.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
- }
- } else {
- redirect_header("register.php", 1);
- }
+ // Partner. Only shown if marital status is married, it's complicated, engaged)
+ $partner = $item->input('partner', 'partner', 'partner',$size='30', stripslashes($r['partner']));
+ $xoopsTpl->append('partner',$partner);
+ } else {
+ $xoopsTpl->assign('show_relationshipstatus','no');
+ }
+
+ if (smallworldGetValfromArray ('lookingfor', 'smallworldusethesefields') != 0) {
+ $nr1 = unserialize($r['searchrelat']);
+ $searchrelat = $item->RetrieveRadio('searchrelat',$arr03,$nr1, $selected=null);
+ $xoopsTpl->append('searchrelat',$searchrelat);
+ } else {
+ $xoopsTpl->assign('show_lookingfor','no');
+ }
+
+ if (smallworldGetValfromArray ('birthday', 'smallworldusethesefields') != 0) {
+ // Select Birthday dd-mm-Y
+ $birthday = $item->input('birthday', 'birthday', 'birthday',$size='12', $preset=stripslashes(Smallworld_UsToEuroDate($r['birthday'])));
+ $xoopsTpl->append('birthdaydate',$birthday);
+ } else {
+ $xoopsTpl->assign('show_birthday','no');
+ }
+
+ // Select Hometown or Enter new
+ if (smallworldGetValfromArray ('birthplace', 'smallworldusethesefields') != 0) {
+ $birthplace = $item->input('birthplace', 'birthplace', 'birthplace',$size='50', $preset=stripslashes($r['birthplace']));
+ $xoopsTpl->append('birthplace',$birthplace);
+ } else {
+ $xoopsTpl->assign('show_birthplace','no');
+ }
+
+ // Dropdown politics
+ if (smallworldGetValfromArray ('politicalview', 'smallworldusethesefields') != 0) {
+ $politic = $item->dropdown('politic',$arr04,0);
+ $xoopsTpl->append('politic',$politic);
+ } else {
+ $xoopsTpl->assign('show_political','no');
+ }
+
+ // Dropdown Religion
+ if (smallworldGetValfromArray ('religiousview', 'smallworldusethesefields') != 0) {
+ $religion = $item->dropdown('religion',$arr05,0);
+ $xoopsTpl->append('religion',$religion);
+ } else {
+ $xoopsTpl->assign('show_religion','no');
+ }
+
+ // ------------ CONTACT INFO ------------ //
+ // Add email test
+ if (smallworldGetValfromArray ('emails', 'smallworldusethesefields') != 0) {
+ $nr2 = unserialize($r['emailtype']);
+ $emailtext = '';
+ foreach ($nr2 as $k => $v) {
+ $nr2id = "email-".$k;
+ $emailtext .= $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,$addmore=null,$preset=stripslashes($v),$nr2id);
+ // $emailtext .= $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,$addmore=null,$preset=stripslashes($v));
+ $emailtext .= "<span class='smallworld_remove' id='emailremove'><a href='javascript:removelnk (\"#emailremovelnk\",\"input#email\",\"email\");' id='emailremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
+ }
+ $emailtext .= "<a class='smallworld_addemail' href='javascript:void();' id='emailAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
+ $xoopsTpl->append('emailtext',$emailtext);
+ } else {
+ $xoopsTpl->assign('show_emails','no');
+ }
+
+
+ //Add screen names (usernames for facebook etc etc)
+ if (smallworldGetValfromArray ('screennames', 'smallworldusethesefields') != 0) {
+ $nr3 = unserialize($r['screenname_type']);
+ $nr4 = unserialize($r['screenname']);
+ $count1 = count($nr3);
+ $cnt1 = 0;
+
+ // Drop down for screen names
+ $screenname ="";
+ foreach ($nr3 as $k => $v) {
+ if ($cnt1 < $count1-1) {$addmore1 ="";} else {$addmore1 = _SMALLWORLD_ADDMORE;}
+ $screenname .= $item->dropdown_add('smallworld_add','screenname', 'screenname_type', '.smallworld_clone',$arr06,$addmore1,$selected=stripslashes($nr4[$k]),$preset=stripslashes($v));
+ $screenname .= "<span class='smallworld_remove' id='screennameremove'>";
+ $screenname .= "<a href='javascript:removelnk (\"#screennameremovelnk\",\"span#screenname\",\"screenname\");' id='screennameremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
+ $cnt1++;
+ }
+ $screenname .= "<a class='smallworld_addscreenname' href='javascript:void(0);' id='screennameAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
+ $xoopsTpl->append('screenname',$screenname);
+ } else {
+ $xoopsTpl->assign('show_screennames','no');
+ }
+
+ // Mobilephone
+ if (smallworldGetValfromArray ('mobile', 'smallworldusethesefields') != 0) {
+ $mobile = $item->input('mobile','mobile','mobile',12,$preset=stripslashes($r['mobile']));
+ $xoopsTpl->append('mobile',$mobile);
+ } else {
+ $xoopsTpl->assign('show_mobile','no');
+ }
+
+ // Landphone
+ if (smallworldGetValfromArray ('landphone', 'smallworldusethesefields') != 0) {
+ $phone = $item->input('phone','phone','phone',12,$preset=stripslashes($r['phone']));
+ $xoopsTpl->append('phone',$phone);
+ } else {
+ $xoopsTpl->assign('show_landphone','no');
+ }
+
+ // Adress
+ if (smallworldGetValfromArray ('streetadress', 'smallworldusethesefields') != 0) {
+ $adress = $item->input('adress','adress','adress',$size='50',$preset=stripslashes($r['adress']));
+ $xoopsTpl->append('adress',$adress);
+ } else {
+ $xoopsTpl->assign('show_adress','no');
+ }
+
+ if (smallworldGetValfromArray ('presentcity', 'smallworldusethesefields') != 0) {
+ $present_city = $item->input('present_city', 'present_city', 'present_city',50, $preset=stripslashes($r['present_city']));
+ $xoopsTpl->append('present_city',$present_city);
+
+ $present_country = $item->input('present_country', 'present_country', 'present_country',$size='50', $preset=stripslashes($r['present_country']));
+ $xoopsTpl->append('present_country',$present_country);
+ } else {
+ $xoopsTpl->assign('show_city','no');
+ }
+
+ if (smallworldGetValfromArray ('website', 'smallworldusethesefields') == 0) {
+ $xoopsTpl->assign('show_website','no');
+ }
+
+ // ------------ INTERESTS ------------ //
+
+ // Textarea for interests
+ //textarea($name, $id, $title, $rows, $cols, $class)
+ if (smallworldGetValfromArray ('interests', 'smallworldusethesefields') != 0) {
+ $interests = $item->textarea('interests','interests',_SMALLWORLD_INTERESTS,1,20,'favourites',$preset=stripslashes($r['interests']));
+ $xoopsTpl->append('interests',$interests);
+ } else {
+ $xoopsTpl->assign('show_interests','no');
+ }
+
+ // Textarea for Music
+ if (smallworldGetValfromArray ('favouritemusic', 'smallworldusethesefields') != 0) {
+ $music = $item->textarea('music','music',_SMALLWORLD_MUSIC,1,20,'favourites',$preset=stripslashes($r['music']));
+ $xoopsTpl->append('music',$music);
+ } else {
+ $xoopsTpl->assign('show_music','no');
+ }
+
+ // Textarea for Tvshow
+ if (smallworldGetValfromArray ('favouritetvshows', 'smallworldusethesefields') != 0) {
+ $tvshow = $item->textarea('tvshow','tvshow',_SMALLWORLD_TVSHOW,1,20,'favourites',$preset=stripslashes($r['tvshow']));
+ $xoopsTpl->append('tvshow',$tvshow);
+ } else {
+ ...
[truncated message content] |
|
From: <dj...@us...> - 2013-06-03 01:59:04
|
Revision: 11611
http://sourceforge.net/p/xoops/svn/11611
Author: djculex
Date: 2013-06-03 01:59:01 +0000 (Mon, 03 Jun 2013)
Log Message:
-----------
Bugfix: Check right permission and do action accordingly
Bugfix: Set values through checkIfProfile method
Change: Added new text to install.txt for upgrading module
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
XoopsModules/smallworld/trunk/smallworld/docs/install.txt
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/preloads/core.php
Modified: XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-06-03 00:25:04 UTC (rev 11610)
+++ XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-06-03 01:59:01 UTC (rev 11611)
@@ -1,20 +1,12 @@
------------------------------
-Changelog v.1.15 RC 14
+Changelog v.1.15 RC 15
------------------------------
-22. may 2013 15:31 revision: 11573 - 11576
+03. june 2013 03:44 revision: 11573 - 11576
-NEW: Inplementing settings for post/comment/notify
-NEW: Adding tagging
-NEW: Language defines for tagging and image uploader
-Bugfix: Fixing selector for like/dislike
-Bugfix: Check permissions return array
-Change: Sql messages from varchar to text
-Bugfix: Fixing appearance of admin
-Bugfix: Problem with installation
-Bugfix: undeclared methods
-Bugfix: Permissions set and read
-Bugfix: reading geolocate correct
-Bugfix: If no users and xoopsuser redirect to register. Cancel array_unique error
+Bugfix: Fixing permission redirect if XoopsUser bot not Smalluser
+ and privacy permissions are set to 0
+Bugfix: Extended test when returning access values to script
+Bugfix: Updated installation details when upgrading
------------------------------
Changelog v.1.15 RC 13
Modified: XoopsModules/smallworld/trunk/smallworld/docs/install.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/install.txt 2013-06-03 00:25:04 UTC (rev 11610)
+++ XoopsModules/smallworld/trunk/smallworld/docs/install.txt 2013-06-03 01:59:01 UTC (rev 11611)
@@ -1,6 +1,18 @@
INSTALL/UNISTALL
=================
-No special measures necessary, follow the standard installation process \x96 extract the module folder into the ../modules directory. Install the module through Admin -> System Module -> Modules.
+First Time Install
+==================
+No special measures necessary, follow the standard installation process
+1) extract the module folder into the ../modules directory.
+2) Install the module through Admin -> System Module -> Modules.
+
+Upgrading
+=========
+1) Install like normal module (download, unzip overwrite destinatin files etc etc)
+2) Upgrade through admin -> Modules - > smallworld -> update
+3) Goto smallworld admin page (automatic check for changing or adding things to tables, converting values in tables etc)
+4) done
+
Detailed instructions on installing modules are available in the XOOPS Operations Manual: http://goo.gl/adT2i
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-03 00:25:04 UTC (rev 11610)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-03 01:59:01 UTC (rev 11611)
@@ -1058,7 +1058,7 @@
$script .= "var hasmessages = " . $count_invit . ";\n";
$script .= "var smallworldvalidationstrenght = " . $validate . ";\n";
$script .= "var smallworld_getFriendsMsgComCount = " . $getUserMsgNum . ";\n";
- $script .= "var $ = jQuery();\n";
+ //$script .= "var $ = jQuery();\n";
$script .= "} else {"."\n";
$script .= "\n";
$script .= "}"."\n";
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2013-06-03 00:25:04 UTC (rev 11610)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2013-06-03 01:59:01 UTC (rev 11611)
@@ -216,6 +216,10 @@
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/preloads/core.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2013-06-03 00:25:04 UTC (rev 11610)
+++ XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2013-06-03 01:59:01 UTC (rev 11611)
@@ -31,8 +31,8 @@
//Load language if not defined
smallworld_isDefinedLanguage ('_SMALLWORLD_SYSERROR', 'main.php');
- $xoTheme->addScript("http://code.jquery.com/jquery-1.9.1.js");
- //$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.min.js');
+ //$xoTheme->addScript("http://code.jquery.com/jquery-1.9.1.js");
+ $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/ui/1.10.2/jquery-ui.js");
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/base/jquery.ui.all.css');
|
|
From: <dj...@us...> - 2013-06-12 17:42:12
|
Revision: 11659
http://sourceforge.net/p/xoops/svn/11659
Author: djculex
Date: 2013-06-12 17:42:10 +0000 (Wed, 12 Jun 2013)
Log Message:
-----------
Bugfix: Attached colorbox to relevant pages after smallworld.js init
Bugfix: Revert colorbox -> dialog i register and edit register
Bugfix: datepicker does not work with colorbog - jquery.ui issue
Bugfix: Attached plugin read to switch ie. better organized
Bugfix: Smallworld changes to run also with xoops 2.5.5 core
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/editprofile.php
XoopsModules/smallworld/trunk/smallworld/friends.php
XoopsModules/smallworld/trunk/smallworld/galleryshow.php
XoopsModules/smallworld/trunk/smallworld/img_upload.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/include/getSelects.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/js/jqueryui.min.js
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/permalink.php
XoopsModules/smallworld/trunk/smallworld/preloads/core.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/register.php
XoopsModules/smallworld/trunk/smallworld/smallworldshare.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -124,7 +124,7 @@
$sql = "SELECT ".$var." FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".$id."'";
$result = $xoopsDB->queryF($sql);
if ($xoopsDB->getRowsNum($result) < 1) {
- return _SMALLWORLD_REPLY_NOTSPECIFIED;
+ return 0;//_SMALLWORLD_REPLY_NOTSPECIFIED;
}
while ($row = $xoopsDB->fetchArray($result)) {
$msg[$var] = $row[$var];
Modified: XoopsModules/smallworld/trunk/smallworld/editprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -315,13 +315,6 @@
$xoopsTpl->assign('smallworld_beforesubmit',_SMALLWORLD_TEXTBEFORESUBMIT);
$xoopsTpl->assign('smallworld_save',_SMALLWORLD_SUBMIT);
$xoopsTpl->assign('smallworld_user_website',$r['website']);
-
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validate.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validation.functions.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.stepy.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
}
} elseif ($profile < 2) {
redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
Modified: XoopsModules/smallworld/trunk/smallworld/friends.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/friends.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/friends.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -202,21 +202,9 @@
$xoopsTpl->assign('myavatarlink',$myavatarlink);
$xoopsTpl->assign('myusername',$username);
$xoopsTpl->assign('username',$Xusername);
- } else {
+ } else {
$check->chkUser ();
- }
-
- global $xoTheme;
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/apprise-1.5.full.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/jquery.fileupload-ui.css');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- //$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
+ }
} else {
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
Modified: XoopsModules/smallworld/trunk/smallworld/galleryshow.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -25,16 +25,7 @@
include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php");
global $xoopsUser, $xoTheme;
- if ($xoopsUser) {
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/galleriffic-5.css');
- //$xoTheme->addScript("http://code.jquery.com/jquery-migrate-1.0.0.js");
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.galleriffic.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.history.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.opacityrollover.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/gallery_mod.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
-
+ if ($xoopsUser) {
$id = $xoopsUser->getVar('uid');
$check = new SmallWorldUser;
$image = new SmallWorldImages;
Modified: XoopsModules/smallworld/trunk/smallworld/img_upload.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/img_upload.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/img_upload.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -28,24 +28,6 @@
if ($xoopsUser) {
global $xoTheme;
$xoopsLogger->activated = false;
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/bootstrap.min.css');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/style.css');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/bootstrap-responsive.min.css');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/bootstrap-image-gallery.min.css');
-
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/vendor/jquery.ui.widget.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/tmpl.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/load-image.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/canvas-to-blob.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/bootstrap.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/bootstrap-image-gallery.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.iframe-transport.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.fileupload.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.fileupload-fp.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.fileupload-ui.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/main.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- //$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
$id = $xoopsUser->getVar('uid');
$check = new SmallWorldUser;
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -1068,8 +1068,126 @@
$xoTheme->addScript("https://maps.googleapis.com/maps/api/js?sensor=false&language="._LANGCODE);
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete.js');
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete_now.js');
+
+ smallworld_includeScripts ();
+
}
+
+ /**
+ * Include script files based on $page
+ * @return void
+ */
+
+ function smallworld_includeScripts () {
+ global $xoopsUser, $xoopsConfig, $xoTheme;
+ $page = basename ($_SERVER['PHP_SELF'],".php");
+ switch ($page) {
+ case 'register':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validate.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validation.functions.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.stepy.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ break;
+
+ case 'publicindex':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ break;
+
+ case 'permalink':
+ $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');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ $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');
+ break;
+
+ case 'index':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ break;
+
+ case 'img_upload':
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/bootstrap.min.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/style.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/bootstrap-responsive.min.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/uploader/bootstrap-image-gallery.min.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/vendor/jquery.ui.widget.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/tmpl.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/load-image.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/canvas-to-blob.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/bootstrap.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/uploader/bootstrap-image-gallery.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.iframe-transport.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.fileupload.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.fileupload-fp.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.fileupload-ui.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/main.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ break;
+
+ case 'galleryshow':
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/galleriffic-5.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.galleriffic.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.history.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.opacityrollover.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/gallery_mod.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ break;
+
+ case 'friends':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/apprise-1.5.full.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/jquery.fileupload-ui.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ //$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
+ break;
+
+ case 'editprofile':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validate.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.validation.functions.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.stepy.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ break;
+
+ case 'smallworldshare':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ break;
+ }
+ }
+
/**
* Check if permission is set for userid to post publicly
* @return array
Modified: XoopsModules/smallworld/trunk/smallworld/include/getSelects.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/getSelects.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/include/getSelects.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -34,6 +34,6 @@
$politic = $db->getVar($id,'politic');
$religion = $db->getVar($id,'religion');
header('Content-type: "application/json"');
- echo "{\"relat\":\"$relat \", \"partner\":\"$partner \", \"gender\":\"$gender \", \"politic\":\"$politic \", \"religion\":\"$religion \"}";
+ echo "{\"relat\":\"$relat\", \"partner\":\"$partner\", \"gender\":\"$gender\", \"politic\":\"$politic\", \"religion\":\"$religion\"}";
}
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2013-06-12 17:42:10 UTC (rev 11659)
@@ -198,18 +198,7 @@
$xoopsTpl->assign('friendinvitations',$getInvitations);
$xoopsTpl->assign('access',$set['access']);
- // }
-
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
- $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');
+ // }
}
if ($profile == 1 && $set['access'] == 0) {
Modified: XoopsModules/smallworld/trunk/smallworld/js/jqueryui.min.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/jqueryui.min.js 2013-06-12 16:30:47 UTC (rev 11658)
+++ XoopsModules/smallworld/trunk/smallworld/js/jqueryui.min.js 2013-06-12 17:42:10 UTC (rev 11659)
@@ -1,6 +1,15003 @@
-/*! jQuery UI - v1.10.0 - 2013-01-29
+/*! jQuery UI - v1.10.3 - 2013-05-03
* http://jqueryui.com
-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js
-* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function( $, undefined ) {
@@ Diff output truncated at 100000 characters. @@
|
|
From: <dj...@us...> - 2013-06-16 17:29:36
|
Revision: 11699
http://sourceforge.net/p/xoops/svn/11699
Author: djculex
Date: 2013-06-16 17:29:32 +0000 (Sun, 16 Jun 2013)
Log Message:
-----------
Bugfix: Global vars and functions prefixing (security fix)
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/user.php
XoopsModules/smallworld/trunk/smallworld/editprofile.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/include/getSelects.php
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/js/wall.js
XoopsModules/smallworld/trunk/smallworld/templates/getlastcom.html
XoopsModules/smallworld/trunk/smallworld/templates/getlastmsg.html
XoopsModules/smallworld/trunk/smallworld/templates/getmore.html
XoopsModules/smallworld/trunk/smallworld/templates/getmorepublic.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
XoopsModules/smallworld/trunk/smallworld/userprofile.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/user.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-06-16 17:29:32 UTC (rev 11699)
@@ -183,9 +183,9 @@
$msg[$start]['img'] = $Wall->Gravatar($row['me']);
$msg[$start]['friendimage'] = "<img src='".XOOPS_UPLOAD_URL."/".$msg[$start]['img']."' height='40px'/>";
$msg[$start]['frienddate'] = date('d-m-Y',$row['date']);
- $msg[$start]['accept'] = '<a id="smallworldrequestlink" href = "javascript:AcceptDenyFriend(1,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_ACCEPT.'</a>';
- $msg[$start]['deny'] = '<a id="smallworldrequestlink" href = "javascript:AcceptDenyFriend(-1,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_DENY.'</a>';
- $msg[$start]['later'] = '<a id="smallworldrequestlink" href = "javascript:AcceptDenyFriend(0,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_LATER.'</a>';
+ $msg[$start]['accept'] = '<a id="smallworldrequestlink" href = "javascript:Smallworld_AcceptDenyFriend(1,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_ACCEPT.'</a>';
+ $msg[$start]['deny'] = '<a id="smallworldrequestlink" href = "javascript:Smallworld_AcceptDenyFriend(-1,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_DENY.'</a>';
+ $msg[$start]['later'] = '<a id="smallworldrequestlink" href = "javascript:Smallworld_AcceptDenyFriend(0,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_LATER.'</a>';
$msg[$start]['cnt'] = $start;
$start++;
}
Modified: XoopsModules/smallworld/trunk/smallworld/editprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-06-16 17:29:32 UTC (rev 11699)
@@ -135,9 +135,9 @@
$nr2id = "email-".$k;
$emailtext .= $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,$addmore=null,$preset=stripslashes($v),$nr2id);
// $emailtext .= $item->input_add('smallworld_add2','email','emailtype','.smallworld_clone2',20,$addmore=null,$preset=stripslashes($v));
- $emailtext .= "<span class='smallworld_remove' id='emailremove'><a href='javascript:removelnk (\"#emailremovelnk\",\"input#email\",\"email\");' id='emailremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
+ $emailtext .= "<span class='smallworld_remove' id='emailremove'><a href='javascript:void(0);' id='emailremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
}
- $emailtext .= "<a class='smallworld_addemail' href='javascript:void();' id='emailAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
+ $emailtext .= "<a class='smallworld_addemail' href='javascript:void(0);' id='emailAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
$xoopsTpl->append('emailtext',$emailtext);
} else {
$xoopsTpl->assign('show_emails','no');
@@ -157,7 +157,7 @@
if ($cnt1 < $count1-1) {$addmore1 ="";} else {$addmore1 = _SMALLWORLD_ADDMORE;}
$screenname .= $item->dropdown_add('smallworld_add','screenname', 'screenname_type', '.smallworld_clone',$arr06,$addmore1,$selected=stripslashes($nr4[$k]),$preset=stripslashes($v));
$screenname .= "<span class='smallworld_remove' id='screennameremove'>";
- $screenname .= "<a href='javascript:removelnk (\"#screennameremovelnk\",\"span#screenname\",\"screenname\");' id='screennameremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
+ $screenname .= "<a href='javascript:void(0);' id='screennameremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
$cnt1++;
}
$screenname .= "<a class='smallworld_addscreenname' href='javascript:void(0);' id='screennameAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
@@ -269,7 +269,7 @@
$school .= $item->school_add ('smallworld_add3', 'school', 'school_type',
'.smallworld_clone3', $arr7, _SMALLWORLD_ADDMORE, $selected=stripslashes($nr6[$k]),$preset=$v, $selectedstart=date("Y",$nr7[$k]),$selectedstop=date("Y",$nr8[$k]));
$school .= "<span class='smallworld_remove2' id='schoolremove'>";
- $school .= "<a href='javascript:removelnk (\"#schoolremovelnk\",\"div#school\",\"school\");' id='schoolremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
+ $school .= "<a href='javascript:void(0);' id='schoolremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
}
$school .= "<a class='smallworld_addschool' href='javascript:void(0);' id='schoolAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
$xoopsTpl->append('school',$school);
@@ -289,7 +289,7 @@
$job .= $item->job('smallworld_add4', 'job', 'job_type', '.smallworld_clone4', _SMALLWORLD_ADDMORE, $employer=stripslashes($v), $position=stripslashes($nr10[$k]),
$selectedstart = ($nr11[$k] != '') ? date("Y",$nr11[$k]):'', $selectedstop=($nr12[$k] != '') ? date("Y",$nr12[$k]):'',$description=$nr13[$k]);
$job .= "<span class='smallworld_remove3' id='jobremove'>";
- $job .= "<a href='javascript:removelnk (\"#jobremovelnk\",\"div#job\",\"job\");' id='jobremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
+ $job .= "<a href='javascript:void(0);' id='jobremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
}
$job .= "<a class='smallworld_addjob' href='javascript:void(0);' id='jobAdd'>"._SMALLWORLD_ADDMORE."</a><br><br>";
$xoopsTpl->append('job',$job);
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-16 17:29:32 UTC (rev 11699)
@@ -417,6 +417,24 @@
}
}
+/**
+ * Get version number of xim if exists
+ * @return int $version
+ */
+function smallworld_XIMversion () {
+ global $xoopsDB;
+ $sql = "SELECT version FROM ".$xoopsDB->prefix('modules')." WHERE dirname = 'xim'";
+ $result = $xoopsDB->queryF($sql);
+ if ($result) {
+ while ($r = $xoopsDB->fetchArray($result)) {
+ $version = $r['version'];
+ }
+ } else {
+ $version = 0;
+ }
+ return $version;
+}
+
/*
* Input: Message Id,
* Return owner of thread (original poster)
@@ -1044,23 +1062,22 @@
// Set javascript vars but only if not already defined.
// Check prevents multible loads
- $script = "if (myID === undefined) {"."\n";
+ $script = "var Smallworld_myID;"."\n";
+ $script .= "if (typeof Smallworld_myID === 'undefined') {"."\n";
$script .= "var smallworld_url = '" . $xoops_url . "/modules/smallworld/" . "';\n";
$script .= "var smallworld_uploaddir = '" . $xoops_url . "/uploads/avatars/" . "';\n";
$script .= "var xoops_smallworld = jQuery.noConflict();\n";
- $script .= "var myID = " . $myid . ";\n";
- $script .= "var userHasProfile = " . $ChkProf . ";\n";
+ $script .= "var Smallworld_myID = " . $myid . ";\n";
+ $script .= "var Smallworld_userHasProfile = " . $ChkProf . ";\n";
$script .= "var smallworldTakeOverLinks = " . $takeoverlinks . ";\n";
- $script .= "var geocomplete = '';\n";
+ $script .= "var Smallworld_geocomplete = '';\n";
$script .= "var smallworldVerString = '" . $smallworldUV . "';\n";
$script .= "var smallworlduseverification = new Array();\n";
$script .= "smallworlduseverification = smallworldVerString.split(',');\n";
- $script .= "var hasmessages = " . $count_invit . ";\n";
+ $script .= "var Smallworld_hasmessages = " . $count_invit . ";\n";
$script .= "var smallworldvalidationstrenght = " . $validate . ";\n";
$script .= "var smallworld_getFriendsMsgComCount = " . $getUserMsgNum . ";\n";
//$script .= "var $ = jQuery();\n";
- $script .= "} else {"."\n";
- $script .= "\n";
$script .= "}"."\n";
$xoTheme->addScript('','',$script);
@@ -1184,7 +1201,22 @@
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
- break;
+ break;
+
+ case 'userprofile':
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/apprise-1.5.full.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/jquery.fileupload-ui.css');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.countdown.js');
+ $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ break;
}
}
Modified: XoopsModules/smallworld/trunk/smallworld/include/getSelects.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/getSelects.php 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/include/getSelects.php 2013-06-16 17:29:32 UTC (rev 11699)
@@ -35,5 +35,8 @@
$religion = $db->getVar($id,'religion');
header('Content-type: "application/json"');
echo "{\"relat\":\"$relat\", \"partner\":\"$partner\", \"gender\":\"$gender\", \"politic\":\"$politic\", \"religion\":\"$religion\"}";
- }
+ } else {
+ header('Content-type: "application/json"');
+ echo "{\"relat\":\"\", \"partner\":\"\", \"gender\":\"\", \"politic\":\"\", \"religion\":\"\"}";
+ }
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-06-16 17:29:32 UTC (rev 11699)
@@ -13,7 +13,7 @@
*/
xoops_smallworld(function() {
//Attach function for avatar
- attachAvatarOpen ();
+ Smallworld_attachAvatarOpen ();
// Get page url and page title (index.php)
var smallworld_pageUrl = window.location.pathname;
@@ -21,7 +21,7 @@
// GET pop for statistics
xoops_smallworld('#smallworld_statistics_lnk').on('click',function(e) {
- if (userHasProfile == 0) {
+ if (Smallworld_userHasProfile == 0) {
alert (SmallworldDialogNotUser);
return false;
}
@@ -46,15 +46,15 @@
// GET pop for recentactivities
xoops_smallworld('#smallworld_recentactivities').on('click',function(e) {
- if (userHasProfile == 0) {
+ if (Smallworld_userHasProfile == 0) {
alert (SmallworldDialogNotUser);
return false;
}
e.preventDefault();
- var uname = xoops_smallworld(this).attr('rel');
+ var Smallworld_uname = xoops_smallworld(this).attr('rel');
if (xoops_smallworld('#smallworld_recentactivities').length) { // implies *not* zero
xoops_smallworld('#smallworld_recentactivitiesDiv').show();
- xoops_smallworld("#smallworld_recentactivitiesDiv").load('recentactivities.php?username='+uname);
+ xoops_smallworld("#smallworld_recentactivitiesDiv").load('recentactivities.php?username='+Smallworld_uname);
xoops_smallworld.colorbox({
width:"35%",
height:"50%",
@@ -101,7 +101,7 @@
// Function to make friend invitations form into ui dialog
xoops_smallworld(function() {
xoops_smallworld('#friendInvitations_box').css('display','none');
- if (hasmessages > 0) {
+ if (Smallworld_hasmessages > 0) {
if (xoops_smallworld('#friendInvitations_box').length) { // implies *not* zero
xoops_smallworld('#friendInvitations_box').show();
xoops_smallworld.colorbox({
@@ -186,7 +186,7 @@
// If user does not have a profile in smallworld then goto register.
// If user has already a profile then goto edit profile dialog
- if (userHasProfile === 0) {
+ if (Smallworld_userHasProfile === 0) {
var buttons = {};
buttons[_smallworldContinueToReg] = function() {
location.href = smallworld_url+'register.php';
@@ -704,7 +704,7 @@
xoops_smallworld('#_smallworld_birthplace_map').hide();
},
onComplete:function() {
- initialize_birthplace(smallworld_birthlng,smallworld_birthlatt);
+ Smallworld_initialize_birthplace(smallworld_birthlng,smallworld_birthlatt);
xoops_smallworld('#_smallworld_birthplace_map').show();
},
title: function() {
@@ -730,7 +730,7 @@
xoops_smallworld('#_smallworld_present_map').hide();
},
onComplete:function(){
- initialize_currplace(smallworld_currlng,smallworld_currlatt);
+ Smallworld_initialize_currplace(smallworld_currlng,smallworld_currlatt);
xoops_smallworld('#_smallworld_present_map').show();
},
title: function() {
@@ -744,20 +744,20 @@
// Function to rewrite urls used in xoops core for directing to profile.php
- // Sets var uname = link text()
+ // Sets var Smallworld_uname = link text()
// removes /userinfo.php?uid=#
- // replaces with /modules/smallworld/userprofile.php?username=uname
+ // replaces with /modules/smallworld/userprofile.php?username=Smallworld_uname
// culex okt 2011
if (smallworldTakeOverLinks != 0) {
xoops_smallworld('a[href*="userinfo.php?"]').each(function() {
- var oldurl = xoops_smallworld(this).attr("href");
- var uname = xoops_smallworld(this).text();
- if (oldurl.match(/.*xoops.*/)) {
- return oldurl;
+ var Smallworld_oldurl = xoops_smallworld(this).attr("href");
+ var Smallworld_uname = xoops_smallworld(this).text();
+ if (Smallworld_oldurl.match(/.*xoops.*/)) {
+ return Smallworld_oldurl;
} else {
- var tempArray = xoops_smallworld(this).attr("href").split("/");
- var baseURL = tempArray[0];
- this.href = this.href.replace(oldurl, smallworld_url + "userprofile.php?username="+uname);
+ var Smallworld_tempArray = xoops_smallworld(this).attr("href").split("/");
+ var Smallworld_baseURL = Smallworld_tempArray[0];
+ this.href = this.href.replace(Smallworld_oldurl, smallworld_url + "userprofile.php?username="+Smallworld_uname);
}
});
}
@@ -785,7 +785,7 @@
var username = xoops_smallworld('span[name="' + id + '"]').attr('rel2');
xoops_smallworld('[name="' + id + '"]').toggle();
xoops_smallworld('span[name="' + id + '"]').bookmark({
- onSelect: customBookmark,
+ onSelect: Smallworld_customBookmark,
url:ref,
description:desc,
title:username
@@ -910,13 +910,13 @@
// Open custom boomark window
-function customBookmark(id, display, url) {
+function Smallworld_customBookmark(id, display, url) {
window.open(url, '_blank',
'width=600,height=400,menubar=no,toolbar=no,scrollbars=yes');
}
// Init birthplace_map
-function initialize_birthplace(smallworld_birthlng,smallworld_birthlatt) {
+function Smallworld_initialize_birthplace(smallworld_birthlng,smallworld_birthlatt) {
var birth_myLatlng = new google.maps.LatLng(smallworld_birthlatt, smallworld_birthlng);
var birth_myOptions = {
@@ -933,7 +933,7 @@
}
// Init currentcity_map
-function initialize_currplace(smallworld_currlng,smallworld_currlatt) {
+function Smallworld_initialize_currplace(smallworld_currlng,smallworld_currlatt) {
var currplace_myLatlng = new google.maps.LatLng(smallworld_currlatt, smallworld_currlng);
var currplace_myOptions = {
zoom: 8,
@@ -950,7 +950,7 @@
// Function to send invitation of friendship to userid
//get friends email ids and message to send invitation
-function inviteFriends(friendID,myuid) {
+function Smallworld_inviteFriends(friendID,myuid) {
xoops_smallworld('#resultMsg').hide();
var txtMsgModal = xoops_smallworld('#friendship').text().replace(/\t/g, '');
var frNa = xoops_smallworld('#smallworld_capname').text();
@@ -978,7 +978,7 @@
}
// function to follow / unfollow friends
-function FollowFriend(friendID,myuid) {
+function Smallworld_FollowFriend(friendID,myuid) {
xoops_smallworld('#resultMsgFollow').hide();
xoops_smallworld.ajax({
type: 'POST',
@@ -1030,7 +1030,7 @@
});
}
// function to Accept / deny friendships
-function AcceptDenyFriend(stat,friendID,myuid,targetID) {
+function Smallworld_AcceptDenyFriend(stat,friendID,myuid,targetID) {
xoops_smallworld.ajax({
type: 'POST',
url: smallworld_url+ 'friendinvite.php?' + Math.random(),
@@ -1190,7 +1190,7 @@
return false;
}
-function attachAvatarOpen () {
+function Smallworld_attachAvatarOpen () {
// Open comment and update avatar imagen in new window on click
xoops_smallworld(function() {
xoops_smallworld('.smallworld_big_face, .smallworld_small_face, .smallworldAttImg').css('cursor', 'pointer');
Modified: XoopsModules/smallworld/trunk/smallworld/js/wall.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/wall.js 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/js/wall.js 2013-06-16 17:29:32 UTC (rev 11699)
@@ -68,7 +68,7 @@
// commentopen
xoops_smallworld('body').on("click", '.smallworld_commentopen', function(e) {
e.preventDefault();
- if (userHasProfile == 0) {
+ if (Smallworld_userHasProfile == 0) {
alert (SmallworldDialogNotUser);
return false;
}
@@ -131,7 +131,7 @@
xoops_smallworld("body").on('click', '.smallworld_stcomment_vote',
function(e) {
e.preventDefault();
- if (userHasProfile == 0) {
+ if (Smallworld_userHasProfile == 0) {
alert (SmallworldDialogNotUser);
return false;
}
@@ -180,7 +180,7 @@
xoops_smallworld("body").on('click', '.smallworld_comment_complaint',
function(e) {
e.preventDefault();
- if (userHasProfile == 0) {
+ if (Smallworld_userHasProfile == 0) {
alert (SmallworldDialogNotUser);
return false;
}
Modified: XoopsModules/smallworld/trunk/smallworld/templates/getlastcom.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/getlastcom.html 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/templates/getlastcom.html 2013-06-16 17:29:32 UTC (rev 11699)
@@ -40,6 +40,6 @@
<script type="text/javascript">
xoops_smallworld(document).ready(function(){
smallworldCheckNumDivs();
- attachAvatarOpen();
+ Smallworld_attachAvatarOpen();
});
</script>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/templates/getlastmsg.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/getlastmsg.html 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/templates/getlastmsg.html 2013-06-16 17:29:32 UTC (rev 11699)
@@ -2,7 +2,7 @@
<script type="text/javascript">
xoops_smallworld(document).ready(function(){
smallworldCheckNumDivs();
- attachAvatarOpen();
+ Smallworld_attachAvatarOpen();
xoops_smallworld('#smallworld_stexpand<{$post.msg_id}>').oembed('<{$post.orimessage}>',{
maxWidth: "100%",
Modified: XoopsModules/smallworld/trunk/smallworld/templates/getmore.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/getmore.html 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/templates/getmore.html 2013-06-16 17:29:32 UTC (rev 11699)
@@ -121,7 +121,7 @@
<script type="text/javascript">
xoops_smallworld(document).ready(function(){
smallworldCheckNumDivs();
- attachAvatarOpen();
+ Smallworld_attachAvatarOpen();
SmallworldGetMoreMsg ();
});
</script>
Modified: XoopsModules/smallworld/trunk/smallworld/templates/getmorepublic.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/getmorepublic.html 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/templates/getmorepublic.html 2013-06-16 17:29:32 UTC (rev 11699)
@@ -89,7 +89,7 @@
<script type="text/javascript">
xoops_smallworld(document).ready(function(){
smallworldCheckNumDivs();
- attachAvatarOpen();
+ Smallworld_attachAvatarOpen();
SmallworldGetMoreMsg ();
});
</script>
Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html 2013-06-16 17:29:32 UTC (rev 11699)
@@ -94,11 +94,11 @@
<br/>
<{if $friendID != $myUid}>
<p class="smallworld_friendshipFollowersHolder">
- <a id="friendship" href="javascript:inviteFriends(<{$friendID}>,<{$myUid}>);">
+ <a id="friendship" href="javascript:Smallworld_inviteFriends(<{$friendID}>,<{$myUid}>);">
<{$friendship_text}>
</a>
<{if $isuserafriend == 'yes' || $friendID == $myUid || $isadminuser == 'YES'}>
- <a id="followfriend" href="javascript:FollowFriend(<{$friendID}>,<{$myUid}>);">
+ <a id="followfriend" href="javascript:Smallworld_FollowFriend(<{$friendID}>,<{$myUid}>);">
<{$followfriend_text}>
</a>
<{/if}>
Modified: XoopsModules/smallworld/trunk/smallworld/userprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-06-16 17:28:38 UTC (rev 11698)
+++ XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-06-16 17:29:32 UTC (rev 11699)
@@ -172,9 +172,15 @@
$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>";
- $menu_xim_js = "javascript:chatWith('".$id."','".$Xusername."')";
- $menu_ximme = "<a href='javascript:void(0);' onClick=".$menu_xim_js."><img height='10px' width='10px' src='".XOOPS_URL."/modules/smallworld/images/messenger.png'>"._SMALLWORLD_XIMUSER.$Xusername."</a>";
+ if (smallworld_XIMversion () > 102) {
+ $menu_xim_js = "javascript:xim_chatWith('".$id."','".$Xusername."')";
+ } else {
+ $menu_xim_js = "javascript:chatWith('".$id."','".$Xusername."')";
+ }
+
+ $menu_ximme = "<a href='javascript:void(0);' onClick=".$menu_xim_js."><img height='10px' width='10px' src='".XOOPS_URL."/modules/smallworld/images/messenger.png'>"._SMALLWORLD_XIMUSER.$Xusername."</a>";
+
// Check for folder xim to add messenger user to menu items
$hasxim = smallworld_checkForXim ();
if ($hasxim == true) {
@@ -213,24 +219,9 @@
$xoopsTpl->assign('bdaynow',$birthday_today_text);
$xoopsTpl->assign('isfollowing',$fl[0]);
$xoopsTpl->assign('flds',smallworld_GetModuleOption('smallworldusethesefields', $repmodule='smallworld'));
- } else {
+ } else {
redirect_header("index.php", 1, _SMALLWORLD_NOUSER_ERROR);
- }
-
- global $xoTheme;
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/apprise-1.5.full.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/jquery.fileupload-ui.css');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.oembed.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/wall.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ajaxupload.3.5.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.avatar_helper.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.elastic.source.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.countdown.js');
- $xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
-
+ }
//Check Language
$lang = $xoopsConfig['language'];
|
|
From: <dj...@us...> - 2013-06-17 17:20:46
|
Revision: 11712
http://sourceforge.net/p/xoops/svn/11712
Author: djculex
Date: 2013-06-17 17:20:44 +0000 (Mon, 17 Jun 2013)
Log Message:
-----------
Bugfix: Missing settings and colorbox in a few places
Bugfix: html tags breaks up changelog.txt (mamba)
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
Modified: XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-06-17 17:16:51 UTC (rev 11711)
+++ XoopsModules/smallworld/trunk/smallworld/docs/changelog.txt 2013-06-17 17:20:44 UTC (rev 11712)
@@ -32,7 +32,7 @@
Bugfix : Parsing links double
Bugfix : Removing nl2br (module.sanitizer already does this)
bugfix : Min xoops is 2.5.5 not 2.55
-Bugfix : Aparently function smallworld_xv_getGroupd (); needs to be defined. Solution include function file
+Bugfix : Aparently function smallworld_xv_getGroupd () needs to be defined. Solution include function file
@@ -210,7 +210,7 @@
- Bugfix: Merging a few css files into smallworld.css
- Bugfix: Correction language/danish/js/bookmark.js
- Bugfix: Calculating age in profile was (-1 year) when month == this month. Now only if day < this day
-- Bugfix: added some return false; or e.preventDefault; to js functions
+- Bugfix: added some return false or e.preventDefault to js functions
- Bugfix: After pressing 'more' - avatar size in comment is wrong
- Change: Preparing test for adding js / css to templates via function based on request page
@@ -263,9 +263,9 @@
- Bugfix: Added check for preloads javascript vars to see if vars is already defined (djculex)
- Bugfix: html_entity_decode is not set in returning image link or post from image uploads (djculex)
- Bugfix: Spelling error in english/main.php (tanks -> thanks) (djculex)
-- Bugfix: on close upload new images do (location.href = 'editimages.php';) instead of index.php
+- Bugfix: on close upload new images do (location.href = 'editimages.php') instead of index.php
- Bugfix: css url() pointing to wrong folder (djculex)
-- Bugfix: Removed empty <td></td>
+- Bugfix: Removed empty
- Bugfix: moved ui-anim_basic_16x16.gif to ..images/
- Change: Changed update text when upload new images to use image and default uploaded new text (djculex)
@@ -274,7 +274,7 @@
- Bugfix: Discovered jquery was 1.5.1 -> Updated to 1.7.1
- Bugfix: Jquery 1.7.1 revealed bugs in show more/less on updates (djculex)
- Bugfix: changed selector name .finish to .smallworld_finish
-- Bugfix: Changed multible return false; to e.preventDefault();
+- Bugfix: Changed multible return false to e.preventDefault()
- Changed: css, jquery for new addions
- Changed: claning up code etc
@@ -314,7 +314,7 @@
- change $modversion name due to name too long for mysql thus being cut short (djculex)
25. januar 2012
-- Implimenting colorbox instead of jquery dialog(); (djculex)
+- Implimenting colorbox instead of jquery dialog() (djculex)
- Correction in stats() function to show correct user avatar (djculex)
- Css adjustments (djculex)
- Re-attach validate to colorbox forms (djculex)
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-17 17:16:51 UTC (rev 11711)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-06-17 17:20:44 UTC (rev 11712)
@@ -1127,7 +1127,8 @@
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
$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');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
break;
case 'index':
@@ -1201,6 +1202,7 @@
$xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.bookmark.js');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/oembed.css');
$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/smallworld.css');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.colorbox.js');
break;
case 'userprofile':
Modified: XoopsModules/smallworld/trunk/smallworld/publicindex.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-06-17 17:16:51 UTC (rev 11711)
+++ XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-06-17 17:20:44 UTC (rev 11712)
@@ -67,6 +67,11 @@
} else {
$xoopsTpl->assign('isadminuser', 'NO');
}
+
+ // Create form for private settings
+ $form = new SmallWorldForm;
+ $usersettings = $form->usersettings ($id, $selected=null);
+ $xoopsTpl->assign('usersetting', $usersettings);
/* if (!$xoopsUser && $set['access']==1) {
*/
Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html 2013-06-17 17:16:51 UTC (rev 11711)
+++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html 2013-06-17 17:20:44 UTC (rev 11712)
@@ -248,6 +248,7 @@
<{/foreach}>
</table>
</div>
+ <{$usersetting}>
<div id="smallworldStatsDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div>
<{else}>
<div id="smallworld_notyetregistered" title="<{$smarty.const._SMALLWORLD_NOTYETREGISTERED_TITLE}>">
|
|
From: <dj...@us...> - 2013-06-19 16:48:24
|
Revision: 11723
http://sourceforge.net/p/xoops/svn/11723
Author: djculex
Date: 2013-06-19 16:48:22 +0000 (Wed, 19 Jun 2013)
Log Message:
-----------
NEW : Added a sync class to remove orphans in smallworld module when accessing admin/index
Bugfix: When deleting user remove also settings and complaints of user and against user
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/admin/index.php
XoopsModules/smallworld/trunk/smallworld/class/adminclass.php
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/preloads/core.php
Modified: XoopsModules/smallworld/trunk/smallworld/admin/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/admin/index.php 2013-06-19 16:47:58 UTC (rev 11722)
+++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2013-06-19 16:48:22 UTC (rev 11723)
@@ -33,6 +33,8 @@
$admin = new SmallworldAdmin();
+$d = new SmallWorldDoSync;
+$d->checkOrphans ();
// Find oldest message and apply to template
$dfm = $admin->oldestMsg();
Modified: XoopsModules/smallworld/trunk/smallworld/class/adminclass.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2013-06-19 16:47:58 UTC (rev 11722)
+++ XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2013-06-19 16:48:22 UTC (rev 11723)
@@ -456,4 +456,146 @@
return $text;
}
+}
+
+/*
+ * Does a sync to remove orphans from smallworld db
+ *
+ */
+
+class SmallWorldDoSync {
+ /**
+ * check for orphans (xoops_users <-> smallworld_users) and remove from smallworld
+ * @return void
+ */
+ function checkOrphans ()
+ {
+ global $xoopsDB;
+ $sql = "SELECT userid FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid NOT IN ( SELECT uid FROM ".$xoopsDB->prefix('users').")";
+ $result = $xoopsDB->queryF($sql);
+ if ($result) {
+ while ($r = $xoopsDB->fetchArray($result)) {
+ $this->deleteAccount($r['userid']);
+ }
+ }
+ }
+
+ /**
+ * deleteAccount function
+ * - Delete user account and associate rows across tables
+ * @param int $userid
+ * @return string
+ */
+ function deleteAccount($userid)
+ {
+ global $xoopsDB,$xoopsUser;
+ $user = new XoopsUser($userid);
+ $username = $user->uname();
+ $sql01 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_admin')." WHERE userid = '".$userid."'";
+ $sql02 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_comments')." WHERE uid_fk = '".$userid."'";
+ $sql03 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_followers')." WHERE me = '".$userid."' OR you = '".$userid."'";
+ $sql04 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_friends')." WHERE me = '".$userid."' OR you = '".$userid."'";
+ $sql05 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_images')." WHERE userid = '".$userid."'";
+ $sql06 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_messages')." WHERE uid_fk = '".$userid."'";
+ $sql07 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_user')." WHERE userid = '".$userid."'";
+ $sql08 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_vote')." WHERE user_id = '".$userid."'";
+ $sql09 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_complaints')." WHERE owner = '".$userid."' OR byuser_id = '".$userid."'";
+ $sql10 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_settings')." WHERE userid = '".$userid."'";
+
+ $result01 = $xoopsDB->queryF($sql01);
+ $result02 = $xoopsDB->queryF($sql02);
+ $result03 = $xoopsDB->queryF($sql03);
+ $result04 = $xoopsDB->queryF($sql04);
+ $result05 = $xoopsDB->queryF($sql05);
+ $result06 = $xoopsDB->queryF($sql06);
+ $result07 = $xoopsDB->queryF($sql07);
+ $result08 = $xoopsDB->queryF($sql08);
+ $result08 = $xoopsDB->queryF($sql09);
+ $result08 = $xoopsDB->queryF($sql10);
+ // Remove picture dir
+ $dirname = XOOPS_ROOT_PATH . '/uploads/albums_smallworld' . "/" . $userid . "/";
+ $this->smallworld_remDir ($userid, $dirname, $empty = false);
+ }
+
+ /**
+ * smallworld_remDir function
+ * - Remove user image dir in uploads.
+ * @param int $userid
+ * @param string $directory
+ * @param int $empty
+ * @return true
+ */
+ function smallworld_remDir ($userid, $directory, $empty = false)
+ {
+ if ($userid != '') {
+ if (substr($directory,-1) == "/") {
+ $directory = substr($directory, 0, -1);
+ }
+
+ if (!file_exists($directory) || !is_dir($directory)) {
+ return false;
+ } elseif (!is_readable($directory)) {
+ return false;
+ } else {
+ $directoryHandle = opendir($directory);
+ while ($contents = readdir($directoryHandle)) {
+ if ($contents != '.' && $contents != '..') {
+ $path = $directory . "/" . $contents;
+ if (is_dir($path)) {
+ $this->smallworld_remDir($userid, $path);
+ } else {
+ unlink($path);
+ }
+ }
+ }
+ closedir($directoryHandle);
+ if ($empty == false) {
+ if (!rmdir($directory)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+
+ /**
+ * SmallworldDeleteDirectory function
+ * - Delete images from users on delete
+ * @param int $userid
+ * @return true
+ */
+ function SmallworldDeleteDirectory($userid)
+ {
+ $dirname = XOOPS_ROOT_PATH.'/uploads/albums_smallworld'."/".$userid."/";
+ if (is_dir($dirname)) {
+ $dir_handle = opendir($dirname);
+ }
+ if (!$dir_handle) {
+ return false;
+ }
+ while($file = readdir($dir_handle)) {
+ if ($file != "." && $file != "..") {
+ if (!is_dir($dirname."/".$file)) {
+ unlink($dirname."/".$file);
+ }
+ else {
+ $this->SmallworldDeleteDirectory($dirname.'/'.$file);
+ }
+ }
+ }
+ closedir($dir_handle);
+ rmdir($dirname);
+ return true;
+ }
}
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-06-19 16:47:58 UTC (rev 11722)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-06-19 16:48:22 UTC (rev 11723)
@@ -560,6 +560,11 @@
. $xoopsDB->prefix('smallworld_user')." WHERE userid = '".$userid."'";
$sql08 = "DELETE FROM "
. $xoopsDB->prefix('smallworld_vote')." WHERE user_id = '".$userid."'";
+ $sql09 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_complaints')." WHERE owner = '".$userid."' OR byuser_id = '".$userid."'";
+ $sql10 = "DELETE FROM "
+ . $xoopsDB->prefix('smallworld_settings')." WHERE userid = '".$userid."'";
+
$result01 = $xoopsDB->queryF($sql01);
$result02 = $xoopsDB->queryF($sql02);
$result03 = $xoopsDB->queryF($sql03);
@@ -568,6 +573,8 @@
$result06 = $xoopsDB->queryF($sql06);
$result07 = $xoopsDB->queryF($sql07);
$result08 = $xoopsDB->queryF($sql08);
+ $result08 = $xoopsDB->queryF($sql09);
+ $result08 = $xoopsDB->queryF($sql10);
// Remove picture dir
$dirname = XOOPS_ROOT_PATH . '/uploads/albums_smallworld' . "/" . $userid . "/";
$this->smallworld_remDir ($userid, $dirname, $empty = false);
Modified: XoopsModules/smallworld/trunk/smallworld/preloads/core.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2013-06-19 16:47:58 UTC (rev 11722)
+++ XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2013-06-19 16:48:22 UTC (rev 11723)
@@ -27,7 +27,7 @@
function eventCoreHeaderAddmeta()
{
- global $xoTheme,$xoopsUser,$xoopsConfig;
+ global $xoTheme,$xoopsUser,$xoopsConfig;
//Load language if not defined
smallworld_isDefinedLanguage ('_SMALLWORLD_SYSERROR', 'main.php');
|
|
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)
+++ Xoops...
[truncated message content] |
|
From: <dj...@us...> - 2013-08-31 18:06:28
|
Revision: 11992
http://sourceforge.net/p/xoops/svn/11992
Author: djculex
Date: 2013-08-31 18:06:22 +0000 (Sat, 31 Aug 2013)
Log Message:
-----------
NEW: Choose weather to use google maps autocomplete or not
CHANGE: Clearify that only numbers can be used in telephone forms
BUG: Sending notifications mail to user weather set or unset.
BUG: User image not collected true in some cases
BUG: Array of users merged incorrect in xoops_version
BUG: Friendship check return incorrect in some places
BUG: Wrong array values used for checks in some places
BUG: In friendship invite missing privacy settings check
BUG: Public index missing correct avatar variables
BUG: friendship request function in smallworld.js rewritten to stay open if more requests are pending.
BUG: Return in history -1 after visiting user gallery, before returning to index.php
BUG: Fixing autocomplete hiding issue in chrome
BUG: Auto setting messages to private upon pageload.
BUG: Adding friend invitation box in friends.php
BUG: Various fixes, adjustments to html
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/class/user.php
XoopsModules/smallworld/trunk/smallworld/class/wall.php
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/friendinvite.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/language/english/main.php
XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php
XoopsModules/smallworld/trunk/smallworld/publicindex.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/xoops_version.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -422,6 +422,9 @@
." WHERE me = '".intval($userid)."' AND you = '".intval($friendid)."'";
$result = $xoopsDB->queryF($sql);
$result2 = $xoopsDB->queryF($sql2);
+
+ // Since friendship is canceled also following is deleted
+ $this->toogleFollow (1, $userid, $friendid);
}
}
Modified: XoopsModules/smallworld/trunk/smallworld/class/user.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -183,9 +183,15 @@
$msg[$start]['img'] = $Wall->Gravatar($row['me']);
$msg[$start]['friendimage'] = "<img src='".XOOPS_UPLOAD_URL."/".$msg[$start]['img']."' height='40px'/>";
$msg[$start]['frienddate'] = date('d-m-Y',$row['date']);
- $msg[$start]['accept'] = '<a id="smallworldrequestlink" href = "javascript:Smallworld_AcceptDenyFriend(1,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_ACCEPT.'</a>';
- $msg[$start]['deny'] = '<a id="smallworldrequestlink" href = "javascript:Smallworld_AcceptDenyFriend(-1,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_DENY.'</a>';
- $msg[$start]['later'] = '<a id="smallworldrequestlink" href = "javascript:Smallworld_AcceptDenyFriend(0,'.$row['me'].','.$row['you'].','.$start.');">'._SMALLWORLD_LATER.'</a>';
+ $msg[$start]['accept'] = '<a class="smallworldrequestlink" id = "smallworldfriendrequest_'.$msg[$start]['friendname'].
+ '" href = "javascript:Smallworld_AcceptDenyFriend(1,'.$row['me'].','.$row['you'].','.$start.');">'.
+ _SMALLWORLD_ACCEPT.'</a>';
+ $msg[$start]['deny'] = '<a class="smallworldrequestlink" id = "smallworldfriendrequest_'.$msg[$start]['friendname'].
+ '" href = "javascript:Smallworld_AcceptDenyFriend(-1,'.$row['me'].','.$row['you'].','.$start.');">'.
+ _SMALLWORLD_DENY.'</a>';
+ $msg[$start]['later'] = '<a class="smallworldrequestlink" id = "smallworldfriendrequest_'.$msg[$start]['friendname'].
+ '" href = "javascript:Smallworld_AcceptDenyFriend(0,'.$row['me'].','.$row['you'].','.$start.');">'.
+ _SMALLWORLD_LATER.'</a>';
$msg[$start]['cnt'] = $start;
$start++;
}
Modified: XoopsModules/smallworld/trunk/smallworld/class/wall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -140,6 +140,8 @@
$image = $r['userimage'];
}
+ $image = ($image == '') ? smallworld_getAvatarLink($uid, $image) : $image;
+
$type = Array(
1 => 'jpg',
2 => 'jpeg',
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -56,7 +56,7 @@
if($data) {
// Is comments's user a friend ?
- $frC = $check->friendcheck($id,$cdata['uid_fk']);
+ $frC = $check->friendcheck($id,$data['uid_fk']);
$USC = array();
$USC['posts'] = 0;
@@ -91,8 +91,8 @@
$wc['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wc['cface']);
$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['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['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".Smallworld_getOwnerFromComment($data['msg_id_fk']);
+ $wc['compl_msg_lnk'] .= "&updid=".$cdata['msg_id_fk']."#".$data['com_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
$wc['vote_up'] = $Wall->countVotesCom ('com', 'up', $data['msg_id_fk'],$data['com_id']);
$wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $data['msg_id_fk'],$data['com_id']);
@@ -114,7 +114,9 @@
foreach ($parts as $k=>$v) {
$owner = Smallworld_getOwnerFromComment ($data['msg_id_fk']);
if(smallworld_GetModuleOption('smallworldusemailnotis', $repmodule='smallworld') != 0) {
- $mail->sendMails ($data['uid_fk'], $v, 'commentToWM', $link=null, $wc);
+ if ($USC['notify'] == 1) {
+ $mail->sendMails ($data['uid_fk'], $v, 'commentToWM', $link=null, $wc);
+ }
}
}
}
Modified: XoopsModules/smallworld/trunk/smallworld/friendinvite.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/friendinvite.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/friendinvite.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -38,6 +38,7 @@
$myUid = $_POST['myUid'];
$friendName = $check->getName($friend);
$yourName = $check->getName($myUid);
+ $USC = json_decode($db->GetSettings($friend), true);
if ($invitation == '1') {
if ($friendProfile >= 2) {
@@ -46,7 +47,9 @@
if ($friendshipExists[0] == 0) {
$resultMsg = _SMALLWORLD_JSON_ADDFRIEND.$friendName._SMALLWORLD_JSON_REQUEST_PENDING;
if(smallworld_GetModuleOption('smallworldusemailnotis', $repmodule='smallworld') != 0) {
- $mail->sendMails ($friend, $friend, 'friendshipfollow', $link=null, array());
+ if ($USC['notify'] == 1) {
+ $mail->sendMails ($friend, $friend, 'friendshipfollow', $link=null, array());
+ }
}
$db->toogleFriendInvite ($friendshipExists, $friend, $myUid);
echo json_encode(array('error' => 'no', 'msg' => $resultMsg, 'msgChange' => _SMALLWORLD_JSON_CANCELFR_TEXT));
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -1001,7 +1001,7 @@
while ($r = $db->fetchArray($result)) {
$data[$r['userid']] = $r['username'];
}
- $ndata = array_merge(array(0 => _MI_SMALLWORLD_ALL), $data);
+ $ndata = array(0 => _MI_SMALLWORLD_ALL) + $data;
}
return $ndata;
}
@@ -1050,6 +1050,9 @@
$useverification = smallworld_GetModuleOption('smallworldmandatoryfields', $repmodule='smallworld');
$smallworldUV = implode(',', $useverification);
+ // Use googlemaps ?
+ $googlemaps = $moduleConfig['smallworldUseGoogleMaps'];
+
// Get users messages count based on users followerArray
$getUserMsgNum = ($xoopsUser) ? smallworld_getCountFriendMessagesEtc():0;
@@ -1070,7 +1073,7 @@
$script .= "var Smallworld_myID = " . $myid . ";\n";
$script .= "var Smallworld_userHasProfile = " . $ChkProf . ";\n";
$script .= "var smallworldTakeOverLinks = " . $takeoverlinks . ";\n";
- $script .= "var Smallworld_geocomplete = '';\n";
+ $script .= "var Smallworld_geocomplete = " . $googlemaps . ";\n";
$script .= "var smallworldVerString = '" . $smallworldUV . "';\n";
$script .= "var smallworlduseverification = new Array();\n";
$script .= "smallworlduseverification = smallworldVerString.split(',');\n";
@@ -1082,9 +1085,11 @@
$xoTheme->addScript('','',$script);
// Include geolocate styling
- $xoTheme->addScript("https://maps.googleapis.com/maps/api/js?sensor=false&language="._LANGCODE);
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete.js');
- $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete_now.js');
+ if ($googlemaps == 1) {
+ $xoTheme->addScript("https://maps.googleapis.com/maps/api/js?sensor=false&language="._LANGCODE);
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete.js');
+ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/ui.geo_autocomplete_now.js');
+ }
smallworld_includeScripts ();
Modified: XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-08-31 18:06:22 UTC (rev 11992)
@@ -115,9 +115,16 @@
href:"#friendInvitations_box"
});
};
- xoops_smallworld('#smallworldrequestlink').on('click',function() {
- xoops_smallworld('#friendInvitations_box').css('display','none');
- xoops_smallworld.colorbox.close();
+ xoops_smallworld('.smallworldrequestlink').on('click',function() {
+ var smallworld_request_id = xoops_smallworld(this).prop('id');
+ if (xoops_smallworld("tr[id^='smallworldfriendrequest_']").length === 0) {
+ xoops_smallworld('#friendInvitations_box').css('display','none');
+ } else {
+ xoops_smallworld('tr#'+smallworld_request_id).remove();
+ if (xoops_smallworld("tr[id^='smallworldfriendrequest_']").length === 0) {
+ xoops_smallworld.colorbox.close();
+ }
+ }
});
}
});
@@ -178,7 +185,8 @@
xoops_smallworld('div#page').hide();
},
onClosed:function() {
- location.href = 'index.php';
+ //location.href = window.location.pathname;
+ history.go(-1);
},
href:"div#page"
});
@@ -260,19 +268,20 @@
}
// Attach geolocate autocomplete to forms
- xoops_smallworld(document).ready(function(){
- if (xoops_smallworld("#birthplace").length > 0) {
- if( typeof xoops_smallworld('#birthplace').val() != "undefined" ) {
- xoops_smallworld('#birthplace').geo_autocomplete();
- }
- }
- if (xoops_smallworld("#present_city").length > 0){
- if ( typeof xoops_smallworld('#present_city').val() != "undefined" ) {
- xoops_smallworld('#present_city').geo_autocomplete_now();
+ if (Smallworld_geocomplete == 1) {
+ xoops_smallworld(document).ready(function(){
+ if (xoops_smallworld("#birthplace").length > 0) {
+ if( typeof xoops_smallworld('#birthplace').val() != "undefined" ) {
+ xoops_smallworld('#birthplace').geo_autocomplete();
+ }
}
- }
- });
-
+ if (xoops_smallworld("#present_city").length > 0){
+ if ( typeof xoops_smallworld('#present_city').val() != "undefined" ) {
+ xoops_smallworld('#present_city').geo_autocomplete_now();
+ }
+ }
+ });
+ }
// Make Textareas elastic
xoops_smallworld(function() {
@@ -413,7 +422,7 @@
// Search for user in smallworld users or test for new user
xoops_smallworld(function() {
- xoops_smallworld("#smallworld_searchform").focus().select();
+ //xoops_smallworld("#smallworld_searchform").focus().select();
xoops_smallworld("#smallworld_searchform").autocomplete({
source: smallworld_url+ 'search.php',
minLength:1,
@@ -463,7 +472,7 @@
// Keep public as default checked in Update field
xoops_smallworld(function(){
- xoops_smallworld("input[name=updatePublic] option[value='private']").attr('checked', false);
+ xoops_smallworld("input[name=updatePublic][value=1]").prop("checked", true);
});
@@ -708,6 +717,7 @@
xoops_smallworld('#_smallworld_birthplace_maplink').on('click',function(event){
event.preventDefault();
if (xoops_smallworld('#_smallworld_birthplace_map').length) { // implies *not* zero
+ if (Smallworld_geocomplete == 1) {
xoops_smallworld('#_smallworld_birthplace_map').show();
xoops_smallworld.colorbox({
innerWidth:"550px",
@@ -726,7 +736,7 @@
},
href:"#_smallworld_birthplace_map",
});
-
+ };
};
});
@@ -734,7 +744,8 @@
xoops_smallworld('#_smallworld_present_maplink').on('click',function(event){
event.preventDefault();
if (xoops_smallworld('#_smallworld_present_map').length) { // implies *not* zero
- xoops_smallworld('#_smallworld_present_map').show();
+ if (Smallworld_geocomplete == 1) {
+ xoops_smallworld('#_smallworld_present_map').show();
xoops_smallworld.colorbox({
innerWidth:"550px",
innerHeight:"550px",
@@ -752,6 +763,7 @@
},
href:"#_smallworld_present_map"
});
+ };
};
});
@@ -1081,6 +1093,7 @@
var text = smallworldDeletedMessages + diff;
xoops_smallworld('#smallworld_messagecounter_id').html(text);
xoops_smallworld('#smallworld_messagecounter_id').show();
+ //window.location.reload();
}
if (diff == 0) {
@@ -1092,6 +1105,7 @@
var text = smallworldNewMessages + diff;
xoops_smallworld('#smallworld_messagecounter_id').html(text);
xoops_smallworld('#smallworld_messagecounter_id').show();
+ //window.location.reload();
}
}
return false;
Modified: XoopsModules/smallworld/trunk/smallworld/language/english/main.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/language/english/main.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -45,8 +45,8 @@
define("_SMALLWORLD_EMAILS","Emails");
/*--------------- contact info -----------------*/
-define("_SMALLWORLD_MOBILEPHONE","Mobile phone");
-define("_SMALLWORLD_LANDPHONE","Land phone");
+define("_SMALLWORLD_MOBILEPHONE","Mobile phone (numbers only)");
+define("_SMALLWORLD_LANDPHONE","Land phone (numbers only)");
define("_SMALLWORLD_ADRESS","Street Adress");
define("_SMALLWORLD_CITY","City");
Modified: XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/language/english/modinfo.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -33,8 +33,8 @@
/* -------- Configs ---------- */
// Map apis
-define("_MI_SMALLWORLD_USEGOOGLE","Use google maps geolocation Api ?");
-define("_MI_SMALLWORLD_USEGOOGLE_DESC","Default is geonames database. Choose yes to use google maps");
+define("_MI_SMALLWORLD_USEGOOGLEMAPS","Use google maps geolocation Api ?");
+define("_MI_SMALLWORLD_USEGOOGLEMAPS_DESC","Default yes");
// Messages per page
define("_MI_SMALLWORLD_MSGTOSHOW","Messages to show ?");
Modified: XoopsModules/smallworld/trunk/smallworld/publicindex.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-08-31 18:06:22 UTC (rev 11992)
@@ -192,6 +192,9 @@
$xoopsTpl->assign('menu_home',$menu_home);
$xoopsTpl->assign('menu_register',$menu_register);
$xoopsTpl->assign('avatar', $user_img);
+ $xoopsTpl->assign('myavatar',$myavatar);
+ $xoopsTpl->assign('myavatarlink',$myavatarlink);
+ $xoopsTpl->assign('myavatar_highwide',$myavatar_highwide);
$xoopsTpl->assign('pagename','publicindex');
$xoopsTpl->assign('check',$profile);
$xoopsTpl->assign('access',$set['access']);
Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_friends_template.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_friends_template.html 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_friends_template.html 2013-08-31 18:06:22 UTC (rev 11992)
@@ -388,33 +388,25 @@
</div>
<div id="resultMsgFollow" title="<{$smarty.const._SMALLWORLD_FRIENDSHIPFOLLOW}> <{$username}>">
</div>
- <div id="friendInvitations_box" title="<{$smarty.const._SMALLWORLD_FRIENDSINVITATIONS}>">
- <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
- <{foreach item=post from=$friendinvitations}>
- <tr>
- <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
- <th></th>
- <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
- <th></th>
- <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
- <th></th>
- </tr>
-
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
-
- <tr id="<{$post.cnt}>">
- <td><{$post.friendname}></td>
- <td><{$post.friendimage}></td>
- <td><{$post.frienddate}></td>
- <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
- </tr>
- <{/foreach}>
- </table>
- </div>
+ <div id="friendInvitations_box" title="<{$smarty.const._SMALLWORLD_FRIENDSINVITATIONS}>">
+ <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
+ <tr>
+ <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
+ <th></th>
+ <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
+ <th></th>
+ <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
+ <th></th>
+ </tr>
+ <{foreach item=post from=$friendinvitations}>
+ <tr id="smallworldfriendrequest_<{$post.friendname}>">
+ <td><{$post.friendname}></td>
+ <td><{$post.friendimage}></td>
+ <td><{$post.frienddate}></td>
+ <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
+ </tr>
+ <{/foreach}>
+ </table>
+ </div>
<{$usersetting}>
<div id="smallworldStatsDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_index.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_index.html 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_index.html 2013-08-31 18:06:22 UTC (rev 11992)
@@ -183,7 +183,7 @@
<div class="smallworld_commentupdate" style="display:none" id="smallworld_commentbox<{$post.msg_id}>">
<div class="smallworld_stcommentimg">
- <img src="<{$myavatarlink}>" class='smallworld_small_face' <{$myavatar_highwide}>/>
+ <img src="<{$myavatarlink}>" class='smallworld_small_face' width="35px" height="35px"/>
</div>
<div class="smallworld_stcommenttext" >
<form method="post" action="">
@@ -211,33 +211,25 @@
</table>
</div>
<div id="friendInvitations_box" title="<{$smarty.const._SMALLWORLD_FRIENDSINVITATIONS}>">
- <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
- <{foreach item=post from=$friendinvitations}>
- <tr>
- <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
- <th></th>
- <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
- <th></th>
- <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
- <th></th>
- </tr>
-
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
-
- <tr id="<{$post.cnt}>">
- <td><{$post.friendname}></td>
- <td><{$post.friendimage}></td>
- <td><{$post.frienddate}></td>
- <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
- </tr>
- <{/foreach}>
- </table>
-</div>
+ <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
+ <tr>
+ <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
+ <th></th>
+ <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
+ <th></th>
+ <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
+ <th></th>
+ </tr>
+ <{foreach item=post from=$friendinvitations}>
+ <tr id="smallworldfriendrequest_<{$post.friendname}>">
+ <td><{$post.friendname}></td>
+ <td><{$post.friendimage}></td>
+ <td><{$post.frienddate}></td>
+ <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
+ </tr>
+ <{/foreach}>
+ </table>
+ </div>
<{$usersetting}>
<div id="smallworldStatsDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div>
<{else}>
Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html 2013-08-31 18:06:22 UTC (rev 11992)
@@ -191,9 +191,9 @@
<div class="smallworld_commentupdate" style="display:none" id="smallworld_commentbox<{$post.msg_id}>">
<div class="smallworld_stcommentimg">
<{if $xoopsUser}>
- <img src="<{$myavatarlink}>" class='smallworld_small_face' <{$myavatar_highwide}>/>
+ <img src="<{$myavatarlink}>" class='smallworld_small_face' width="35px" height="35px"/>
<{else}>
- <img src="<{$myavatarlink}>" class='smallworld_small_face' width="50px" height="50px"/>
+ <img src="<{$myavatarlink}>" class='smallworld_small_face' width="35px" height="35px"/>
<{/if}>
</div>
<div class="smallworld_stcommenttext" >
@@ -221,34 +221,7 @@
</tr>
</table>
</div>
- <div id="friendInvitations_box" title="<{$smarty.const._SMALLWORLD_FRIENDSINVITATIONS}>">
- <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
- <{foreach item=post from=$friendinvitations}>
- <tr>
- <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
- <th></th>
- <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
- <th></th>
- <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
- <th></th>
- </tr>
-
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
-
- <tr id="<{$post.cnt}>">
- <td><{$post.friendname}></td>
- <td><{$post.friendimage}></td>
- <td><{$post.frienddate}></td>
- <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
- </tr>
- <{/foreach}>
- </table>
- </div>
+
<{$usersetting}>
<div id="smallworldStatsDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div>
<{else}>
Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html 2013-08-29 20:58:50 UTC (rev 11991)
+++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html 2013-08-31 18:06:22 UTC (rev 11992)
@@ -620,33 +620,26 @@
</div>
<div id="resultMsgFollow" title="<{$smarty.const._SMALLWORLD_FRIENDSHIPFOLLOW}> <{$username}>">
</div>
- <div id="friendInvitations_box" title="<{$smarty.const._SMALLWORLD_FRIENDSINVITATIONS}>">
- <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
- <{foreach item=post from=$friendinvitations}>
- <tr>
- <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
- <th></th>
- <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
- <th></th>
- <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
- <th></th>
- </tr>
-
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
-
- <tr id="<{$post.cnt}>">
- <td><{$post.friendname}></td>
- <td><{$post.friendimage}></td>
- <td><{$post.frienddate}></td>
- <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
- </tr>
- <{/foreach}>
- </table>
- <{$usersetting}>
- <div id="smallworldStatsDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div>
- <div id="smallworld_recentactivitiesDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div>
\ No newline at end of file
+ <div id="friendInvitations_box" title="<{$smarty.const._SMALLWORLD_FRIENDSINVITATIONS}>">
+ <table border="0" class="smallworld_invitetable" cellspacing="0" cellpadding="0">
+ <tr>
+ <th><{$smarty.const._SMALLWORLD_REALNAME}></th>
+ <th></th>
+ <th><{$smarty.const._SMALLWORLD_DATERECIEVED}></th>
+ <th></th>
+ <th> <{$smarty.const._SMALLWORLD_ACTION}></th>
+ <th></th>
+ </tr>
+ <{foreach item=post from=$friendinvitations}>
+ <tr id="smallworldfriendrequest_<{$post.friendname}>">
+ <td><{$post.friendname}></td>
+ <td><{$post.friendimage}></td>
+ <td><{$post.frienddate}></td>
+ <td><{$post.accept}></td><td><{$post.deny}></td><td><{$post.later}></td>
+ </tr>
+ <{/foreach}>
+ </table>
+ </div>>
+ <{$user...
[truncated message content] |
|
From: <dj...@us...> - 2013-10-01 17:11:23
|
Revision: 12114
http://sourceforge.net/p/xoops/svn/12114
Author: djculex
Date: 2013-10-01 17:11:18 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
NEW : When entering admin automaticly rename user avatars set as blank.gif to void.
NEW : Parsing array from walls in respective classes clearing multible lines of code
NEW : smallworld_referer to return after various pages
NEW : Count all msg in wall
BUG : Mysql error in ALTER table comments from varchar to text
BUG : School start/stop displayed wrong.
BUG : User avatars displayed void if blank. No shows default gender / no-gender user avatar
BUG : User gallery opening in new tab / window. Now direct to _self instead of _SELF (?)
BUG : Error in smallworld_getAvatarLink($userid, $image); Condition changed from || to &&
BUG : comment_ajax. Condition changed from AND to OR if admin or owner of comment. Permission added to condition correctly.
BUG : In edit profile education start/stop displays correct data (date function not needed in this case).
BUG : In gallery only displays if visitor is a friend or admin.
BUG : Heavy code cleanup -> re-arranging to make use of classes / functions.
BUG : Only allow friends to view profile.
BUG : User posts not showing correctly to friends/followers OR admin.
BUG : jquery.history.js added to code to show hidden iframe in IE correctly.
BUG : After accepting friend request force reload of page to show new friend posts.
BUG : After closing gallery return to refer-page.
BUG : In smallworld.js -> tagging. If @ is followed by /s then close autocomplete indicating email or other. ((this).autocomplete( "close" );)
BUG : When tagging autocomplete is attached after single @ not @@@ (wow strange error)
BUG : Removed test alert() OR console.logs used for testing.
BUG : In friendpage show only gallery menu items for friends.
BUG : Show only wall container if num of messages > 0. [smarty error]
BUG : Rename selector (gave issue with TDMPicture) [mamba]
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php
XoopsModules/smallworld/trunk/smallworld/class/db.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/editprofile.php
XoopsModules/smallworld/trunk/smallworld/galleryshow.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/js/jquery.history.js
XoopsModules/smallworld/trunk/smallworld/js/smallworld.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/templates/smallworld_friends_template.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_galleryshow.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_publicindex.html
XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html
XoopsModules/smallworld/trunk/smallworld/userprofile.php
Modified: XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/admin/upgrade.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -8,6 +8,7 @@
global $xoopsDB, $xoopsUser;
varcharToBlog ();
smallworld_comToBlog ();
+ smallworld_adminAvatarRename ();
if (smallworld_DoTableExists($xoopsDB->prefix('smallworld_settings'))) {
// Table exists
Return false;
@@ -24,6 +25,14 @@
}
}
+function smallworld_adminAvatarRename () {
+ global $xoopsDB;
+ $sql = "update ".$xoopsDB->prefix('smallworld_admin')." set userimage = '' WHERE userimage = 'blank.gif' || userimage NOT REGEXP '\.(jpe?g|gif|png|bmp)'";
+ $sql2 = "update ".$xoopsDB->prefix('smallworld_user')." set userimage = '' WHERE userimage = 'blank.gif' || userimage NOT REGEXP '\.(jpe?g|gif|png|bmp)'";
+ $result = $xoopsDB->queryF($sql);
+ $result2 = $xoopsDB->queryF($sql2);
+}
+
function smallworld_DoTableExists($tablename) {
global $xoopsDB;
$result = $xoopsDB->queryF("SHOW TABLES LIKE '$tablename'");
@@ -46,7 +55,7 @@
*/
function smallworld_comToBlog () {
global $xoopsDB;
- $sql ="ALTER TABLE ".$xoopsDB->prefix('smallworld_comments')." CHANGE 'comments' 'comments' TEXT";
+ $sql ="ALTER TABLE ".$xoopsDB->prefix('smallworld_comments')." CHANGE comment comment TEXT";
$result = $xoopsDB->queryF($sql);
}
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -77,8 +77,8 @@
while ($start<=$end) {
$msg[$start]['school_type'] = $school_type[$start];
$msg[$start]['school'] = $arr7[$school[$start]];
- $msg[$start]['schoolstart'] = date('Y', $schoolstart[$start]);
- $msg[$start]['schoolstop'] = date('Y', $schoolstop[$start]);
+ $msg[$start]['schoolstart'] = $schoolstart[$start];
+ $msg[$start]['schoolstop'] = $schoolstop[$start];
$start++;
}
return $msg;
@@ -241,15 +241,14 @@
$aboutme = Smallworld_sanitize($_POST['aboutme']);
$school_type = Smallworld_sanitize(serialize($_POST['school_type']));
$school = Smallworld_sanitize(serialize($_POST['school']));
- $schoolstart = Smallworld_sanitize(serialize(Smallworld_DateOfArray ($_POST['schoolstart'])));
- $schoolstop = Smallworld_sanitize(serialize(Smallworld_DateOfArray ($_POST['schoolstop'])));
+ $schoolstart = Smallworld_sanitize(serialize($_POST['schoolstart']));
+ $schoolstop = Smallworld_sanitize(serialize($_POST['schoolstop']));
$jobemployer = Smallworld_sanitize(serialize($_POST['employer']));
$jobposition = Smallworld_sanitize(serialize($_POST['position']));
$jobstart = Smallworld_sanitize(serialize(Smallworld_YearOfArray ($_POST['jobstart'])));
$jobstop = Smallworld_sanitize(serialize(Smallworld_YearOfArray ($_POST['jobstop'])));
$jobdescription = Smallworld_sanitize(serialize($_POST['description']));
-
$sql = '';
if ($_POST['function']=='edit') {
Modified: XoopsModules/smallworld/trunk/smallworld/class/publicWall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/class/publicWall.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -151,6 +151,12 @@
$image = $r['userimage'];
}
+ if ($image == 'blank.gif') {
+ $image = smallworld_getAvatarLink($uid, $image);
+ }
+
+ //$image = ($image == '' || $image == 'blank.gif') ? smallworld_getAvatarLink($uid, $image) : $image;
+
$type = Array(
1 => 'jpg',
2 => 'jpeg',
@@ -345,6 +351,147 @@
}
return $text;
}
-
+
+ /**
+ * @Parse update and comments array to template for public updates
+ * @param array $updatesarray
+ * @param int $id
+ * @param string $permalink
+ * @return void
+ */
+ function ParsePubArray ($updatesarray, $id)
+ {
+ global $xoopsUser, $xoopsTpl, $tpl, $xoopsModule, $xoopsTpl, $xoopsConfig;
+
+ $check = new SmallWorldUser;
+ $dBase = new SmallWorldDB;
+ $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'));
+
+ $myavatar = $this->Gravatar($id);
+ $myavatarlink = smallworld_getAvatarLink($id, $myavatar);
+ $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."/>";
+
+ $xoopsTpl->assign('myavatar',$myavatar);
+ $xoopsTpl->assign('myavatarlink',$myavatarlink);
+ $xoopsTpl->assign('myavatar_highwide',$myavatar_highwide);
+ $xoopsTpl->assign('avatar', $user_img);
+
+ if (!empty($updatesarray)) {
+ foreach ($updatesarray as $data) {
+
+ // Is update's user a friend ?
+ $frU = $check->friendcheck($id,$data['uid_fk']);
+
+ $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;
+ $frU[0] = 2;
+ } 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'] = $this->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'] = $this->countVotes ('msg', 'up', $data['msg_id']);
+ $wm['vote_down'] = $this->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'] = $this->GetSharing ($wm['msg_id'],$wm['priv']);
+ } else {
+ $wm['sharelink'] = $this->GetSharing ($wm['msg_id'],1);
+ }
+
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharediv'] = $this->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ } else {
+ $wm['sharediv'] = $this->GetSharingDiv ($wm['msg_id'],1, $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['commentsarray'] = $this->Comments($data['msg_id']);
+
+ if ($frU[0] == 2 || $USW['posts'] == 1) {
+ $xoopsTpl->append('walldata', $wm);
+ }
+
+ if (!empty($wm['commentsarray'])){
+ foreach($wm['commentsarray'] as $cdata) {
+ // Is commentuser a friend ?
+ $frC = $check->friendcheck($id,$cdata['uid_fk']);
+
+ $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;
+ $frC[0] = 2;
+ } 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'] = $this->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'] = $this->Gravatar($cdata['uid_fk']);
+ $wc['avatar_link'] = smallworld_getAvatarLink ($cdata['uid_fk'], $wc['cface']);
+ $wc['vote_up'] = $this->countVotesCom ('com', 'up', $cdata['msg_id_fk'],$cdata['com_id']);
+ $wc['vote_down'] = $this->countVotesCom ('com', 'down', $cdata['msg_id_fk'],$cdata['com_id']);
+
+ if ($frC[0] == 2 || $USC['comments'] == 1) {
+ $xoopsTpl->append('comm', $wc);
+ }
+ }
+ }
+ }
+ }
+ }
}
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/class/wall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/class/wall.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -140,7 +140,7 @@
$image = $r['userimage'];
}
- $image = ($image == '') ? smallworld_getAvatarLink($uid, $image) : $image;
+ $image = ($image == '' || $image == 'blank.gif') ? smallworld_getAvatarLink($uid, $image) : $image;
$type = Array(
1 => 'jpg',
@@ -436,5 +436,144 @@
return $text;
}
+ /**
+ * @Parse update and comments array to template for public updates
+ * @param array $updatesarray
+ * @param int $id
+ * @param string $permalink
+ * @return void
+ */
+ function ParsePubArray ($updatesarray, $id)
+ {
+ global $xoopsUser, $xoopsTpl, $tpl, $xoopsModule, $xoopsConfig;
+
+ $check = new SmallWorldUser;
+ $dBase = new SmallWorldDB;
+ $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'));
+
+ $myavatar = $this->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);
+
+ $xoopsTpl->assign('myavatar',$myavatar);
+ $xoopsTpl->assign('myavatarlink',$myavatarlink);
+ $xoopsTpl->assign('myavatar_highwide',$myavatar_highwide);
+
+ if (!empty($updatesarray)) {
+ foreach ($updatesarray as $data) {
+
+ // Is update's user a friend ?
+ $frU = $check->friendcheck($id,$data['uid_fk']);
+
+ $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;
+ $frU[0] = 2;
+ } 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'] = $this->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'] = $this->countVotes ('msg', 'up', $data['msg_id']);
+ $wm['vote_down'] = $this->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'] = $this->GetSharing ($wm['msg_id'],$wm['priv']);
+ } else {
+ $wm['sharelink'] = $this->GetSharing ($wm['msg_id'],1);
+ }
+
+ if ($USW['posts'] == 1 || $profile >= 2) {
+ $wm['sharediv'] = $this->GetSharingDiv ($wm['msg_id'],$wm['priv'], $wm['sharelinkurl'],$wm['orimessage'],$wm['usernameTitle']);
+ } else {
+ $wm['sharediv'] = $this->GetSharingDiv ($wm['msg_id'],1, $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['commentsarray'] = $this->Comments($data['msg_id']);
+
+ if ($frU[0] == 2 || $USW['posts'] == 1) {
+ $xoopsTpl->append('walldata', $wm);
+ }
+
+ if (!empty($wm['commentsarray'])){
+ foreach($wm['commentsarray'] as $cdata) {
+ // Is commentuser a friend ?
+ $frC = $check->friendcheck($id,$cdata['uid_fk']);
+
+ $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;
+ $frC[0] = 2;
+ } 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'] = $this->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'] = $this->Gravatar($cdata['uid_fk']);
+ $wc['avatar_link'] = smallworld_getAvatarLink ($cdata['uid_fk'], $wc['cface']);
+ $wc['vote_up'] = $this->countVotesCom ('com', 'up', $cdata['msg_id_fk'],$cdata['com_id']);
+ $wc['vote_down'] = $this->countVotesCom ('com', 'down', $cdata['msg_id_fk'],$cdata['com_id']);
+
+ if ($frC[0] == 2 || $USC['comments'] == 1) {
+ $xoopsTpl->append('comm', $wc);
+ }
+ }
+ }
+ }
+ }
+ }
}
?>
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -64,9 +64,10 @@
if ($xoopsUser) {
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) || $data['uid_fk'] == $id) {
$USC['posts'] = 1;
$USC['comments'] = 1;
+ $frC[0] = 2;
} else {
$USC = json_decode($dBase->GetSettings($data['uid_fk']), true);
}
Modified: XoopsModules/smallworld/trunk/smallworld/css/smallworld.css
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/css/smallworld.css 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/css/smallworld.css 2013-10-01 17:11:18 UTC (rev 12114)
@@ -664,7 +664,7 @@
padding:3px;
}
-#display
+#smallworld_display
{
width:250px;
display:none;
Modified: XoopsModules/smallworld/trunk/smallworld/editprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/editprofile.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -267,7 +267,7 @@
$school = "";
foreach ($nr5 as $k => $v) {
$school .= $item->school_add ('smallworld_add3', 'school', 'school_type',
- '.smallworld_clone3', $arr7, _SMALLWORLD_ADDMORE, $selected=stripslashes($nr6[$k]),$preset=$v, $selectedstart=date("Y",$nr7[$k]),$selectedstop=date("Y",$nr8[$k]));
+ '.smallworld_clone3', $arr7, _SMALLWORLD_ADDMORE, $selected=stripslashes($nr6[$k]),$preset=$v, $selectedstart=$nr7[$k],$selectedstop=$nr8[$k]);
$school .= "<span class='smallworld_remove2' id='schoolremove'>";
$school .= "<a href='javascript:void(0);' id='schoolremovelnk'>"._SMALLWORLD_REMOVE."</a><br></span>";
}
Modified: XoopsModules/smallworld/trunk/smallworld/galleryshow.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -23,44 +23,52 @@
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;
+global $xoopsUser, $xoTheme, $xoopsLogger;
+$xoopsLogger->activated = false;
+
+ $admin = false;
- if ($xoopsUser) {
+ if ($xoopsUser) {
$id = $xoopsUser->getVar('uid');
$check = new SmallWorldUser;
$image = new SmallWorldImages;
+ $username = $_GET['username'];
+ $userID = smallworld_isset_or($_GET['username']); // Id of user wich profile you want to see
+ $userisfriend = $check->friendcheck($id,$userID);
- // Check if inspected userid -> redirect to userprofile and show admin countdown
+ if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+ $xoopsTpl->assign('isadminuser', 'YES');
+ $admin = true;
+ }
+
+ // Check if inspected userid -> redirect to userprofile and show admin countdown
$inspect = Smallworld_isInspected ($id);
if ($inspect['inspect'] == 'yes') {
- redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
+ redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1, _SMALLWORLD_INSPEC_usermsg);
}
$profile = $check->checkIfProfile($id);
- if ($profile >= 2) {
+ if ($profile >= 2 || $userisfriend[0] == 2 || $admin == true) {
$myusername = $xoopsUser->getVar('uname');
- if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
- $xoopsTpl->assign('isadminuser', 'YES');
- }
+
$user = new XoopsUser($id);
- $userID = smallworld_isset_or($_GET['username']); // Id of user wich profile you want to see
- $username = $_GET['username'];
$countimages = $image->count($userID);
- $userisfriend = $check->friendcheck($id,$userID);
//$gallery = $image->viewalbum ($id, $user=$xoopsUser->getVar('uid'));
$gallery = $image->viewalbum ($id, $userID);
$xoopsTpl->assign('countimages',$countimages);
- $xoopsTpl->assign('userisfriend',$userisfriend);
+ $xoopsTpl->assign('userisfriend',$userisfriend[0]);
$xoopsTpl->assign('gallery',$gallery);
$xoopsTpl->assign('closealbum',_SMALLWORLD_ALBUMTITLETEXT);
$xoopsTpl->assign('username',$username);
$xoopsTpl->assign('myusername',$myusername);
$xoopsTpl->assign('gallerytitleheader',_SMALLWORLD_TITLEHEADER);
$xoopsTpl->assign('check',1);
- } elseif ($profile == 0) {
+ } elseif ($profile == 0) {
$check->chkUser ();
- }
+ } else {
+ redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1, _NOPERM);
+ }
} else {
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
}
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-09-30 23:16:50 UTC (rev 12113)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-10-01 17:11:18 UTC (rev 12114)
@@ -240,15 +240,19 @@
$text = str_replace('UPLIMAGE', '', $text);
$text = preg_replace('/(((f|ht){1}tp:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=...
[truncated message content] |
|
From: <dj...@us...> - 2013-10-11 17:21:33
|
Revision: 12169
http://sourceforge.net/p/xoops/svn/12169
Author: djculex
Date: 2013-10-11 17:21:28 +0000 (Fri, 11 Oct 2013)
Log Message:
-----------
- Bugfix : Redirect and permission mayhem (Thanks Cesag)
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/user.php
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/message_ajax.php
XoopsModules/smallworld/trunk/smallworld/register.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/user.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-10-10 12:50:52 UTC (rev 12168)
+++ XoopsModules/smallworld/trunk/smallworld/class/user.php 2013-10-11 17:21:28 UTC (rev 12169)
@@ -229,7 +229,7 @@
return Smallworld_array_flatten($data,0);
}
} else {
- redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
+ //redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
}
}
}
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-10-10 12:50:52 UTC (rev 12168)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-10-11 17:21:28 UTC (rev 12169)
@@ -26,7 +26,7 @@
$xoopsLogger->activated = false;
$page = 'index';
$check = new SmallWorldUser;
-$id = $xoopsUser->getVar('uid');
+$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
if ($profile >= 2) {
Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-10-10 12:50:52 UTC (rev 12168)
+++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-10-11 17:21:28 UTC (rev 12169)
@@ -27,7 +27,7 @@
$xoopsLogger->activated = false;
//error_reporting(E_ALL);
$page = 'index';
-$id = $xoopsUser->getVar('uid');
+$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
$check = new SmallWorldUser;
$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
Modified: XoopsModules/smallworld/trunk/smallworld/register.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/register.php 2013-10-10 12:50:52 UTC (rev 12168)
+++ XoopsModules/smallworld/trunk/smallworld/register.php 2013-10-11 17:21:28 UTC (rev 12169)
@@ -289,7 +289,7 @@
}
} else {
- redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
+ redirect_header(XOOPS_URL . "/register.php", 1, _NOPERM);
}
include(XOOPS_ROOT_PATH."/footer.php");
?>
\ No newline at end of file
|
|
From: <dj...@us...> - 2013-10-15 17:41:46
|
Revision: 12175
http://sourceforge.net/p/xoops/svn/12175
Author: djculex
Date: 2013-10-15 17:41:43 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
Bugfix : - Fixed problem with following issue when unfriending
Bugfix : - Multible issues with not displaying genderbased avatar if not uploaded.
Bugfix : - Sending notifications on replys to a thread where user is active, new registry, complaints etc
Bugfix : - Error with partnersearch or username search.
Bugfix : - Fixing a few IE special issues (Just gotta love IE :o[ )
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/class/mail.php
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
XoopsModules/smallworld/trunk/smallworld/search.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-10-14 18:48:40 UTC (rev 12174)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2013-10-15 17:41:43 UTC (rev 12175)
@@ -447,7 +447,9 @@
if ($following > 0) {
$sql = "DELETE FROM ".$xoopsDB->prefix('smallworld_followers')." WHERE you = '".intval($friend)."'";
$sql .= " AND me = '".intval($myUid)."'";
- $result = $xoopsDB->queryF($sql);
+ $sql2 = "DELETE FROM ".$xoopsDB->prefix('smallworld_followers')." WHERE me = '".intval($friend)."'";
+ $sql2 .= " AND you = '".intval($myUid)."'";
+ $result2 = $xoopsDB->queryF($sql2);
}
}
@@ -685,7 +687,7 @@
{
global $xoopsDB;
$sql = "SELECT value FROM ".$xoopsDB->prefix('smallworld_settings')." WHERE userid = ".intval($userid)."";
- $result = $xoopsDB->query($sql);
+ $result = $xoopsDB->queryF($sql);
$i = $xoopsDB->getRowsNum($result);
if ($i < 1) {
$posts = serialize(array(
@@ -700,8 +702,9 @@
while ($row=$xoopsDB->fetchArray($result)) {
$data = $row['value'];
}
+ return json_encode(unserialize(stripslashes($data)));
}
- return json_encode(unserialize(stripslashes($data)));
+
}
}
Modified: XoopsModules/smallworld/trunk/smallworld/class/mail.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/mail.php 2013-10-14 18:48:40 UTC (rev 12174)
+++ XoopsModules/smallworld/trunk/smallworld/class/mail.php 2013-10-15 17:41:43 UTC (rev 12175)
@@ -35,7 +35,7 @@
*/
function sendMails ($fromUserID, $toUserID, $event, $link=null, array $data) {
- global $xoopsConfig, $xoopsUser;
+ global $xoopsConfig, $xoopsUser;
$date = date('m-d-Y H:i:s',time());
$mail = new XoopsMultiMailer;
$wall = new Wall_Updates;
@@ -45,12 +45,11 @@
// From and To user ids
$FromUser = new xoopsUser($fromUserID);
$from_avatar = $wall->Gravatar($fromUserID);
- $from_avatarlink = "<img class='left' src='".XOOPS_URL."/uploads/".$from_avatar."' height='90px' width='90px'>";
+ $from_avatarlink = "<img class='left' src='".smallworld_getAvatarLink($fromUserID, $from_avatar)."' height='90px' width='90px'>";
$ToUser = new xoopsUser($toUserID);
$To_avatar = $wall->Gravatar($toUserID);
- $To_avatarlink = "<img class='left' src='".XOOPS_URL."/uploads/".$To_avatar."' height='90px' width='90px'>";
-
+ $To_avatarlink = "<img class='left' src='".smallworld_getAvatarLink ($toUserID, $To_avatar)."' height='90px' width='90px'>";
// Senders username
$SendName = $FromUser->getVar('uname');
$SendNameUrl = "<a href='".XOOPS_URL."/modules/smallworld/userprofile.php?username=".$SendName."'>".$SendName."</a>";
@@ -64,7 +63,7 @@
$subject = _SMALLWORLD_MAIL_REGISTERSUBJECT.$xoopsConfig['sitename'];
$registername = $SendName;
- $To_avatarlink = "<img class='left' src='".XOOPS_URL."/modules/smallworld/images/genderless.png' height='90px' width='90px'>";
+ $To_avatarlink = "<img class='left' src='".smallworld_getAvatarLink ($fromUserID, $To_avatar)."' height='90px' width='90px'>";
$tpl = new XoopsTpl();
$tpl->assign('registername',$registername);
@@ -112,7 +111,7 @@
$owner = Smallworld_getOwnerFromComment ($data['msg_id_fk']);
$OwnerUser = new xoopsUser($owner);
$Owner_avatar = $wall->Gravatar($owner);
- $Owner_avatarlink = "<img class='left' src='".XOOPS_URL."/uploads/".$Owner_avatar."' height='90px' width='90px'>";
+ $Owner_avatarlink = "<img class='left' src='".smallworld_getAvatarLink ($owner, $Owner_avatar)."' height='90px' width='90px'>";
$OwnerName = $OwnerUser->getVar('uname');
$OwnerNameUrl = "<a href='".XOOPS_URL."/modules/smallworld/userprofile.php?username=".$OwnerName."'>".$OwnerName."</a>";
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-10-14 18:48:40 UTC (rev 12174)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-10-15 17:41:43 UTC (rev 12175)
@@ -24,6 +24,7 @@
include_once (XOOPS_ROOT_PATH.'/class/template.php');
global $xoopsUser, $xoopsModule,$xoopsLogger,$xoopsTpl;
$xoopsLogger->activated = false;
+//error_reporting(E_ALL);
$page = 'index';
$check = new SmallWorldUser;
$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
@@ -61,6 +62,7 @@
$USC = array();
$USC['posts'] = 0;
$USC['comments'] = 0;
+ //$USC['notify'] = 0;
if ($xoopsUser) {
@@ -93,10 +95,10 @@
$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['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".Smallworld_getOwnerFromComment($data['msg_id_fk']);
- $wc['compl_msg_lnk'] .= "&updid=".$cdata['msg_id_fk']."#".$data['com_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
+ $wc['compl_msg_lnk'] .= "&updid=".$data['msg_id_fk']."#".$data['com_id']."'>"._SMALLWORLD_COMP_MSG_LNK_DESC."</a>";
$wc['vote_up'] = $Wall->countVotesCom ('com', 'up', $data['msg_id_fk'],$data['com_id']);
$wc['vote_down'] = $Wall->countVotesCom ('com', 'down', $data['msg_id_fk'],$data['com_id']);
-
+
//Send mail if tagged
$permalink = XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".$data['uid_fk']."&updid=".$data['msg_id_fk'];
smallworld_getTagUsers ($wc['comment'],$wc['uid'], $permalink);
@@ -112,10 +114,12 @@
// send mail to user owning update + participans in the thread that a comment has been posted
$parts = $mail->getPartsFromComment ($data['msg_id_fk']);
$emails = "";
- foreach ($parts as $k=>$v) {
+ foreach ($parts as $k => $v) {
$owner = Smallworld_getOwnerFromComment ($data['msg_id_fk']);
+ // Get owner of posts settings in order to send mail or not!
+ $owner_privset = json_decode($dBase->GetSettings($v), true);
if(smallworld_GetModuleOption('smallworldusemailnotis', $repmodule='smallworld') != 0) {
- if ($USC['notify'] == 1) {
+ if ($owner_privset['notify'] == 1) {
$mail->sendMails ($data['uid_fk'], $v, 'commentToWM', $link=null, $wc);
}
}
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-10-14 18:48:40 UTC (rev 12174)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-10-15 17:41:43 UTC (rev 12175)
@@ -569,9 +569,20 @@
while ($r = $xoopsDB->fetchArray($result)) {
$image = $r['userimage'];
}
- if ($image == 'Not specifiyed' || $image == '') {
- $avt = new XoopsUser($uid);
- $avatar = $avt->user_avatar();
+
+ $image = ($image == '' || $image == 'blank.gif') ? smallworld_getAvatarLink($uid, $image) : $image;
+
+ $type = Array(
+ 1 => 'jpg',
+ 2 => 'jpeg',
+ 3 => 'png',
+ 4 => 'gif'
+ );
+
+ $ext = explode(".",$image);
+
+ if (@!in_array(strtolower ($ext[1]), $type) || $image == '') {
+ $avatar = '';
} else {
$avatar = $image;
}
Modified: XoopsModules/smallworld/trunk/smallworld/js/smallworld.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-10-14 18:48:40 UTC (rev 12174)
+++ XoopsModules/smallworld/trunk/smallworld/js/smallworld.js 2013-10-15 17:41:43 UTC (rev 12175)
@@ -243,7 +243,7 @@
changeMonth: true,
changeYear: true,
dateFormat: 'yy',
- yearRange: '-100:+0',
+ yearRange: '-100:+0'
});
// Attach jquery-ui datepicker to form.
@@ -332,56 +332,56 @@
}
function extractLast(term) {
- return split( term ).pop();
+ return split( term ).pop();
}
// Attach '@' to comment and message for user tagging
xoops_smallworld(document).ready(function() {
xoops_smallworld("#smallworld_update, .smallworld_comment").bind("keydown", function(event) {
- // if TAB or autocomplete already is active
- if (event.keyCode === 9 && xoops_smallworld(this).data("autocomplete").menu.active) {
- event.preventDefault();
- }
- // if @ is pressed
+ // if TAB or autocomplete already is active
+ if (event.keyCode === 9 && xoops_smallworld(this).data("autocomplete").menu.active) {
+ event.preventDefault();
+ }
+ // if @ is pressed
if (event.keyCode === 50) {
xoops_smallworld(this).autocomplete({
disabled: false,
minLength: 1,
source : function (request, response) {
- xoops_smallworld.ajax({
- // basePath is used for defining contecxt-path of the url.
- url: smallworld_url+ 'partnersearch.php',
- dataType: "json",
- // data to be sent to the server:
- data: {
- term : extractLast(request.term)
- },
- success: function(data,type) {
- //console.log( data);
- items = data;
- response(items);
- },
- error: function(data,type){
- console.log( type);
- }
+ xoops_smallworld.ajax({
+ // basePath is used for defining contecxt-path of the url.
+ url: smallworld_url+ 'search.php',
+ dataType: "json",
+ // data to be sent to the server:
+ data: {
+ term : extractLast(request.term)
+ },
+ success: function(data,type) {
+ //console.log( data);
+ items = data;
+ response(items);
+ },
+ error: function(data,type){
+ console.log( type);
+ }
});
- },
+ },
focus: function() {
return false;
- },
+ },
open: function(event, ui){
- xoops_smallworld("ul.ui-autocomplete li a").each(function(){
- var htmlString = xoops_smallworld(this).html().replace(/</g, '<');
- htmlString = htmlString.replace(/>/g, '>');
- xoops_smallworld(this).html(htmlString);
- xoops_smallworld('.ui-autocomplete.ui-menu').width(200);
- });
+ xoops_smallworld("ul.ui-autocomplete li a").each(function(){
+ var htmlString = xoops_smallworld(this).html().replace(/</g, '<');
+ htmlString = htmlString.replace(/>/g, '>');
+ xoops_smallworld(this).html(htmlString);
+ xoops_smallworld('.ui-autocomplete.ui-menu').width(200);
+ });
},
select: function(event, ui) {
var terms = split_(this.value);
terms.pop();
//Add @ to username
- ui.item.value = "@" + ui.item.value;
+ ui.item.value = "@" + ui.item.value;
terms.push(ui.item.value);
terms.push("");
// Join last username with @
@@ -393,16 +393,16 @@
}
});
} else {
- xoops_smallworld(this).autocomplete({ disabled: true });
- xoops_smallworld(this).autocomplete( "close" );
- }
+ xoops_smallworld(this).autocomplete({ disabled: true });
+ xoops_smallworld(this).autocomplete( "close" );
+ }
});
-});
+});
// Search for partner in smallworld users or accept username
xoops_smallworld(function() {
xoops_smallworld("#partner").autocomplete({
- source: smallworld_url+ 'partnersearch.php',
+ source: smallworld_url+ 'search.php',
minLength:1,
open: function(event, ui){
xoops_smallworld("ul.ui-autocomplete li a").each(function(){
@@ -411,6 +411,9 @@
xoops_smallworld(this).html(htmlString);
xoops_smallworld('.ui-autocomplete.ui-menu').width(200);
});
+ },
+ select: function(event, ui) {
+ xoops_smallworld("input#partner").val(ui.item.value);
}
});
});
Modified: XoopsModules/smallworld/trunk/smallworld/search.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/search.php 2013-10-14 18:48:40 UTC (rev 12174)
+++ XoopsModules/smallworld/trunk/smallworld/search.php 2013-10-15 17:41:43 UTC (rev 12175)
@@ -38,18 +38,8 @@
$imageLink = XOOPS_URL.'/uploads/'.trim($row['userimage']);
$imageSize = smallworld_getImageSize(30, 30, $imageLink);
$imageHw = smallworld_imageResize($imageSize[0], $imageSize[1], 30);
- $image = '<img src="'.XOOPS_URL.'/uploads/'.$row['userimage'].'" '.$imageHw.'/>';
- } else {
- if ($row['gender'] == 1) {
- $image = "<img src='".XOOPS_URL."/modules/smallworld/images/ano_woman.png'"." height='30px' width='30px'/>";
- }
- if ($row['gender'] == 2) {
- $image = "<img src='".XOOPS_URL."/modules/smallworld/images/ano_man.png'"." height='30px' width='30px'/>";
- }
- if ($row['gender'] == 0) {
- $image = "<img src='".XOOPS_URL."/modules/smallworld/images/genderless.png'"." height='30px' width='30px'/>";
- }
- }
+ $image = '<img src="'.smallworld_getAvatarLink ($row['userid'], $row['userimage']).'" height="20" />';
+ }
$imageHw = smallworld_imageResize($imageSize[0], $imageSize[1], 30);
$data[] = array(
|