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  

WIERD problem with Domain Masking

 
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
OmahaVike

Beginner
Beginner


Joined: Oct 25, 2005
Posts: 6

PostPosted: Mon Nov 07, 2005 5:57 pm    Post subject: WIERD problem with Domain Masking Reply with quote

catch this one!

i'm using nuke/g2 install. i have it set up perfectly, and tested it using strict IP calls (i.e. 147.134.2.20, not the real IP, but you get the picture). worked flawlessly

anyhow, i'm migrating it to a live production site, using masked domain forwarding. the albums and photos come up alright, but it is missing the template information. hmmmm....

view source shows me this (domain name/ IP addresses have been changed to protect the innocent):
Code: ›
      var albumTree = new dTree('albumTree');
      albumTree.icon = {
     root            : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/base.gif',
     folder          : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/folder.gif',
     folderOpen      : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/imgfolder.gif',
     node            : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/imgfolder.gif',
     empty           : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/empty.gif',
     line            : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/line.gif',
     join            : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/join.gif',
     joinBottom      : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/joinbottom.gif',
     plus            : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/plus.gif',
     plusBottom      : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/plusbottom.gif',
     minus           : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/minus.gif',
     minusBottom     : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/minusbottom.gif',
     nlPlus          : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/nolines_plus.gif',
     nlMinus         : 'http://testing.mydomain.com/modules/gallery/modules/albumselect/images/nolines_minus.gif'
      };
      albumTree.config.useLines = true;
      albumTree.config.useIcons = true;
      albumTree.config.useCookies = true;
      albumTree.config.closeSameLevel = false;
      albumTree.add(0, -1, " Our Photo Album",
          'http://69.66.140.243:40907/modules.php?name=gallery');
            albumTree.add(1, 0, "2005",
            'http://147.134.2.20/modules.php?name=gallery&g2_view=core.ShowItem&g2_itemId=913');
            albumTree.add(2, 1, "January - February",
            'http://147.134.2.20/modules.php?name=gallery&g2_view=core.ShowItem&g2_itemId=915');
            albumTree.add(3, 1, "March",
            'http://147.134.2.20/modules.php?name=gallery&g2_view=core.ShowItem&g2_itemId=958');
            albumTree.add(4, 1, "April",
            'http://147.134.2.20/modules.php?name=gallery&g2_view=core.ShowItem&g2_itemId=1008');
            albumTree.add(5, 1, "May - June",


notice how in some instances, it uses the fully qualified DN? While in the other, it uses the referenced IP address?

so, i backtraced it into gallery/modules/albumselect/templates/blocks/AlbumTree.tpl

Code: ›
joinBottom      : '{g->url href="modules/albumselect/images/joinbottom.gif"}',


shows masked domain, or the fully qualified DN.

Code: ›
{$albumTree}.add(0, -1, " {$block.albumselect.LoadAlbumData.titles.root|markup:strip}",'{g->url}');


shows the IP address. i find it *very* strange how the same call to

Code: ›
g->url


is resulting in different returned results.

more on this as i dig deeper...
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: WIERD problem with Domain Masking  

Back to top
OmahaVike

Beginner
Beginner


Joined: Oct 25, 2005
Posts: 6

PostPosted: Mon Nov 07, 2005 10:22 pm    Post subject: Re: WIERD problem with Domain Masking Reply with quote

ah ha! got it.

g2 with the integration package is working as designed. no fault of any author.

apparently, what is happening is... with URL forwarding, somehow the url is lost, so g2 defaults to the base url (as you set up in the admin-modules-gallery panel). i happened to have mine set as the FQDN (fully qualified domain name, or testing.mydomain.com).

so, it's a quick hack:

in: gallery/modules/core/classes/GalleryUrlGenerator.class

WARNING: the following is not complete code, please only comment out the two lines in which i exemplify. DO NOT COPY/PASTE.

Code: ›
function generateUrl($params=array(), $forceSessionId=null, $baseUrl=null) {
        global $gallery;
        $currentView = $gallery->getCurrentView();

        /*
         * For non-absolute 'href' urls always use G2 base url
         * (direct to G2 codebase location, even if multisite or embedded),
         * For 'core.DownloadItem' urls or if 'forceDirect' param given, use G2 site url
         * (direct to main.php in directory for active config.php, even if embedded)
         * Otherwise use application url
         * (embed url; same as G2 site url if not embedded)
         */
        if (isset($baseUrl)) {
            $url = $baseUrl;
            $appSession = true;
        } else if (isset($params['href'])) {
            $url = $gallery->getConfig('galleryBaseUrl');
/*   2005.11.07 - OmahaVike - edited two of the next three lines */
/*          if (empty($url)) {   */
                $url = $this->getCurrentUrlDir(true);
/*          }  */

            $href = $params['href'];
            unset($params['href']);
            if (!isset($forceSessionId)) {
                /* Default to not including session id in href urls */
                $forceSessionId = false;
            }


feel free to reply to this, adding any verbiage that might help the search engine index this (appropriately, of course).
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 ServiceNeckermannBluetooth HeadsetOnline internetSEOchina factoryDressesRestaurant Locatorandroid tablet

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