T3h mod needs t3h help! (PHP/Javascript)

Status
Not open for further replies.

Geometric-sama

The Manly Man of Steel
  • 11,436
    Posts
    21
    Years
    PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>-> 52 Reason <-</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="default.css" rel="stylesheet" type="text/css">
    
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function rollpics() { //by ryuken design; v1.0
      picno = Math.floor(Math.random() * 10 + 1);
      var picpath="images/rollpics/" + picno + ".jpg"
      document.rollingpic.src=picpath
      setTimeout("rollpics()",3000)
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
    function swapBanner(imgName,mseconds) { //by ryuken design; v1.0
      var imgpath="images/layout/topbanner/" + imgName + ".jpg"
      document.bannerimg.src=imgpath;
      setTimeout("document.bannerimg.src='images/layout/topbanner/reason.jpg'",mseconds)
    }
    
    function MM_changeProp(objName,x,theProp,theValue) { //v6.0
      var obj = MM_findObj(objName);
      if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
        if (theValue == true || theValue == false)
          eval("obj."+theProp+"="+theValue);
        else eval("obj."+theProp+"='"+theValue+"'");
      }
    }
    
    function MM_displayStatusMsg(msgStr) { //v1.0
      status=msgStr;
      document.MM_returnValue = true;
    }
    
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    //-->
    </script>
    
    </head>
    
    <body onLoad="rollpics();MM_displayStatusMsg('52 REASON');MM_preloadImages('images/layout/bio_f2.gif','images/layout/discography_f2.gif','images/layout/gigs_f2.gif','images/layout/links_f2.gif','images/layout/lyrics_f2.gif','images/layout/media_f2.gif','images/layout/news_f2.gif','images/layout/photos_f2.gif','images/layout/leftbanner/bio.jpg','images/layout/leftbanner/discography.jpg','images/layout/leftbanner/gigs.jpg','images/layout/leftbanner/links.jpg','images/layout/leftbanner/lyrics.jpg','images/layout/leftbanner/media.jpg','images/layout/leftbanner/news.jpg','images/layout/leftbanner/photos.jpg','images/layout/topbanner/bio.jpg','images/layout/topbanner/discography.jpg','images/layout/topbanner/gigs.jpg','images/layout/topbanner/links.jpg','images/layout/topbanner/lyrics.jpg','images/layout/topbanner/media.jpg','images/layout/topbanner/news.jpg','images/layout/topbanner/photos.jpg','images/rollpics/2.jpg','images/rollpics/3.jpg','images/rollpics/4.jpg','images/rollpics/5.jpg','images/rollpics/6.jpg','images/rollpics/7.jpg','images/rollpics/8.jpg','images/rollpics/9.jpg','images/rollpics/10.jpg');return document.MM_returnValue">
    <div id="content" name="content" class="content">
    <?php
    	include "news.php";
    ?>
    </div>
    
    <div id="banner" class="banner"><img name="bannerimg" src="images/layout/topbanner/reason.jpg" height="62" width="780"></div>
    
    <div id="leftbanner" class="leftbanner"><img src="images/layout/leftbanner/reason.jpg" width="54" height="362" name="lbanner"></div>
    
    <!--Navigation buttons-->
    <div id="newsbtn" class="newsbtn"><a href="javascript:;" onMouseOver="MM_changeProp('newsbtn','','style.cursor','hand','DIV');MM_displayStatusMsg('NEWS');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/news.gif" alt="news" name="news" width="37" height="15" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include news.php \?>','DIV');" onMouseOver="MM_swapImage('news','','images/layout/news_f2.gif','lbanner','','images/layout/leftbanner/news.jpg',1);swapBanner('news','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="biobtn" class="biobtn"><a href="javascript:;" onMouseOver="MM_changeProp('biobtn','','style.cursor','hand','DIV');MM_displayStatusMsg('BIOGRAPHY');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/bio.gif" width="24" height="21" alt="biography" name="bio" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include bio.php \?>','DIV');" onMouseOver="MM_swapImage('bio','','images/layout/bio_f2.gif','lbanner','','images/layout/leftbanner/bio.jpg',1);swapBanner('bio','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="discographybtn" class="discographybtn"><a href="javascript:;" onMouseOver="MM_changeProp('discographybtn','','style.cursor','hand','DIV');MM_displayStatusMsg('DISCOGRAPHY');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/discography.gif" width="87" height="28" alt="discography" name="discography" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include discography.php \?>','DIV');" onMouseOver="MM_swapImage('discography','','images/layout/discography_f2.gif','lbanner','','images/layout/leftbanner/discography.jpg',1);swapBanner('discography','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="lyricsbtn" class="lyricsbtn"><a href="javascript:;" onMouseOver="MM_changeProp('lyricsbtn','','style.cursor','hand','DIV');MM_displayStatusMsg('LYRICS');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/lyrics.gif" width="39" height="27" alt="lyrics" name="lyrics" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include lyrics.php \?>','DIV');" onMouseOver="MM_swapImage('lyrics','','images/layout/lyrics_f2.gif','lbanner','','images/layout/leftbanner/lyrics.jpg',1);swapBanner('lyrics','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="photosbtn" class="photosbtn"><a href="javascript:;" onMouseOver="MM_changeProp('photosbtn','','style.cursor','hand','DIV');MM_displayStatusMsg('PHOTOS');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/photos.gif" width="50" height="27" alt="photos" name="photos" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include photos.php \?>','DIV');" onMouseOver="MM_swapImage('photos','','images/layout/photos_f2.gif','lbanner','','images/layout/leftbanner/photos.jpg',1);swapBanner('photos','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="mediabtn" class="mediabtn"><a href="javascript:;" onMouseOver="MM_changeProp('mediabtn','','style.cursor','hand','DIV');MM_displayStatusMsg('MEDIA');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/media.gif" width="45" height="21" alt="media" name="media" border="0" onClick="MM_changeProp('content','','innerHTML','<?php include "media.php"; ?>','DIV');" onMouseOver="MM_swapImage('media','','images/layout/media_f2.gif','lbanner','','images/layout/leftbanner/media.jpg',1);swapBanner('media','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="gigsbtn" class="gigsbtn"><a href="javascript:;" onMouseOver="MM_changeProp('gigsbtn','','style.cursor','hand','DIV');MM_displayStatusMsg('UPCOMING GIGS');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/gigs.gif" width="107" height="28" alt="upcoming gigs" name="gigs" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include gigs.php \?>','DIV');" onMouseOver="MM_swapImage('gigs','','images/layout/gigs_f2.gif','lbanner','','images/layout/leftbanner/gigs.jpg',1);swapBanner('gigs','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    <div id="linksbtn" class="linksbtn"><a href="javascript:;" onMouseOver="MM_changeProp('linksbtn','','style.cursor','hand','DIV');MM_displayStatusMsg('LINKS');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('52 REASON');return document.MM_returnValue"><img src="images/layout/links.gif" width="35" height="21" alt="links" name="links" border="0" onClick="MM_changeProp('content','','innerHTML','<\?php include links.php \?>','DIV');" onMouseOver="MM_swapImage('links','','images/layout/links_f2.gif','lbanner','','images/layout/leftbanner/links.jpg',1);swapBanner('links','2750');" onMouseOut="MM_swapImgRestore();"></a></div>
    
    
    <div id="epsoon" class="epsoon"><img src="images/layout/comingsoon.gif" width="397" height="39"></div>
    <div id="bottomlinks" class="bottomlinks">guestbook | <a href="mailto:[email protected]">email</a>
    <br>
    <br>
    site & contents © 2004-5 52 reason... layout/coding by <a href="https://design.ryux.net/" target="_blank">ryuken design</a></div>
    
    <div id="bottomline" class="bottomline"> </div>
    <div id="leftline" class="leftline"> </div>
    
    <div id="sbox" class="shoutbox">INSERT SHOUTBOX HERE</div>
    
    <div id="rollpics" class="rollpics"><img name="rollingpic" src="images/rollpics/1.jpg" width="180" height="135"></div>
    </body>
    </html>

    When the page loads, "news.php" is included into the document on the div layer "content". When I click on, say, the "media" button, it should load "media.php" into "content", or click on "photos" button to load in "photos.php", but it isn't working. You'll see there are two different codes on the buttons, one for "media" and one for the others - these are the ones I tried. Can anyone help me? Gregory, this is on your server (52reason) so if you want to go fiddle, feel free.
     
    <\?php include "media.php"\?>

    Bold stuff you need to add and get rid of the ;

    I think
     
    the includes are fine. NEVER REMOVE THE ; it is required at the end of all php statements except for ifs, foreach, while, etc.

    and <?php include("media.php"); ?> is how i would write it but i dont think the brackets make any difference.
     
    I tried all those things, none of them worked... what happened when I did that was, it just read the <?php include "media.php"; ?> and included it, ignoring all the Javascript around it.
     
    Jedi_Amara said:
    I tried all those things, none of them worked... what happened when I did that was, it just read the <?php include "media.php"; ?> and included it, ignoring all the Javascript around it.
    I'm not exactly sure on this as I forgot almost everything I knew about Javascript. So here it goes. PHP is server side scripting, Javascript is browser scripting. PHP will be done first on the server. Javascript will be done last at the browser. So that could be the problem, either that or the browser. Again, I'm not exactly sure, but I do know that Javascript is browser scripting and PHP is server scripting.
     
    As far as I know, you need to backslash the quotes.

    ex. <?php something(\"iphehfuoeiig\"); ?>
     
    I figured it out eventually, I ended up using an iframe as a buffer and an onLoad action in the content page.

    *closed
     
    Status
    Not open for further replies.
    Back
    Top