Index Photos

I have created a second Shared Photos Gallery but I'm having a hard time getting the photos to display on the index page like the standard gallery does. BxBaseIndex and PageView seem to be the only docs that make reference to the photos on the index. I've looked in both and made changes (had to reverse the changes) and all I got was a blank white page. Any ideas?

Quote · 27 Dec 2009

inc/header.inc.php

 

Take a look at it, it'll make sense to you.

Quote · 28 Dec 2009

I have the changes made to header.inc

In PageView, I have

77 => array(
'Func'      => 'SharePhotos',
'Content'   => '',
'Caption'   => '_Photo Gallery',
'Visible'   => 'non,memb',
'DesignBox' => 1

Now I'm trying to add

77 => array(
'Func'      => 'SharePhotos2',
'Content'   => '',
'Caption'   => '_Photo Gallery',
'Visible'   => 'non,memb',
'DesignBox' => 1

Where SharePhotos2 calls BxDolShareMedia2 (in BxBaseIndex). I'm doing an exact copy. All I'm changing is the "Func" and the call to BxDolShareMedia.

Quote · 28 Dec 2009

Your calling 77 => array...

 

That's your issue.  You need to assign a different value to this as it's recognizing 77 => array as belong to ShareMedia and ShareMedia2.  This creates a conflict as it can't be the same value for both.

 

Think of your sever as a 2 year old.  It's going to exactly as you tell it and if you give it conflicting information it won't be able to make a decision.  It only follows orders, it does not pick and choose which order to follow and if the orders conflict then it goes into a loop completely confused until you clarify the orders

Quote · 29 Dec 2009

That was actually an error on my part. I did it correctly but I took a short cut when pasting here. I copied 77 twice and just added a "2" where needed. I believe the original was 88 or 89. I removed it because I was having problems. So I don't recall the exact number. I went into the db and looked at the last entry which was about 86 or 87 then created a record following the next consecutive number. I wanted to make sure there was no other record with that id. Still, it appears to work when it is in the format;

** => array(
'Func'      => 'SharePhotos2',
'Content'   => '',
'Caption'   => '_Photo Gallery',
'Visible'   => 'non,memb',
'DesignBox' => 1

All that works correctly. It's when the 2 is introduced to BxBaseIndex.

The original doc is

function getBlockCode_SharePhotos() {
global $site;
global $dir;

$aMem = array('ID'=>$this->iMemberID);
$oNew = new BxDolSharedMedia('photo', $site, $dir, $aMem);
$aRes = $oNew->getBlockCode_SharedMedia();

return $aRes;
}

I copied the above and pasted directly below with the following changes

function getBlockCode_SharePhotos2() {               <---- as altered in PageView
global $site;
global $dir;

$aMem = array('ID'=>$this->iMemberID);
$oNew = new BxDolSharedMedia2('photo', $site, $dir, $aMem);         <---- as altered for the second Gallery
$aRes = $oNew->getBlockCode_SharedMedia();

return $aRes;
}

This is when the page goes white. It works with the 2 on SharePhotos2. When the 2 is added to BxDolSharedMedia, it is what is causing the white page. However, removing the 2 there calls the original gallery photos and I have two boxes on the index displaying the same content.

Quote · 30 Dec 2009

I think you missing this function

$oNew = new BxDolSharedMedia2('photo', $site, $dir, $aMem);

inside the file BxDolSharedMedia.php

Quote · 31 Dec 2009

Where would I put that?

I do have a file bxdolsharedmedia2.php for the second gallery (which works fine).

Quote · 31 Dec 2009

 

Where would I put that?

 

I do have a file bxdolsharedmedia2.php for the second gallery (which works fine).

 Look inside your BxDolMediaShare.php file for:

 

$oNew = new BxDolSharedMedia('photo', $site, $dir, $aMem);

 

 

And place the new line that OKWeb gave you in the correct spot.

Quote · 31 Dec 2009

I have searched the entire archive and I have no file with the name BxDolMediaShare.php

I do have a file with the name BxDolSharedMedia.php

The only references within that document to "BxDolSharedMedia" are

"class BxDolSharedMedia {"

and

"function BxDolSharedMedia($sMediaType, &$aSite, &$aDir, &$aMember)"

within BxDolSharedMedia2.php, a 2 is added after "...Media" in each instance listed above.

Am I missing something?

Quote · 2 Jan 2010

I have created a second Shared Photos Gallery but I'm having a hard time getting the photos to display on the index page like the standard gallery does. BxBaseIndex and PageView seem to be the only docs that make reference to the photos on the index. I've looked in both and made changes (had to reverse the changes) and all I got was a blank white page. Any ideas?

Have you made a new upload site and a new DB table to save information  to your second Shared Photo Gallery,

if not this will not work.

If you have, you need to edit your new file inc/classes/BxDolSharedMedia2.php

find function BxDolSharedMedia2($sMediaType, &$aSite, &$aDir, &$aMember)

and there you need to edit this code

switch($sMediaType) {
case 'photo':
$this->sPrLinkPar = 'permalinks_gallery_photos';
$this->sFilesPath = $this->aConfigDir['sharingImages2'];
$this->sFilesUrl  = $this->aConfigSite['sharingImages2'];
$this->sMainTable = 'sharePhotoFiles2';

sharePhotoFiles2 -> new DB tables to your second Shared Photo Gallery

I'm sure there are more places you will need to change the code or add DB tables to get this to work,

url/permalinks, tags, fav, edit, save, delete etc

good luck

Quote · 3 Jan 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.