Page 1 of 1

include a php dont works (blank space)

Posted: Tue Aug 22, 2006 9:13 pm
by poekelen
hey

i have now a new problem.
i want to run a phpbb stats script on a cmsms page. put when i include de page its give a white space.
and its dont give a results.
if i phpbb stats file open in my browser then he works fine..

i have insert the php code in active content but i have then the same problem.

this is the script.

Code: Select all

<?php
define('IN_PHPBB', true);
////////////////////////////////////////////
// DE LAATSTE x AANTAL FORUM BERICHTEN
// DOOR: TED [WEBMASTER@MASTERCODE.NL]
// WWW.MASTERCODE.NL
////////////////////////////////////////////
// INSTELLINGEN
////////////////////////////////////////////
// Pad naar je forum (inclusief SLASH aan het einde) Bijv: forum/
$phpbb_root_path = 'forum/';
// Maximum lengte van een onderwerp naam
$maxlen = 30;
// Aantal weer te geven berichten
$limiet = 5;
 
////////////////////////////////////////////
// HIERONDER NIETS MEER VERANDEREN
// TENZIJ JE VERSTAND VAN ZAKEN HEBT ;)
////////////////////////////////////////////
 
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
 
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
 
$query = "SELECT `p`.`post_id`, `p`.`post_time`, `t`.`topic_title`, `t`.`topic_type`, `t`.`topic_vote`, `u`.`user_id`, `u`.`username`, `c`.`config_value` as `df`
         FROM ".POSTS_TABLE." as `p`, ".TOPICS_TABLE." as `t`, ".USERS_TABLE." as `u`, ".CONFIG_TABLE." as `c`
         WHERE `p`.`topic_id` = `t`.`topic_id`
         AND `p`.`poster_id` = `u`.`user_id`
         AND `c`.`config_name` = 'default_dateformat'
         ORDER BY `p`.`post_id` DESC
         LIMIT 0,".$limiet;
 
$sql = mysql_query($query) or die("Error: ".mysql_error());
 
 
// DE OUTPUT
echo "<ul id='laatsteberichten'>\n";
while($temp = mysql_fetch_array($sql))
{
   extract($temp);
   $topic_title = strlen($topic_title) > $maxlen ? substr($topic_title,0,$maxlen) . "…" : $topic_title;
   
   switch($topic_type)
   {
      case 2: $topic_type = '<strong>'.$lang['Topic_Announcement'].'</strong> '; break;
      case 1: $topic_type = '<strong>'.$lang['Topic_Sticky'].'</strong> '; break;
      case 0: $topic_type = ''; break;
   }
   if($topic_vote == 1)
   {
      $topic_type = $topic_type.' '.$lang['Topic_Poll'].' ';
   }
 
   echo "\t<li>".$topic_type."<a href='".$phpbb_root_path."viewtopic.php?p=".$post_id."#".$post_id."'>".$topic_title."</a> ";
   echo "door <a href='".$phpbb_root_path."profile.php?mode=viewprofile&u=".$user_id."'>".$username."</a> ";
   echo "op " . date($df,$post_time);
   echo "</li>\n";
}
echo "</ul>\n\n";
?>
why dont it works with cms ms? ???

Re: include a php dont works (blank space)

Posted: Tue Aug 22, 2006 9:32 pm
by Dr.CSS
The Documentation tab above has neat things like this page on doing UDT that will do what you want done...
http://wiki.cmsmadesimple.org/index.php ... fined_Tags

EDIT: tyr this also...
http://wiki.cmsmadesimple.org/index.php/Developers_FAQ