Skip to Content Skip to Menu

Please help with modified superthumb module

  • amnion
  • amnion
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
17 years 1 month ago #47655 by amnion
I modified the cb_superthumb module so that it would display the avatar in the center instead of aligned left, and also so it wouldn't automatically size the images. It was distorting them. What I did was remove the two lines of code that called for the avatar's height and width;

Everything works great in Mozilla, but not in IE. I was wondering if someone could please take a look and help me fix it so it will work with IE.

[code:1]<?php
/*
* @name mod_CB_superthumb 1.0
* Created By Yose and Andy Sikumbang
* www.templatePlazza.com
* @copyright Copyright (C) 2007 TemplatePlazza.com / All rights reserved.
* @license www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/


defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$count = intval( $params->get( 'count', 10) );
$modulename = intval( $params->get( 'modulename', 2) );
$viewname = intval( $params->get( 'viewname', 0) );
$viewgroup = intval( $params->get( 'viewgroup', 1) );
$user = mosGetParam( $_REQUEST, 'user', 0 );

if ($viewname == 0) {
// changed by ERW
//$s = "c.username";
$s = "u.username";
} else {
// changed by ERW
//$s = "c.name";
$s = "u.name";
}


switch ($modulename)
{
case 2 : // Random USer
//$sql = "select u.id, u.name, c.avatar from #__users u, #__comprofiler c where u.id = c.user_id order by rand() desc limit " . $count;
$sql = "select u.id, $s, c.avatar from #__users u, #__comprofiler c where u.id = c.user_id order by rand() desc limit " . $count;
break;
case 3 : // Latest Pony
//$sql = "select u.id, u.name, c.avatar from #__users u,#__comprofiler c, #__ponygallery p where u.id = c.user_id and u.name = p.owner and p.published = 1 group by u.id order by p.imgdate desc limit " . $count;
$sql = "select u.id, $s, c.avatar from #__users u,#__comprofiler c, #__ponygallery p where u.id = c.user_id and u.name = p.owner and p.published = 1 group by u.id order by p.imgdate desc limit " . $count;
break;
case 4 : // Latest Login
//$sql = "select u.id, u.name, c.avatar from #__users u,#__comprofiler c where u.id = c.user_id group by u.id order by u.lastvisitDate desc limit " . $count;
$sql = "select u.id, $s, c.avatar from #__users u,#__comprofiler c where u.id = c.user_id group by u.id order by u.lastvisitDate desc limit " . $count;
break;
case 5 : // Most Popular
//$sql = "SELECT u.id, u.name, c.avatar, count(*) as num FROM #__comprofiler_views v, #__comprofiler c, #__users u where v.profile_id = c.id and c.user_id = u.id group by u.id order by num desc limit " . $count;
$sql = "SELECT u.id, $s, c.avatar, count(*) as num FROM #__comprofiler_views v, #__comprofiler c, #__users u where v.profile_id = c.id and c.user_id = u.id group by u.id order by num desc limit " . $count;
break;
case 6 : // last updated profile
//$sql = "select u.id, u.name, c.avatar from #__users u, #__comprofiler c where u.id = c.user_id and c.lastupdatedate > '0000-00-00 00:00:00' group by u.id order by c.lastupdatedate desc limit " . $count;
$sql = "select u.id, $s, c.avatar from #__users u, #__comprofiler c where u.id = c.user_id and c.lastupdatedate > '0000-00-00 00:00:00' group by u.id order by c.lastupdatedate desc limit " . $count;
break;
case 7 : // Latest RS Gallery Update
//$sql = "select u.id, u.name, c.avatar from #__users u, #__comprofiler c, #__rsgallery2_files p where u.id = c.user_id and u.id = p.userid and p.published = 1 group by u.id order by p.date desc limit " . $count;
$sql = "select u.id, $s, c.avatar from #__users u, #__comprofiler c, #__rsgallery2_files p where u.id = c.user_id and u.id = p.userid and p.published = 1 group by u.id order by p.date desc limit " . $count;
break;
case 8 : // connection
//$sql = "select u.id, u.name, c.avatar FROM #__users u, #__comprofiler c, #__comprofiler_members a WHERE u.id = c.user_id and c.user_id = a.memberid and a.referenceid=".$my->id." AND a.accepted=1 AND a.pending=0 group by u.id limit " . $count;
$sql = "select u.id, $s, c.avatar FROM #__users u, #__comprofiler c, #__comprofiler_members a WHERE u.id = c.user_id and c.user_id = a.memberid and a.referenceid=".$my->id." AND a.accepted=1 AND a.pending=0 group by u.id limit " . $count;
break;
case 9 : // online user
//$sql = "select u.id, u.name, c.avatar FROM #__users u, #__comprofiler c, #__comprofiler_members a, #__session AS s WHERE u.id = c.user_id and c.user_id = a.memberid and u.username = s.username group by u.id limit " . $count;
$sql = "select u.id, $s, c.avatar FROM #__users u, #__comprofiler c, #__comprofiler_members a, #__session AS s WHERE u.id = c.user_id and c.user_id = a.memberid and u.username = s.username group by u.id limit " . $count;
break;
default : // Latest Profile
//$sql = "select u.id, u.name, c.avatar from #__users u, #__comprofiler c, #__comprofiler_plug_profilebook p where u.id = c.user_id and u.id = p.userid and p.published = 1 group by u.id order by p.date desc limit " . $count;
$sql = "select u.id, $s, c.avatar from #__users u, #__comprofiler c, #__comprofiler_plug_profilebook p where u.id = c.user_id and u.id = p.userid and p.published = 1 group by u.id order by p.date desc limit " . $count;
}
$database->setQuery($sql);
//print($database->getQuery());
$data = $database->loadObjectList();



if (count($data) > 0) {
?>

<?php // Move this CSS link into your index.php header to make this module valid XHTML
echo '<link href="'.$mosConfig_live_site.'/modules/cb_superthumb/style.css" rel="stylesheet" type="text/css" />';
echo '<!-- CB SuperThumb from www.templatePlazza.com -->';
?>
<div class="superthumb_wrapper">
<?php
$k = count($data);
$i = 0;
while ($i < $k) {
?>
<?php
$dat = $data[$i];

if ($dat->avatar != NULL) {
if (ereg("^gallery", $dat->avatar) == false) {
$dat->avatar = "tn" . $dat->avatar;
}
$img = "<img width=\"".$width_thumbcb."\" height=\"".$height_thumbcb."\" src=\"images/comprofiler/" .$dat->avatar ."\" alt=\" ". $dat->name." \" border=\"0\"/>";
} else {
$img = "<img width=\"".$width_thumbcb."\" height=\"".$height_thumbcb."\" src=\"components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg\" alt=\" ". $dat->name."\" border=\"0\"/>";
}

$arr = Array();
$sql = "SELECT s.id_group, g.name FROM #__gj_users s, #__gj_groups g where s.id_group = g.id and s.id_user = " . $dat->id;
$database->setQuery($sql);
$grp = $database->loadObjectList();


if (count($grp) > 0) {
$arr[0] = $grp[0]->name;
$arr[1] = $grp[0]->id_group;
} else {
$arr[0] = NULL;
$arr[1] = NULL;
}

$link_cb = sefRelToAbs("index.php?option=com_comprofiler&amp;task=userProfile&amp;user=$dat->id"«»);
if ($arr[1] != NULL) {
$tmp = sefRelToAbs("index.php?option=com_groupjive&amp;task=showgroup&amp;groupid=" . $arr[1]);
$link_gjive = "<a href=\"" .$tmp. "\">" . $arr[0] . "</a>";
} else {
$link_gjive = $arr[0];
}

?>
<div class="superthumb_inner" style="float:center;">
<a href="<?php echo $link_cb;?>"><?php echo $img;?></a><br />
<a class="superthumb_uname" href="<?php echo $link_cb;?>">
<!-- edited+added by ERW -->
<?php
if ($viewname == 0) { $name = $dat->username; }

?>

<?php echo $name; ?>
<!-- end edited and replaced ERW -->
<?php /*echo $dat->name;*/ ?>

</a>
<br/>
<?php if($viewgroup == 1) { ?>
<span class="superthumb_gjive"><?php echo $link_gjive; ?></span>
<?php } else { ?>
<?php } ?>
</div>
<?php
$i++;
?>
<?php
}
?>
</div><div style="clear:both"></div>
<?php
} else {
if ($modulename == 8) {
echo "<div>You don't have any friend connection.</div>";
}
if ($modulename == 9) {
echo "<div>No online user.</div>";
}
}

if ($modulename == 8) {
echo "<div><br/><a href=\"index.php?option=com_comprofiler&amp;task=manageConnections\">Manage connection</a>";
if ($user != $my->id && $user > 0) {
$sql = "select a.* FROM #__comprofiler_members a WHERE
a.referenceid=".$my->id." and a.memberid=".$user."";
$database->setQuery($sql);
$rows = $database->loadObjectList();
if (count($rows) > 0) {
$row = $rows[0];
if (($row->accepted == 1) && ($row->pending == 0)) {
echo "&nbsp;|&nbsp;<img src=\"modules/cb_superthumb/delete.png\" alt=\"Revoke\"/><a
href=\"index.php?option=com_comprofiler&amp;task=removeConnection&amp;act=connection&amp;connectionid=".$user."\">Remove
Connection</a>";
} elseif (($row->accepted == 1) && ($row->pending == 1)) {
echo "&nbsp;|&nbsp;<img src=\"modules/cb_superthumb/delete.png\" alt=\"Remove\"/><a
href=\"index.php?option=com_comprofiler&amp;task=removeConnection&amp;act=connections&amp;connectionid=".$user."\">Revoke
Connection</a>";
}
} else {
echo "&nbsp;|&nbsp;<img src=\"modules/cb_superthumb/add.png\" alt=\"Add\"/><a
href=\"index.php?option=com_comprofiler&amp;task=addConnection&amp;act=connection&amp;connectionid=".$user."\">Request
Connection</a>";
}
}
echo "</div>";
}
?>

[/code:1]

Yeah, but it's a sweet car bed. | www.fatalfitness.com

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum