dal 2003, semper fidelis!

Header in joomla

Il luogo dove parlare di informatica.

Moderator: Moderatori

Volevo mettere lo script come quello nel forum dove l'header varia di giorno in giorno, anche sul mio sito in joomla con i banner che mi avete preparato (esclusi quelli dove sono nel mirino... sob sob).

Ora se prendo il mio bello script e lo ficco dentro lo stronzone non va...

Ho poi provato con un'altro script che varia random... ma niente!

Che voi sappiate in joomla o nei .php ci sono restrizioni per lanciare uno script java?

Lo script ? questo

Code: Select all

	<script language="JavaScript">
<!--

/*
Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com) 
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/

function random_imglink(){

//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="templates/torquebiz/images/bigheader.jpg"
imagelinks[2]="http://www.johnslades.com/bigheader1.jpg"
imagelinks[3]="http://www.johnslades.com/bigheader2.jpg"
imagelinks[4]="http://www.johnslades.com/bigheader3.gif"

var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<td width="760"><img src="'+myimages[ry]+'" width="760" height="150" border="0">')
}
random_imglink()
//-->
</script>
Attualmente per fare uscire l'header ho aggiunto queste due righe.

Code: Select all

	<td width="760"><img src="http://www.johnslades.com/bigheader3.gif" width="760" height="150" border="0">		
	</td>

Mi mandi tutta la pagina php...
ma se lo script lo facessimo in php? cos? ? anche + cross -browser?

Code: Select all

<?php echo "<?xml version=\"1.0\"?".">"; ?>
<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $mosConfig_sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php
if ($my->id) {
	include ("editor/editor.php");
	initEditor();
}
?>
<?php include ("includes/metadata.php"); ?>
<?php include ("templates/torquebiz/mycssmenu.php"); ?>

<script language="JavaScript" type="text/javascript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="<?php echo $mosConfig_live_site;?>/templates/torquebiz/css/template_css.css" rel="stylesheet" type="text/css" />


</head>

<body leftmargin="0" topmargin="0">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="5" rowspan="9" bgcolor="#999999">&nbsp;</td>
    <td width="760"><img src="templates/torquebiz/images/greyline.jpg" width="760" height="5"></td>
    <td width="5" rowspan="9" bgcolor="#999999">&nbsp;</td>
  </tr>
  <tr> 
    
	
	<script language="JavaScript">
<!--

/*
Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com) 
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/

function random_imglink(){

//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="templates/torquebiz/images/bigheader.jpg"
imagelinks[2]="http://www.johnslades.com/bigheader1.jpg"
imagelinks[3]="http://www.johnslades.com/bigheader2.jpg"
imagelinks[4]="http://www.johnslades.com/bigheader3.gif"

var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<td width="760"><img src="'+myimages[ry]+'" width="760" height="150" border="0">')
}
random_imglink()
//-->
</script>
	<td width="760"><img src="http://www.johnslades.com/bigheader3.gif" width="760" height="150" border="0">		
	</td>
  
  
  
  
  
  
  
  
  </tr>
  <tr> 
    <td width="760"><img src="templates/torquebiz/images/dotbar.jpg" width="760" height="20"></td>
  </tr>
  <tr> 
    <td width="760" align="center" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td width="175" align="center" valign="top"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center" valign="middle"> 
                  <div id="menuvertical"> 
                    <!-- BEGIN MENU -->
                    <div class="navvirtcontainer"><?php echo $mycssONLY_PRI_menu ?></div>
                  </div>
                  <!-- END MENU -->
                </td>
              </tr>
              <tr> 
                <td align="center">&nbsp; </td>
              </tr>
              <tr> 
                <td align="center" valign="middle"> 
                  <?php mosLoadModules ( 'left' ); ?>
                  <p> 
                    <?php mosLoadModules ( 'user1' ); ?>
                  </p></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
            </table></td>
          <td width="5" bgcolor="#999999">&nbsp;</td>
          <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="5" rowspan="4">&nbsp;</td>
                <td align="center" valign="top">
                  <?php include ("mainbody.php"); ?>
                </td>
                <td width="5" rowspan="4">&nbsp;</td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td align="center" valign="middle">
                  <?php mosLoadModules ( 'bottom' ); ?>
                </td>
              </tr>
            </table></td>
          <td width="5" bgcolor="#999999">&nbsp;</td>
          <td width="175" align="center" valign="top"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center"> 
                  <?php mosLoadModules ( 'top' ); ?>
                </td>
              </tr>
              <tr> 
                <td align="center"> 
                  <?php mosLoadModules ( 'right' ); ?>
                  <p>
                    <?php mosLoadModules ( 'user2' ); ?>
                  </p></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td width="760"><img src="templates/torquebiz/images/bottomhr.jpg" width="760" height="3"></td>
  </tr>
  <tr> 
    <td width="760" height="30" bgcolor="#FFFFFF"> 
      <div align="center"><a href="http://www.mambointouch.com" target="_blank">design 
        by mambointouch.com</a></div></td>
  </tr>
  <tr> 
    <td><img src="templates/torquebiz/images/dotbar_inv.jpg" width="760" height="20" /></td>
  </tr>
  <tr> 
    <td align="center" valign="middle">
      <?php include_once('includes/footer.php'); ?>
    </td>
  </tr>
  <tr> 
    <td><img src="templates/torquebiz/images/greyline.jpg" width="760" height="5"></td>
  </tr>
</table>
</body>
</html>
johnslades.com wrote:
Attualmente per fare uscire l'header ho aggiunto queste due righe.

Code: Select all

	<td><img src="http://www.johnslades.com/bigheader3.gif" width="760" height="150" border="0">		
	</td>
Quindi l'hai staticizzata.

Comunque sei sicuro che del codice js pu? terminare senza ; (io non me ne intendo ma proverei...)

Code: Select all

var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<td><img src="'+myimages[ry]+'" width="760" height="150" border="0">')
}
random_imglink() 

Comunque tradurre lo script in php ? un attimo.
Anche se non penso che ci siano restrizioni js lato codice....

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 164 on Wed Aug 18, 2021 7:03 pm

Users browsing this forum: No registered users and 1 guest