Nice Social Bookmark – no img width and height attributes

Website producers often include images on their pages badly, creating accessibility issues for visitors and increasing page load times.

It is important to include the width and height attributes in each image tag.  The mark-up is valid without a height and width attribute, but it is best practice to include them.

You can include them by adding the width and height attributes to the images in the following file: modules\mod_nice_social_bookmark\mod_nice_social_bookmark.php

Back up first!

The code for the whole file is below:

<?php

// no direct access

//defined( '_VALID_MOS' ) or die( 'Restricted access' );

$url = "http://".$_SERVER['HTTP_HOST'] . getenv('REQUEST_URI'); 

$rss_url = "http://".$_SERVER['HTTP_HOST'];

$isize = $params->get('isize');

$iset = $params->get('iset');

$iposition = $params->get('iposition');

$document = JFactory::getDocument();

$opac = $params->get('opac');

if ($opac=="yes"){

 $document->addStyleSheet('modules/mod_nice_social_bookmark/css/nsb-opac.css');

 }

 elseif ($opac=="invert"){$document->addStyleSheet('modules/mod_nice_social_bookmark/css/nsb-opac-inv.css');

 }

 else{$document->addStyleSheet('modules/mod_nice_social_bookmark/css/nsb.css');

 }

$twlink = $params->get('twlink');

$fblink = $params->get('fblink');

$mslink = $params->get('mslink');

$rsslink = $params->get('rsslink');

echo '<div align="'.$iposition.'">';
$tt = $params->get('s1', 'yes');
if ($tt == "yes"){ if ($fblink == "")
echo '<a id="l1" target="_blank" rel="nofollow" href="http://www.facebook.com/sharer.php?u='.$url.'&title="><img title="Facebook" border="0" src="modules/mod_nice_social_bookmark/icons/facebook_'.$iset.'_'.$isize.'.png" alt="Facebook" width="32px" height="32px"  /></a>&nbsp;';
else echo '<a id="l1" target="_blank" rel="nofollow" href="http://'.$fblink.'"><img title="Facebook" border="0" src="modules/mod_nice_social_bookmark/icons/facebook_'.$iset.'_'.$isize.'.png" alt="Facebook" width="32px" height="32px"/></a>&nbsp;';}
$tt = $params->get('s2', 'yes');
if ($tt == "yes"){ if ($mslink == "")
echo '<a id="l2" target="_blank" rel="nofollow" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u='.$url.'&amp;title="><img title="MySpace" border="0" src="modules/mod_nice_social_bookmark/icons/myspace_'.$iset.'_'.$isize.'.png" alt="MySpace"  width="32px" height="32px" /></a>&nbsp;';
else echo '<a id="l2" target="_blank" rel="nofollow" href="http://'.$mslink.'"><img title="MySpace" border="0" src="modules/mod_nice_social_bookmark/icons/myspace_'.$iset.'_'.$isize.'.png" alt="MySpace" width="32px" height="32px" /></a>&nbsp;';}
$tt = $params->get('s3', 'yes');
if ($tt == "yes"){ if ($twlink == "")
echo '<a id="l3" target="_blank" rel="nofollow" href="http://twitter.com/home?status='.$url.'&amp;title="><img title="Twitter" border="0" src="modules/mod_nice_social_bookmark/icons/twitter_'.$iset.'_'.$isize.'.png" alt="Twitter" width="32px" height="32px" /></a>&nbsp;';
else echo '<a id="l3" target="_blank" rel="nofollow" href="http://'.$twlink.'"><img title="Twitter" border="0" src="modules/mod_nice_social_bookmark/icons/twitter_'.$iset.'_'.$isize.'.png" alt="Twitter" width="32px" height="32px"  /></a>&nbsp;';}
$tt = $params->get('s4', 'yes');
if ($tt == "yes")echo '<a id="l4" target="_blank" rel="nofollow" href="http://digg.com/submit?phase=2&amp;url='.$url.'&amp;title="><img title="Digg" border="0" src="modules/mod_nice_social_bookmark/icons/digg_'.$iset.'_'.$isize.'.png" alt="Digg" width="32px" height="32px" /></a>&nbsp;';
$tt = $params->get('s5', 'yes');
if ($tt == "yes")echo '<a id="l5" target="_blank" rel="nofollow" href="http://del.icio.us/post?url='.$url.'&amp;title="><img title="Delicious" border="0" src="modules/mod_nice_social_bookmark/icons/delicious_'.$iset.'_'.$isize.'.png" alt="Delicious" width="32px" height="32px" /></a>&nbsp;';
$tt = $params->get('s6', 'yes');
if ($tt == "yes")echo '<a id="l6" target="_blank" rel="nofollow" href="http://www.stumbleupon.com/submit?url='.$url.'&amp;title="><img title="Stumbleupon" border="0" src="modules/mod_nice_social_bookmark/icons/stumbleupon_'.$iset.'_'.$isize.'.png" alt="Stumbleupon" width="32px" height="32px" /></a>&nbsp;';
$tt = $params->get('s7', 'yes');
if ($tt == "yes")echo '<a id="l7" target="_blank" rel="nofollow" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk='.$url.'&amp;title="><img title="Google Bookmarks" border="0" src="modules/mod_nice_social_bookmark/icons/google_'.$iset.'_'.$isize.'.png" alt="Google Bookmarks" width="32px" height="32px" /></a>&nbsp;';
$tt = $params->get('s8', 'yes');
if ($tt == "yes"){if ($rsslink == "")
echo '<a id="l8" target="_blank" rel="nofollow" href="'.$rss_url.'/index.php?format=feed&amp;type=rss&amp;title="><img title="RSS Feed" border="0" src="modules/mod_nice_social_bookmark/icons/rss_'.$iset.'_'.$isize.'.png" alt="RSS Feed" width="32px" height="32px" /></a>&nbsp;';
else echo '<a id="l8" target="_blank" rel="nofollow" href="'.$rsslink.'"><img title="RSS Feed" border="0" src="modules/mod_nice_social_bookmark/icons/rss_'.$iset.'_'.$isize.'.png" alt="RSS Feed" width="32px" height="32px" /></a>&nbsp;';}
echo '</div><div style="clear:both;"></div>';
?>

Hope this help.

Share
This entry was posted in CSS, Joomla, Performance and tagged , , , . Bookmark the permalink.

One Response to Nice Social Bookmark – no img width and height attributes

  1. For the future planning this blog is very useful and supportive to php programmer.

Leave a Reply to Singapore WebDesign Cancel reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free