Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
corpse




Joined: Apr 06, 2008
Posts: 33

PostPosted: Thu May 08, 2008 10:13 pm
Reply with quote

over on my test site. I did the Lightbox on my site to work with any image that well, basically I wanted. added the code to the header.php.

I went to do that on my main site and it messed up the light box for the digital shop. What I am wondering is if there is a way of instead of installing it like normal on my site, but if there was a way I can just have it run off the digital shops Lightbox? I figured I asked here before I went digging through all the files.
 
View user's profile Send private message Visit poster's website
Guardian




Joined: Dec 09, 2006
Posts: 335

PostPosted: Fri May 09, 2008 2:08 am
Reply with quote

Could be a tricky one as I think the Shop uses it's own header files but in essence, you would need to remove the calls to lightbox in the Shop and move the call to nuke header file to ensure the js file is only ever called the once and the function is only called the once.
It is relatively easy in PHP to test if a php file or function has been invoked but I do not have a clue how you could do that with a js file.

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
corpse




Joined: Apr 06, 2008
Posts: 33

PostPosted: Fri May 09, 2008 4:29 am
Reply with quote

You think it would be easier to create let's say, like header2.php and have the same thing you would find in the header.php, but just without the stuff for the lightbox. I would guess that all you would have to do after creating that file is to alter the shop to call for the header2.php rather then header.php.
 
View user's profile Send private message Visit poster's website
Guardian




Joined: Dec 09, 2006
Posts: 335

PostPosted: Fri May 09, 2008 10:27 am
Reply with quote

I have not looked at the Shop templates too much but in theory, yes, that would work.

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
corpse




Joined: Apr 06, 2008
Posts: 33

PostPosted: Sat May 10, 2008 11:19 am
Reply with quote

okay, I will give it a try, I will dig through the files to find the files to alter and alter it to see if it works.
 
View user's profile Send private message Visit poster's website
Guardian




Joined: Dec 09, 2006
Posts: 335

PostPosted: Sat May 10, 2008 1:55 pm
Reply with quote

There is another approach you could take as well.
*nuke allows for a custom header file and will include it automatically if it is there.
You could add some code to that file to detect which module is active - something like
Code:

if ($module_name(!'Digital_Shop')) {
your java include here }
else {
anothing you need to put here in future}

That will include the java call but only if Digital_Shop is not the avtice module.

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
corpse




Joined: Apr 06, 2008
Posts: 33

PostPosted: Sat May 10, 2008 2:07 pm
Reply with quote

huh, I didn't even think about that, I will give that a try.
 
View user's profile Send private message Visit poster's website
Guardian




Joined: Dec 09, 2006
Posts: 335

PostPosted: Sat May 10, 2008 2:28 pm
Reply with quote

You may have have to add the global to that code if it doesnt work but it might be better to test it before adding the java include. A test snippet might look like this;
Code:

global $module_name;
if ($module_name(!'Digital_Shop')) {
echo 'first test valid'; }
else {
echo 'second test valid'; }

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 921

PostPosted: Sat May 10, 2008 6:09 pm
Reply with quote

I've never seen it done like that before Guardian, syntax looks wrong. I think it should be more like:

Code:
if ($module_name != 'Digital_Shop') {
 
View user's profile Send private message Visit poster's website
Guardian




Joined: Dec 09, 2006
Posts: 335

PostPosted: Sun May 11, 2008 4:14 am
Reply with quote

You are right - no idea what I was thinking Sad

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 5 Hours
Forums ©