Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro
Author Message
mrbilly
Worker
Worker



Joined: Jun 07, 2006
Posts: 114

PostPosted: Tue Jun 27, 2006 5:46 pm Reply with quote

hey all.

I am trying to make a regular html window pop up from one of my sites modules.

To do this on a 'static HTML' site I would usually use using the following java script:



< SCR IPT LANGUAGE= "JavaScript" > < !-- Begin
function popUp() {
props=window.open(' http ://www.ravenphpscripts.com', 'poppage', 'menubar=0, toolbar=0, location=0, directories=0, scrollbars=1, top=134, left=6, height=500 , width=800 ,resizable=1, status=1 , links=1');
}
// End -- >
< / SC RIPT > < A HREF ="javas cript:popUp()" CLASS="test" >Raven Website< /A >




However this will not work in with the php of the module, so I am wondering if someone would help me and advise what the code should be in order to use it with a module in my php site.


thanks all.
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue Jun 27, 2006 6:22 pm Reply with quote

well you can do this in 2 ways,or by putting it with the rest of the java scripts in javscript.php in includes,or by adding it in custom header...
then use the active link in your module...
theoretically that should work..
 
View user's profile Send private message
mrbilly







PostPosted: Tue Jun 27, 2006 6:24 pm Reply with quote

i have no clue how this is all relative.

i mean, what code do i then put in my module so it knows i want a pop up wndow and the sizes and properties of that window.......i.e no scroll bars, no resizing, etc

i am not usre about all this and dont want to mess my files up.
 
montego
Site Admin



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

PostPosted: Tue Jun 27, 2006 9:00 pm Reply with quote

Think of it in terms of a static HTML page where you define your javascript functions at the top in-between your HEAD tags and then within the HTML tags you have "onclick" or other types of "events" on your HTML objects which "trigger" one of your javascript functions.

In nuke, you need to define those functions up in the HEAD (well, actually, you really do NOT have to as it will work even if you echo them out within your module), which is where hitwalkers suggestions are pointing you to. Then, as your module code executes, you write out the appropriate HTML which has the appropriate code to trigger those functions.

If you want an example, you can try to figure out my code in the HTML Newsletter application, but I do have it kind-of spread out in several places...

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
mrbilly







PostPosted: Wed Jun 28, 2006 3:29 am Reply with quote

heu montego......thanks for this reply.....but what do you mean, '.....but I do have it kind-of spread out in several places.....'..?

Also, where can I veiw an example of what i need to acomplish?...any urls?
 
mrbilly







PostPosted: Wed Jun 28, 2006 3:42 am Reply with quote

Ok guys...so my quick google searches have lead me to believe that 'Sommaire' is actually called 'Sommaire Param�trable' and is a programme used for creating PHP....am i corrrect?

please could someone confirm this and if i am correct, help me to find a download to try etc.

this would be a great help because i am presently using a simple html to php converter for creating my new modules and it can seem a nightmare at times when the converter messes up where there is a space in the original html coding...does anyone else have this problem...where you have to make sure there are no spaces in the html coding before you convert it to a php block or module?


thanks
 
hitwalker







PostPosted: Wed Jun 28, 2006 4:02 am Reply with quote

the converters work but not that great in firefox.
the converter can be used here.. [ Only registered users can see links on this board! Get registered or login! ]
 
mrbilly







PostPosted: Wed Jun 28, 2006 4:55 am Reply with quote

yes....but this is my point....i have tried a converter, but it doesnt help make the pop up window scripts part of the html page work correctly in the module and i do not know why.

as montego said before, you should be able to '...echo them out within your module....', but for some reason this doesnt work in the module. i am a little lost as to why this would be?
 
montego







PostPosted: Wed Jun 28, 2006 6:07 am Reply with quote

mrbilly wrote:
heu montego......thanks for this reply.....but what do you mean, '.....but I do have it kind-of spread out in several places.....'..?

Also, where can I veiw an example of what i need to acomplish?...any urls?


First things first...

I was short on time yesterday and so was pointing you to go download my HMTL Newsletter module from my site (the "WWW" icon at the bottom of my posts is the "url" to my site). My quote above was just saying that you would have to dig a little bit to find it.

Now that I have had time to look at it, I had forgotten that I completely changed how I did this in the last release. Here is how I am doing it now.

on click="window.open(this.href, \'ViewNewsletter\'); return false"

Please note that you need to remove the space in "on click" and this needs to be a part of your link. [Edited] Also, you can add any of the window.open additional parameters that you want to set the size of the window and position, for example.

BTW, given your initial posts, it sounded like you already knew how to possibly do this in HTML, hence why I explained it the way I did.
 
montego







PostPosted: Wed Jun 28, 2006 6:16 am Reply with quote

MrBilly and Hitwalker,

I have moved out a few posts from this thread off to where Raven can take a look at them and decide if he wants to move them back.

Please no personal attacks, as this is against this site's policies. I will also PM each of you separately to address why I did this.

Thanks and lets get back on topic now.

Regards,
montego
 
mrbilly







PostPosted: Wed Jun 28, 2006 6:43 am Reply with quote

thank you montego...most sensible......i just think it unfair for me to be expected to divulge personal information for a matter i felt could be dealt with in a 'generic' way.
 
montego







PostPosted: Wed Jun 28, 2006 7:00 am Reply with quote

Maybe so, but he was going to take a little bit of his precious time to help you get it working. That is the kind of person he is.

I tried the "generic way" and it was not good enough, so he was going to help you out more since he knows I am only on the boards in the early AM.
 
mrbilly







PostPosted: Wed Jun 28, 2006 11:08 am Reply with quote

Hi montego....I am still not sure how to implement your following explaination....

montego wrote:
......Here is how I am doing it now.

on click="window.open(this.href, \'ViewNewsletter\'); return false"

Please note that you need to remove the space in "on click" and this needs to be a part of your link.
 
gregexp
The Mouse Is Extension Of Arm



Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Wed Jun 28, 2006 3:06 pm Reply with quote

on click seems to be a javascript property and not able to be run alone( i may be mistakin) but i believe the original code had the answer ur looking for:

< A HREF ="javas cript:popUp()" CLASS="test" >Raven Website< /A >

now if this works in stand alone html, throw the scr ipt code in the includes/javascript then use the link i just posted as a link in the module/block/wherever you want the link to show.

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
gregexp







PostPosted: Wed Jun 28, 2006 3:08 pm Reply with quote

sorry montego just wanted to put my 2 cents in and see if this helps.
 
mrbilly







PostPosted: Wed Jun 28, 2006 4:46 pm Reply with quote

darklord i do not know how to add the javascript to my includes/javascript.php file.

I have no clue because the original html of this java would require changing to php and i do not know how to do this or where to place it in the includes/javascript.php file.

also, it would be far easier and preferable if I could just place the script and link in the module i want it all to work in. this way i will only be messing about with the specific module and it will be less likely for me to mess upo other files in the set up.

how do i intergrate the script in the module i want to create and which i want the html window to pop up from?
 
gregexp







PostPosted: Wed Jun 28, 2006 4:52 pm Reply with quote

Place this in the javascript.php:

Code:
function popUp() { 

props=window.open(' http ://www.ravenphpscripts.com', 'poppage', 'menubar=0, toolbar=0, location=0, directories=0, scrollbars=1, top=134, left=6, height=500 , width=800 ,resizable=1, status=1 , links=1');
}

I removed the <scri pt> tags as everything in that file is wrapped in those tags and to do it twice would cause errors.


Then place this where you'd like to link it:
Code:
< A HREF ="javas cript:popUp()" CLASS="test" >Raven Website< /A >


Hope this is correct.
 
gregexp







PostPosted: Wed Jun 28, 2006 5:08 pm Reply with quote

Sorry but I was trying to explain how to do this with a simple way of defining the javascript function in the entire scope of nuke and calling on it only in that module. To include this into a module, do this:

Create your module in php,

Then you can put the script into another file, lets say js.js in the module itself.

Put this line into your index.php of your module file:

Code:
$module_name = basename(dirname(__FILE__));

echo "<scri pt type=\"text/javascr ipt\" src=\"modules/$module_name/js.js\"></scr ipt>";


then somewhere else within the index.php

Code:
echo"< A HREF =\"javas cript:popUp()\" CLASS=\"test\" >Raven Website< /A >";


now create file called js.js and put that within the module folder:

place this inside js.js:

Code:
function popUp() { 

props=window.open(' http ://www.ravenphpscripts.com', 'poppage', 'menubar=0, toolbar=0, location=0, directories=0, scrollbars=1, top=134, left=6, height=500 , width=800 ,resizable=1, status=1 , links=1');
}
 
mrbilly







PostPosted: Wed Jun 28, 2006 5:12 pm Reply with quote

well darklord, i just pasted the exact code you gave before the final ?> in the includes/javascript.php file without making any changes to it and all i had was a white screen on my website...
 
gregexp







PostPosted: Wed Jun 28, 2006 5:17 pm Reply with quote

Thats the problem, the code I gave you is meant to sit outside that.

just AFTER the last ?> (heredoc I believe its called) add the code and make it LOOK like this:

?>

function popUp() {
props=window.open(' http ://www.ravenphpscripts.com', 'poppage', 'menubar=0, toolbar=0, location=0, directories=0, scrollbars=1, top=134, left=6, height=500 , width=800 ,resizable=1, status=1 , links=1');
}

Dont forget to unspace all the script words as it was necessary to do that so you could see what we were typing as I'm sure you know.
 
aseitz
Regular
Regular



Joined: Mar 08, 2005
Posts: 57
Location: Portland, Oregon USA

PostPosted: Wed Jun 28, 2006 5:18 pm Reply with quote

mrbilly wrote:
well darklord, i just pasted the exact code you gave before the final ?> in the includes/javascript.php file without making any changes to it and all i had was a white screen on my website...


You do realize the code is missing some letters and formatting, right?

for expmple...
Code:
"javas cript:popUp()\"

should read
Code:
"javascript:popUp()\"
... etc.

Just double check for all those and try again.
 
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
gregexp







PostPosted: Wed Jun 28, 2006 5:22 pm Reply with quote

aseitz, that was done as to afoid being blocked by nukesentinel on this site, the codes as they are posted cannot function at all, but the thing is you cant post the html form of script as it would block you. So we space it so that people can see what we mean and try to let them all know to unspace it.
 
aseitz







PostPosted: Wed Jun 28, 2006 5:25 pm Reply with quote

darklord wrote:
aseitz, that was done as to afoid being blocked by nukesentinel on this site, the codes as they are posted cannot function at all, but the thing is you cant post the html form of script as it would block you. So we space it so that people can see what we mean and try to let them all know to unspace it.


Right, I was mearly mentioning that to the other guy. Wink
 
mrbilly







PostPosted: Wed Jun 28, 2006 5:42 pm Reply with quote

hi again darklord.

i am trying your advise on how to do this within the specific module itself and have completed the first 2 stepps.

however the third step is confusing me where you say....now create file called js.js and put that within the module folder:.


i have created the file called js.js but I do not know how or where to place the following text within the file,......

function popUp() {
props=window.open(' http ://www.ravenphpscripts.com', 'poppage', 'menubar=0, toolbar=0, location=0, directories=0, scrollbars=1, top=134, left=6, height=500 , width=800 ,resizable=1, status=1 , links=1');
}



more specifically, I do not know what to put either side of that code. I mean do i enclose the code in <? and ?>
 
gregexp







PostPosted: Thu Jun 29, 2006 5:11 pm Reply with quote

nope, just leave it as is and paste that in there, that should be the only contents of the file.

I have tested this approach on my site both private and public to make sure it worked.

Remember to remove ALL spaces within the code.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro

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 ©