Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

including index.php file
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=2885
Page 1 of 1

Author:  havock [ 25. Jan 2011, 22:52 ]
Post subject:  including index.php file

Hey all,

I am trying to includ the index.php file in my existing php site. I'd prefer the php mothod over the iFrame.

I was unable to find the example_php_include.php file that the FAQ references and when I did a search onthe forum the words were too common so please forgive this I'm sure already asked question.

The FAQ says I need to set the follow :$php_include=true; and $install_dir="twg/".

My setup is mainsite --> twg sub folder.

So I did this at the top of my gallery.php file:

?<php
$php_include=true;
$install_dir="twg/".
>?

(I intentionally broke the php above)

I also tried adding a ; after the twg/".

this resulted in a black page being shown. When I remove the above code and simply used:

?>php include("twg/index.php"); >? I get the "please select a gallery" and languages menu at the the top.
followed by a message that says "No Images Uploaded Yet"
followed by the bottom information (total visits etc)

then the remainder of the page layout after the include is broken.

In the admin I get the following lines in the debug:

01.25.2011 20:22:51 (en) - ERROR 2 in php/site/twg/index.php, line 164: Cannot modify header information - headers already sent by (output started at /srv/www/php/site/gallery2.php:4)
01.25.2011 20:22:51 (en) - ERROR 2 in site/twg/inc/head.inc.php, line 21: Cannot modify header information - headers already sent by (output started at /srv/www/php/site/gallery2.php:4)
01.25.2011 20:22:51 (en) - ERROR 2 in site/twg/inc/filefunctions.inc.php, line 2122: copy(buttons/twg.gif) [_a href='function.copy'_function.copy_/a_]: failed to open stream: No such file or directory

I'd appreciate any help.

Author:  TinyWebGallery [ 26. Jan 2011, 01:55 ]
Post subject:  Re: including index.php file

you have to set this settings in the my_config.php and not in your php file.

Best,
Michael

Author:  havock [ 26. Jan 2011, 20:46 ]
Post subject:  Re: including index.php file

Micheal, thanks for the tip that fixed the problem with the php include but caused 2 other problems.
Well 1 new one and 1 existing one continues.
the first problem and previously existing is that anything after the php include is broken, I'll have to break out firebug unless there is something obvious I'm missing.

the new problem is that when I click on a picture to view it full size I get a message about no files being uploaded yet. I also get this message if I try to access index.php directly in the twp folder.

thanks

Author:  TinyWebGallery [ 26. Jan 2011, 22:10 ]
Post subject:  Re: including index.php file

have you read the howto yet? There it is explained how to include TWG with php include.
Of course calling the index.php direclty will lead to an error.

- Michael

Author:  havock [ 26. Jan 2011, 23:23 ]
Post subject:  Re: including index.php file

I've read the php how to in the FAQ on the site. Is there another how-to I should be reading? The one in the diectory points me to the online FAQ.

I've set the following in my_config
$php_include=true;
$install_dir='twg/';

I've also set the Doc type as recommended in the FAQ.

I then call the index file with

php include('twg/index.php';)

the index file appears just fine, everything after it is broken.
When I click on a gallery it opens just fine and shows the picture thumbnails.
When I click on a thumnail the picture opens fine.
the problem is when I click on the picture to open it in a window it says it's opened /twg/index.php
there is no styles attached, it is just text and says "No images uploaded yet"

thanks,
-Rob

Author:  TinyWebGallery [ 26. Jan 2011, 23:55 ]
Post subject:  Re: including index.php file

have you installed TWG in
twg/
and is your file in the directory where the twg dir is?

- Michael

Author:  havock [ 27. Jan 2011, 00:07 ]
Post subject:  Re: including index.php file

I installed twg in a sub-folder of my site called twg.

my gallery.php file which is calling the /twg/index.php file is in the site root.

Author:  TinyWebGallery [ 27. Jan 2011, 00:24 ]
Post subject:  Re: including index.php file

I just tested again with the latest version and it works fine. Make sure to have this settings in my_config.php.

- Michael

Author:  havock [ 27. Jan 2011, 17:52 ]
Post subject:  Re: including index.php file

Here is the contents of my my_config.php file.

$browser_title_prefix= 'Landscaping';
$default_gallery_title= 'Landscaping Portfolio';
$skin= 'admin';
$icon_set= 'lightgrey';
$show_border= 'FALSE';

$resize_only_if_too_big= true;
$show_clipped_images= false;

$show_comments= false;
$show_image_rating= false;
$show_image_rating= false;
$show_help_link= false;
$open_in_maximized_view= true;

$text= 'Landscaping';
$php_include=true;
$install_dir='twg/';

Author:  TinyWebGallery [ 27. Jan 2011, 18:04 ]
Post subject:  Re: including index.php file

looks o.k. - can you sent am an url with pm?

- Michael

Author:  TinyWebGallery [ 28. Jan 2011, 09:28 ]
Post subject:  Re: including index.php file

$open_in_maximized_view= true;

in php include is not working - i'll check the code...

- Michael

Author:  TinyWebGallery [ 28. Jan 2011, 10:53 ]
Post subject:  Re: including index.php file

This setting does actually not make sense. Because when you include TWG in your code it is not possible anymore to render a fullscreen TWG.
In the code I did disable this but not the possibility to start this mode. I'll disable this in the next version.

You have to decide what you want fullscreen or not. Fullscreen + php include is not possible.

Have fun using TWG,
Michael

Author:  havock [ 28. Jan 2011, 18:16 ]
Post subject:  Re: including index.php file

Is using an iFrame restricted in the same way?

Author:  TinyWebGallery [ 28. Jan 2011, 22:32 ]
Post subject:  Re: including index.php file

no - the fullscrenn is then only in the iframe.

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/