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  

Error with Gallery

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic
Author Message
XtraX

Novice
Novice


Joined: Aug 02, 2003
Posts: 24

PostPosted: Mon Mar 22, 2004 1:42 pm    Post subject: Error with Gallery Reply with quote

Ok we are using this gallery version Powered by Gallery v1.4.2 on Nuke 7.1 my question is we changed the prefix from nuke to are own prefix for example

nuke_bbuser

OUR PREFIX_bbuser

and we are getting errors becuase i think its looking for the nuke prefix of the user what files do l need to change or edit to fix this problem

XtraX Sad
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Error with Gallery  

Back to top
XtraX

Novice
Novice


Joined: Aug 02, 2003
Posts: 24

PostPosted: Tue Mar 23, 2004 3:34 pm    Post subject: Re: Error with Gallery Reply with quote

Ok maybe I worded this wrong is to why no one has thee answer..

Gallery uses the nuke_prefix from the data base tables to call the user_id etc..

now are problem is the installtion we did of our nuke does not use the nuke prefix in the data_base it uses something simular to this nuke2_user_id or whatever

How do we get gallery to pick up that prefix anyone ..?

XtraX
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: Tue Mar 23, 2004 3:55 pm    Post subject: Re: Error with Gallery Reply with quote

in gallery/init.php edit (after the "case phpnuke"):
PHP: › <?php if (isset($GLOBALS['user_prefix'])) {
                                
$gallery->database{"user_prefix"} = 'nuke_';
                        }
                        else {
                                
$gallery->database{"user_prefix"} = 'nuke_';
                        } 
?>
Back to top
Offline View user's profile Send private message Visit poster's website
XtraX

Novice
Novice


Joined: Aug 02, 2003
Posts: 24

PostPosted: Tue Mar 23, 2004 6:47 pm    Post subject: Re: Error with Gallery Reply with quote

thank you I will try this now and report back to you dari...

IS there any other spot in Gallery that I may also need to do this to to pic up the user_id ..?


XtraX
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: Wed Mar 24, 2004 8:04 am    Post subject: Re: Error with Gallery Reply with quote

nope, since this is the init file, making the change there should take care of it...post back when you have it finished so i know if it works Smile
Back to top
Offline View user's profile Send private message Visit poster's website
XtraX

Novice
Novice


Joined: Aug 02, 2003
Posts: 24

PostPosted: Wed Mar 24, 2004 6:18 pm    Post subject: Re: Error with Gallery Reply with quote

Ok well l did try it and it still throwing a MySQL error ... and the comments still have thos

Comment 0 wirtes or something blah blah blah but the zero being the user Crying or Very sad

It still doesnt want to work ....
Back to top
Offline View user's profile Send private message
XtraX

Novice
Novice


Joined: Aug 02, 2003
Posts: 24

PostPosted: Wed Mar 24, 2004 6:29 pm    Post subject: Re: Error with Gallery Reply with quote

let me get the exact error message that may help you more and l appreciate your patients Smile

Here is the Code: to init.php

Code: › <?php
// Hack prevention.
$sensitiveList = array("gallery", "GALLERY_BASEDIR");
foreach ($sensitiveList as $sensitive) {
   if (!empty($HTTP_GET_VARS[$sensitive]) ||
         !empty($HTTP_POST_VARS[$sensitive]) ||
         !empty($HTTP_COOKIE_VARS[$sensitive]) ||
         !empty($HTTP_POST_FILES[$sensitive])) {
      print _("Security violation") ."\n";
      exit;
   }
}
?>
<?php

error_reporting(E_ALL & ~E_NOTICE);

$register_globals = ini_get("register_globals");
if (empty($register_globals) ||
        !strcasecmp($register_globals, "off") ||
        !strcasecmp($register_globals, "false")) {
    $gallery->register_globals = 0;
} else {
    $gallery->register_globals = 1;
}

if (!$gallery->register_globals) {

    $scrubList = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_POST_FILES');
    foreach ($scrubList as $outer) {
   foreach ($scrubList as $inner) {
       unset(${$outer}[$inner]);
   }
    }
   
    if (is_array($HTTP_GET_VARS)) {
   extract($HTTP_GET_VARS);
    }

    if (is_array($HTTP_POST_VARS)) {
   extract($HTTP_POST_VARS);
    }

    if (is_array($HTTP_COOKIE_VARS)) {
   extract($HTTP_COOKIE_VARS);
    }

    if (is_array($HTTP_POST_FILES)) {
   foreach($HTTP_POST_FILES as $key => $value) {
       ${$key."_name"} = $value["name"];
       ${$key."_size"} = $value["size"];
       ${$key."_type"} = $value["type"];
       ${$key} = $value["tmp_name"];
   }
    }
}

require($GALLERY_BASEDIR . "Version.php");
require($GALLERY_BASEDIR . "util.php");
/* Load bootstrap code */
if (getOS() == OS_WINDOWS) {
   include($GALLERY_BASEDIR . "platform/fs_win32.php");
} else {
   include($GALLERY_BASEDIR . "platform/fs_unix.php");
}


if (fs_file_exists($GALLERY_BASEDIR . "config.php")) {
        global $gallery;
   include($GALLERY_BASEDIR . "config.php");
}
if (isset($gallery->app->devMode) &&
      $gallery->app->devMode == "yes") {
          ini_set("display_errors", "1");
          error_reporting(E_ALL);
} else {
          error_reporting(E_ALL & ~E_NOTICE);
}

if(isset($gallery->app)) {
   if (isset($HTTP_SERVER_VARS["HTTPS"] ) && stristr($HTTP_SERVER_VARS["HTTPS"], "on")) {
      $gallery->app->photoAlbumURL =
         eregi_replace("^http:", "https:", $gallery->app->photoAlbumURL);
      $gallery->app->albumDirURL =
         eregi_replace("^http:", "https:", $gallery->app->albumDirURL);
   } else {
      $gallery->app->photoAlbumURL =
         eregi_replace("^https:", "http:", $gallery->app->photoAlbumURL);
      $gallery->app->albumDirURL =
         eregi_replace("^https:", "http:", $gallery->app->albumDirURL);
   }
}


set_magic_quotes_runtime(0);

require($GALLERY_BASEDIR . "classes/Album.php");
require($GALLERY_BASEDIR . "classes/Image.php");
require($GALLERY_BASEDIR . "classes/AlbumItem.php");
require($GALLERY_BASEDIR . "classes/AlbumDB.php");
require($GALLERY_BASEDIR . "classes/User.php");
require($GALLERY_BASEDIR . "classes/EverybodyUser.php");
require($GALLERY_BASEDIR . "classes/NobodyUser.php");
require($GALLERY_BASEDIR . "classes/LoggedInUser.php");
require($GALLERY_BASEDIR . "classes/UserDB.php");
require($GALLERY_BASEDIR . "classes/Comment.php");

if (!isset($GALLERY_NO_SESSIONS)) {
    require($GALLERY_BASEDIR . "session.php");
}

$gallerySanity = gallerySanityCheck();
initLanguage();

if ($gallerySanity != NULL) {
   include ("${GALLERY_BASEDIR}errors/$gallerySanity");
   exit;
}

if (isset($GALLERY_EMBEDDED_INSIDE) &&
   !strcmp($GALLERY_EMBEDDED_INSIDE, "nuke")) {
        include($GALLERY_BASEDIR . "classes/Database.php");

   if ($GALLERY_EMBEDDED_INSIDE_TYPE == 'postnuke') {
   /* We're in embedded in Postnuke */

       if (!function_exists("pnUserGetVar")) {
      /* pre 0.7.1 */
      include($GALLERY_BASEDIR . "classes/postnuke/UserDB.php");
      include($GALLERY_BASEDIR . "classes/postnuke/User.php");
      
      $gallery->database{"db"} = $GLOBALS['dbconn'];
      $gallery->database{"prefix"} = $GLOBALS['pnconfig']['prefix'] . "_";
       } else {
      /* 0.7.1 and beyond */
      include($GALLERY_BASEDIR . "classes/postnuke0.7.1/UserDB.php");
      include($GALLERY_BASEDIR . "classes/postnuke0.7.1/User.php");
       }

       $gallery->userDB = new PostNuke_UserDB;

       if (isset($GLOBALS['user'])) {
      $gallery->session->username = $GLOBALS['user'];
       }
      
       if (isset($GLOBALS['user']) && is_user($GLOBALS['user'])) {
      $user_info = getusrinfo($GLOBALS['user']);
      $gallery->session->username = $user_info["uname"];
      $gallery->user =
          $gallery->userDB->getUserByUsername($gallery->session->username);
       }
   } else {
   /* we're in phpnuke */
       include($GALLERY_BASEDIR . "classes/database/mysql/Database.php");
       include($GALLERY_BASEDIR . "classes/nuke5/UserDB.php");
       include($GALLERY_BASEDIR . "classes/nuke5/User.php");

       $gallery->database{"nuke"} = new MySQL_Database(
         $GLOBALS['dbhost'],
         $GLOBALS['dbuname'],
         $GLOBALS['dbpass'],
         $GLOBALS['dbname']);
       if (isset($GLOBALS['user_prefix'])) {
      $gallery->database{"user_prefix"} = $GLOBALS['user_prefix'] . '_';
       } else {
      $gallery->database{"user_prefix"} = $GLOBALS['prefix'] . '_';
       }
       $gallery->database{"prefix"} = $GLOBALS['prefix'] . '_';

            /* PHP-Nuke changed its "users" table field names in v.6.5 */
       /* Select the appropriate field names */
       if (isset($Version_Num) && $Version_Num >= 6.5) {
      $gallery->database{'fields'} =
         array ('name'  => 'name',
                'uname' => 'username',
                'email' => 'user_email',
                'uid'   => 'user_id');
       }
       else {
      $gallery->database{'fields'} =
         array ('name'  => 'name',
                'uname' => 'uname',
                'email' => 'email',
                'uid'   => 'uid');
       }
      
       /* Load our user database (and user object) */
       $gallery->userDB = new Nuke5_UserDB;
       if ($GLOBALS['user']) {
      $gallery->session->username = $GLOBALS['user'];
       }
      
       if (isset($GLOBALS['admin']) && is_admin($GLOBALS['admin'])) {
      include($GALLERY_BASEDIR . "classes/nuke5/AdminUser.php");
      
      $gallery->user = new Nuke5_AdminUser($GLOBALS['admin']);
      $gallery->session->username = $gallery->user->getUsername();
       } else if (is_user($GLOBALS['user'])) {
      $user_info = getusrinfo($GLOBALS['user']);
      $gallery->session->username =
         $user_info[$gallery->database{'fields'}{'uname'}];
      $gallery->user =
          $gallery->userDB->getUserByUsername($gallery->session->username);
       }
   }
} else {
   include($GALLERY_BASEDIR . "classes/gallery/UserDB.php");
   include($GALLERY_BASEDIR . "classes/gallery/User.php");

   /* Load our user database (and user object) */
   $gallery->userDB = new Gallery_UserDB;

   /* Load their user object with their username as the key */
   if (isset($gallery->session->username)) {
      $gallery->user =
         $gallery->userDB->getUserByUsername($gallery->session->username);
   }
}

/* If there's no specific user, they are the special Everybody user */
if (!isset($gallery->user)) {
   $gallery->user = $gallery->userDB->getEverybody();
   $gallery->session->username = "";
}

if (!isset($gallery->session->offline)) {
    $gallery->session->offline = FALSE;
}

if ($gallery->userDB->versionOutOfDate())
{
   include($GALLERY_BASEDIR . "upgrade_users.php");
   exit;
}

/* Load the correct album object */
if (!empty($gallery->session->albumName)) {
   $gallery->album = new Album;
   $ret = $gallery->album->load($gallery->session->albumName);
   if (!$ret) {
      $gallery->session->albumName = "";
   } else {
      if ($gallery->album->versionOutOfDate()) {
         include($GALLERY_BASEDIR . "upgrade_album.php");
         exit;
      }
   }
}
?>



And here I applied your Changes:

Code: › <?php
// Hack prevention.
$sensitiveList = array("gallery", "GALLERY_BASEDIR");
foreach ($sensitiveList as $sensitive) {
   if (!empty($HTTP_GET_VARS[$sensitive]) ||
         !empty($HTTP_POST_VARS[$sensitive]) ||
         !empty($HTTP_COOKIE_VARS[$sensitive]) ||
         !empty($HTTP_POST_FILES[$sensitive])) {
      print _("Security violation") ."\n";
      exit;
   }
}
?>
<?php

error_reporting(E_ALL & ~E_NOTICE);

$register_globals = ini_get("register_globals");
if (empty($register_globals) ||
        !strcasecmp($register_globals, "off") ||
        !strcasecmp($register_globals, "false")) {
    $gallery->register_globals = 0;
} else {
    $gallery->register_globals = 1;
}

if (!$gallery->register_globals) {

    $scrubList = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_POST_FILES');
    foreach ($scrubList as $outer) {
   foreach ($scrubList as $inner) {
       unset(${$outer}[$inner]);
   }
    }
   
    if (is_array($HTTP_GET_VARS)) {
   extract($HTTP_GET_VARS);
    }

    if (is_array($HTTP_POST_VARS)) {
   extract($HTTP_POST_VARS);
    }

    if (is_array($HTTP_COOKIE_VARS)) {
   extract($HTTP_COOKIE_VARS);
    }

    if (is_array($HTTP_POST_FILES)) {
   foreach($HTTP_POST_FILES as $key => $value) {
       ${$key."_name"} = $value["name"];
       ${$key."_size"} = $value["size"];
       ${$key."_type"} = $value["type"];
       ${$key} = $value["tmp_name"];
   }
    }
}

require($GALLERY_BASEDIR . "Version.php");
require($GALLERY_BASEDIR . "util.php");
/* Load bootstrap code */
if (getOS() == OS_WINDOWS) {
   include($GALLERY_BASEDIR . "platform/fs_win32.php");
} else {
   include($GALLERY_BASEDIR . "platform/fs_unix.php");
}


if (fs_file_exists($GALLERY_BASEDIR . "config.php")) {
        global $gallery;
   include($GALLERY_BASEDIR . "config.php");
}
if (isset($gallery->app->devMode) &&
      $gallery->app->devMode == "yes") {
          ini_set("display_errors", "1");
          error_reporting(E_ALL);
} else {
          error_reporting(E_ALL & ~E_NOTICE);
}

if(isset($gallery->app)) {
   if (isset($HTTP_SERVER_VARS["HTTPS"] ) && stristr($HTTP_SERVER_VARS["HTTPS"], "on")) {
      $gallery->app->photoAlbumURL =
         eregi_replace("^http:", "https:", $gallery->app->photoAlbumURL);
      $gallery->app->albumDirURL =
         eregi_replace("^http:", "https:", $gallery->app->albumDirURL);
   } else {
      $gallery->app->photoAlbumURL =
         eregi_replace("^https:", "http:", $gallery->app->photoAlbumURL);
      $gallery->app->albumDirURL =
         eregi_replace("^https:", "http:", $gallery->app->albumDirURL);
   }
}


set_magic_quotes_runtime(0);

require($GALLERY_BASEDIR . "classes/Album.php");
require($GALLERY_BASEDIR . "classes/Image.php");
require($GALLERY_BASEDIR . "classes/AlbumItem.php");
require($GALLERY_BASEDIR . "classes/AlbumDB.php");
require($GALLERY_BASEDIR . "classes/User.php");
require($GALLERY_BASEDIR . "classes/EverybodyUser.php");
require($GALLERY_BASEDIR . "classes/NobodyUser.php");
require($GALLERY_BASEDIR . "classes/LoggedInUser.php");
require($GALLERY_BASEDIR . "classes/UserDB.php");
require($GALLERY_BASEDIR . "classes/Comment.php");

if (!isset($GALLERY_NO_SESSIONS)) {
    require($GALLERY_BASEDIR . "session.php");
}

$gallerySanity = gallerySanityCheck();
initLanguage();

if ($gallerySanity != NULL) {
   include ("${GALLERY_BASEDIR}errors/$gallerySanity");
   exit;
}

if (isset($GALLERY_EMBEDDED_INSIDE) &&
   !strcmp($GALLERY_EMBEDDED_INSIDE, "nuke")) {
        include($GALLERY_BASEDIR . "classes/Database.php");

   if ($GALLERY_EMBEDDED_INSIDE_TYPE == 'postnuke') {
   /* We're in embedded in Postnuke */

       if (!function_exists("pnUserGetVar")) {
      /* pre 0.7.1 */
      include($GALLERY_BASEDIR . "classes/postnuke/UserDB.php");
      include($GALLERY_BASEDIR . "classes/postnuke/User.php");
      
      $gallery->database{"db"} = $GLOBALS['dbconn'];
      $gallery->database{"prefix"} = $GLOBALS['pnconfig']['prefix'] . "_";
       } else {
      /* 0.7.1 and beyond */
      include($GALLERY_BASEDIR . "classes/postnuke0.7.1/UserDB.php");
      include($GALLERY_BASEDIR . "classes/postnuke0.7.1/User.php");
       }

       $gallery->userDB = new PostNuke_UserDB;

       if (isset($GLOBALS['user'])) {
      $gallery->session->username = $GLOBALS['user'];
       }
      
       if (isset($GLOBALS['user']) && is_user($GLOBALS['user'])) {
      $user_info = getusrinfo($GLOBALS['user']);
      $gallery->session->username = $user_info["uname"];
      $gallery->user =
          $gallery->userDB->getUserByUsername($gallery->session->username);
       }
   } else {
   /* we're in phpnuke */
       include($GALLERY_BASEDIR . "classes/database/mysql/Database.php");
       include($GALLERY_BASEDIR . "classes/nuke5/UserDB.php");
       include($GALLERY_BASEDIR . "classes/nuke5/User.php");

       $gallery->database{"nuke"} = new MySQL_Database(
         $GLOBALS['dbhost'],
         $GLOBALS['dbuname'],
         $GLOBALS['dbpass'],
         $GLOBALS['dbname']);
       if (isset($GLOBALS['user_prefix'])) {
      $gallery->database{"user_prefix"} = $GLOBALS['user_prefix'] . 'ourprefix_';
       } else {
      $gallery->database{"user_prefix"} = $GLOBALS['prefix'] . 'ourprefix_';
       }
       $gallery->database{"prefix"} = $GLOBALS['prefix'] . '_';

            /* PHP-Nuke changed its "users" table field names in v.6.5 */
       /* Select the appropriate field names */
       if (isset($Version_Num) && $Version_Num >= 6.5) {
      $gallery->database{'fields'} =
         array ('name'  => 'name',
                'uname' => 'username',
                'email' => 'user_email',
                'uid'   => 'user_id');
       }
       else {
      $gallery->database{'fields'} =
         array ('name'  => 'name',
                'uname' => 'uname',
                'email' => 'email',
                'uid'   => 'uid');
       }
      
       /* Load our user database (and user object) */
       $gallery->userDB = new Nuke5_UserDB;
       if ($GLOBALS['user']) {
      $gallery->session->username = $GLOBALS['user'];
       }
      
       if (isset($GLOBALS['admin']) && is_admin($GLOBALS['admin'])) {
      include($GALLERY_BASEDIR . "classes/nuke5/AdminUser.php");
      
      $gallery->user = new Nuke5_AdminUser($GLOBALS['admin']);
      $gallery->session->username = $gallery->user->getUsername();
       } else if (is_user($GLOBALS['user'])) {
      $user_info = getusrinfo($GLOBALS['user']);
      $gallery->session->username =
         $user_info[$gallery->database{'fields'}{'uname'}];
      $gallery->user =
          $gallery->userDB->getUserByUsername($gallery->session->username);
       }
   }
} else {
   include($GALLERY_BASEDIR . "classes/gallery/UserDB.php");
   include($GALLERY_BASEDIR . "classes/gallery/User.php");

   /* Load our user database (and user object) */
   $gallery->userDB = new Gallery_UserDB;

   /* Load their user object with their username as the key */
   if (isset($gallery->session->username)) {
      $gallery->user =
         $gallery->userDB->getUserByUsername($gallery->session->username);
   }
}

/* If there's no specific user, they are the special Everybody user */
if (!isset($gallery->user)) {
   $gallery->user = $gallery->userDB->getEverybody();
   $gallery->session->username = "";
}

if (!isset($gallery->session->offline)) {
    $gallery->session->offline = FALSE;
}

if ($gallery->userDB->versionOutOfDate())
{
   include($GALLERY_BASEDIR . "upgrade_users.php");
   exit;
}

/* Load the correct album object */
if (!empty($gallery->session->albumName)) {
   $gallery->album = new Album;
   $ret = $gallery->album->load($gallery->session->albumName);
   if (!$ret) {
      $gallery->session->albumName = "";
   } else {
      if ($gallery->album->versionOutOfDate()) {
         include($GALLERY_BASEDIR . "upgrade_album.php");
         exit;
      }
   }
}
?>


Now the 'ourprefix_ is what we are using for out tables

And this is the error where still getting

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/virtual/site13/fst/var/www/html/modules/Gallery/classes/database/mysql/Database.php on line 37
Back to top
Offline View user's profile Send private message
Brujo

Novice
Novice


Joined: Apr 21, 2003
Posts: 21

PostPosted: Tue Mar 30, 2004 2:29 pm    Post subject: Re: Error with Gallery Reply with quote

hi together,
i have the same problem since i changed the prefix from nuke_ -> xyz_

with best regards
Brujo
Back to top
Offline View user's profile Send private message
Brujo

Novice
Novice


Joined: Apr 21, 2003
Posts: 21

PostPosted: Tue Mar 30, 2004 2:45 pm    Post subject: Re: Error with Gallery Reply with quote

after playing around if found my mistake. I set in the config.php the user_prefix to the same as prefix and the error was gone

maybe it helps you to.

with best regards
Brujo
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 » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic

 
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 filterWorld Meds Direct

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