cant add php code :S

Shearer

No avatar

2006-05-13 17:03

Hey

i am trying to ad a php code, to the page.tpl, butt i dont work.

i have this code: include "counter/online/showonline.php";

how do i add it to this footer code, so i can see it on my site ?

<!-- BEGIN FOOTER -->
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
<div id="footer">
<p align="right"><!--//</p>
<h1>NEED THE CODE TO BE SHOWED HERE, before the powered by tekst ?</h1>
<div>
<br />
</div>

</div>
</div>

</body>
</html>
<!-- END FOOTER -->

Regards Shearer

Shearer

No avatar

2006-05-14 01:24

no help here ? :S

Regards Shearer

~~~wallace

No avatar

2006-05-14 15:55

you have to add php code to index.php
and then you can add $useronline or whatever in any template

Shearer

No avatar

2006-05-14 19:13

so i add this to the index
include "counter/online/showonline.php";

and $useronline in the page.tpl ?

where in the index file, do i put the code, so i wont be displayet on a site. first when i add the $useronline code it will be possible to se on the page ?

Regards Shearer

Shearer

No avatar

2006-05-15 14:22

come on guys :)

Regards Shearer

nvictor

No avatar

2006-05-15 16:39

Shearer,

Add $useronline to the template.
Add require "counter/online/showonline.php"; to index.php

I assume that $useronline contains a value that you get from the script counter/online/showonline.php . If not nothing will be shown.

nvictor

Shearer

No avatar

2006-05-15 17:43

nvictor

i have tryet to do that, butt i dont work :(

nvictor

No avatar

2006-05-15 19:18

weird...

nvictor

Shearer

No avatar

2006-05-19 20:49

hey

do you have a mail i can contact you on, so can i try to send the file to you, and you can see if you can work it out ?

Regards Shearer

Shearer

No avatar

2006-05-19 20:51

ill try here

i have this code

<?php

// Insert at the very top of your page

$time microtime();
$time explode(" "$time);
$time $time[1] + $time[0];
$start $time;

?>

<?php

// Place at the very bottom of your page

$time microtime();
$time explode(" "$time);
$time $time[1] + $time[0];
$finish $time;
$totaltime = ($finish $start);
printf ("Sidens er l&aelig;st p&aring; %f seconds to load."$totaltime);
// The above line can be changed but remember to keep %f 

?> 



where do i put that and how du i get it showed on the pages ?

Regards Shearer

Shearer

No avatar

2006-05-19 22:26

i can get it showed on the site, if i put it in index.php but its not in the footer i can see it. i is on the bottom og the page :(

can anyone help ?

Shearer

No avatar

2006-05-20 11:30

no help ?

treewood (OpenSolution)

Avatar: treewood

2006-06-09 09:36

Shearer - edit index.php and first code put in second line, second code put before code:

echo $tpl->tbHtml'page.tpl''HEAD'.$sBlockPage ).$content.$tpl->tbHtml'page.tpl''FOOTER'.$sBlockPage );


delete this line from Your code:

printf (''Sidens er l&#230;st p&#229; %f seconds to load.'', $totaltime);

add variable $totaltime to templates/page.tpl to show time generation

Back to top
about us | contact