Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Can anyone help me wrap this code into a php table?  (Read 3444 times)

0 Members and 1 Guest are viewing this topic.

dke

  • Guest
Can anyone help me wrap this code into a php table?
« on: January 10, 2008, 11:10:42 pm »

Hi,

I'm no coder and i'm trying to figure out how to wrap this code:

Code: [Select]
<html>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<div align="center">
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '750',
'height', '250',
'src', 'flow',
'FlashVars', 'xmlPath=http://dkeserver.mine.nu/flow.php', <!--Absolute path to 'flow.php'-->
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'flow_link',
'bgcolor', '#FFFFFF',
'name', 'flow',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'flow',
'salign', ''
); //end AC code
}
</script>
</body>
</html>

Into this PHP table code:

Code: [Select]
starttable("100%");

echo '<tr><td class="tableh2"><b><b>Recently added files</b></td></tr>';
endtable();
?>

I cannot figure out how to mix php and html without breaking the PHP using ?>

I would like to do something like this:

Code: [Select]
starttable("100%");

echo '<tr><td class="tableh2"><b><b>Recently added files</b></td></tr>';
echo '<td class="tableb">';
<html>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<div align="center">
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '750',
'height', '250',
'src', 'flow',
'FlashVars', 'xmlPath=http://dkeserver.mine.nu/flow.php', <!--Absolute path to 'flow.php'-->
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'flow_link',
'bgcolor', '#FFFFFF',
'name', 'flow',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'flow',
'salign', ''
); //end AC code
}
</script>
</body>
</html>
endtable();
?>

Can any PHP/HTML wiz help me?

Thanks!
« Last Edit: January 12, 2008, 10:44:03 am by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Can anyone help me wrap this code into a php table?
« Reply #1 on: January 11, 2008, 07:59:47 am »

Use the heredoc syntax:
Code: [Select]
starttable("100%");

echo '<tr><td class="tableh2"><b>Recently added files</b></td></tr>';
echo <<< EOT
<td class="tableb">';
<div align="center">
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '750',
'height', '250',
'src', 'flow',
'FlashVars', 'xmlPath=http://dkeserver.mine.nu/flow.php', <!--Absolute path to 'flow.php'-->
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'flow_link',
'bgcolor', '#FFFFFF',
'name', 'flow',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'flow',
'salign', ''
); //end AC code
}
</script>
EOT;
endtable();
?>
Then edit themes/yourtheme/theme.php and add
Code: [Select]
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
into a new line before
Code: [Select]
</head>, as you mustn't add mutliple instances of the tags <html> or <body>.
You should really read up some HTML tutorials first to understand the basics.
Logged

dke

  • Guest
Re: Can anyone help me wrap this code into a php table?
« Reply #2 on: January 11, 2008, 09:12:22 am »

Thank you Joachim, you have been great help!
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 16 queries.