I'm currently trying to add a nice mod to my website, the only issue is this:

The installation website requests me to add:

$message = itemstats_parse($message);

somewhere in a PHP Section.

however, this doesn't simply work for me, you see, for my webpage I'm using another PHP code that posts news from my forums.

the code is written within a table, and the code is:

<?php include("forumnews.php"); ?>

That's where my news comes from, so it's kinda hard to parse that one.

And here is the code inside forumnews.php that extracts the news from my forums:

<?=get_post_text($GLOBALS['numchar'], $res[$i][pst_posttxt], $res[$i][pst_postid]) ?>

My question is, how can I make it so that when the php script extracts news from my forum it also does the itemstats_parse part, so the code also shows up correctly on my webpage ?

if you want to know more about the mod im using here is a link:

http://itemstats.free.fr/e107_plugins/content/content.php?content.24

--

Any help appreciated.

    Its possible this will work, it may not of course.

    $message = itemstats_parse(get_post_text($GLOBALS['numchar'], $res[$i][pst_posttxt], $res[$i][pst_postid]); 
    

      Where do I put this though ? anywhere in the main php file ?

        Well I tried putting it in the index.php file, and i got an error of an unexpected ';'.. I removed the ; and still got the error, so I figure it's not working..

          less than ideal but may work

          ob_start();
          include("forumnews.php");
          $out = ob_get_clean();
          $message = itemstats_parse($out); 
          

          this is not the best way to do things but with out seeing all the code it's hard to work out the best option.

            for some odd reason it didn't work... anything else I can provide to help with this ?

            Here is an example of how the php page should look like, according to the mod website.

            I did everything right, but I can't figure out the $message to work properly. Hope this helps even further

            <!DOCTYPE html PUBLIC"><html xmlns="http://www.w3.org/1999/xhtml"> 
            
            <head> 
            
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
            
            <title>My page / Ma page</title> 
            
            </head> 
            
            <link rel="stylesheet" href="itemstats/templates/itemstats.css" type="text/css"\> 
            
            <script type="text/javascript" src="itemstats/overlib/overlib.js"><!-- overLIB (c) Erik Bosrup --></script> 
            
            <?php 
            
            include_once("./itemstats/generic_itemstats.php") 
            
            ?> 
            
            <body> 
            
            <?php 
            
            $myMessage = "This is an example for this item : [item]My object[/item]. You can also have [itemico]My object[/itemico]."; 
            
            $myMessage = itemstats_parse($myMessage); 
            
            echo $myMessage;
            
            ?> 
            
            </body> 
            
            </html>
              Write a Reply...