Not Solved Another PHP in template request ...
#1
Not Solved Question 
I know, I've read all the post on the subject, but I need help formating the code ...

I need to insert php code because I found a PNG-24 Alpha transparency script in PHP.

http://koivi.com/ie-png-transparency/

I need this code inserted at the beginning of each page :
<?php ob_start(); ?>

And this one at the end of every page :
<?php
    include_once 'replacePngTags.php';
    echo replacePngTags(ob_get_clean());
?>

Plus I need to point to a php file named replacePngTags.php that I put in the "jscripts" folder.

So where do I put the PHP (in global.php ?) ?
How do I code it to make it in 2 variables ?
In which template do I put them (header & footer ?) ?
And what will be the path of my php file (jscripts/replacePngTags.php) ?

Thanks in advance !
Reply
#2
Not Solved
There is a javascript for this. No need for php code.
http://homepage.ntlworld.com/bobosola/index.htm
Reply
#3
Not Solved
I know there is a javascript for this, but I want to implement this one ...
The javascript doesn't fix background images and if someone has javascript disable, it just doesn't work ...

The only thing I want to know is how to create the variables in PHP and in which PHP file to put it ...
Reply
#4
Not Solved
Add
ob_start();
include_once 'replacePngTags.php';
$pngtags = replacePngTags(ob_get_clean());
to global.php at the beginning somewhere.

Then you add {$pngtags} to headerinclude or header or where you want it.
Reply
#5
Not Solved
Ok, well it doesn't work ...
Pretty sure it's because everything is at the beginning of the code ...

I need two variables one with this inside :
<?php ob_start(); ?>

And one with this inside :
<?php
    include_once 'replacePngTags.php';
    echo replacePngTags(ob_get_clean());
?>

On the Web Site they say that the 1st one needs to be at the beginning and the other one at the end.
With only one variable, I can only put everything at the top or everything at the end and it doesn't work (tried both).
Reply
#6
Not Solved
Oh I see now.
Revert the other modifications.

Inside inc/functions.php
find:
echo $contents;
add above:
include_once MYBB_ROOT.'replacePngTags.php';
$contents = replacePngTags($contents);
Smile
Reply
#7
Not Solved
Can't find it ... !
I see some return $contents; but no echo !
Reply
#8
Not Solved
Look again please. It's there.
inside inc/functions.php
Around line 77.
Reply
#9
Not Solved
Ok sorry found it ...

Here is the error :

Fatal error: Call to undefined function replacePngTags() in C:\Documents and Settings\Marc Laberge\My Documents\WampServer\www\QcFL\MyBB\inc\functions.php on line 77
Reply
#10
Not Solved
Sorry for confusing you.
http://community.mybboard.net/showthread...2#pid92002 (Updated code)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)