Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

How can I fix it? (IIS USERS READ THIS)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Author Message
Klinduni

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 17

PostPosted: Thu Oct 30, 2003 10:33 am    Post subject: Reply with quote

slackbladder wrote: › Hi,

this:
Code: ›
define(ALBUM_BASEADDR, "http://www.****.com/albums/";);

needs to be this:
Code: ›
define(ALBUM_BASEADDR, "http://www.****.com/albums/");

Also this:
Code: ›
define(SERVER_ADDR, "http://www.****.com/";);

needs to be this:
Code: ›
define(SERVER_ADDR, "http://www.****.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\****\modules\Gallery\";
define(ALBUM_BASEADDR, "http://www.****.com/albums/");
define(SERVER_ADDR, "http://www.****.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\\****\\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\****\modules\Gallery\nls.php:43) in D:\Websites\****\modules\gallery\nls.php on line 42

Thanks for the fast responses guys. ...any other suggestions?


Last edited by Klinduni on Tue Aug 04, 2009 11:26 am; edited 1 time in total
Back to top
Offline View user's profile Send private message
AdBot
   Post subject:  

Back to top
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Oct 30, 2003 10:41 am    Post subject: Reply with quote

Have you tried changing block-NG-random.php to 'RANDOM' instead of 'HOURLY'?

Does it produce the same error?
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Klinduni

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 17

PostPosted: Thu Oct 30, 2003 11:52 am    Post subject: Reply with quote

Changed $selector = "HOURLY"; to $selector = "RANDOM";

Still have the same parse error.
Quote: › Parse error: parse error, unexpected T_STRING in D:\Websites\****\blocks\block-NG-random.php on line 32

The actual line 32 is: define(ALBUM_BASEADDR, "http://www.DOMAIN.com/albums/");


Last edited by Klinduni on Tue Aug 04, 2009 11:25 am; edited 1 time in total
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Thu Oct 30, 2003 12:16 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Thu Oct 30, 2003 12:21 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
Klinduni

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 17

PostPosted: Thu Oct 30, 2003 4:20 pm    Post subject: Reply with quote

Okay, I placed the backslashes back into line 31. I have the following redeclare error:
Quote: › Fatal error: Cannot redeclare getnls() (previously declared in d:\Websites\****\modules\Gallery\nls.php:43) in D:\Websites\****\modules\gallery\nls.php on line 42


...and yes, Gallery does not support Windows IIS. ... but I have Gallery running in PHP Nuke well, I was just hoping this would work too. If it doesn't it's not a major issue, just no picture from the Gallery on the homepage. Razz

Thanks slack and dari for your help.


Last edited by Klinduni on Tue Aug 04, 2009 11:25 am; edited 1 time in total
Back to top
Offline View user's profile Send private message
Klinduni

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 17

PostPosted: Fri Oct 31, 2003 1:05 am    Post subject: Reply with quote

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
Offline View user's profile Send private message
Klinduni

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 17

PostPosted: Fri Oct 31, 2003 12:18 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Fri Oct 31, 2003 12:23 pm    Post subject: Re: How can I fix it? Reply with quote

Nice one - glad you sorted it. Thx for posting back for other IIS users! Very Happy
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Fri Oct 31, 2003 12:24 pm    Post subject: Reply with quote

great job Smile 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
Offline View user's profile Send private message Visit poster's website
Klinduni

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 17

PostPosted: Fri Oct 31, 2003 12:33 pm    Post subject: Reply with quote

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. Very Happy
Back to top
Offline View user's profile Send private message
newtrend19

Beginner
Beginner


Joined: Aug 31, 2010
Posts: 1

PostPosted: Tue Aug 31, 2010 4:27 am    Post subject: Re: How can I fix it? (IIS USERS READ THIS) Reply with quote

parse error, unexpected T_STRING in d:\apache group\apache\htdocs\blocks\block-NG-random.php on line 31
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Goto page Previous  1, 2

 
Jump to:  
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 vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannOnline internetSEORestaurant Locator • Get great HP coupons from CouponSnapshot • Search for great dell coupons at CouponSnapshot.com.au • Graduation DressesAndroid TabletSEO IndiaBuy Phen375fuel filter

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia