From: <dj...@us...> - 2012-05-01 17:40:22
|
Revision: 9421 http://xoops.svn.sourceforge.net/xoops/?rev=9421&view=rev Author: djculex Date: 2012-05-01 17:40:16 +0000 (Tue, 01 May 2012) Log Message: ----------- Bugfix: Problems with wrong username in image uploads->wall Updates Modified Paths: -------------- 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/userprofile.php Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-05-01 17:36:52 UTC (rev 9420) +++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-05-01 17:40:16 UTC (rev 9421) @@ -227,16 +227,18 @@ // Return only url/link // If url is image link return <img> -function smallworld_tolink($text) +function smallworld_tolink($text, $uid) { global $xoopsUser; $ext = substr($text,-4,4); $ext2 = substr($text,-5,5); + $usr = new $xoopsUser($uid); + $userID = $xoopsUser->getVar('uid'); $user = new XoopsUser($userID); $username = $user->getVar('uname'); - $gallery = XOOPS_URL."/modules/smallworld/galleryshow.php?username=".$username; + $gallery = XOOPS_URL."/modules/smallworld/galleryshow.php?username=".$usr->getVar('uname'); if (in_array($ext,array('.jpg','.bmp','.gif','.png')) || in_array($ext2,array('.jpeg'))){ if (strpos($text, 'UPLIMAGE') !== false ) { @@ -244,7 +246,7 @@ $text = preg_replace('/(((f|ht){1}tp:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i', '<span class="smallworldUplImgTxt"><br/><img class="smallworldAttImg" src="\\1"><br><br><a id="smallworldUplImgLnk" href="' . $gallery . '" target="_SELF">' - . $username . _SMALLWORLD_UPLOADEDSOMEIMAGES + . $usr->getVar('uname') . _SMALLWORLD_UPLOADEDSOMEIMAGES . '</a><br></span>', $text ); $text = preg_replace('/(((f|ht){1}tps:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i', Modified: XoopsModules/smallworld/trunk/smallworld/index.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/index.php 2012-05-01 17:36:52 UTC (rev 9420) +++ XoopsModules/smallworld/trunk/smallworld/index.php 2012-05-01 17:40:16 UTC (rev 9421) @@ -73,7 +73,7 @@ foreach ($updatesarray as $data) { $wm['msg_id'] = $data['msg_id']; $wm['orimessage'] = str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])); - $wm['message'] = smallworld_tolink(htmlspecialchars_decode($data['message'])); + $wm['message'] = smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']); $wm['message'] = str_replace(array('<','>'),array('<','>'), $wm['message']); $wm['created'] = smallworld_time_stamp($data['created']); $wm['username'] = $data['username']; Modified: XoopsModules/smallworld/trunk/smallworld/loadmore.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/loadmore.php 2012-05-01 17:36:52 UTC (rev 9420) +++ XoopsModules/smallworld/trunk/smallworld/loadmore.php 2012-05-01 17:40:16 UTC (rev 9421) @@ -64,7 +64,7 @@ foreach ($updatesarray as $data) { $wm['msg_id'] = $data['msg_id']; $wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']); - $wm['message'] = smallworld_tolink(htmlentities($data['message'])); + $wm['message'] = smallworld_tolink(htmlentities($data['message']), $data['uid_fk']); $wm['created'] = smallworld_time_stamp($data['created']); $wm['username'] = $data['username']; $wm['uid_fk'] = $data['uid_fk']; Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2012-05-01 17:36:52 UTC (rev 9420) +++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2012-05-01 17:40:16 UTC (rev 9421) @@ -57,7 +57,7 @@ foreach ($insdata as $data) { $wm['msg_id'] = $data['msg_id']; $wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']); - $wm['message'] = smallworld_tolink(htmlspecialchars_decode($data['message'])); + $wm['message'] = 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']; Modified: XoopsModules/smallworld/trunk/smallworld/userprofile.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/userprofile.php 2012-05-01 17:36:52 UTC (rev 9420) +++ XoopsModules/smallworld/trunk/smallworld/userprofile.php 2012-05-01 17:40:16 UTC (rev 9421) @@ -112,7 +112,7 @@ foreach ($updatesarray as $data) { $wm['msg_id'] = $data['msg_id']; $wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']); - $wm['message'] = smallworld_tolink(htmlspecialchars_decode($data['message'])); + $wm['message'] = 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']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |