Skip to Content Skip to Menu

help with Gallery2 plugin

  • skunkpit
  • skunkpit
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
18 years 2 months ago #19724 by skunkpit
Replied by skunkpit on topic Re:help with Gallery2 plugin
im getting similar errors

Fatal error: Call to a member function on a non-object in /mounted-storage/www/joomla/components/com_comprofiler/plugin/user/plug_g2bridge/g2bridge.php on line 160

using
com_gallery2_v2.0.13-beta2

CB_plugin_gallery2

galery2.1

cb 1.0.1
joomla 1.0.10



158 /* count total */
159 list ($ret, $results) = $gallery->search($countQuery, $data);
160 if ($ret->isError()) {
161 /* error reporting, use cb style but have to read it first */
162 return false;
163 }

Post edited by: skunkpit, at: 2006/08/28 01:49

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

  • sastian
  • sastian
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 2 months ago #21494 by sastian
Replied by sastian on topic Re:help with Gallery2 plugin
heres what fixed mine B)

file in location:
components/com_comprofiler/plugin/user/plug_g2bridge/g2bridge.php

[code:1]
<?php

class getg2bridgeTab extends cbTabHandler {
/**
* Constructor
*/
function getg2bridgeTab() {
$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, $my;
$return="";
if(!file_exists('components/com_gallery2/init.inc')){
return _G2BRIDGE_GALLERYNOTINSTALLED;
}
/* setup base */
require_once('components/com_gallery2/init.inc');
core::initiatedG2();
core::classRequireOnce('utility');
core::classRequireOnce('user');
global $gallery, $g2Cache;

$g2ProfileId = utility::getG2Id($user->id);
$g2ViewerId = utility::getG2Id($my->id);

$params=$this->params;
$imgTextIfNoImg = $params->get('imgTextnoImg', _G2BRIDGE_NOIMAGES);
$imgSortByAllowed = $params->get('imgSortByAllowed', 0);
$imgNumberPerPage = $params->get('imgNumberPerPage', '10');
$pagingParams = $this->_getPaging(array(),array("img_"«»));
$offset = $pagingParams["img_limitstart"] ? $pagingParams["img_limitstart"] : 0;

if(empty($imgSortByAllowed)){
$imageList = $params->get('imgSortBy', 'date');
} else {
$imageList = $pagingParams;
}

$data = getList($imageList, $g2ViewerId, $g2ProfileId, $offset, $imgNumberPerPage);

if($data<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";

if(!empty($imgSortByAllowed)){
$return.= "<div style=\"margin-bottom:10px;\">".sprintf(_UE_CLICKTOSORTBY, ":"«»);
$return .= "<span style=\"margin:12px;\">".$this->_writeSortByLink($pagingParams,"img_","date",_G2BRIDGE_SORTLAST,true)."</span>";
$return .= "<span style=\"margin:12px;\">".$this->_writeSortByLink($pagingParams,"img_","hits",_G2BRIDGE_SORTVIEWS)."</span>";
$return .= "<span style=\"margin:12px;\">".$this->_writeSortByLink($pagingParams,"img_","album",_G2BRIDGE_SORTALBUM)."</span>";
$return.= "</div>";
}

foreach ($data as $photo) {
$photo = $photo;
$return.= "<div class=\"containerBox\">";
$return.= "<a href=\"".$photo."\"><b>".$photo."</b></a><br />";
$return.= "<a href=\"".$photo."\">"
."<img src=\"".$photo."\" border=\"0\" alt=\"\" title=\"".$photo."\" />"
."</a>\n";
$return.= "</div>";

}
$return .= "<div style=\"clear:both;\">&nbsp;</div>";
if ($imgNumberPerPage < $data) {
$return .= "<div style='width:95%;text-align:center;'>"
.$this->_writePaging($pagingParams, "img_", $imgNumberPerPage, $data)
."</div>";
}
return $return;
}
}

function getList($imageList, $g2ViewerId, $ownerId, $offset, $count){
global $gallery;

$urlGenerator = $gallery->getUrlGenerator();
switch ($imageList) {
case "album":
$aclIds = core::getAclIds(array('core.view'), $g2ViewerId);
$orderBy = '[GalleryItem::originationTimestamp] DESC';
$albumCheck = 1;
break;
case "hits":
$aclIds = core::getAclIds(array('core.view'), $g2ViewerId);
$orderBy = '[GalleryItemAttributesMap::viewCount] DESC';
$albumCheck = 0;
break;
case "date":
default:
$aclIds = core::getAclIds(array('core.view'), $g2ViewerId);
$orderBy = '[GalleryItem::originationTimestamp] DESC';
$albumCheck = 0;
break;
}

if (empty($aclIds)) {
return array('start' => 0, 'end' => '0', 'count' => 0, 'results' => array());
}

$aclMarkers = GalleryUtilities::makeMarkers(count($aclIds));

$countQuery = sprintf('
SELECT
COUNT([GalleryItem::id])
FROM
[GalleryItem], [GalleryAccessSubscriberMap], [GalleryItemAttributesMap]
WHERE
[GalleryAccessSubscriberMap::itemId] = [GalleryItem::id]
AND
[GalleryItemAttributesMap::itemId] = [GalleryItem::id]
AND
[GalleryItem::canContainChildren] = ?
AND
[GalleryItem::ownerId] = ?
AND
[GalleryAccessSubscriberMap::accessListId] IN (%s)
ORDER BY
%s
', $aclMarkers, $orderBy);

$query = sprintf('
SELECT
[GalleryItem::id]
FROM
[GalleryItem], [GalleryAccessSubscriberMap], [GalleryItemAttributesMap]
WHERE
[GalleryAccessSubscriberMap::itemId] = [GalleryItem::id]
AND
[GalleryItemAttributesMap::itemId] = [GalleryItem::id]
AND
[GalleryItem::canContainChildren] = ?
AND
[GalleryItem::ownerId] = ?
AND
[GalleryAccessSubscriberMap::accessListId] IN (%s)
ORDER BY
%s
', $aclMarkers, $orderBy);

$data = array();
$data[] = $albumCheck;
$data[] = $ownerId;
$data = array_merge($data, $aclIds);

/* count total */
list ($ret, $results) = $gallery->search($countQuery, $data);
/* if ($ret->isError()) { */
/* error reporting, use cb style but have to read it first */
/* return false; */
/* } */
/* $result = $results->nextResult(); */
$numRows = (int)$result[0];

/* fetch the images */
list ($ret, $results) = $gallery->search(
$query, $data, array('limit' => array('offset' => $offset, 'count' => $count)));
/* if ($ret->isError()) { */
/* error reporting, use cb style but have to read it first */
/* return false; */
/* } */

$searchResults = array();
while ($result = $results->nextResult()) {
$itemId = (int)$result[0];
list($ret, $item) = GalleryCoreApi::loadEntitiesById($itemId);
$fields = array();
$title = $item->getTitle() ? $item->getTitle() : $item->getPathComponent();
$fields = preg_replace('/\r\n/', ' ', $title);
list (, $fields) = GalleryCoreApi::fetchItemViewCount($itemId);
list(,$thumbs) = GalleryCoreApi::fetchThumbnailsByItemIds(array($itemId));
$fields = @$urlGenerator->generateUrl(array('view' => 'core.ShowItem', 'itemId' => $thumbs[$itemId]->getderivativeSourceId()));
$fields = @$urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $thumbs[$itemId]->getId()));

$searchResults[] = array('itemId' => $itemId,
'fields' => $fields);
}

$data = array('start' => $numRows == 0 ? 0 : $offset+1,
'end' => $numRows == 0 ? 0 : $offset + sizeof($searchResults),
'count' => $numRows,
'results' => $searchResults);
return $data;
}
?>[/code:1]

Post edited by: sastian, at: 2006/09/25 11:50

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

  • SUPERT
  • SUPERT
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 1 month ago #22012 by SUPERT
Replied by SUPERT on topic Re:help with Gallery2 plugin
Hello,

I was able to install the latest gallery2 plugin successfully with the above changes however none of the user images are appearing?

All my users are sync and I'm already using the latest bridge release along with the newest Gallery2 release.

Am I missing something? No images are appearing for any specific user.

Any help, I would appreciated.

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

  • sastian
  • sastian
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 1 month ago #22031 by sastian
Replied by sastian on topic Re:help with Gallery2 plugin
well in the final analysis, i got gallery to work, people can upload to ther user accounts BUT no pictures sho up in the gallery tab on their profiles. so the patch made the tab show up but really "work" Id still love to see a solution to this too.

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

  • SUPERT
  • SUPERT
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 1 month ago #22050 by SUPERT
Replied by SUPERT on topic Re:help with Gallery2 plugin
I think it might be a permissions issue.

Take a look at this and tell me what you think
forum.4theweb.nl/showthread.php?t=29&highlight=cb+plugin

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

  • junkers
  • junkers
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 3
17 years 10 months ago #27731 by junkers
Replied by junkers on topic Re:help with Gallery2 plugin
Good news all you G2 mavens out there. Michiel (the creator of the g2bridge) is back on the project and is soon to have version 2.0.14 out.

He is open to new feature requests and of course, bug reports, and has a new set of forums going at forum.4theweb.nl/forumdisplay.php?f=5 so get busy with your requests and reports. :)

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

Moderators: beatnantkrileon
Powered by Kunena Forum