|
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 {
+ $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 = ($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 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');
+ }
+ } elseif ($profile < 2) {
+ redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
+ }
} else {
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
}
Modified: XoopsModules/smallworld/trunk/smallworld/friendinvite.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/friendinvite.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/friendinvite.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -40,7 +40,7 @@
$yourName = $check->getName($myUid);
if ($invitation == '1') {
- if ($friendProfile > 0) {
+ if ($friendProfile >= 2) {
$friendshipExists = $check->friendcheck($myUid,$friend);
if ($friendshipExists[0] == 0) {
@@ -67,7 +67,7 @@
}
}
if ($invitation == '2') {
- if ($friendProfile > 0) {
+ if ($friendProfile >= 2) {
// Used for followers
$following = $check->following_or ($myUid, $friend);
@@ -85,7 +85,7 @@
}
}
if ($invitation == '3') {
- if ($friendProfile > 0) {
+ if ($friendProfile >= 2) {
// Used for accept/deny friendship requests
if ($stat > 0) {
// Friendship is accepted (update status in mysql)
Modified: XoopsModules/smallworld/trunk/smallworld/friends.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/friends.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/friends.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -41,7 +41,7 @@
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
- if ($profile > 0) {
+ if ($profile >= 2) {
$user = new SmallWorldProfile;
$user->ShowUser($id);
$username = $xoopsUser->getVar('uname'); //Myusername
@@ -192,7 +192,7 @@
$xoopsTpl->assign('menu_profile',$menu_profile);
$xoopsTpl->assign('menu_friends',$menu_friends);
$xoopsTpl->assign('menu_gallery',$menu_gallery);
- $xoopsTpl->assign('check',1);
+ $xoopsTpl->assign('check',$profile);
$xoopsTpl->assign('friendID',$id);
$xoopsTpl->assign('myUid',$yourid);
$xoopsTpl->assign('friendship_text',$friendship_text);
@@ -216,7 +216,7 @@
$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');
+ //$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-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -46,7 +46,7 @@
}
$profile = $check->checkIfProfile($id);
- if ($profile > 0) {
+ if ($profile >= 2) {
$myusername = $xoopsUser->getVar('uname');
if ( $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$xoopsTpl->assign('isadminuser', 'YES');
Modified: XoopsModules/smallworld/trunk/smallworld/img_upload.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/img_upload.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/img_upload.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -45,13 +45,13 @@
$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');
+ //$xoTheme->addStylesheet(XOOPS_URL.'/modules/smallworld/css/colorbox.css');
$id = $xoopsUser->getVar('uid');
$check = new SmallWorldUser;
$profile = $check->CheckIfProfile($id);
- if ($profile > 0) {
- $xoopsTpl->assign('check',1);
+ if ($profile >= 2) {
+ $xoopsTpl->assign('check',$profile);
$item = new SmallWorldForm;
$db = new SmallWorldDB;
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2013-05-22 13:25:30 UTC (rev 11576)
@@ -34,9 +34,7 @@
redirect_header(XOOPS_URL . "/user.php", 5, _NOPERM);
}
include_once(XOOPS_ROOT_PATH."/header.php");
- $xoopsLogger->activated = false;
- /* error_reporting(E_ALL); */
- if ($xoopsUser || $set['access'] == 1) {
+ if ($set['access'] == 1) {
$id = ($xoopsUser) ? $xoopsUser->getVar('uid'):0;
$user = new XoopsUser($id);
$dBase = new SmallWorldDB;
@@ -66,7 +64,7 @@
$check = new SmallWorldUser;
$profile = ($xoopsUser) ? $check->checkIfProfile($id) : 0;
- if ($profile > 0) {
+ if ($profile >= 2) {
$xuser = new SmallWorldProfile;
$xuser->ShowUser($id);
$menu_startpage = "<a href='".XOOPS_URL."/modules/smallworld/publicindex.php'><img id='menuimg' src='".XOOPS_URL."/modules/smallworld/images/highrise.png'>"._SMALLWORLD_STARTPAGE."</a>";
@@ -74,11 +72,11 @@
$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>";
- }
+ }
// Things to do with wall
- $Wall = ($profile > 0) ? new Wall_Updates() : new Public_Wall_Updates;
- if (!$xoopsUser && $set['access'] == 1) {
+ $Wall = ($profile >= 2) ? new Wall_Updates() : new Public_Wall_Updates;
+ if ($profile < 2 && $set['access'] == 1) {
$pub = smallworld_checkUserPubPostPerm ();
$updatesarray = $Wall->updates(0, $pub);
} else {
@@ -94,8 +92,6 @@
//Get friends invitations
$getInvitations = ($xoopsUser) ? $check->getRequests ($id) : 0;
- //Srinivas Tamada http://9lessons.info
- //Loading Comments link with load_updates.php
if (!empty($updatesarray)) {
foreach ($updatesarray as $data) {
@@ -105,7 +101,7 @@
if ($xoopsUser) {
- if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) && $data['uid_fk'] == $id) {
+ if ($xoopsUser->isAdmin($xoopsModule->getVar('mid')) || $data['uid_fk'] == $id) {
$USW['posts'] = 1;
$USW['comments'] = 1;
} else {
@@ -120,7 +116,6 @@
$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'] = 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'];
@@ -187,7 +182,7 @@
}
}
- if ($profile > 0) {
+ if ($profile >= 2) {
$xoopsTpl->assign('menu_startpage',$menu_startpage);
$xoopsTpl->assign('menu_home',$menu_home);
$xoopsTpl->assign('menu_profile',$menu_profile);
@@ -196,7 +191,7 @@
}
$xoopsTpl->assign('myusername',$username);
$xoopsTpl->assign('pagename','index');
- $xoopsTpl->assign('check',1);
+ $xoopsTpl->assign('check',$profile);
$xoopsTpl->assign('myavatar',$myavatar);
$xoopsTpl->assign('myavatarlink',$myavatarlink);
$xoopsTpl->assign('myavatar_highwide',$myavatar_highwide);
@@ -212,13 +207,16 @@
$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->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 ($profile <= 0 && $set['access'] == 0) {
+ }
+ if ($profile == 1 && $set['access'] == 0) {
redirect_header(XOOPS_URL . "/modules/smallworld/register.php");
- } else {
+ }
+
+ if ($profile == 0 && $set['access'] == 0) {
redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
}
Deleted: XoopsModules/smallworld/trunk/smallworld/js/geoname.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/geoname.js 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/js/geoname.js 2013-05-22 13:25:30 UTC (rev 11576)
@@ -1,58 +0,0 @@
- // AutoSugguest for city / country in forms using geonames
- xoops_smallworld(function() {
- var img;
- xoops_smallworld( "#birthplace" ).autocomplete({
- source: function( request, response ) {
- xoops_smallworld.ajax({
- url: "http://ws.geonames.org/searchJSON",
- dataType: "jsonp",
- data: {
- featureClass: "P",
- style: "full",
- maxRows: 10,
- name_startsWith: request.term,
- },
- success: function( data ) {
- response( xoops_smallworld.map( data.geonames, function( item ) {
- countryname = item.countryCode.toLowerCase();
- img = "<img src='"+smallworld_url+"images/flags/" + countryname + ".gif'>";
- var lng = item.lng;
- var lat = item.lat;
- return {
- label: img+" "+item.name + " / " + item.countryName,
- value: item.name,
- source: item
- }
- }));
- }
- });
- },
- minLength: 2,
- select: function(event, ui ) {
- if (ui.item) {
- xoops_smallworld("input[name=birthplace_lat]").val( ui.item.source.lat );
- xoops_smallworld("input[name=birthplace_lng]").val( ui.item.source.lng );
- var flag = ui.item.source.countryCode.toLowerCase();
- xoops_smallworld("#flag").html("<img src='"+smallworld_url+"images/flags/"+flag+".gif'");
- xoops_smallworld("input[name=birthplace_country]").val(smallworld_url+"images/flags/"+flag+".gif");
- xoops_smallworld("input[name=birthplace_country_img]").val(smallworld_url+"images/flags/"+flag+".gif");
- xoops_smallworld(this).val(ui.item.value);
- }
- },
- open: function() {
- xoops_smallworld( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
- },
- close: function() {
- xoops_smallworld( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
- }
- });
- /* this allows us to pass in HTML tags to autocomplete. Without this they get escaped */
- xoops_smallworld[ "ui" ][ "autocomplete" ].prototype["_renderItem"] = function( ul, item) {
- return xoops_smallworld( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( xoops_smallworld( "<a></a>" ).html( item.label ) )
- .appendTo( ul );
- };
-
-
- });
\ No newline at end of file
Deleted: XoopsModules/smallworld/trunk/smallworld/js/geoname_now.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/geoname_now.js 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/js/geoname_now.js 2013-05-22 13:25:30 UTC (rev 11576)
@@ -1,57 +0,0 @@
- // AutoSugguest for city / country in forms using geonames
- xoops_smallworld(function() {
- var img;
- xoops_smallworld( "#present_city" ).autocomplete({
- source: function( request, response ) {
- xoops_smallworld.ajax({
- url: "http://ws.geonames.org/searchJSON",
- dataType: "jsonp",
- data: {
- featureClass: "P",
- style: "full",
- maxRows: 10,
- name_startsWith: request.term,
- },
- success: function( data ) {
- response( xoops_smallworld.map( data.geonames, function( item ) {
- img = "<img src='"+smallworld_url+"images/flags/" + item.countryCode+ ".gif'>";
- var lng = item.lng;
- var lat = item.lat;
- return {
- label: img+" "+item.name + " / " + item.countryName,
- value: item.name,
- source: item
- }
- }));
- }
- });
- },
- minLength: 2,
- select: function(event, ui ) {
- if (ui.item) {
- xoops_smallworld("input[name=present_lat]").val( ui.item.source.lat );
- xoops_smallworld("input[name=present_lng]").val( ui.item.source.lng );
- var flag = ui.item.source.countryCode.toLowerCase();
- xoops_smallworld("#flag").html("<img src='"+smallworld_url+"images/flags/"+flag+".gif'");
- xoops_smallworld("input[name=present_country]").val(ui.item.source.countryName);
- xoops_smallworld("input[name=present_country_img]").val(smallworld_url+"images/flags/"+flag+".gif");
- xoops_smallworld(this).val(ui.item.value);
- }
- },
- open: function() {
- xoops_smallworld( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
- },
- close: function() {
- xoops_smallworld( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
- }
- });
- /* this allows us to pass in HTML tags to autocomplete. Without this they get escaped */
- xoops_smallworld[ "ui" ][ "autocomplete" ].prototype["_renderItem"] = function( ul, item) {
- return xoops_smallworld( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( xoops_smallworld( "<a></a>" ).html( item.label ) )
- .appendTo( ul );
- };
-
-
- });
\ No newline at end of file
Modified: XoopsModules/smallworld/trunk/smallworld/js/jquery.min.js
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/js/jquery.min.js 2013-05-22 13:08:31 UTC (rev 11575)
+++ XoopsModules/smallworld/trunk/smallworld/js/jquery.min.js 2013-05-22 13:25:30 UTC (rev 11576)
@@ -1,9597 +1,5 @@
-/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tw...
[truncated message content] |