| Author |
Message |
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
Posted: Thu Oct 30, 2003 10:33 am Post subject: |
|
|
slackbladder wrote: › Hi,
this:
Code: ›
define(ALBUM_BASEADDR, "http://www.induni.com/albums/";);
needs to be this:
Code: ›
define(ALBUM_BASEADDR, "http://www.induni.com/albums/");
Also this:
Code: ›
define(SERVER_ADDR, "http://www.induni.com/";);
needs to be this:
Code: ›
define(SERVER_ADDR, "http://www.induni.com/");
I made these changes and still have the same error. Again my code:
Code: › <?php
global $gallery;
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Developed by Dariush Molavi at NukedGallery.net
* Version 1.0
* 8 August 2003
*/
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violation\n";
exit;
}
$GALLERY_BASEDIR = "d:\Websites\induni\modules\Gallery\";
define(ALBUM_BASEADDR, "http://www.induni.com/albums/");
define(SERVER_ADDR, "http://www.induni.com/");
require_once($GALLERY_BASEDIR . "init.php");
require_once($GALLERY_BASEDIR . "random_support.php");
define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache");
define(CACHE_EXPIRED, 86400);
/* VALID VALUES FOR $selector:
* "DAILY"
* "HOURLY"
* "RANDOM"
*/
$selector = "HOURLY";
if($selector=="DAILY"){
$content = daily_photo();
}
else if ($selector=="HOURLY"){
$content = hourly_photo();
}
else if ($selector=="RANDOM"){
list($album, $index) = get_random_photo_id();
$content = random_photo($album, $index,0);
}
?>
dari wrote: › you may also have to escape out the backslashes in your path, ie:
Code: › $GALLERY_BASEDIR = "d:\\Websites\\induni\\modules\\Gallery\\";
try slackbladder's suggestion first, then this one (ie, not both at the same time) so that we can further assist.
I made the change to escape the \ and get the following error, so I took out the extra \'s and am back where we started.
Quote: › Fatal error: Cannot redeclare getnls() (previously declared in d:\Websites\induni\modules\Gallery\nls.php:43) in D:\Websites\induni\modules\gallery\nls.php on line 42
Thanks for the fast responses guys. ...any other suggestions? |
|
| Back to top |
|
|
AdBot
|
|
| Back to top |
|
 |
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Oct 30, 2003 10:41 am Post subject: |
|
|
Have you tried changing block-NG-random.php to 'RANDOM' instead of 'HOURLY'?
Does it produce the same error? _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
Posted: Thu Oct 30, 2003 11:52 am Post subject: |
|
|
Changed $selector = "HOURLY"; to $selector = "RANDOM";
Still have the same parse error. Quote: › Parse error: parse error, unexpected T_STRING in D:\Websites\induni\blocks\block-NG-random.php on line 32
The actual line 32 is: define(ALBUM_BASEADDR, "http://www.induni.com/albums/"); |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Thu Oct 30, 2003 12:16 pm Post subject: |
|
|
i noticed this: http://gallery.menalto.com/modules.php? ... ws-iis.php
stating that IIS is NOT supported by Gallery. however, we will try to do our best to help you. let me look over your errors and try to figure something out. _________________
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Thu Oct 30, 2003 12:21 pm Post subject: |
|
|
that type of parse error is usually generated because of a problem on the preceding line (no semicolon at the end, etc). however, it looks like yours is ok...my only guess is the pathing of your gallery (the fact that it uses windows, with the backslash, which PHP reserves as an escape character). actually, put the escaped backslashes in there, so that you get the redeclare error, i think i've worked this one out before. _________________
 |
|
| Back to top |
|
|
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
|
| Back to top |
|
|
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
Posted: Fri Oct 31, 2003 1:05 am Post subject: |
|
|
| Okay, I searched the forums and found that the general solution to a redeclare error has been to use "require_once". Though I'm not sure of the context that should go around the NLS.PHP function to make that work with having the double backslashes in the block page. |
|
| Back to top |
|
|
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
Posted: Fri Oct 31, 2003 12:18 pm Post subject: |
|
|
Issue fixed for Windows / IIS users who want to use the Random picture block!
Original File contains the following code in the block-NG-random.php file.
Code: › $GALLERY_BASEDIR = "/home/httpd/htdocs/modules/gallery/";
Originally I had the full Windows path to the gallery folder as you can see if above code blocks. Most of us know that when using windows you use a \ instead of a / when using pathing. However, this will work if you enter the following:
Code: › $GALLERY_BASEDIR = "modules/gallery/";
At least that's all I did and everything is working! Thanks Slack and Dari so very much for your help! |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Fri Oct 31, 2003 12:23 pm Post subject: Re: How can I fix it? |
|
|
Nice one - glad you sorted it. Thx for posting back for other IIS users!  _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Fri Oct 31, 2003 12:24 pm Post subject: |
|
|
great job glad to hear it's working for ya. i'll make this thread sticky so other IIS users can see it easily if needed. _________________
 |
|
| Back to top |
|
|
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
Posted: Fri Oct 31, 2003 12:33 pm Post subject: |
|
|
Also, in the random_support.php page you must add this
Code: › $count = floatval($count);
in front of:
Code: › $choose = rand(1, $count);
Otherwise you will get out of bounds errors occasionally.
Hope this helps the few Windows / IIS users out there.  |
|
| Back to top |
|
|
|
|
|
|
|