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  

0.5.4 block-G2_ImageBlock
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
dari

Site Admin
Site Admin


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

PostPosted: Wed Mar 01, 2006 3:55 pm    Post subject: Re: 0.5.4 block-G2_ImageBlock Reply with quote

yeah, i need to fix the default integration field values in the admin for first-timers to include any prefixes before /modules/...
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: Re: 0.5.4 block-G2_ImageBlock  

Back to top
kungfoo

Wizard
Wizard


Joined: Jan 30, 2006
Posts: 75

PostPosted: Wed Mar 01, 2006 7:11 pm    Post subject: Re: 0.5.4 block-G2_ImageBlock Reply with quote

Dari, saw your last post, and thought to myself... "self, thats an excellent idea!"

Dug through some php docs and there's no $_SERVER var (that I could find) that returns the document path, without the document, and you can't use __FILE__ because you can't gaurantee everyone's webroot will be public_html, or how many subdirectories deep the admin.php file is.

So I took a stab using my trusty preg_match code Smile

Code: ›
    if($installed == 0) {

   $docpath = $_SERVER['PHP_SELF'];
   preg_match("/^(.*)?(admin.php)/i", $docpath, $matches);
   $nukepath = $matches[1];

        $embedUri = $nukepath."modules.php?name=".$module_name;
        $g2Uri = $nukepath."modules/".$module_name."/";
        $loginRedirect = $nukepath."modules.php?name=Your_Account";


I tested this and it worked just fine for me. Is there any reason the admin.php wouldn't be admin.php? If so, then that wouldn't work.

$nukeurl is another alternative... The following code would provide setup configurations with the full URL.

change #1 (add $nukeurl)
change #2 (fix the paths)
Code: ›
#1:
function DisplayMainPage() {
   global $admin, $prefix, $db, $currentlang, $admin_file, $module_name, $dbname, $embedVersion, $nukeurl;


#2
    if($installed == 0) {
        $embedUri = $nukeurl."/modules.php?name=".$module_name;
        $g2Uri = $nukeurl."/modules/".$module_name."/";
        $loginRedirect = $nukeurl."/modules.php?name=Your_Account";
        $activeUserId = 0;


This second chunk of code seems the most simple. I tested that also, seems to work just fine. Being based on $nukeurl, I'm assuming this has to be configured properly or other things beyond gallery wouldn't be working. Right?

My $0.02,
kungfoo
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


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

PostPosted: Thu Mar 02, 2006 8:01 am    Post subject: Re: 0.5.4 block-G2_ImageBlock Reply with quote

yes, admin.php can be renamed to asdfhklh24fdkdhsag.php in new versions of nuke, for security reasons...just use the $admin_file (i think) variable...
_________________
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: 6284
Location: Washington Township, NJ, USA

PostPosted: Thu Mar 02, 2006 8:43 am    Post subject: Re: 0.5.4 block-G2_ImageBlock Reply with quote

also, turns out that my implementation of the integration doesn't require loginRedirect, so adding $nukeurl to the embed/g2Uri values would be the best route here Smile methinks i'll change that.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
kungfoo

Wizard
Wizard


Joined: Jan 30, 2006
Posts: 75

PostPosted: Thu Mar 02, 2006 9:23 am    Post subject: Re: 0.5.4 block-G2_ImageBlock Reply with quote

Cool!
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


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

PostPosted: Thu Mar 02, 2006 9:37 am    Post subject: Re: 0.5.4 block-G2_ImageBlock Reply with quote

i'm making that update, along with a few others. should hopefully have 0.5.10 out later today.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
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: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSEO Search Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaCheap Web Design

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