ending, then restarting php session in index.template

Started by 1MileCrash, August 22, 2005, 09:32:41 PM

Previous topic - Next topic

1MileCrash

What am i doing wrong here? Im getting a template parse error, im trying to end the php session in <head> to add a javascript, then start it back up afterwards.
        document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

         current_header = mode;
      }
   // --></script>
?><script language="javascript><!--

/*
Configure menu styles below
NOTE: To edit the link colors, go to the STYLE tags and edit the ssm2Items colors
*/
YOffset=150; // no quotes!!
XOffset=0;
staticYOffset=30; // no quotes!!
slideSpeed=20 // no quotes!!
waitTime=100; // no quotes!! this sets the time the menu stays out for after the mouse goes off it.
menuBGColor="black";
menuIsStatic="yes"; //this sets whether menu should stay static on the screen
menuWidth=150; // Must be a multiple of 10! no quotes!!
menuCols=2;
hdrFontFamily="verdana";
hdrFontSize="2";
hdrFontColor="white";
hdrBGColor="#170088";
hdrAlign="left";
hdrVAlign="center";
hdrHeight="15";
linkFontFamily="Verdana";
linkFontSize="2";
linkBGColor="white";
linkOverBGColor="#FFFF99";
linkTarget="_top";
linkAlign="Left";
barBGColor="#444444";
barFontFamily="Verdana";
barFontSize="2";
barFontColor="white";
barVAlign="center";
barWidth=20; // no quotes!!
barText="SIDE MENU"; // <IMG> tag supported. Put exact html for an image to show.

///////////////////////////

// ssmItems[...]=[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
ssmItems[0]=["Main Site"] //create header
ssmItems[1]=["test", "http://test.com", ""]
ssmItems[2]=["test", "http://test.com",""]
ssmItems[3]=["test", "http://test.com", ""]
ssmItems[4]=["test", "http://test.com", "_new"]
buildMenu();
</script>
<?
echo"
</head>
<body>";

   // Because of the way width/padding are calculated, we have to tell
The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

Hi,
can you post the hall "head" and separetly what you like to add, please?

[Unknown]


1MileCrash

The only thing php can't do is tell you how much milk is left in the fridge.



1MileCrash

one problem after another with me.  :P

Alright, im not so stupid as to not know i can use an external javascript. I need to use it within index.template.php because some links use php. (the log out link, comes to mind). So i re-opened the php session-
ssmItems[1]=["Testo", "<?echo "Some php stuff";?>", ""]

But, when i actually try to add php, (example)
ssmItems[1]=["Testo", "<?echo "', $context['forum_name'], '";?>", ""]

= parse error.

What's wrong now?
The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

I dont know what you mean with session.
But you can include e.g. javascript.php witch contains all javascript functions.

1MileCrash

#6
What are you talking about? :-\ The reason i am including the javascript in index.template.php is stated above. That part is solved.

a php session. As in, when php is parsed, is a php session. When it's between the <? tags, it's a session, when it's after the ?>, it is not processed.
The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

I dont know what you mean with session for me those are scripts.




1MileCrash

http://www.w3schools.com/php/php_syntax.asp

when something is between the php tags, it is processed as php. When it isnt, it is not processed. For example, if you put ', $context['user_name'], ' in index.template.php outside of the php tags, or session, it would not be processed. So you would see ', $context['user_name'], ' in your browser, rather than "Tippmaster", or "tetronik"

EDIT: oh okay. A php "script" and a php "session" and a php "block" all mean the same thing.
The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

#9
I quote your own link:

QuoteBasic PHP Syntax

A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.

Below, we have an example of a simple PHP script which sends the text "Hello World" to the browser:

And because i asking "dumb" question is because i try to help you. And i try to find out wht is this about - rightnow i have no clue.
Just ignore me if you think im absolutely wrong or whtever ;)

Cheers

tentronik

1MileCrash

#10
I thought you were asking me what a php session was, as in a php script, block, or any other names it has. Some people call it different things. They really all mean the exact same thing.

This is my problem-
ssmItems[1]=["Testo", "<?echo "', $context['forum_name'], '";?>", ""]
adding php inside the tags gives me a parse error. When just adding text in it, doesnt-
ssmItems[1]=["Testo", "<?echo "Some php stuff";?>", ""]


The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

Ok i think you mean
when the server runs the script because the user browser is accessing/requesting it then the server has1 php session till the end of the php script.



tentronik

I have a similar include here maybe this helps:
<?php include_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/footer.php' ); ?>

1MileCrash

i dont understand how that is relevant. I have everything done, i just need to get the php link right.
The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

#14
Hmm

ssmItems[1]=["Testo", "<?php echo "', $context['forum_name'], '";?>", ""]

maybe this?
ssmItems[1]=["Testo", "<?echo ', $context['forum_name'], ';?>", ""]
or
ssmItems[1]=["Testo", "<?echo '', $context['forum_name'], '';?>", ""]
or the error is somewhere else?

1MileCrash

The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

Please try the 1st again from my last post.

And please post the error message and the hall function or part of the script not just 1 line.

1MileCrash

#17
1 line is all there is to it dude. And i already tried simple things like that.

Like, do you really know a solution, or are you just testing stuff out?

Apreciate the effort..
The only thing php can't do is tell you how much milk is left in the fridge.



tentronik

Yes i testing and this cant be only 1 line.
At least you have somewhere else an include for this line and i think with only this 1 line this might works for text as in your example but might not work when you include php.
Well i dont know though maybe someone else knows.

Cheers

[Unknown]

You want:

ssmItems[1]=["Testo", "<?echo $context['forum_name']; ?>", ""]

-[Unknown]

Advertisement: