Newline Characters

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Newline Characters
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 

if ($userinfo[user_popup_pm] == 1) {

$content .= "<s cript language='javas cript'>\n"
    ."<!--\n"
    ."if(confirm('You have a new private message.\n\n\nClick OK to view it, or Cancel to hide this prompt.'))\n"
    ."{var answer = confirm('Open your inbox in a new window?\n\n\n(Press Cancel to open in the current window.)')\n"
    ."if (!answer)\n"
    ."popupwindow=window.location('modules.php?name=Private_Messages')\n"
    ."else\n"
    ."popupWindow=window.open('modules.php?name=Private_Messages', '', 'location=yes,toolbar=yes,menubar=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes,height=480,width=640', false)}\n"
    ."//-->\n"
    ."</s cript>"; }
}


I am using this to notify users of a new PM in PHPnuke. I have modified the code that Telli posted for me in another thread. I am not to good with Javascript. I am stuck in a couple places.

In the confirm boxes I would like to put newline characters so the sentences are on different lines, however I get an error because it thinks I am trying to end the whole line. Is there a way to put a newline in there? (I left the \n\n\n in there to show where I would like to put it, for it to work I had to take it out and all the text appears on one line.)

Any thoughts?


Back to top Reply with quote
#2   re: Newline Characters
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Dont edit that file edit your modules/Forums/language/lang_english/lang_main.php

$lang['Notification_subject'] = 'New Private Message has arrived!';
$lang['Click_view_privmsg'] = 'Click %sHere%s to visit your Inbox';




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Newline Characters
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 
I am really confused. I would like the confirm dialog box that pop up to be formatted differently. I have two sentences and would like three lines between them. If I try to use "\n\n\n" for the three newlines I get in error in PHPNuke.

How would I convert this to work with PHPnuke js? I have converted it except for receiving an error when using the newline characters in the middle of the line.


<s cript language='javas cript'>
    <!--
    if(confirm('You have a new private message.\n\n\nClick OK to view it, or Cancel to hide this prompt.'))
    {var answer = confirm('Open your inbox in a new window?\n\n\n(Press Cancel to open in the current window.)')
    if (!answer)
    popupwindow=window.location('modules.php?name=Private_Messages')
    else
    popupWindow=window.open('modules.php?name=Private_Messages', '', 'location=yes,toolbar=yes,menubar=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes,height=480,width=640', false)}
    //-->
    </s cript>



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum