|
From: <dj...@us...> - 2012-01-26 18:05:54
|
Revision: 8817
http://xoops.svn.sourceforge.net/xoops/?rev=8817&view=rev
Author: djculex
Date: 2012-01-26 18:05:41 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
Renaming and prefixing functions
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/class/adminclass.php
XoopsModules/smallworld/trunk/smallworld/class/db.php
XoopsModules/smallworld/trunk/smallworld/class/images.php
XoopsModules/smallworld/trunk/smallworld/class/mail.php
XoopsModules/smallworld/trunk/smallworld/class/profile.php
XoopsModules/smallworld/trunk/smallworld/class/wall.php
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/editimages.php
XoopsModules/smallworld/trunk/smallworld/editprofile.php
XoopsModules/smallworld/trunk/smallworld/friends.php
XoopsModules/smallworld/trunk/smallworld/galleryshow.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/index.php
XoopsModules/smallworld/trunk/smallworld/loadmore.php
XoopsModules/smallworld/trunk/smallworld/message_ajax.php
XoopsModules/smallworld/trunk/smallworld/partnersearch.php
XoopsModules/smallworld/trunk/smallworld/permalink.php
XoopsModules/smallworld/trunk/smallworld/register.php
XoopsModules/smallworld/trunk/smallworld/search.php
XoopsModules/smallworld/trunk/smallworld/smallworldshare.php
XoopsModules/smallworld/trunk/smallworld/stats.php
XoopsModules/smallworld/trunk/smallworld/userprofile.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/adminclass.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -359,7 +359,7 @@
return $return;
}
- function sanitize($text) {
+ function Smallworld_sanitize($text) {
$text = htmlspecialchars($text, ENT_QUOTES);
//$text = preg_replace('/([^\s]{10})(?=[^\s])/m', '$1<br />', $text);
$myts = MyTextSanitizer::getInstance();
Modified: XoopsModules/smallworld/trunk/smallworld/class/db.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/db.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/class/db.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -141,53 +141,53 @@
}
if ($_POST['relationship'] != '2') {
- $partner = sanitize($_POST['partner']);
+ $partner = Smallworld_sanitize($_POST['partner']);
} else {
$partner = '';
}
$regdate = time();
$username = $user->uname();
- $realname = sanitize($_POST['realname']);
- $gender = sanitize($_POST['gender']);
- $intingender = sanitize(serialize($_POST['intingender']));
- $relationship = sanitize($_POST['relationship']);
- $searchrelat = sanitize(serialize($_POST['searchrelat']));
- $birthday = sanitize(euroToUsDate($_POST['birthday']));
- $birthplace = sanitize($_POST['birthplace']);
- $birthplace_lat = sanitize($_POST['birthplace_lat']);
- $birthplace_lng = sanitize($_POST['birthplace_lng']);
- $birthplace_country = sanitize($_POST['birthplace_country']);
- $birthplace_country_img = sanitize($_POST['birthplace_country_img']);
- $politic = sanitize($_POST['politic']);
- $religion = sanitize($_POST['religion']);
- $emailtype = sanitize(serialize($_POST['emailtype']));
- $screenname_type = sanitize(serialize($_POST['screenname_type']));
- $screenname = sanitize(serialize($_POST['screenname']));
- $mobile = sanitize($_POST['mobile']);
- $phone = sanitize($_POST['phone']);
- $adress = sanitize($_POST['adress']);
- $present_city = sanitize($_POST['present_city']);
- $present_lat = sanitize($_POST['present_lat']);
- $present_lng = sanitize($_POST['present_lng']);
- $present_country = sanitize($_POST['present_country']);
- $present_country_img = sanitize($_POST['present_country_img']);
- $website = sanitize($_POST['website']);
- $interests = sanitize($_POST['interests']);
- $music = sanitize($_POST['music']);
- $tvshow = sanitize($_POST['tvshow']);
- $movie = sanitize($_POST['movie']);
- $books = sanitize($_POST['books']);
- $aboutme = sanitize($_POST['aboutme']);
- $school_type = sanitize(serialize($_POST['school_type']));
- $school = sanitize(serialize($_POST['school']));
- $schoolstart = sanitize(serialize(DateOfArray ($_POST['schoolstart'])));
- $schoolstop = sanitize(serialize(DateOfArray ($_POST['schoolstop'])));
- $jobemployer = sanitize(serialize($_POST['employer']));
- $jobposition = sanitize(serialize($_POST['position']));
- $jobstart = sanitize(serialize(DateOfArray ($_POST['jobstart'])));
- $jobstop = sanitize(serialize(DateOfArray ($_POST['jobstop'])));
- $jobdescription = sanitize(serialize($_POST['description']));
+ $realname = Smallworld_sanitize($_POST['realname']);
+ $gender = Smallworld_sanitize($_POST['gender']);
+ $intingender = Smallworld_sanitize(serialize($_POST['intingender']));
+ $relationship = Smallworld_sanitize($_POST['relationship']);
+ $searchrelat = Smallworld_sanitize(serialize($_POST['searchrelat']));
+ $birthday = Smallworld_sanitize(Smallworld_euroToUsDate($_POST['birthday']));
+ $birthplace = Smallworld_sanitize($_POST['birthplace']);
+ $birthplace_lat = Smallworld_sanitize($_POST['birthplace_lat']);
+ $birthplace_lng = Smallworld_sanitize($_POST['birthplace_lng']);
+ $birthplace_country = Smallworld_sanitize($_POST['birthplace_country']);
+ $birthplace_country_img = Smallworld_sanitize($_POST['birthplace_country_img']);
+ $politic = Smallworld_sanitize($_POST['politic']);
+ $religion = Smallworld_sanitize($_POST['religion']);
+ $emailtype = Smallworld_sanitize(serialize($_POST['emailtype']));
+ $screenname_type = Smallworld_sanitize(serialize($_POST['screenname_type']));
+ $screenname = Smallworld_sanitize(serialize($_POST['screenname']));
+ $mobile = Smallworld_sanitize($_POST['mobile']);
+ $phone = Smallworld_sanitize($_POST['phone']);
+ $adress = Smallworld_sanitize($_POST['adress']);
+ $present_city = Smallworld_sanitize($_POST['present_city']);
+ $present_lat = Smallworld_sanitize($_POST['present_lat']);
+ $present_lng = Smallworld_sanitize($_POST['present_lng']);
+ $present_country = Smallworld_sanitize($_POST['present_country']);
+ $present_country_img = Smallworld_sanitize($_POST['present_country_img']);
+ $website = Smallworld_sanitize($_POST['website']);
+ $interests = Smallworld_sanitize($_POST['interests']);
+ $music = Smallworld_sanitize($_POST['music']);
+ $tvshow = Smallworld_sanitize($_POST['tvshow']);
+ $movie = Smallworld_sanitize($_POST['movie']);
+ $books = Smallworld_sanitize($_POST['books']);
+ $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'])));
+ $jobemployer = Smallworld_sanitize(serialize($_POST['employer']));
+ $jobposition = Smallworld_sanitize(serialize($_POST['position']));
+ $jobstart = Smallworld_sanitize(serialize(Smallworld_DateOfArray ($_POST['jobstart'])));
+ $jobstop = Smallworld_sanitize(serialize(Smallworld_DateOfArray ($_POST['jobstop'])));
+ $jobdescription = Smallworld_sanitize(serialize($_POST['description']));
$sql = '';
Modified: XoopsModules/smallworld/trunk/smallworld/class/images.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/images.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/class/images.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -30,9 +30,9 @@
} else {
mkdir($dir.'/'.$userID, 0777);
mkdir($dir.'/'.$userID."/thumbnails", 0777);
- CreateIndexFiles ($dir.'/');
- CreateIndexFiles($dir.'/'.$userID."/");
- CreateIndexFiles($dir.'/'.$userID."/thumbnails/");
+ Smallworld_CreateIndexFiles ($dir.'/');
+ Smallworld_CreateIndexFiles($dir.'/'.$userID."/");
+ Smallworld_CreateIndexFiles($dir.'/'.$userID."/thumbnails/");
}
}
@@ -52,8 +52,8 @@
$post[$i]['id'] = stripslashes($sqlfetch['id']);
$post[$i]['userid'] = stripslashes($sqlfetch['userid']);
$post[$i]['imgurl'] = stripslashes($sqlfetch['imgurl']);
- $post[$i]['desc'] = cleanup_string($sqlfetch['desc']);
- $post[$i]['alt'] = cleanup_string($sqlfetch['desc']);
+ $post[$i]['desc'] = Smallworld_cleanup_string($sqlfetch['desc']);
+ $post[$i]['alt'] = Smallworld_cleanup_string($sqlfetch['desc']);
$post[$i]['time'] = stripslashes($sqlfetch['time']);
$post[$i]['editimg'] = "<span class='smallworld_edit_imgdesc_holder'><img src='images/edit_icon.png'/></span> <a class='smallworld_edit_imgdesc' href='editimages.php'>"._SMALLWORLD_EDITDESCRIPTION."</a>";
$i++;
Modified: XoopsModules/smallworld/trunk/smallworld/class/mail.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/mail.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/class/mail.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -105,7 +105,7 @@
$ownermessage = stripslashes($this->getOwnerUpdateFromMsgID($data['msg_id_fk']));
- $owner = getOwnerFromComment ($data['msg_id_fk']);
+ $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'>";
Modified: XoopsModules/smallworld/trunk/smallworld/class/profile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/profile.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/class/profile.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -38,7 +38,7 @@
$uname = ucwords($r['username']);
$realname = $r['realname'];
$membersince = date("d-m-Y",$user->user_regdate());
- $birthday = UsToEuroDate($r['birthday']);
+ $birthday = Smallworld_UsToEuroDate($r['birthday']);
$cnt_bday = smallworldNextBdaySecs ($r['birthday']);
$birthcity = $r['birthplace'];
@@ -180,7 +180,7 @@
$adress = $r['adress'];
$website = $r['website'];
- $age = birthday($r['birthday']);
+ $age = Smallworld_Birthday($r['birthday']);
}
//SW_CheckIfUser ($userid);
Modified: XoopsModules/smallworld/trunk/smallworld/class/wall.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/wall.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/class/wall.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -125,7 +125,7 @@
//Insert Update
public function Insert_Update($uid, $update,$priv) {
global $xoopsUser, $xoopsDB;
- $update=sanitize(htmlentities($update, ENT_QUOTES,"UTF-8"));
+ $update=Smallworld_sanitize(htmlentities($update, ENT_QUOTES,"UTF-8"));
$time=time();
$query = "SELECT msg_id,message FROM ".$xoopsDB->prefix('smallworld_messages')." WHERE uid_fk='".$uid."' order by msg_id desc limit 1";
$result = $xoopsDB->queryF($query);
@@ -154,7 +154,7 @@
//Insert Comments
public function Insert_Comment($uid,$msg_id,$comment) {
global $xoopsUser, $xoopsDB;
- $comment=sanitize(htmlentities($comment, ENT_QUOTES,"UTF-8"));
+ $comment=Smallworld_sanitize(htmlentities($comment, ENT_QUOTES,"UTF-8"));
$time=time();
$query = "SELECT com_id,comment FROM ".$xoopsDB->prefix('smallworld_comments')." WHERE uid_fk='".$uid."' and msg_id_fk='".$msg_id."' order by com_id desc limit 1 ";
$result = $xoopsDB->fetchArray($query);
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -38,7 +38,7 @@
$tpl->assign('isadminuser', 'YES');
}
//$followers = $Wall->getFollowers($id);
- $followers = array_flatten($Wall->getFollowers($id),0);
+ $followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
$myavatar = $Wall->Gravatar($id);
$myavatarlink = smallworld_getAvatarLink($id, $myavatar);
@@ -59,7 +59,7 @@
$wc['myavatar_link']= $myavatarlink;
$wc['cface'] = $Wall->Gravatar($data['uid_fk']);
$wc['avatar_link'] = smallworld_getAvatarLink ($data['uid_fk'], $wc['cface']);
- $wc['compl_msg_lnk'] = "<a href='".XOOPS_URL."/modules/smallworld/permalink.php?ownerid=".getOwnerFromComment($cdata['msg_id_fk']);
+ $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']);
@@ -75,7 +75,7 @@
$parts = $mail->getPartsFromComment ($data['msg_id_fk']);
$emails = "";
foreach ($parts as $k=>$v) {
- $owner = getOwnerFromComment ($data['msg_id_fk']);
+ $owner = Smallworld_getOwnerFromComment ($data['msg_id_fk']);
if(smallworld_GetModuleOption('smallworldusemailnotis', $repmodule='smallworld') != 0) {
$mail->sendMails ($data['uid_fk'], $v, 'commentToWM', $link=null, $wc);
}
Modified: XoopsModules/smallworld/trunk/smallworld/editimages.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editimages.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/editimages.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -30,7 +30,7 @@
$userID = $xoopsUser->getVar('uid');
// Check if inspected userid -> redirect to userprofile and show admin countdown
- $inspect = isInspected ($userID);
+ $inspect = Smallworld_isInspected ($userID);
if ($inspect['inspect'] == 'yes') {
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
Modified: XoopsModules/smallworld/trunk/smallworld/editprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/editprofile.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/editprofile.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -33,7 +33,7 @@
// Check if inspected userid -> redirect to userprofile and show admin countdown
/*
- $inspect = isInspected ($id);
+ $inspect = Smallworld_isInspected ($id);
if ($inspect['inspect'] == 'yes') {
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
@@ -97,7 +97,7 @@
if (smallworldGetValfromArray ('birthday', 'smallworldusethesefields') != 0) {
// Select Birthday dd-mm-Y
- $birthday = $item->input('birthday', 'birthday', 'birthday',$size='12', $preset=stripslashes(UsToEuroDate($r['birthday'])));
+ $birthday = $item->input('birthday', 'birthday', 'birthday',$size='12', $preset=stripslashes(Smallworld_UsToEuroDate($r['birthday'])));
$xoopsTpl->append('birthdaydate',$birthday);
} else {
$xoopsTpl->assign('show_birthday','no');
Modified: XoopsModules/smallworld/trunk/smallworld/friends.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/friends.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/friends.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -36,7 +36,7 @@
$friends = new SmallWorldFriends;
// Check if inspected userid -> redirect to userprofile and show admin countdown
- $inspect = isInspected ($yourid);
+ $inspect = Smallworld_isInspected ($yourid);
if ($inspect['inspect'] == 'yes') {
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
@@ -115,7 +115,7 @@
if (!empty($pending_array)) {
foreach ($pending_array as $data) {
$fp['friend_id'] = $data['you'];
- $fp['friendname'] = getName($data['you']);
+ $fp['friendname'] = Smallworld_getName($data['you']);
$fp['avatar'] = $Wall->Gravatar($data['you']);
$fp['avatar_link'] = smallworld_getAvatarLink ($data['you'], $fp['avatar']);
$xoopsTpl->append('pendingfriends', $fp);
@@ -127,7 +127,7 @@
if (!empty($friends_array)) {
foreach ($friends_array as $data) {
$ff['friend_id'] = $data['you'];
- $ff['friendname'] = getName($data['you']);
+ $ff['friendname'] = Smallworld_getName($data['you']);
$ff['avatar'] = $Wall->Gravatar($data['you']);
$ff['avatar_link'] = smallworld_getAvatarLink ($data['you'], $ff['avatar']);
$xoopsTpl->append('verifiedfriends', $ff);
@@ -139,7 +139,7 @@
if (!empty($following_array)) {
foreach ($following_array as $data) {
$fy['friend_id'] = $data['you'];
- $fy['friendname'] = getName($data['you']);
+ $fy['friendname'] = Smallworld_getName($data['you']);
$fy['avatar'] = $Wall->Gravatar($data['you']);
$fy['avatar_link'] = smallworld_getAvatarLink ($data['you'], $fy['avatar']);
$xoopsTpl->append('followingyou', $fy);
@@ -151,7 +151,7 @@
if (!empty($followingme_array)) {
foreach ($followingme_array as $data) {
$fm['friend_id'] = $data['me'];
- $fm['friendname'] = getName($data['me']);
+ $fm['friendname'] = Smallworld_getName($data['me']);
$fm['avatar'] = $Wall->Gravatar($data['me']);
$fm['avatar_link'] = smallworld_getAvatarLink ($data['me'], $fm['avatar']);
$xoopsTpl->append('followingme', $fm);
Modified: XoopsModules/smallworld/trunk/smallworld/galleryshow.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/galleryshow.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -42,7 +42,7 @@
$image = new SmallWorldImages;
// Check if inspected userid -> redirect to userprofile and show admin countdown
- $inspect = isInspected ($id);
+ $inspect = Smallworld_isInspected ($id);
if ($inspect['inspect'] == 'yes') {
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -37,20 +37,20 @@
// Clean vars or arrays
// If array check for magicQuotes.
-// Pass string to cleanup_string
-function cleanup($text) {
+// Pass string to Smallworld_cleanup_string
+function Smallworld_cleanup($text) {
if (is_array($text)) {
foreach ($text as $key => $value) {
- $text[$key] = cleanup_string($value);
+ $text[$key] = Smallworld_cleanup_string($value);
}
} else {
- $text = cleanup_string($text);
+ $text = Smallworld_cleanup_string($text);
}
return $text;
}
// Sanitize string
-function cleanup_string($text) {
+function Smallworld_cleanup_string($text) {
$text = htmlspecialchars($text, ENT_QUOTES);
$myts = MyTextSanitizer::getInstance();
$text = $myts->displayTarea($text,1,1,1,1);
@@ -62,19 +62,19 @@
}
// clean Array for mysql insertion
-// or send string to sanitize_string
-function sanitize ($text) {
+// or send string to Smallworld_sanitize_string
+function Smallworld_sanitize ($text) {
if (is_array($text)) {
foreach ($text as $key => $value) {
- $text[$key] = sanitize_string($value);
+ $text[$key] = Smallworld_sanitize_string($value);
}
} else {
- $text = sanitize_string($text);
+ $text = Smallworld_sanitize_string($text);
}
return $text;
}
-function sanitize_string ($value) {
+function Smallworld_sanitize_string ($value) {
$myts = MyTextSanitizer::getInstance();
if(get_magic_quotes_gpc()){
$value = $myts->stripSlashesGPC($value);
@@ -84,7 +84,7 @@
return $value;
}
-function DateOfArray ($array) {
+function Smallworld_DateOfArray ($array) {
$data = array();
foreach ($array as $k => $v) {
$data[$k] = strtotime($v);
@@ -92,7 +92,7 @@
return $data;
}
-function CreateIndexFiles ($folderUrl) {
+function Smallworld_CreateIndexFiles ($folderUrl) {
$myts =& MyTextSanitizer::getInstance();
file_put_contents($folderUrl.'index.html', "<script>history.go(-1);</script>");
}
@@ -103,10 +103,10 @@
// recursively reduces deep arrays to single-dimensional arrays
// $preserve_keys: (0=>never, 1=>strings, 2=>always)
-function array_flatten($array, $preserve_keys = 1, &$newArray = Array()) {
+function Smallworld_array_flatten($array, $preserve_keys = 1, &$newArray = Array()) {
foreach ($array as $key => $child) {
if (is_array($child)) {
- $newArray =& array_flatten($child, $preserve_keys, $newArray);
+ $newArray =& Smallworld_array_flatten($child, $preserve_keys, $newArray);
} elseif ($preserve_keys + is_string($key) > 1) {
$newArray[$key] = $child;
} else {
@@ -119,7 +119,7 @@
// Returns age in years
// Input birthdate
// Requires php >= 5.3
-function birthday($birth, $now = NULL){
+function Smallworld_Birthday($birth, $now = NULL){
$now = new DateTime($now);
$birth = new DateTime($birth);
return $birth->diff($now)->format('%r%y');
@@ -225,7 +225,7 @@
return $text;
}
-function stripWordsKeepUrl ($text) {
+function Smallworld_stripWordsKeepUrl ($text) {
preg_replace('/(((f|ht){1}tps:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
'<div class=".embed"><a href="\\1">\\1</a></div>', $text);
return $text;
@@ -345,7 +345,7 @@
* Return owner of thread (original poster)
* Return Integer
*/
-function getOwnerFromComment ($msg_id_fk) {
+function Smallworld_getOwnerFromComment ($msg_id_fk) {
global $xoopsDB;
$sql = "Select uid_fk from ".$xoopsDB->prefix('smallworld_messages')." where msg_id = '".$msg_id_fk."'";
$result = $xoopsDB->queryF($sql);
@@ -356,7 +356,7 @@
}
// Get username from userID
-function getName($userID){
+function Smallworld_getName($userID){
global $xoopsUser, $xoopsDB;
$sql = "SELECT username FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".intval($userID)."'";
$result = $xoopsDB->queryf($sql);
@@ -369,7 +369,7 @@
// Check if user has been taken down for inspection by admin
// Userid = user id of user to check
// return array
-function isInspected ($userid) {
+function Smallworld_isInspected ($userid) {
global $xoopsDB;
$data = array();
$sql = "SELECT inspect_start, inspect_stop FROM ".$xoopsDB->prefix('smallworld_admin')." WHERE userid = '".$userid."' AND (inspect_start+inspect_stop) > ".time()."";
@@ -400,7 +400,7 @@
$user = new xoopsUser;
$Wall = new Wall_Updates();
$userid = $xoopsUser->getVar('uid');
- $followers = array_flatten($Wall->getFollowers($userid),0);
+ $followers = Smallworld_array_flatten($Wall->getFollowers($userid),0);
if (smallworld_GetModuleOption('usersownpostscount', $repmodule='smallworld') == 1) {
array_push($followers, $userid);
}
@@ -452,7 +452,7 @@
$nu[$i]['username_link'] = "<a href = '".XOOPS_URL."/modules/smallworld/userprofile.php?username=".$r['username']."'>";
$nu[$i]['username_link'] .= $r['username']." (".$r['realname'].") [".$nu[$i]['regdate']."] </a>";
$nu[$i]['userimage'] = $r['userimage'];
- $nu[$i]['userimage_link'] = smallworld_getAvatarLink ($r['userid'], Gravatar($r['userid']));
+ $nu[$i]['userimage_link'] = smallworld_getAvatarLink ($r['userid'], Smallworld_Gravatar($r['userid']));
$i++;
}
@@ -460,7 +460,7 @@
return $nu;
}
//Avatar Image
-function Gravatar($uid) {
+function Smallworld_Gravatar($uid) {
global $xoopsUser, $xoopsDB;
$image='';
$sql = "SELECT userimage FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".$uid."'";
@@ -478,7 +478,7 @@
}
// find user with most posted messages
-function mostactiveusers_allround() {
+function Smallworld_mostactiveusers_allround() {
global $xoopsDB,$xoopsUser;
$sql = "SELECT uid_fk, COUNT( * ) as cnt ";
$sql .= "FROM ( ";
@@ -499,7 +499,7 @@
$counter = 1;
while ($row = $xoopsDB->fetchArray($result)) {
$msg[$counter]["counter"] = $counter;
- $msg[$counter]["img"] = smallworld_getAvatarLink ($row['uid_fk'], Gravatar($row['uid_fk']));
+ $msg[$counter]["img"] = smallworld_getAvatarLink ($row['uid_fk'], Smallworld_Gravatar($row['uid_fk']));
$msg[$counter]["msgs"] = _SMALLWORLD_TOTALPOSTS." : ".$row["cnt"];
$msg[$counter]["cnt"] = $row["cnt"];
$msg[$counter]["username"] = $xoopsUser->getUnameFromId($row["uid_fk"]);
@@ -512,7 +512,7 @@
}
// Find worst rated users overall
-function worstratedusers() {
+function Smallworld_worstratedusers() {
global $xoopsUser, $xoopsDB;
$array = array();
$counter = 1;
@@ -524,7 +524,7 @@
$result = $xoopsDB->queryF($sql);
while ($row = $xoopsDB->fetchArray($result)) {
$array[$counter]['counter'] = $counter;
- $array[$counter]['img'] = smallworld_getAvatarLink ($row["owner"], Gravatar($row["owner"]));
+ $array[$counter]['img'] = smallworld_getAvatarLink ($row["owner"], Smallworld_Gravatar($row["owner"]));
$array[$counter]['user'] = $xoopsUser->getUnameFromId($row["owner"]);
$array[$counter]['rating'] = $row["total"];
$array[$counter]['user_link'] = "<a href = '".XOOPS_URL."/modules/smallworld/userprofile.php?username=".$array[$counter]['user']."'>";
@@ -535,7 +535,7 @@
}
// Find best rated users overall
-function topratedusers() {
+function Smallworld_topratedusers() {
global $xoopsUser, $xoopsDB;
$array = array();
$counter = 1;
@@ -547,7 +547,7 @@
$result = $xoopsDB->queryF($sql);
while ($row = $xoopsDB->fetchArray($result)) {
$array[$counter]['counter'] = $counter;
- $array[$counter]['img'] = smallworld_getAvatarLink ($row["owner"], Gravatar($row["owner"]));
+ $array[$counter]['img'] = smallworld_getAvatarLink ($row["owner"], Smallworld_Gravatar($row["owner"]));
$array[$counter]['user'] = $xoopsUser->getUnameFromId($row["owner"]);
$array[$counter]['rating'] = $row["total"];
$array[$counter]['user_link'] = "<a href = '".XOOPS_URL."/modules/smallworld/userprofile.php?username=".$array[$counter]['user']."'>";
@@ -575,7 +575,7 @@
while ($r = $xoopsDB->fetchArray($result)) {
$res[$i]['amount'] = $counter;
$res[$i]['userid'] = $r['userid'];
- $res[$i]['userimage'] = smallworld_getAvatarLink ($r['userid'], Gravatar($r["userid"]));
+ $res[$i]['userimage'] = smallworld_getAvatarLink ($r['userid'], Smallworld_Gravatar($r["userid"]));
$res[$i]['birthday'] = $r['daymon'];
$res[$i]['agenow'] = $r['age_now'];
$res[$i]['username'] = $xoopsUser->getUnameFromId($r['userid']);
@@ -589,13 +589,13 @@
// Return new date format US for MySql
// Require php>5.2 using DateTime class
-function euroToUsDate ($stringDate) {
+function Smallworld_euroToUsDate ($stringDate) {
$date = DateTime::createFromFormat('d-m-Y', $stringDate);
return $date->format("Y-m-d");
}
// Return new date format EU For display
-function UsToEuroDate ($stringDate) {
+function Smallworld_UsToEuroDate ($stringDate) {
$date = DateTime::createFromFormat('Y-m-d', $stringDate);
return $date->format("d-m-Y");
}
Modified: XoopsModules/smallworld/trunk/smallworld/index.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/index.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/index.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -31,7 +31,7 @@
$user = new XoopsUser($id);
// Check if inspected userid -> redirect to userprofile and show admin countdown
- $inspect = isInspected ($id);
+ $inspect = Smallworld_isInspected ($id);
if ($inspect['inspect'] == 'yes') {
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
@@ -63,14 +63,14 @@
$getInvitations = $check->getRequests ($id);
// Follow array here
- $followers = array_flatten($Wall->getFollowers($id),0);
+ $followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
$updatesarray=$Wall->Updates(0,$id, $followers);
//Srinivas Tamada http://9lessons.info
//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"), '',stripWordsKeepUrl($data['message']));
+ $wm['orimessage'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message']));
$wm['message'] = smallworld_tolink(htmlentities($data['message']));
$wm['message'] = str_replace(array('<','>'),array('<','>'), $wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
@@ -103,7 +103,7 @@
$wc['myavatar_link'] = $myavatarlink;
$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=".getOwnerFromComment($cdata['msg_id_fk']);
+ $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']);
Modified: XoopsModules/smallworld/trunk/smallworld/loadmore.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/loadmore.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/loadmore.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -48,7 +48,7 @@
$myavatar = $Wall->Gravatar($id);
$myavatarlink = smallworld_getAvatarLink($id, $myavatar);
-$followers = array_flatten($Wall->getFollowers($id),0);
+$followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
if ($page == 'index') {
$updatesarray=$Wall->Updates($_POST['last'], $id, $followers);
} elseif ($page == 'profile') {
@@ -95,7 +95,7 @@
$wc['myavatar_link']= $myavatarlink;
$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=".getOwnerFromComment($cdata['msg_id_fk']);
+ $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']);
Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -41,7 +41,7 @@
}
$priv = intval($_POST['priv']);
- $followers = array_flatten($Wall->getFollowers($id),0);
+ $followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
$myavatar = $Wall->Gravatar($id);
@@ -88,7 +88,7 @@
$wc['myavatar_link']= $myavatarlink;
$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=".getOwnerFromComment($cdata['msg_id_fk']);
+ $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']);
Modified: XoopsModules/smallworld/trunk/smallworld/partnersearch.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/partnersearch.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/partnersearch.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -27,7 +27,7 @@
global $xoopsUser,$xoopsDB,$xoopsLogger;
$xoopsLogger->activated = false;
if($_GET) {
- $q=sanitize($_GET['term']);
+ $q=Smallworld_sanitize($_GET['term']);
$sql = "select * from ".$xoopsDB->prefix('smallworld_user')." where realname like '%".$q."%' or username like '%".$q."%' order by userid LIMIT 5";
$result = $xoopsDB->query($sql);
$data = array();
Modified: XoopsModules/smallworld/trunk/smallworld/permalink.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/permalink.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/permalink.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -58,7 +58,7 @@
$myavatarlink = smallworld_getAvatarLink($id, $myavatar);
// Follow array here
- $followers = array_flatten($Wall->getFollowers($id),0);
+ $followers = Smallworld_array_flatten($Wall->getFollowers($id),0);
$updatesarray=$Wall->UpdatesPermalink ($updID,$id, $ownerID);
@@ -66,7 +66,7 @@
//Loading Comments link with load_updates.php
foreach ($updatesarray as $data) {
$wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = str_replace(array("\r", "\n"), '',stripWordsKeepUrl($data['message']));
+ $wm['orimessage'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message']));
$wm['message'] = smallworld_tolink(htmlentities($data['message']));
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/register.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/register.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/register.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -34,7 +34,7 @@
// Check if inspected userid -> redirect to userprofile and show admin countdown
/*
- $inspect = isInspected ($id);
+ $inspect = Smallworld_isInspected ($id);
if ($inspect['inspect'] == 'yes') {
redirect_header("userprofile.php?username=".$xoopsUser->getVar('uname'), 1);
}
Modified: XoopsModules/smallworld/trunk/smallworld/search.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/search.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/search.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -27,7 +27,7 @@
global $xoopsUser,$xoTheme,$xoopsLogger,$xoopsDB;
$xoopsLogger->activated = false;
if($_GET) {
- $q=sanitize($_GET['term']);
+ $q=Smallworld_sanitize($_GET['term']);
$sql = "select * from ".$xoopsDB->prefix('smallworld_user')." where realname like '%".$q."%' or username like '%".$q."%' order by userid LIMIT 5";
$result = $xoopsDB->query($sql);
$data = array();
Modified: XoopsModules/smallworld/trunk/smallworld/smallworldshare.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/smallworldshare.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/smallworldshare.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -42,7 +42,7 @@
//Loading Comments link with load_updates.php
foreach ($updatesarray as $data) {
$wm['msg_id'] = $data['msg_id'];
- $wm['orimessage'] = str_replace(array("\r", "\n"), '',stripWordsKeepUrl($data['message']));
+ $wm['orimessage'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message']));
$wm['message'] = smallworld_tolink(htmlentities($data['message']));
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -64,7 +64,7 @@
}
} else {
$wm['msg_id'] = $updID;
- $wm['orimessage'] = str_replace(array("\r", "\n"), '',stripWordsKeepUrl(_SMALLWORLD_BOOKMARK_NOPERM_MESSAGE));
+ $wm['orimessage'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl(_SMALLWORLD_BOOKMARK_NOPERM_MESSAGE));
$wm['message'] = smallworld_tolink(htmlentities(_SMALLWORLD_BOOKMARK_NOPERM_MESSAGE));
$wm['created'] = smallworld_time_stamp(time());
$wm['username'] = _SMALLWORLD_SYSNAME;
Modified: XoopsModules/smallworld/trunk/smallworld/stats.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/stats.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/stats.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -29,9 +29,9 @@
$userid = $xoopsUser->getVar('uid');
$newusers = smallworld_Stats_newest ();
-$m_a_users = mostactiveusers_allround();
-$br_users = topratedusers();
-$wo_users = worstratedusers();
+$m_a_users = Smallworld_mostactiveusers_allround();
+$br_users = Smallworld_topratedusers();
+$wo_users = Smallworld_worstratedusers();
$birth = smallworld_nextBirthdays ();
$sp = smallworld_sp ();
$tpl->assign('newusers',$newusers);
Modified: XoopsModules/smallworld/trunk/smallworld/userprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/userprofile.php 2012-01-26 17:03:42 UTC (rev 8816)
+++ XoopsModules/smallworld/trunk/smallworld/userprofile.php 2012-01-26 18:05:41 UTC (rev 8817)
@@ -41,7 +41,7 @@
$user = new SmallWorldProfile;
$user->ShowUser($id);
$username = $xoopsUser->getVar('uname'); //Myusername
- $inspected = isInspected($id);
+ $inspected = Smallworld_isInspected($id);
$xoopsTpl->assign('inspect',$inspected['inspect']);
if ($inspected['inspect'] != 'no') {
$xoopsTpl->assign('inspecttime',$inspected['totaltime']);
@@ -139,7 +139,7 @@
$wc['myavatar_link']= $myavatarlink;
$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=".getOwnerFromComment($cdata['msg_id_fk']);
+ $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']);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|