Great work.. I'm running the 2.5.1 RC2 version because I found there were too many bugs in 2.5b3 with my server config.
I modified your code to make the thumblinks open to the full pic in a new window when clicked. I don't know if this will work with the 2.5b3 so proceed with caution. I'm also no coder by any means but it works for me quite nicely.
NOTE: If your Joomla installation is in a different folder than root, update the two instances of /images/zoom/.... to /yourjoomlafolder/images/zoom....
EDIT FILE /...comprofiler/plugin/user/plug_cbzoomtab/zoom.php
[code:1]<?php
/**
* Zoom Tab Class for handling the CB tab api
* @package Community Builder
* @author Unknown, PeterMixt, JoomlaJoe, Beat
*/
class getZoomTab extends cbTabHandler {
/**
* Constructor
*/
function getZoomTab() {
$this->cbTabHandler();
}
/**
* Generates the HTML to display the user profile tab
* @param object tab reflecting the tab database entry
* @param object mosUser reflecting the user being displayed
* @param int 1 for front-end, 2 for back-end
* @returns mixed : either string HTML for tab content, or false if ErrorMSG generated
*/
function getDisplayTab($tab,$user,$ui) {
global $database,$mosConfig_live_site,$acl,$my,$mosConfig_absolute_path;
$return="";
if(!file_exists('components/com_zoom/etc/zoom_config.php')){
return _UE_ZOOMNOTINSTALLED;
}
$params=$this->params;
$imgNumberPerPage = $params->get('imgNumberPerPage', '10');
$imgTextIfNoImg = $params->get('imgTextnoImg', _UE_NOZOOMIMGS);
$imgTextAbovePics = $params->get('imgTextAbovePics', _UE_ZOOMGALLERY);
if ($imgTextAbovePics == ""«») $imgTextAbovePics = " ";
$imgPhotoName = $params->get('imgPhotoName', '1');
$imgSortByAllowed = $params->get('imgSortByAllowed', 0);
$pagingParams = $this->_getPaging(array(),array("img_"«»));
if ($imgSortByAllowed != '1') $pagingParams["img_sortby"] = null;
switch ($pagingParams["img_sortby"]) {
case "category":
$order = "z.catname ASC, zf.imgdate DESC";
break;
case "hits":
$order = "zf.imghits DESC, zf.imgdate DESC";
break;
case "date":
default:
$order = "zf.imgdate DESC, zf.imghits DESC";
break;
}
$queryGet = "SELECT zf.imgid, zf.imgfilename, zf.imgname, zf.imgdate, zf.imghits, zf.imgdescr, zf.published, zf.catid, zf.uid, z.catdir, z.catname";
$queryCount = "SELECT COUNT(zf.imgfilename)";
$queryRest = "\n FROM #__zoomfiles zf"
. "\n INNER JOIN #__zoom z ON zf.catid=z.catid"
. "\n WHERE zf.uid=".$user->id;
$queryLimit = "\n ORDER BY ".$order
. "\n LIMIT ".($pagingParams["img_limitstart"]?$pagingParams["img_limitstart"]:"0"«»).",".$imgNumberPerPage;
$database->setQuery($queryCount.$queryRest);
$total = $database->loadResult();
if($total<1) {
if ($imgTextIfNoImg) {
if ($tab->description != null) $return .= "\t\t<div class=\"tab_Description\">".unHtmlspecialchars(getLangDefinition($tab->description))."</div>\n";
$return .= $imgTextIfNoImg;
}
return $return;
}
if ($tab->description != null) $return .= "\t\t<div class=\"tab_Description\">".unHtmlspecialchars(getLangDefinition($tab->description))."</div>\n";
$database->setQuery ($queryGet.$queryRest.$queryLimit);
$photos = $database->loadObjectList();
$database->setQuery("SELECT id FROM #__menu WHERE link = 'index.php?option=com_zoom' AND published=1"«»);
$Itemid = $database->loadResult();
if ($Itemid) $itemurl = "&Itemid=".$Itemid;
else $itemurl = "";
$ZoomPath =$params->get('ZoomPath') ;
if ($imgSortByAllowed) {
$return.= "<div class=\"cbZoomSorting\" style=\"margin-bottom:10px;\">".sprintf(_UE_CLICKTOSORTBY, ":"«»);
$return .= "<span style=\"margin:12px;\">".$this->_writeSortByLink($pagingParams,"img_","date",_UE_FORUMDATE,true)."</span>";
$return .= "<span style=\"margin:12px;\">".$this->_writeSortByLink($pagingParams,"img_","category",_UE_FORUMCATEGORY)."</span>";
$return .= "<span style=\"margin:12px;\">".$this->_writeSortByLink($pagingParams,"img_","hits",_UE_FORUMHITS)."</span>";
$return.= "</div>";
}
foreach ($photos as $photo) {
$thumbphoto = $photo->imgfilename;
$photoname = $photo->imgname;
$photoname = wordwrap($photoname, 8, "\n", 1);
$imgdir = $photo->catdir;
$thumbpath = "/thumbs/";
$return.= "<div class=\"containerBox\">";
$return.= "<a href=\"".sefRelToAbs("index.php?option=com_zoom".$itemurl."&catid=".$photo->catid)."\"><b>".$imgTextAbovePics."</b></a><br />";
$return.= "<a href=\"".sefRelToAbs("/images/zoom/".$photo->catdir."/".$thumbphoto)."\" target=\"u_blank\">"
."<img src=\"/images/zoom/$photo->catdir$thumbpath$thumbphoto\" border=\"0\" alt=\"\" title=\"".htmlentities(stripslashes($photo->imgdescr))."\" />"
."</a>\n";
if ($imgPhotoName == 1) {
$return.= "<br />".htmlentities(str_replace("\n"," ",stripslashes($photoname)))."\n";
}
$return.= "</div>";
}
$return .= "<div style=\"clear:both;\"> </div>";
if ($imgNumberPerPage < $total) {
$return .= "<div style='width:95%;text-align:center;'>"
.$this->_writePaging($pagingParams, "img_", $imgNumberPerPage, $total)
."</div>";
}
return $return;
}
} // end class getZoomTab.
?>[/code:1]
Post edited by: SRTKOTA, at: 2007/06/22 07:19
Post edited by: SRTKOTA, at: 2007/06/22 07:20