From: <dj...@us...> - 2012-05-03 20:25:28
|
Revision: 9433 http://xoops.svn.sourceforge.net/xoops/?rev=9433&view=rev Author: djculex Date: 2012-05-03 17:42:04 +0000 (Thu, 03 May 2012) Log Message: ----------- - Bugfix: Corrected image styling (Thx Yuri) - Bugfix: removed extra divs & closing correctly span (thx Yuri) - Bugfix: Checking for null values in jquery.oembed.js - Bugfix: Breaking jquery without adding jquery.coundown.js to core.php - Bugfix: Correcting how smallworld_getAvatarLink handles non-image values Modified Paths: -------------- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php XoopsModules/smallworld/trunk/smallworld/class/profile.php XoopsModules/smallworld/trunk/smallworld/include/functions.php XoopsModules/smallworld/trunk/smallworld/js/jquery.oembed.js XoopsModules/smallworld/trunk/smallworld/preloads/core.php XoopsModules/smallworld/trunk/smallworld/search.php XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html XoopsModules/smallworld/trunk/smallworld/xoops_version.php Modified: XoopsModules/smallworld/trunk/smallworld/class/adminclass.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-05-03 17:42:04 UTC (rev 9433) @@ -152,7 +152,7 @@ $i = 1; while ($row = $xoopsDB->fetchArray($result)) { $msg["counter"][$i] = $i; - $msg["img"][$i] = "<img style='margin:0px 5px;' src = '../images/".$i.".png'></img>"; + $msg["img"][$i] = "<img style='margin:0px 5px;' src = '../images/".$i.".png'/>"; if ($msg['counter'][$i] > 3) { $msg["img"][$i] = ''; } @@ -190,7 +190,7 @@ $i = 1; while ($row = $xoopsDB->fetchArray($result)) { $msgtoday["counter"][$i] = $i; - $msgtoday["img"][$i] = "<img style='margin:0px 5px;' src = '../images/".$i.".png'></img>"; + $msgtoday["img"][$i] = "<img style='margin:0px 5px;' src = '../images/".$i.".png'/>"; if ($msgtoday['counter'][$i] > 3) { $msgtoday["img"][$i] = ''; } @@ -224,7 +224,7 @@ while ($row = $xoopsDB->fetchArray($result)) { $array['counter'][$i] = $i; $array['img'][$i] = "<img height='10px' width='10px' " - . "style='margin:0px 5px;' src = '../images/like.png'></img>"; + . "style='margin:0px 5px;' src = '../images/like.png'/>"; if ($array['counter'][$i] > 3) { $array["img"][$i] = ''; } @@ -245,7 +245,7 @@ while ($row = $xoopsDB->fetchArray($result)) { $array['counter'][$i] = $i; $array['img'][$i] = "<img height='10px' width='10px' " - . "style='margin:0px 5px;' src = '../images/dislike.png'></img>"; + . "style='margin:0px 5px;' src = '../images/dislike.png'/>"; if ($array['counter'][$i] > 3) { $array["img"][$i] = ''; } Modified: XoopsModules/smallworld/trunk/smallworld/class/profile.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/class/profile.php 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/class/profile.php 2012-05-03 17:42:04 UTC (rev 9433) @@ -66,12 +66,12 @@ $rank = $user->rank(); $rank_title = $rank['title']; if (isset($rank['image'])) { - $rank_image = "<img align='center' src='".XOOPS_UPLOAD_URL."/".$rank['image']."'></img>"; + $rank_image = "<img align='center' src='".XOOPS_UPLOAD_URL."/".$rank['image']."'/>"; } else { $rank_image = ''; } - $commentsrating = "<img src='".XOOPS_URL."/modules/smallworld/images/like.png' height='10px'width='10px'"."/></img> ".$usersratedplus; - $commentsrating .= " <img src='".XOOPS_URL."/modules/smallworld/images/dislike.png' height='10px'width='10px'"."/></img> ".$usersratedminus; + $commentsrating = "<img src='".XOOPS_URL."/modules/smallworld/images/like.png' height='10px' width='10px'"."/></img> ".$usersratedplus; + $commentsrating .= " <img src='".XOOPS_URL."/modules/smallworld/images/dislike.png' height='10px' width='10px'"."/></img> ".$usersratedminus; $lastlogin = $user->getVar('last_login'); $gender = $r['gender']; @@ -90,7 +90,7 @@ $avatar = $Wall->Gravatar($id); $avatar_size = smallworld_getImageSize(80, 100, smallworld_getAvatarLink($id, $avatar)); $avatar_highwide = smallworld_imageResize($avatar_size[0], $avatar_size[1], 100); - $user_img = "<img src='".smallworld_getAvatarLink($id, $avatar)."' id='smallworld_user_img' ".$avatar_highwide."/></img>"; + $user_img = "<img src='".smallworld_getAvatarLink($id, $avatar)."' id='smallworld_user_img' ".$avatar_highwide."/>"; $currentcity = $r['present_city']; $currlng = $r['present_lng']; Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2012-05-03 17:42:04 UTC (rev 9433) @@ -367,33 +367,51 @@ return $retval; } +/** + * Check image extension and users gender. If image is legal image extension return avatar, + else return default gender based image + * @param int $userid + * @param string $image + * @returns string + */ function smallworld_getAvatarLink($userid, $image) { - global $xoopsUser, $xoopsDB; + global $xoopsUser, $xoopsDB; + $ext = pathinfo(strtolower($image), PATHINFO_EXTENSION); $sql = "SELECT gender FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".intval($userid)."'"; $result = $xoopsDB->queryf($sql); while ($row = $xoopsDB->fetchArray($result)) { $gender = $row['gender']; } + $link = XOOPS_UPLOAD_URL."/".$image; - if ($image == 'blank.gif' or $image=='Not specifiyed' AND $gender == '1') { - $link = XOOPS_URL."/modules/smallworld/images/ano_woman.png"; - } - if ($image == 'blank.gif' or $image=='Not specifiyed' AND $gender == '2') { - $link = XOOPS_URL."/modules/smallworld/images/ano_man.png"; - } - if ($image == '' or $image=='Not specifiyed' AND $gender == '1') { - $link = XOOPS_URL."/modules/smallworld/images/ano_woman.png"; - } - if ($image == '' or $image=='Not specifiyed' AND $gender == '2') { - $link = XOOPS_URL."/modules/smallworld/images/ano_man.png"; - } - if ($image == 'blank.gif' or $image=='Not specifiyed' AND $gender == '') { - $link = XOOPS_URL."/modules/smallworld/images/genderless.png"; - } - if ($image == '' or $image=='Not specifiyed' AND $gender == '') { - $link = XOOPS_URL."/modules/smallworld/images/genderless.png"; - } + if (!in_array($ext,array('jpg','bmp','gif','png','jpeg')) || $image == '' || $image == "blank.gif"){ + if ($ext == '' || $gender == '1') { + $link = XOOPS_URL."/modules/smallworld/images/ano_woman.png"; + } + + if ($ext == '' AND $gender == '1') { + $link = XOOPS_URL."/modules/smallworld/images/ano_woman.png"; + } + + if ($ext == '' AND $gender == '2') { + $link = XOOPS_URL."/modules/smallworld/images/ano_man.png"; + } + if ($ext == '' AND $gender == '1') { + $link = XOOPS_URL."/modules/smallworld/images/ano_woman.png"; + } + if ($ext == '' AND $gender == '2') { + $link = XOOPS_URL."/modules/smallworld/images/ano_man.png"; + } + + if ($ext == '' AND $gender == '') { + $link = XOOPS_URL."/modules/smallworld/images/genderless.png"; + } + + if ($ext == '' AND $gender == '') { + $link = XOOPS_URL."/modules/smallworld/images/genderless.png"; + } + } return $link; } Modified: XoopsModules/smallworld/trunk/smallworld/js/jquery.oembed.js =================================================================== --- XoopsModules/smallworld/trunk/smallworld/js/jquery.oembed.js 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/js/jquery.oembed.js 2012-05-03 17:42:04 UTC (rev 9433) @@ -130,7 +130,7 @@ return false; } var result; - if(embedProvider.yql.xpath && embedProvider.yql.xpath=='//meta'){ + if(embedProvider.yql.xpath && embedProvider.yql.xpath=='//meta' && data.query.results){ var meta={}; for(var i=0, l=data.query.results.meta.length; i<l; i++){ var name = data.query.results.meta[i].name||data.query.results.meta[i].property||null; @@ -621,6 +621,7 @@ new xoops_smallworld.fn.oembed.OEmbedProvider("opengraph", "rich", [".*"], null, {yql:{xpath:"//meta", from:'html' , datareturn:function(results){ + if(results == null)return false; if(!results['og:title'] && results['title'] &&results['description'])results['og:title']=results['title']; if(!results['og:title'] && !results['title'])return false; var code = xoops_smallworld('<p/>'); Modified: XoopsModules/smallworld/trunk/smallworld/preloads/core.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/preloads/core.php 2012-05-03 17:42:04 UTC (rev 9433) @@ -114,6 +114,9 @@ $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.countdown.js'); $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.innerfade.js'); */ + + $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/js/jquery.countdown.js'); + if ( file_exists(XOOPS_ROOT_PATH.'/modules/smallworld/language/'.$xoopsConfig['language'].'/js/jquery.ui.datepicker-language.js')) { $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/language/'.$xoopsConfig['language'].'/js/jquery.ui.datepicker-language.js'); $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/language/'.$xoopsConfig['language'].'/js/jquery.countdown.js'); Modified: XoopsModules/smallworld/trunk/smallworld/search.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/search.php 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/search.php 2012-05-03 17:42:04 UTC (rev 9433) @@ -41,13 +41,13 @@ $image = '<img src="'.XOOPS_URL.'/uploads/'.$row['userimage'].'" '.$imageHw.'/>'; } else { if ($row['gender'] == 1) { - $image = "<img src='".XOOPS_URL."/modules/smallworld/images/ano_woman.png'"." height='30px' width='30px'/></img>"; + $image = "<img src='".XOOPS_URL."/modules/smallworld/images/ano_woman.png'"." height='30px' width='30px'/>"; } if ($row['gender'] == 2) { - $image = "<img src='".XOOPS_URL."/modules/smallworld/images/ano_man.png'"." height='30px' width='30px'/></img>"; + $image = "<img src='".XOOPS_URL."/modules/smallworld/images/ano_man.png'"." height='30px' width='30px'/>"; } if ($row['gender'] == 0) { - $image = "<img src='".XOOPS_URL."/modules/smallworld/images/genderless.png'"." height='30px' width='30px'/></img>"; + $image = "<img src='".XOOPS_URL."/modules/smallworld/images/genderless.png'"." height='30px' width='30px'/>"; } } Modified: XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html =================================================================== --- XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/templates/smallworld_userprofile_template.html 2012-05-03 17:42:04 UTC (rev 9433) @@ -24,7 +24,7 @@ <{if $username == $myusername OR $isadminuser == 'YES'}> <div class="UploadNewAvatar" id="<{$ownerofpage}>" style="display:none"> <div id="smallworld_avatarupload" > - <span>Upload File<span> + <span>Upload File</span> </div> <span id="smallworld_avatarstatus" ></span> <ul id="smallworld_avatarfiles" ></ul> @@ -645,5 +645,4 @@ <{/foreach}> </table> <div id="smallworldStatsDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div> - <div id="smallworld_recentactivitiesDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div> - </div> \ No newline at end of file + <div id="smallworld_recentactivitiesDiv" title="<{$smarty.const._SMALLWORLD_STATS}>" style="display:none;"></div> \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/xoops_version.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2012-05-03 15:02:09 UTC (rev 9432) +++ XoopsModules/smallworld/trunk/smallworld/xoops_version.php 2012-05-03 17:42:04 UTC (rev 9433) @@ -24,7 +24,7 @@ $modversion['description'] = _MI_SMALLWORLD_MODULE_DESC; $modversion['author'] = "Michael Albertsen"; $modversion['nickname'] = 'Culex'; -$modversion['credits'] = "Mariane, Mrsculex, Mamba, Rune"; +$modversion['credits'] = "Mariane, Mrsculex, Mamba, Rune, Zyth"; $modversion['module_website_name'] = 'www.culex.dk'; $modversion['module_website_url'] = 'http://www.culex.dk'; $modversion['license'] = 'GNU GPL'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |