This topic is locked

Custom Popup in list page

2/9/2007 4:13:37 AM
PHPRunner General questions
A
asimha author

Morning all,
Could someone possibly give me a hand here, I am just not good enough to do this alone :-)
Using a "List Page" I am displaying a list of songs with one of the fields being a link to an MP3
I need to add a Java Script reference in the Header:
<script language="JavaScript" type="text/JavaScript" src="soundpop.js"></script>
and also to add this code instead of the URL code that PHP-Runer allows me to enter in the Visual Editor.
<a href="mp3/mymp3.mp3" target="_blank" onClick="java script:PlayerOpen('My MP3 Song',this.href); return false">Play MP3</a>
PlayerOpen is a function in the .js file.
Could someone kindly point me in the right direction?
Many thanks

Andre

J
Jane 2/9/2007

Andre,
to add you soundpop.js file turn on HTML mode on the Visual Editor tab and add your code in it:

<script language="JavaScript" type="text/JavaScript" src="soundpop.js"></script>
Then you need to copy soundpop.js to the output folder.

To show field as custom hyperlink on the List page double click on the field on the Visual Editor tab, select Custom and add your code in it:

<a href="mp3/mymp3.mp3" target="_blank" onClick="java script:PlayerOpen('My MP3 Song',this.href); return false">Play MP3</a>

A
asimha author 2/9/2007

Andre,

to add you soundpop.js file turn on HTML mode on the Visual Editor tab and add your code in it:

&lt;script language="JavaScript" type="text/JavaScript" src="soundpop.js"></script>
Then you need to copy soundpop.js to the output folder.

To show field as custom hyperlink on the List page double click on the field on the Visual Editor tab, select Custom and add your code in it:


Many thanks jane this will help a lot!
What would be the correct syntax to use fields from my tables instead of "mps/mymp3" and 'My MP3 Song'
Thanks a lot as always!

Andre

A
asimha author 2/9/2007

I tried this in the Custom box but obviously my syntax is very poor :-(
<a href="{$row.1mp3_value}" target="_blank" onclick="java script:PlayerOpen({$row.1song_name_value},this.href,'1'); return false">MP3</a>

Sergey Kornilov admin 2/10/2007

Try to use the following in Custom Expression field:

$value= '<a href="' . $data["mp3"] . '" target="_blank" onclick="java script:PlayerOpen(' . $data["song_name"] . ',this.href,'1'); return false">MP3</a>';
A
asimha author 2/10/2007

Try to use the following in Custom Expression field:


$value= '<a href="' . $data["mp3"] . '" target="_blank" onclick="java script:PlayerOpen(' . $data["song_name"] . ',this.href,'1'); return false">MP3</a>';


Thank you very much for the help Sergey, with this function active at Login I have a parse error: "Parse error: syntax error, unexpected T_LNUMBER in /home/www/3584ef1d9a4e06b4f5916fec98d25abc/web/media/include/commonfunctions.php on line 403"
I am trying to debug ...

A
asimha author 2/12/2007

Problem solved, correct syntax is:
$value= "<a href=\"" . $data["mp3"] . "\" target=\"_blank\" onclick=\"java script:PlayerOpen('" . $data["song_name"] . "',this.href,'1'); return false\">MP3</a>";
Thanks a million Sergey and Jane!

Andre