Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
Naquadah
New Member
New Member


Joined: Feb 16, 2005
Posts: 12

PostPosted: Tue Feb 22, 2005 9:16 am Reply with quote

An easy question:
I want to put at the end of my php Nuke (on Footer line 1) this code:


Image


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 Sad. Ive put them with an image hope it works
 
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Tue Feb 22, 2005 12:09 pm Reply with quote

You have to ECHO the code for PHP. Are you?

Like:

echo "<scr ipt>";
 
View user's profile Send private message
Naquadah
PostPosted: Tue Feb 22, 2005 4:03 pm Reply with quote

thank you so much raven now it works. You are the one! Very Happy
 
Raven
PostPosted: Tue Feb 22, 2005 4:39 pm Reply with quote

PHP 101 - wish I could take the credit RavensScripts
 
dcasmr
Worker
Worker


Joined: Feb 06, 2004
Posts: 147

PostPosted: Tue Feb 22, 2005 7:08 pm Reply with quote

Thanks for your great support ! I now understand how to do it per the link you attached.
 
View user's profile Send private message
pinkbeef
Client


Joined: Jul 19, 2005
Posts: 68

PostPosted: Sat Nov 12, 2005 9:06 pm Reply with quote

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.
 
View user's profile Send private message
Raven
PostPosted: Sat Nov 12, 2005 9:09 pm Reply with quote

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
 
pinkbeef
PostPosted: Sun Nov 13, 2005 2:28 am Reply with quote

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: 735
Location: Ohio

PostPosted: Wed Jan 25, 2006 9:26 am Reply with quote

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. Embarassed Shocked
 
View user's profile Send private message Visit poster's website ICQ Number
CodyG
Life Cycles Becoming CPU Cycles


Joined: Jan 02, 2003
Posts: 712
Location: Vancouver Island

PostPosted: Wed Jan 25, 2006 11:05 am Reply with quote

Any chance your cache might be interfering? Need to clear site cookies?

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
Donovan
PostPosted: Fri Jan 27, 2006 9:46 am Reply with quote

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
PostPosted: Fri Jan 27, 2006 9:49 am Reply with quote

It should work, you are correct.
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Fri Jan 27, 2006 9:55 am Reply with quote

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.
 
View user's profile Send private message Send e-mail
Donovan
PostPosted: Fri Jan 27, 2006 10:14 pm Reply with quote

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
PostPosted: Sat Jan 28, 2006 6:09 am Reply with quote

Cool!
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Sat Jan 28, 2006 11:17 am Reply with quote

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: Only registered users can see links on this board! Get registered or login! 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! 
View user's profile Send private message Visit poster's website
badcase
New Member
New Member


Joined: Apr 25, 2006
Posts: 1

PostPosted: Tue Apr 25, 2006 6:41 pm Reply with quote

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?
 
View user's profile Send private message
Raven
PostPosted: Tue Apr 25, 2006 8:47 pm Reply with quote

The code would be whatever javascript code or html that you wanted in your block.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

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 can attach files in this forum
You can download files in this forum


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