PhocaGallery with Community Builder

Phoca Gallery - image gallery extension
jakobe75
Phoca Member
Phoca Member
Posts: 40
Joined: 25 Mar 2008, 00:50

Re: PhocaGallery with Community Builder

Post by jakobe75 »

I have been following this tread for many years and I am amazed that nobody see's the importance of being able to add and share images across a social platform like CB...Look at Facebook..its almost completely "image driven" at times.

Even in 2008 when this thread started MySpace was the ruler of the web and it had comprehensive image galleries.

I love Phoca, it is extremely powerful it would nice to harness that power into a community like Community Builder or Jom Social and have the same options as a facebook type gallery.


The idea is to create space on your site that users to WANT to spend time in and WANT to ATTRACT other users to come see.

thats why facebook galleries work so well, image tagging, comment notifications...ect.

There was a gallery called SimGallery from simbunch.com that works excellent for CB but unfortunately the developer is not supporting Joomla 1.7 or 2.5 and has pretty much abandoned the project.

now would be a perfect time for phoca to step up and take the lead.

since without SimGallery there are no real solid image galleries for the Communities anymore.

who wants to go hang out on a social network where you CANT share your images or view images from other users.
cvoogt
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 08 Oct 2010, 15:00

Re: PhocaGallery with Community Builder

Post by cvoogt »

We built a Phoca Gallery plugin for Community Builder. It creates a link to the user's Phoca Gallery category.

http://www.plethoradesign.com/downloads ... ery-plugin

This Community Builder plugin assumes that a user should have a category associated with their account. In other words, in the Categories area of Phoca Gallery, edit a category and set it to have some user as an "owner". This plugin detects whether a user is an owner of any Phoca Gallery categories, and picks the first one of these. It creates a link to that category. The ideal setup would be to have one top-level category per user, with sub-categories under that. First create the top-level category for the user, then create the sub-level categories. By default this means it will detect that top-level category and link to this, otherwise it will show a "sorry, no photos available" message. Tested on Joomla 1.5, and known to at least install properly on Joomla 2.5 but has not been tested fully on that platform yet. If the database structure is the same in the 2.5 version, it should work fine.
jakobe75
Phoca Member
Phoca Member
Posts: 40
Joined: 25 Mar 2008, 00:50

Re: PhocaGallery with Community Builder

Post by jakobe75 »

Although Phoca is quite powerful in being a gallery. I dont believe it can compete as a social network gallery.

to much is required.

such as...
photo tagging, wall integrations for uploads, posts, comments and ratings.

sure it may work great as a standalone gallery built onto CB but if you can't be social with your images easily on the site then whats the point?

Users must be able to easily upload and mange the images, set the images as a profile pic, tag friends and be able to send/receive notifications of all of this .....and also complete almost any task that has become common place on the bigger social nets.

I will check out your plugin soon. Thanks!
Viktor V
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 28 Feb 2012, 22:47

Re: PhocaGallery with Community Builder

Post by Viktor V »

I found solution.

Download plugin from link above.

Open phoca.php

on line 25 replace

Code: Select all

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

Code: Select all

if ( ! ( defined( '_VALID_CB' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) { die( 'Direct Access to this location is not allowed.' ); } 
find all three variables (lines 63, 131 and 133)

Code: Select all

$database
and replace them with

Code: Select all

$_CB_database
It works for me in joomla 2.5 and CB 1.8 but showing only category but not last 5 photos so, you may want to change

Code: Select all

<tab name="Phoca Gallery" description="Showing 5 recent photos from this user" class="getphocaTab" fields="0" position="cb_tabmain" displaytype="tab">
to

Code: Select all

<tab name="Phoca Gallery" description="Showing Gallery Categories from this user" class="getphocaTab" fields="0" position="cb_tabmain" displaytype="tab">
in phoca.xml before install
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48714
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: PhocaGallery with Community Builder

Post by Jan »

OK
If you find Phoca extensions useful, please support the project
srbmaddie
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 31 Mar 2012, 21:03

Re: PhocaGallery with Community Builder

Post by srbmaddie »

this solution allows the plugin to be installed. tab appears on CB profile but instead of showing pics you get this:
Showing 5 recent photos from this user
View Photos
Clicking on "view photos" results in a 404 error. The test user has 2 photos published. Thank you for your help! Excited to get this working!

Viktor V wrote:I found solution.

Download plugin from link above.

Open phoca.php

on line 25 replace

Code: Select all

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

Code: Select all

if ( ! ( defined( '_VALID_CB' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) { die( 'Direct Access to this location is not allowed.' ); } 
find all three variables (lines 63, 131 and 133)

Code: Select all

$database
and replace them with

Code: Select all

$_CB_database
It works for me in joomla 2.5 and CB 1.8 but showing only category but not last 5 photos so, you may want to change

Code: Select all

<tab name="Phoca Gallery" description="Showing 5 recent photos from this user" class="getphocaTab" fields="0" position="cb_tabmain" displaytype="tab">
to

Code: Select all

<tab name="Phoca Gallery" description="Showing Gallery Categories from this user" class="getphocaTab" fields="0" position="cb_tabmain" displaytype="tab">
in phoca.xml before install
Engine
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 06 Apr 2012, 11:10

Re: PhocaGallery with Community Builder

Post by Engine »

I take original Vipindas's plugin. I made some corrections in phoca.php and now in CB profile showing last 8 photos.
Joomla 2.5 and CB 1.8
Here is my phoca.php

Code: Select all

<?php
/**
* Phoca Gallery CB user plugin with tab classes for handling display of latest photos on user profile.
* @version $Id: cb.connections.php 609 2006-12-13 17:30:15Z beat $
* @package Community Builder
* @subpackage phoca.php
* @author Vipindas V G. 
* @copyright (C) www.phoca.cz and www.joomlapolis.com [Respective]
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 1.0
*/

/** ensure this file is being included by a parent file */
if ( ! ( defined( '_VALID_CB' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) { die( 'Direct Access to this location is not allowed.' ); }

class getphocaTab extends cbTabHandler {
	/**
	 * Construnctor
	 */
	function getphocaTab() {
		$this->cbTabHandler();
	}
	
 	/**
	 * Generates the HTML to display the user profile tab
	 * @param  moscomprofilerTab   $tab       the tab database entry
	 * @param  moscomprofilerUser  $user      the user being displayed
	 * @param  int                 $ui        1 for front-end, 2 for back-end
	 * @return mixed                          either string HTML for tab content, or false if ErrorMSG generated
	 */
	function getDisplayTab($tab,$user,$ui) {
		$return = null;
		global $my, $_CB_database,$mosConfig_live_site;

		//Taking parameters
		$params = $this->params; 		
		$is_phoca_plug_enabled = $params->get('hwPlugEnabled', "1");
		$phoca_tab_message = $params->get('hwTabMessage', "Phoca Gallery Plugin!");
		$hwPlugShowTitle = $params->get('hwPlugShowTitle', "1");
		$hwTabStripTitle = $params->get('hwTabStripTitle', "1");
                $hwTabStripTitleLength = (int)$params->get('hwTabStripTitleLength',10);
                $hwTabNoPhotoMessage = $params->get('hwTabNoPhotoMessage','Sorry, no photos available.');

		if ($is_phoca_plug_enabled != "0") {
			//Show the description
			if($tab->description != null) {
				$return .= "\t\t<div class=\"tab_Description\">"
					. $tab->description	
					. "</div>\n";
			}

			//Main query
			$query="SELECT photos.filename as filename, photos.title as title, cats.id as catid "
			. "\n FROM #__phocagallery as photos "
			. "\n JOIN #__phocagallery_categories as cats "
			. "\n ON cats.id = photos.catid "
			. "\n WHERE cats.published = 1 "	//Where the category is published?
			. "\n AND cats.approved= 1 "		//And the category is approved?
			. "\n AND photos.published= 1 "		//And the image is published?
			. "\n AND photos.approved= 1 "		//And the image is approved?
			. "\n AND cats.owner_id= ".$user->id	//Take the user
			. "\n ORDER BY photos.ordering ASC LIMIT 8";
			 

			$_CB_database->setQuery($query);			
			$pgitems=$_CB_database->loadObjectList();
	
			if(count($pgitems) >0 ){
				foreach($pgitems as $imageitem) {
					$photoTitle = trim($imageitem->title);
					$strippedTitle = $photoTitle;
					if($hwTabStripTitle != "0"){
						$strippedTitle = substr($photoTitle,0,$hwTabStripTitleLength);
						if($photoTitle!=$strippedTitle){
							$strippedTitle = $strippedTitle."...";
						}
					}
					if($hwPlugShowTitle != "0"){
						$return .='<div style="text-align: center; width: 220px;float:left;" ><a target="_blank" href="images/phocagallery/'.$imageitem->filename.'"><b>'.$strippedTitle.'</b></a><br/>';	
					}
					$file = str_replace('/','/thumbs/phoca_thumb_m_',$imageitem->filename);
					$return .='<div style="height: 233px;"><a href="images/phocagallery/'.$imageitem->filename.'" target="_blank"><img border="0" title="'.$photoTitle.'" alt="" src="images/phocagallery/'.$file.'" style="border:1px solid #999999;"/></a></div><br/></div>';
				}
				
				$return .= '<div style="width:100%;float:left;text-align:right;"><a href="'.$mosConfig_live_site.'/index.php?option=com_phocagallery&view=category&id='.$pgitems[0]->catid.'" style="color:red">View this Gallery<a></div>';

			}
			else{
				$return .='<div>'.$hwTabNoPhotoMessage.'</div>';
			}	

			//Comment this if you need :(
			$return .= '<div style="width:100%;float:left;text-align:center;"><a href="http://vipindas.co.nr" target="_blank" style="color:green">&copy; Phoca Gallery Plugin by Vipindas<a></div>';
			$return .= '<div style="clear: both;"> </div>';
		}
		else{
			$return = "\t\t<div class=\"tab_Description\"> This plugin was not enabled.</div>";
		}
		
		
		return $return;
	}  
}  
?>
Now I Looking the way for using css from PhocaGallery in CB profile.

PS: Sorry for my poor English. :)
Post Reply