Forum Index > FlashYourWeb OS Support > Gallery New Topic Post Reply
 g2 embed - sidebar links to main.php
 |  Printable Version
Anonymous: gbj
 December 08 2010 15:32 PM (Read 1676 times)  


hi
I have embeded the output of main.php into a page called photos01.php and that works fine on loading, but if I use the sidebar navigation on this page it just reloads as main.php

How can I keep my navigation of the sidebar in the embeded page, like it would work in a frame for instance.

Many thx in advance

gbj


 
Quote
suprsidr
 December 08 2010 15:38 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

you need to set the embedUri to the same as the filename of your embed file:
for instance:
my embed:
http://www.mysite.com/photos01.php
my gallery:
http://www.mysite.com/gallery2/main.php

PHP Formatted Code
$ret = GalleryEmbed::init(array('g2Uri'=>'http://www.mysite.com/gallery2/main.php', 'embedUri'=>'http://www.mysite.com/photos01.php', 'fullInit'=>'false'));


Hope this helps

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: gbj
 December 09 2010 02:27 AM  


many thx for your very quick reply

I am testing this at www.motorsnaps.com/photos02.php and I think I am using the right code.

<?php
require_once ('embed.php'Wink;
$ret = GalleryEmbed::init( array ('g2Uri'=>'http://www.motorsnaps.com/main.php', 'embedUri'=>'http://www.motorsnaps.com/photos02.php', 'fullInit'=>'false'Wink);
if ($ret) {
print 'G2 init error: '.$ret->getAsHtml();
}
$gallery->setConfig('login', false);
$g2data = GalleryEmbed::handleRequest();
if ($g2data['isDone']) {
exit;
}
GalleryEmbed::done();
?>

and this in the body

<!-- End Your Html Body -->
<!-- Gallery's Body -->
<?php
echo $g2data['bodyHtml'];
?>
<!-- End Gallery's Body -->
<!-- Your Html Footer -->


This works but clicking on any link in the sidebar loads main.php and I loose my navigation header.

Is there something else I am missing?

Many thx
Godric BJ


 
Quote
suprsidr
 December 09 2010 04:36 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

You'll have to re-setup rewrite and tell it where your embed is located so it can write rules for it.
Gallery Admin -> Rewrite

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: gbj
 December 09 2010 07:18 AM  


I have logged in to admin and gone to URL Rewrite Admin...

In the section called "URL Rewite" the first section is called "show item" and has a green tick for active.
The content of the path is v/%path%

To be honest I am not that famillar with the URL Rewrite call. I would guess that since the page that I have as the target for the embebbing is called photos02.php and it is in the webroot that I replace v/%path% with v/photos02.php. Is that correct?

It had been my intention to have the admin login on main.php and have photos02.php with no login as the public part of the gallery with main.php as the admin page.

Would I be right in thinking that if I move the URL Rewrite path to photos02.php that admin from main.php will not be possible?

I have tried to read up some of this on this forum and in the apache docs... I am not finding it very easy.

I would be so grateful for your help on this... motorsnaps is a live site and not the right place to do too much in the way of learning experiments.

Many thx once again,

godric bj


 
Quote
suprsidr
 December 09 2010 07:52 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

I am no rewrite specialist, and I don't use it here myself.
So I set it up on a test site, and the rules would look like this in .htaccess

PHP Formatted Code

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_URI} !//photos01\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/photos01\.php$
    RewriteRule .   /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/photos01\.php$
    RewriteRule .   /photos01.php?g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section
 


But you'd have to append those to your existing rules that gallery wrote already.
No guarantee these will work.

I used gallery admin -> rewrite -> setup to accomplish this as you should have yourself.

Or you could always turn off rewrite and rename your photos01.php to index.php(replacing gallery's) and have your site default to your new index.php, but still have main.php accessible like I do here:
http://www.flashyourweb.com/gallery2/index.php
http://www.flashyourweb.com/gallery2/main.php

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: Velu
 December 29 2010 05:27 AM  


I looked at both pages (main.php and index.php) at the link you have provided. They look very nice. Is the main.php a customized one or the one that ships with Gallery2 ? What theme and plug-in are you using (because I don't see Gallery logo or powered by Gallery logo in both these pages and also I see you having video and audio files also in the albums)?

I appreciate your help!

Regards,
Velu


 
Quote
suprsidr
 December 29 2010 05:57 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

Is the main.php a customized one or the one that ships with Gallery2

You never customize any of gallery's .php files.
All layout is done with templates(.tpl) and CSS

My gallery uses the carbon theme w/ the background color removed and I released as Clear theme.
There are How-to(s) for removing/changing the logo and such in the gallery docs.

Gallery can also handle audio and video.

Of course the gallery support forums would be a better place to ask about their product.

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: Velu
 December 29 2010 07:56 AM  


Thank you very much for the quick and useful reply


 
Quote
Content generated in: 0.13 seconds
New Topic Post Reply



 All times are PDT. The time is now 12:40 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
HTML Allowed 
Censored Content