Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Hi I am having a serious problem here :)
  • Posted: 21.08.2003, 22:51
     
    tekrh
    rank:
    Softmore Softmore
    registered:
     October 2002
    Status:
    offline
    last visit:
    19.07.08
    Posts:
    50
    I am tring to add java to a script but i cannot get this to workout right... Im fairly new with PHP. Sorry here it is.. Note:I want to insert the java after the first $message tag just below ty:)


    Code

    <?php
    // File: $Id: tools.php,v 1.5 2003/06/20 21:07:55 larsneo Exp $ $Name:  $
    // ----------------------------------------------------------------------
    // PostNuke Content Management System
    // Copyright (C) 2002 by the PostNuke Development Team.
    // http://www.postnuke.com/
    // ----------------------------------------------------------------------
    // LICENSE

    // This program is free software; you can redistribute it and/or
    // modify it under the terms of the GNU General Public License (GPL)
    // as published by the Free Software Foundation; either version 2
    // of the License, or (at your option) any later version.

    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.

    // To read the license please visit http://www.gnu.org/copyleft/gpl.html
    // ----------------------------------------------------------------------
    // Original Author of file:
    // Purpose of file:
    // ----------------------------------------------------------------------
    // include 'modules/NS-User/user/database.php';
    include 'modules/NS-User/user/menu.php';
    include 'modules/NS-User/user/access.php';
    // include 'modules/NS-User/user/language.php';
    function redirect_index($message, $url = "index.php")
    {
        $ThemeSel = pnConfigGetVar('Default_Theme');
        echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"2; URL=$url\">\n";
        if (defined("_CHARSET") &amp;&amp; _CHARSET != "") {
            echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=" . _CHARSET . "\">\n";
        }
        echo "<LINK REL=\"StyleSheet\" HREF=\"".WHERE_IS_PERSO."themes/$ThemeSel/style/styleNN.css\" TYPE=\"text/css\">\n";
        echo "<style type=\"text/css\">";
        echo &quot;@import url(\"".WHERE_IS_PERSO."themes/$ThemeSel/style/style.css\"); ";
        echo "</style>\n";
        echo "</head><body bgcolor=#2F363F text=#DADEE3>\n";
        echo "<table align=center border=0 cellpadding=2 cellspacing=0><tr><td><font class=\"pn-title\">$message</font></td></tr></table></body></html>";

        if (function_exists('session_write_close')) {
            session_write_close();
        } else {
            // Hack for old versions of PHP with bad session save
            /**
             * Credit to M.W.Herbert from Forum Post
             */

            $sessvars = '';
            foreach ($GLOBALS as $k => $v) {
                if ((preg_match('/^PNSV/', $k)) &amp;&amp; (isset($v))) {
                    $sessvars .= "$k|" . serialize($v);
                }
            }
            pnSessionWrite(session_id(), $sessvars);
        }
    }

    function redirect_user()
    {
        $ThemeSel = pnConfigGetVar('Default_Theme');
        echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"2; URL=user.php\">\n";
        if (defined("_CHARSET") &amp;&amp; _CHARSET != "") {
            echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=" . _CHARSET . "\">\n";
        }
        echo " <LINK REL=\"StyleSheet\" HREF=\"".WHERE_IS_PERSO."themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n";
        echo "<style type=\"text/css\">";
        echo &quot;@import url(\"".WHERE_IS_PERSO."themes/$ThemeSel/style/style.css\"); ";
        echo "</style>\n";
        echo "</head><body bgcolor=#2F363F text=#DADEE3>\n";
        echo "<table align=center border=0 cellpadding=2 " . 'cellspacing=0><tr><td><font class=\"pn-title\">' . _INFOCHANGED . '</font></td></tr></table></body></html>';
        if (function_exists('session_write_close')) {
            session_write_close();
        } else {
            // Hack for old versions of PHP with bad session save
            $sessvars = '';
            foreach ($GLOBALS as $k => $v) {
                if ((preg_match('/^PNSV/', $k)) &amp;&amp;
                        (isset($v))) {
                    $sessvars .= "$k|" . serialize($v);
                }
            }
            pnSessionWrite(session_id(), $sessvars);
        }
    }

    function docookie($setuid, $setuname, $setpass, $setstorynum, $setumode, $setuorder, $setthold, $setnoscore, $setublockon, $settheme, $setcommentmax)
    {
        $info = base64_encode("$setuid:$setuname:$setpass:$setstorynum:$setumode:$setuorder:$setthold:$setnoscore:$setublockon:$settheme:$setcommentmax");
        setcookie("user", "$info", time() + 15552000);
    }
    // for compatibility : use user_menu_add_option($url,$title,$image)
    function usermenu($url, $title, $image)
    {
        if (!ereg('/', $image)) $image = pnConfigGetVar('userimg') . "/" . $image;
        user_menu_add_option($url, $title, $image);
    }



    This is just half the code I didnt think anyone wanted to see the whole thing lol. The part I need to add the srcipt is @ the first $message tag... Here is the Java


    Code

    <script language="javascript" >
    // Timer Bar - Version 1.0
    // Author: Brian Gosselin of http://scriptasylum.com
    // Script featured on http://www.dynamicdrive.com

    var loadedcolor='#cccccc' ;       // PROGRESS BAR COLOR
    var unloadedcolor='#EFEFEC';     // COLOR OF UNLOADED AREA
    var bordercolor='black';            // COLOR OF THE BORDER
    var barheight=15;                  // HEIGHT OF PROGRESS BAR IN PIXELS
    var barwidth=300;                  // WIDTH OF THE BAR IN PIXELS
    var waitTime=2;                   // NUMBER OF SECONDS FOR PROGRESSBAR

    // THE FUNCTION BELOW CONTAINS THE ACTION(S) TAKEN ONCE BAR REACHES 100%.
    // IF NO ACTION IS DESIRED, TAKE EVERYTHING OUT FROM BETWEEN THE CURLY BRACES ({})
    // BUT LEAVE THE FUNCTION NAME AND CURLY BRACES IN PLACE.
    // PRESENTLY, IT IS SET TO DO NOTHING, BUT CAN BE CHANGED EASILY.
    // TO CAUSE A REDIRECT TO ANOTHER PAGE, INSERT THE FOLLOWING LINE:
    // window.location="http://redirect_page.html";
    // JUST CHANGE THE ACTUAL URL OF COURSE :)

    var action=function()
    {
    //alert("Welcome to Dynamic Drive!");
    //window.location="http://www.dynamicdrive.com
    }

    //*****************************************************//
    //**********  DO NOT EDIT BEYOND THIS POINT  **********//
    //*****************************************************//

    var ns4=(document.layers)?true:false;
    var ie4=(document.all)?true:false;
    var blocksize=(barwidth-2)/waitTime/10;
    var loaded=0;
    var PBouter;
    var PBdone;
    var PBbckgnd;
    var Pid=0;
    var txt='';
    if(ns4){
    txt+='<table border=0 cellpadding=0 cellspacing=0><tr><td>';
    txt+='<ilayer name="PBouter" visibility="hide" height="'+barheight+'" width="'+barwidth+'" onmouseup="hidebar()">';
    txt+='<layer width="'+barwidth+'" height="'+barheight+'" bgcolor="'+bordercolor+'" top="0" left="0"></layer>';
    txt+='<layer width="'+(barwidth-2)+'" height="'+(barheight-2)+'" bgcolor="'+unloadedcolor+'" top="1" left="1"></layer>';
    txt+='<layer name="PBdone" width="'+(barwidth-2)+'" height="'+(barheight-2)+'" bgcolor="'+loadedcolor+'" top="1" left="1"></layer>';
    txt+='</ilayer>';
    txt+='</td></tr></table>';
    }else{
    txt+='<div id="PBouter" onmouseup="hidebar()" style="position:relative; visibility:hidden; background-color:'+bordercolor+'; width:'+barwidth+'px; height:'+barheight+'px;">';
    txt+='<div style="position:absolute; top:1px; left:1px; width:'+(barwidth-2)+'px; height:'+(barheight-2)+'px; background-color:'+unloadedcolor+'; font-size:1px;"></div>';
    txt+='<div id="PBdone" style="position:absolute; top:1px; left:1px; width:0px; height:'+(barheight-2)+'px; background-color:'+loadedcolor+'; font-size:1px;"></div>';
    txt+='</div>';
    }

    document.write(txt);

    function incrCount(){
    window.status="Loading...";
    loaded++;
    if(loaded<0)loaded=0;
    if(loaded>=waitTime*10){
    clearInterval(Pid);
    loaded=waitTime*10;
    setTimeout('hidebar()',100);
    }
    resizeEl(PBdone, 0, blocksize*loaded, barheight-2, 0);
    }

    function hidebar(){
    clearInterval(Pid);
    window.status='';
    //if(ns4)PBouter.visibility="hide";
    //else PBouter.style.visibility="hidden";
    action();
    }

    //THIS FUNCTION BY MIKE HALL OF BRAINJAR.COM
    function findlayer(name,doc){
    var i,layer;
    for(i=0;i<doc.layers.length;i++){
    layer=doc.layers[i];
    if(layer.name==name)return layer;
    if(layer.document.layers.length>0)
    if((layer=findlayer(name,layer.document))!=null)
    return layer;
    }
    return null;
    }

    function progressBarInit(){
    PBouter=(ns4)?findlayer('PBouter',document):(ie4)?document.all['PBouter']:document.getElementById('PBouter');
    PBdone=(ns4)?PBouter.document.layers['PBdone']:(ie4)?document.all['PBdone']:document.getElementById('PBdone');
    resizeEl(PBdone,0,0,barheight-2,0);
    if(ns4)PBouter.visibility="show";
    else PBouter.style.visibility="visible";
    Pid=setInterval('incrCount()',95);
    }

    function resizeEl(id,t,r,b,l){
    if(ns4){
    id.clip.left=l;
    id.clip.top=t;
    id.clip.right=r;
    id.clip.bottom=b;
    }else id.style.width=r+'px';
    }

    window.onload=progressBarInit;
    </script>


    Thanks to all for helping me out...
  • Posted: 22.08.2003, 13:36
     
    larsneo
    rank:
    Software Foundation Software Foundation
    registered:
     December 1969
    Status:
    offline
    last visit:
    15.11.08
    Posts:
    4481
    try to add the snippet in your theme.php (funtion themeheader(), right before the closing tag)

    --
    regards from germany
    ..::[Zikula Application Framework]::.. ..::[SEO-Blog]::.. ..::[CMS Sicherheit]::..

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula