polarbear

Joined: 2005-03-31
Posts: 1
Posted: Thu, 2005-03-31 08:33

Hi,

I am using MDPro 1.072
I have install the Gallery2 into the my CMS

however it works fine with stand-alone version.
It's doesn't really emmbed into the MDPro.

I have try to change the index.php to the following..

 ----- sorry to cut lines above ------
/* header('Location: main.php');
*/


if (!eregi("modules.php", $_SERVER['PHP_SELF'])) { 
/*    die ("You can't access this file directly...");  */
	header('Location: main.php');
} 

require_once("mainfile.php"); 
$module_name = basename(dirname(__FILE__)); 

  include("header.php"); 
    
  require_once(dirname(__FILE__) . '/embed.php'); 
            
      $ret = GalleryEmbed::init(array( 
           'embedUri' => 'modules.php?name=gallery2', 
           'relativeG2Path' => '../modules/gallery2/', 
           'loginRedirect' => 'index.php', 
           'activeUserId' => '0')); 
  
    GalleryCapabilities::set('showSidebar', false); 
  
    // handle the G2 request 
    $g2moddata = GalleryEmbed::handleRequest(); 
  
    // show error message if isDone is not defined 
    if (!isset($g2moddata['isDone'])) 
    { 
      echo 'isDone is not defined, something very bad must have happened.'; 
      exit; 
    } 
    
    // die if it was a binary data (image) request 
    if ($g2moddata['isDone']) 
    { 
      exit; /* uploads module does this too */ 
    } 
  
     if ($ret->isError()) 
     { 
       echo $ret->getAsHtml(); 
     } 
  
     echo $g2moddata['headHtml']; 
     echo $g2moddata['bodyHtml']; 
    
    include("footer.php"); 
?>

and then it can embed into MDPro
like this URL:http://stud.fhjh.tp.edu.tw/%7Ep924/modules.php?op=modload&name=gallery2&file=index

Everything seems so far so good up to this moment.

Then the problem comes...

When I click into any of the albums, it shows me the error message "the file does not exists" in Chinese...

I think it's some kind of link problem....

In a stand-alone version the link of the albums is show like this...
http://stud.fhjh.tp.edu.tw/~p924/modules/gallery2/main.php?g2_view=core:ShowItem&g2_itemId=9&g2_GALLERYSID=f731d814ea005d8bd561

but in embed version the same albums but display different url like this..
http://stud.fhjh.tp.edu.tw/~p924/modules.php?op=modload&name=gallery2&file=indexmodules.php?name=gallery2&g2_view=core:ShowIt

i want to chang it but, don't know where to change.

so, anybody know how to fix that?

i try the pnGallery, but no use.
Therefore, please help

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-03-31 10:33

I don't know MDPro. all i know is it is a postnuke fork. maybe that's because you tried the postnuke integration.

your problem is the embedUri in the GalleryEmbed::init call. the embedUri has to be a string which is part of all embedded G2 urls.

at the moment you have 'modules.php?name=gallery2'.
but i guess you need embedUri => 'modules.php?op=modload&name=gallery2&file=index'

 
burke
burke's picture

Joined: 2003-12-18
Posts: 7
Posted: Wed, 2005-06-15 03:27

Polarbear -- thanks for providing your mods to the index.php.

Following valiant's advice, I modified the embedUri line but then my image died.. Next I changed the relativeG2Path entry. My changes to your index.php now have the gallery and images loading properly.

'embedUri' => 'modules.php?op=modload&name=gallery2&file=index',
'relativeG2Path' => 'modules/gallery2/',

Now I need to figure out the user/group integration for permissions, etc... have you done that part yet Polarbear?