Author |
Message |
Naquadah
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Feb 16, 2005
Posts: 12
|
Posted:
Tue Feb 22, 2005 9:16 am |
|
An easy question:
I want to put at the end of my php Nuke (on Footer line 1) this code:
which is a counter and works great on the mainpage, but on the php Nuke it says there is some mistake on the code. What do i have to change?
THanks :-*
edit: something tells me that Iam trying to hack or something like that. It was only 3 lines of code . Ive put them with an image hope it works |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Feb 22, 2005 12:09 pm |
|
You have to ECHO the code for PHP. Are you?
Like:
echo "<scr ipt>"; |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Naquadah
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 22, 2005 4:03 pm |
|
thank you so much raven now it works. You are the one! ![Very Happy](modules/Forums/images/smiles/icon_biggrin.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 22, 2005 4:39 pm |
|
PHP 101 - wish I could take the credit ![RavensScripts](modules/Forums/images/smiles/ravensphpscripts.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
dcasmr
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Feb 06, 2004
Posts: 147
|
Posted:
Tue Feb 22, 2005 7:08 pm |
|
Thanks for your great support ! I now understand how to do it per the link you attached. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
pinkbeef
Client
![](modules/Forums/images/avatars/blank.gif)
Joined: Jul 19, 2005
Posts: 68
|
Posted:
Sat Nov 12, 2005 9:06 pm |
|
I just happen to be zipping around and thought i would try your first example. so i put it into the head of my page just under the first table and all i get is
= <<<_JSCODE_ _JSCODE_; echo ;
I did not change the code just cut and past.
noew i dont mess with js, but for anyone that does and doesant understand the finer points of php, it would appear that your statement
"That's it! You simply insert your JavaScript code as you use it in your HTML document and drop it in". is not quite that simple. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Nov 12, 2005 9:09 pm |
|
Yes it is. If done as I explained, using a REAL editor and not notepad or wordpad, it is that simple. The fact that your code is all on one line and mine is not shows that you haven't done exactly what I outlined ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
pinkbeef
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Nov 13, 2005 2:28 am |
|
I just put it in my includes folder complete as you asked and it worked, so yes your right i failed to follow your instructions. sorry. I use Crimson editor, its great for hex. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Donovan
Client
![](modules/Forums/images/avatars/cf6050824489cc47e6079.jpg)
Joined: Oct 07, 2003
Posts: 735
Location: Ohio
|
Posted:
Wed Jan 25, 2006 9:26 am |
|
Running RavenNuke 2.0.2.
I have been testing both ways to use javascripts for a module I built. The modules uses popup calandars and I inserted this in the includes/custom_files/custom_header.php file.
Code:
<scri pt language="javascript" src="cal2.js">
/*
Xin's Popup calendar script- Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</scri pt>
<scri pt language="javascript" src="cal_conf2.js"></scri pt>
|
But it doesn't work there. It does work when I place this at the very beginning of my header.php file.
Is there any additional include file I need in my pages to use custom_header.php? Do I need to call mainfile or something?
My header has these lines
Code:echo "\n\n\n</head>\n\n";
if (file_exists("includes/custom_files/custom_header.php")) {
include_once("includes/custom_files/custom_header.php");
}
|
...so it should work in both places.
I am finishing the readme.txt for my module and came across this issue.
Getting nervous about the release, as this is my first attempt at PHPNuke module building. ![Shocked](modules/Forums/images/smiles/icon_eek.gif) |
|
|
![ICQ Number ICQ Number](themes/RavenIce/forums/images/lang_english/icon_icq_add.gif) |
![](themes/RavenIce/forums/images/spacer.gif) |
CodyG
Life Cycles Becoming CPU Cycles
![](modules/Forums/images/avatars/186c8977515afcc3ed82a.jpg)
Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Wed Jan 25, 2006 11:05 am |
|
Any chance your cache might be interfering? Need to clear site cookies? |
_________________ "We want to see if life is ubiquitous." D.Goldin |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Donovan
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jan 27, 2006 9:46 am |
|
Well I cleared cookies but no help. If I put this in the header.php it works fine but shouldn't it also work in custom_header.php?
I means that is what that is for, isn't it? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jan 27, 2006 9:49 am |
|
It should work, you are correct. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Fri Jan 27, 2006 9:55 am |
|
I have not tinkered with the custom_header.php yet but you might want to put the full path to cal_conf.js to avoid any issues there.
I assume the custom_header.php file is empty by default so if you are trying to use html you will need to add the <html> tags before and after, if you are trying to load the code via php you might need to use the PHP open and close tags and echo it to the page as described in previous posts in this thread. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Donovan
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jan 27, 2006 10:14 pm |
|
Guardian2003 wrote: | ...yet but you might want to put the full path to cal_conf.js to avoid any issues there.
|
I think that did the trick.
Thanks |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jan 28, 2006 6:09 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Jan 28, 2006 11:17 am |
|
Sorry to butt in here, but I wanted to expound a bit on the solution comments. When it comes to things like external j avascript files and css files, you always have to remember that it is the client-side (browser) that must be able to retrieve that file and parse it.
I try to avoid hardcoding full absolute references to these files (for example: http://www.yourdomain.com/includes/myjsfile.js). You lose flexibility to move things around or if you distribute code, like many of us do, we end up forgetting and distributing code with hard-coded links.
One needs to keep in mind that the links need to be relative to the script file that the browser requested. In this case, that would be modules.php and NOT custom_header.php. Therefore, the correct relative link would be "includes/myjsfile.js", if that is in fact where you physically placed that js file.
Just wanted to take the opportunity to provide more detail in case it may help others to understand better how to do this.
Regards,
montego |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
badcase
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Apr 25, 2006
Posts: 1
|
Posted:
Tue Apr 25, 2006 6:41 pm |
|
I think im retarded cause i have be messing with this for hours i
m trying to put a menu created with xara it created 2 .js files one called xaramenu.js and menu_.js
i was trying to use the example you gave on nukecops
Code:
<?
$content = <<<_JS_
// Your Script Here
_JS_;
?>
|
but im unclear as to exactlly what the code should be mind helpin me out Raven? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Apr 25, 2006 8:47 pm |
|
The code would be whatever javascript code or html that you wanted in your block. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|