Forum Moderators: coopster
Currently, the user will click on the link title or the Go image and it will take the user to a new page. I would like when the user clicks on the image that it opens a popup window. Here is the code as it shows for the Go link.
$readmoreimg = _LEXREADMORE;
if (file_exists("images/lexe_news_topics/".$language."-go.gif")) {
$readmoreimg = "<img src=\"images/lexe_news_topics/$language-go.gif\">";}
elseif (file_exists("images/lexe_news_topics/go.gif")) {}if (strlen($hometext) > $homemlength) {
$hometext = substr($hometext,0,$homelength);
$topic = $topic;
$hometext .= "... "."<a href=\"modules.php?op=modload&name=News&file=article&sid=$sid&topic=$topic\"><em>" .$readmoreimg."</em></a>";
}
I am not sure how to recode the href to allow ONCLICK to open.window.
Help,
V
[edited by: jatar_k at 10:22 pm (utc) on Dec. 23, 2003]
[edit reason] no personal urls thanks [/edit]
$hometext .= "... "."<a href=\"modules.php?op=modload&name=News&file=article&sid=$sid&topic=$topic\" target=\"_blank\"><em>".$readmoreimg."</em></a>";
Hope this helps,
Elijah
[edited by: jatar_k at 10:23 pm (utc) on Dec. 23, 2003]
[edit reason] thanks [/edit]
<script language="JavaScript" type="text/javascript">
<!--
function popup(url) {
newin = window.open(url, "nameofpopup", 'width=580,height=540,noresize,scrollbars');
}
//-->
</script>
echo "<a href=\"javascript:popup('modules.php?op=modload&name=News&file=article&sid=$sid&topic=$topic')\">linktext</a>";
If the url is always going to include certain parts, you can hardcode that into the javascript to simplify the url in your php.
(I also removed the & from your query string - I'll bet that's an error)