| Author |
Message |
Naquadah New Member


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 |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 14928 Location: Kansas
|
Posted:
Tue Feb 22, 2005 12:09 pm |
|
You have to ECHO the code for PHP. Are you?
Like:
echo "<scr ipt>"; |
|
|
|
 |
Naquadah New Member


Joined: Feb 16, 2005 Posts: 12
|
Posted:
Tue Feb 22, 2005 4:03 pm |
|
thank you so much raven now it works. You are the one!  |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 14928 Location: Kansas
|
Posted:
Tue Feb 22, 2005 4:39 pm |
|
PHP 101 - wish I could take the credit  |
|
|
|
 |
dcasmr Worker


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. |
|
|
|
 |
pinkbeef Client

Joined: Jul 19, 2005 Posts: 65
|
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. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 14928 Location: Kansas
|
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  |
|
|
|
 |
pinkbeef Client

Joined: Jul 19, 2005 Posts: 65
|
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. |
|
|
|
 |
Donovan Client

Joined: Oct 07, 2003 Posts: 675 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.  |
|
|
 |
 |
CodyG PHP-Portal Project

Joined: Jan 02, 2003 Posts: 561 Location: Vancouver Island
|
Posted:
Wed Jan 25, 2006 11:05 am |
|
Any chance your cache might be interfering? Need to clear site cookies? |
|
|
|
 |
Donovan Client

Joined: Oct 07, 2003 Posts: 675 Location: Ohio
|
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? |
|
|
 |
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 14928 Location: Kansas
|
Posted:
Fri Jan 27, 2006 9:49 am |
|
It should work, you are correct. |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 4557 Location: Poland
|
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. |
|
|
|
 |
Donovan Client

Joined: Oct 07, 2003 Posts: 675 Location: Ohio
|
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 |
|
|
 |
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 4557 Location: Poland
|
Posted:
Sat Jan 28, 2006 6:09 am |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7236 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: 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 |
|
|
|
 |
badcase New Member


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? |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 14928 Location: Kansas
|
Posted:
Tue Apr 25, 2006 8:47 pm |
|
The code would be whatever javascript code or html that you wanted in your block. |
|
|
|
 |
|
|
|
|