Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 07:50

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Another simple question
PostPosted: 23. Mar 2013, 06:47 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
I have another simple question. :)

I have installed TWG and it seems to be working fine and everyone likes it a lot. So far, so good. Now I'm trying to integrate it into one of the pages on the new site that is being developed and I'm running into a problem. I did try changing the DOCTYPE as suggested in the installation instructions but that didn't seem to make a difference. I think the problem is with the $install_dir parameter but I don't know what it should be for my folder structure.

Here's the folder structure:

abc
.......... application
.................... config
.................... controllers
.............................. controller.php
.................... inc
.................... layouts
.................... modules
.............................. photogallery.php
.................... templates
.......... data
.......... docs
.......... library
.......... storage
.......... bootstrap.php

public_html
.......... css
.......... js
.......... media
.......... twg
.......... index.php

When a URL is received ("http://abc.com/index.php?page=photogallery"), index.php calls the bootstrap routine (abc/bootstrap.php). It calls a routine in the config folder and then calls controller.php (abc/application/controllers/controller.php). If the page parameter indicates that the desired page is the photogallery, then controller.php will call photogallery.php, which is located in the modules folder.

In photogallery.php, I have the following statements:

<?php
$php_include=true;
$install_dir= '/twg/';
include "http://www.abc.com/twg/index.php";
?>

TWG does come up in the page but it's kind of a mess. There's a message that it cannot find its cache, which leads me to think the problem is with the $install_dir parameter.

Is that correct? And what should the value of that parameter be, given the folder structure I have described?

Many thanks for your help! The product is very good and I'm happy to have purchased a license for it. :)

Brian


Top
 Profile  
 
PostPosted: 23. Mar 2013, 15:47 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Install dir hast to be relative and the include as well.

like

include "../../../public_html/twg/index.php";



and
$php_include=true;
and
$install_dir= '../../../public_html/twg';

has to be set in the config of TWG!
your setting is overwritten by the config.

Best,
Michael


Top
 Profile  
 
PostPosted: 23. Mar 2013, 17:12 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
Michael,

Thank you for such a quick reply! :)

I used .realpath to determine the path that I needed to get to twg since I wasn't sure which of the directories was considered the active directory, given the various includes. It turns out that

include "../public_html/twg/index.php"

will get to twg and include index.php successfully. Once I got that working, I went to the TWG configuration section and looked for the $php_include and $install_dir parameters. Since I didn't see options to set them in the menus, I decided that perhaps I needed to add them into the "Additional" section, so I entered these values in the "Additional Settings".

$php_include=true;
$install_dir = '../public_html/twg/';


I also checked the my_config.php file to make sure that the settings were being written to it and I found these lines in that file:

$additional="\$php_include=true; -NL-\$install_dir = \'../public_html/twg/\';";
/* extra parameters set in the additional page in the TWG admin */
$php_include=true;

$install_dir = '../public_html/twg/';

When I tested TWG on the page, it is a little better than before but still is not functioning correctly. Before, none of the links were functional. Now, they are all functional and TWG knows how many galleries there are and how many photos in each and so on but nothing displays correctly. So it's a bit of progress but, obviously, I'm still missing something.

What am I doing wrong?

Thank you for your help!
Brian


Top
 Profile  
 
PostPosted: 23. Mar 2013, 18:02 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
It occurred to me that perhaps the cache was an issue, so I deleted and rebuilt the image cache and deleted the session cache. Unfortunately, as you probably already guessed, that didn't make any difference. :)


Top
 Profile  
 
PostPosted: 23. Mar 2013, 19:52 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
Looking at other things, I saw that you used double-quotes in your reply as opposed to the single quotes I used (because I'm used to languages that use those). I changed the single-quotes to double-quotes and that, too, made no difference:

$php_include=true;
$install_dir = "../public_html/twg/";


Top
 Profile  
 
PostPosted: 23. Mar 2013, 22:06 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
this does not make a difference.
I php you can use both but they have a slighly different meaning. single quotes is the way you should use ;).

So what is not working exactly?

Have you looked in the log file?

Best,
Michael


Top
 Profile  
 
PostPosted: 23. Mar 2013, 23:35 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
After not being able to find a problem, I decided to go back and make sure that it was still working by using a plain URL to access twg/index.php -- which had been working perfectly. That, too, no longer worked at all properly. I was not sure if it's supposed to or not with "$php_include=true;" set but thought that there was a possibility that I had somehow screwed TWG up so I deleted it from the server and re-installed it. It worked fine (see photo 1, below).

When I add these settings:

$php_include=true;
$install_dir = "../public_html/twg/";


accessing it by the URL results are shown in photo 2, below.

With the include settings set, trying to access it through inclusion results in what we see in photo 3.

Finally, there are errors recorded in the debug log, which I'm including, below.

I honestly have no idea what's going on. :)

Brian


Last edited by BrianNY on 24. Mar 2013, 19:35, edited 2 times in total.

Top
 Profile  
 
PostPosted: 24. Mar 2013, 11:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
if you configure the php include and the install path then direct access does not work anymore because all paths are wrong.

And so it does look in the 2 other pictures.

I'm just wondering . because if index.php is the main files which handels everything it has to be in the public_html folder.
and then
$install_dir = "twg/";
should work fine. But I don't know how your whole include stuff is organized...

- Michael


Top
 Profile  
 
PostPosted: 24. Mar 2013, 16:24 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
Okay, I'll play around with it. I'll put some debugging info in some of the TWG php modules to see if I can figure out the right include structure for my folder organization. I'll post back with what I find.

Brian


Top
 Profile  
 
PostPosted: 24. Mar 2013, 17:57 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
This post was deleted because of references to my full name. ;)


Last edited by BrianNY on 24. Mar 2013, 19:36, edited 1 time in total.

Top
 Profile  
 
PostPosted: 24. Mar 2013, 19:33 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
It works!

Michael, I didn't realize how the $install_dir worked. Tracing it through, I realized that you are using it to build URLS and that the path I was using was resulting in incorrect URLS. As soon as I changed it to

$install_dir = "twg/";

(as you suggested :D ), it worked fine!

Thank you for your help. It's a really good product and I look forward to learning more about it. :)

Brian


Last edited by BrianNY on 24. Mar 2013, 19:38, edited 1 time in total.

Top
 Profile  
 
PostPosted: 24. Mar 2013, 19:37 
Offline

Joined: 20. Mar 2013, 22:55
Posts: 13
PS: I just went back and deleted the files and posts/partial posts that had references to the full URL for the site I'm building for the local town or to my name.

Brian


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy