| Author |
Message |
corpse

Joined: Apr 06, 2008
Posts: 33
|
Posted:
Thu May 08, 2008 10:13 pm |
|
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. |
| |
|
|
 |
Guardian

Joined: Dec 09, 2006
Posts: 335
|
Posted:
Fri May 09, 2008 2:08 am |
|
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 |
|
|
 |
corpse

Joined: Apr 06, 2008
Posts: 33
|
Posted:
Fri May 09, 2008 4:29 am |
|
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. |
| |
|
|
 |
Guardian

Joined: Dec 09, 2006
Posts: 335
|
Posted:
Fri May 09, 2008 10:27 am |
|
I have not looked at the Shop templates too much but in theory, yes, that would work. |
_________________ Code Authors Nuke Reviews |
|
|
 |
corpse

Joined: Apr 06, 2008
Posts: 33
|
Posted:
Sat May 10, 2008 11:19 am |
|
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. |
| |
|
|
 |
Guardian

Joined: Dec 09, 2006
Posts: 335
|
Posted:
Sat May 10, 2008 1:55 pm |
|
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 |
|
|
 |
corpse

Joined: Apr 06, 2008
Posts: 33
|
Posted:
Sat May 10, 2008 2:07 pm |
|
huh, I didn't even think about that, I will give that a try. |
| |
|
|
 |
Guardian

Joined: Dec 09, 2006
Posts: 335
|
Posted:
Sat May 10, 2008 2:28 pm |
|
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 |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Sat May 10, 2008 6:09 pm |
|
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') { |
|
| |
|
|
 |
Guardian

Joined: Dec 09, 2006
Posts: 335
|
Posted:
Sun May 11, 2008 4:14 am |
|
|
|
 |
|
|