Home  | FAQ  | Search  | Memberlist  | Usergroups  | Register  | Profile  | Log in  | Log in for your private messages
Forums Recent Topics request....

 
Post new topic   Reply to topic    myWebland Forum Index -> PHP Script Talk
View previous topic :: View next topic  
Author Message
ExoticCarSite
Newbie


Joined: 27 Nov 2004
Posts: 2

PostPosted: Sat Nov 27, 2004 4:06 am    Post subject: Forums Recent Topics request.... Reply with quote

hey

I came across your mybbsum forum script, but I am unable to get it to work.

Does the script only work on .php homepages? or can it be made to work .html pages?

I have set up a dummy page, to test the script first, for my forum, but I was unable to get the box to appear. Any suggestions?


dummy page link: http://www.exoticcarsite.com/index22.html

The box should appear just above the competitions section, and just below the affiliates section in that little blank area.

I was also hoping, if it can be done on a .html page, to show just the recent topics.

I'll show you what I mean.

On my forum's portal page, http://www.exoticcarsite.com/forums/portal.php there is the recent topics displayed to the left, below the navigation.

Is it possible to grab that and copy it to a .html homepage [ for example the dummy linkI provided above]?

Any help would be much appreciated.

Regards,
Brad Miller

Webmaster:
ExoticCarSite.com
Back to top
View user's profile Send private message
ExoticCarSite
Newbie


Joined: 27 Nov 2004
Posts: 2

PostPosted: Sat Nov 27, 2004 4:08 am    Post subject: Reply with quote

here is the code for the portal page.

Code:
<?php
/***************************************************************************
 *                                portal.php
 *                            -------------------
 *   begin                : Tuesday, August 13, 2002
 *   copyright            : (C) 2002 Smartor
 *   email                : smartor_xp@hotmail.com
 *
 *   $Id: portal.php,v 2.1.7 2003/01/30, 17:05:58 Smartor Exp $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   Some code in this file I borrowed from the original index.php, Welcome
 *   Avatar MOD and others...
 *
 ***************************************************************************/

//
// Set configuration for ezPortal
//

// Welcome Text: note that we are in PHP file, so use \' instead of ' and use \\ instead of \ (HTML enabled)
$CFG['welcome_text'] = '<center><b>Welcome to EasyBB Community <br />This page has information that enables you to find out about our latest Pre Modded phpBB. <br /> Have a good time enjoy the forums</b></center>';

// Number of news on portal
$CFG['number_of_news'] = '5';

// Length of news
$CFG['news_length'] = '1600';

// News Forum ID: separate by comma for multi-forums, eg. '1,2,5'
$CFG['news_forum'] = '1';

// Poll Forum ID: separate by comma for multi-forums, eg. '3,8,14'
$CFG['poll_forum'] = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15';
// Start add  - Photo Album Block
// Pics Cat ID: no multi-categories support
$CFG['cat_id'] = '0';

// Number of pics on portal
$CFG['pics_number'] = '1';

// Pics viewing all: replace '0' with '1' to display both public & personal pics
$CFG['pics_all'] = '0';

// Pics randomization: replace '0' with '1' for random
$CFG['pics_sort'] = '0';
// End add  - Photo Album Block
// Number of Recent Topics (not Forum ID)
$CFG['number_recent_topics'] = '5';

// Exceptional Forums for Recent Topics, eg. '2,4,10' (note: my Recent Topics script has its own permission checking, so you can leave this variable blank)
$CFG['exceptional_forums'] = '';
//
// END configuration
// --------------------------------------------------------

define('IN_PHPBB', true);
$phpbb_root_path = './';
$album_root_path = $phpbb_root_path . 'album_mod/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
// ChatBox Mod
include($phpbb_root_path . 'chatbox_front.php');
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
// Start add  - Photo Album Block
include($album_root_path . 'album_common.'.$phpEx);
// End add  - Photo Album Block
//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
  $l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
  $l_total_post_s = $lang['Posted_article_total'];
}
else
{
  $l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
  $l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
  $l_total_user_s = $lang['Registered_user_total'];
}
else
{
  $l_total_user_s = $lang['Registered_users_total'];
}
//
// Recent Topics
//
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
  message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
  $forum_data[] = $row;
}

$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);

if( $CFG['exceptional_forums'] == '' )
{
  $except_forum_id = '\'start\'';
}
else
{
  $except_forum_id = $CFG['exceptional_forums'];
}

for ($i = 0; $i < count($forum_data); $i++)
{
  if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
  {
    if ($except_forum_id == '\'start\'')
    {
      $except_forum_id = $forum_data[$i]['forum_id'];
    }
    else
    {
      $except_forum_id .= ',' . $forum_data[$i]['forum_id'];
    }
  }
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
    FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
    WHERE t.forum_id NOT IN (" . $except_forum_id . ")
      AND t.topic_status <> 2
      AND p.post_id = t.topic_last_post_id
      AND p.poster_id = u.user_id
    ORDER BY p.post_id DESC
    LIMIT " . $CFG['number_recent_topics'];
if (!$result = $db->sql_query($sql))
{
  message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result);
$recent_topic_row = array();
while ($row = $db->sql_fetchrow($result))
{
  $recent_topic_row[] = $row;
}
for ($i = 0; $i < $number_recent_topics; $i++)
{
  $template->assign_block_vars('recent_topic_row', array(
    'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
    'L_TITLE' => $recent_topic_row[$i]['topic_title'],
    'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']),
    'S_POSTER' => $recent_topic_row[$i]['username'],
    'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])
    )
  );
}
//
// END - Recent Topics
//
if( $userdata['session_logged_in'] )
{
  $sql = "SELECT COUNT(post_id) as total
      FROM " . POSTS_TABLE . "
      WHERE post_time >= " . $userdata['user_lastvisit'];
  $result = $db->sql_query($sql);
  if( $result )
  {
    $row = $db->sql_fetchrow($result);
    $lang['Search_new'] = $lang['Search_new'] . "&nbsp;(" . $row['total'] . ")";
  }
}

//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
  'body' => 'portal_body.tpl')
);

//
// Avatar On Index MOD
//
$avatar_img = '';
if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
{
  switch( $userdata['user_avatar_type'] )
  {
    case USER_AVATAR_UPLOAD:
      $avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
      break;
    case USER_AVATAR_REMOTE:
      $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
      break;
    case USER_AVATAR_GALLERY:
      $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
      break;
  }
}
// Check For Anonymous User
if ($userdata['user_id'] != '-1')
{
  $name_link = '<a href="' . append_sid("profile.$phpEx?mode=editprofile&amp;" . $userdata['user_id']) . '">' . $userdata['username'] . '</a>';
}
else
{
  $name_link = $lang['Guest'];
}
//
// END: Avatar On Index MOD
//

// Start add  - Photo Album Block
// Build Categories Index
$sql = "SELECT c.*, COUNT(p.pic_id) AS count
    FROM ". ALBUM_CAT_TABLE ." AS c
      LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id
    WHERE cat_id <> 0
    GROUP BY cat_id
    ORDER BY cat_order ASC";
if ( !($result = $db->sql_query($sql)) )
{
  message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}
$catrows = array();

while( $row = $db->sql_fetchrow($result) )
{
  $album_user_access = album_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW
  if ($album_user_access['view'] == 1)
  {
    $catrows[] = $row;
  }
}
if ( $CFG['pics_all'] == '1' )
{
  $allowed_cat = '0'; // For Recent Public Pics below
}
else
{
  $allowed_cat = '';
}

//
// $catrows now stores all categories which this user can view. Dump them out!
//
for ($i = 0; $i < count($catrows); $i++)
{
  // Build allowed category-list (for recent pics after here)
  $allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id'];

  // Get Last Pic of this Category
  if ($catrows[$i]['count'] == 0)
  {
    // Category is empty
    $last_pic_info = $lang['No_Pics'];
    $u_last_pic = '';
    $last_pic_title = '';
  }
  else
  {
    // Check Pic Approval
    if ( ($catrows[$i]['cat_approval'] == ALBUM_ADMIN) or ($catrows[$i]['cat_approval'] == ALBUM_MOD) )
    {
      $pic_approval_sql = 'AND p.pic_approval = 1'; // Pic Approval ON
    }
    else
    {
      $pic_approval_sql = ''; // Pic Approval OFF
    }
  }
  // END of Last Pic
}

// Recent Public Pics
if ( $CFG['pics_all'] == '1' )
{
  $pics_allowed = '0';
}
else
{
  $pics_allowed = '';
}

if ( $allowed_cat != $pics_allowed )
{
  $CategoryID = $CFG['cat_id'];

  if ( $CFG['pics_sort'] == '1' )
  {
    if ( $CategoryID != 0 )
    {
      $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
        FROM ". ALBUM_TABLE ." AS p
          LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
          LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id
          LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
          LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
        WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) AND pic_cat_id = ($CategoryID)
        GROUP BY p.pic_id
        ORDER BY RAND()
        LIMIT ". $CFG['pics_number'];
    }
    else
    {
      $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
        FROM ". ALBUM_TABLE ." AS p
          LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
          LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id
          LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
          LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
        WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 )
        GROUP BY p.pic_id
        ORDER BY RAND()
        LIMIT ". $CFG['pics_number'];
      }
  }
  else if ( $CFG['pics_sort'] == '0' )
  {
    if ( $CategoryID != 0 )
    {
      $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
        FROM ". ALBUM_TABLE ." AS p
          LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
          LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id
          LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
          LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
        WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) AND pic_cat_id = ($CategoryID)
        GROUP BY p.pic_id
        ORDER BY pic_time DESC
        LIMIT ". $CFG['pics_number'];
    }
    else
    {
      $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
        FROM ". ALBUM_TABLE ." AS p
          LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
          LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id
          LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
          LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
        WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 )
        GROUP BY p.pic_id
        ORDER BY pic_time DESC
        LIMIT ". $CFG['pics_number'];
    }
  }
  if ( !($result = $db->sql_query($sql)) )
  {
    message_die(GENERAL_ERROR, 'Could not query recent pics information', '', __LINE__, __FILE__, $sql);
  }
  $recentrow = array();

  while( $row = $db->sql_fetchrow($result) )
  {
    $recentrow[] = $row;
  }

  if (count($recentrow) > 0)
  {
    for ($i = 0; $i < count($recentrow); $i += $album_config['cols_per_page'])
    {
      $template->assign_block_vars('recent_pics', array());

      for ($j = $i; $j < ($i + $album_config['cols_per_page']); $j++)
      {
        if ( $j >= count($recentrow) )
        {
          break;
        }

        if (!$recentrow[$j]['rating'])
        {
          $recentrow[$j]['rating'] = $lang['Not_rated'];
        }
        else
        {
          $recentrow[$j]['rating'] = round($recentrow[$j]['rating'], 2);
        }

        // Display pics horizontally
        $template->assign_block_vars('recent_pics.recent_col', array(
          'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_page.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
          'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
          'DESC' => $recentrow[$j]['pic_desc'])
        );

        if( ($recentrow[$j]['user_id'] == ALBUM_GUEST) or ($recentrow[$j]['username'] == '') )
        {
          $recent_poster = ($recentrow[$j]['pic_username'] == '') ? $lang['Guest'] : $recentrow[$j]['pic_username'];
        }
        else
        {
          $recent_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&amp;". POST_USERS_URL .'='. $recentrow[$j]['user_id']) .'">'. $recentrow[$j]['username'] .'</a>';
        }

        // Display pics vertically
        $template->assign_block_vars('recent_pics.recent_detail', array(
          'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_page.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
          'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
          'DESC' => $recentrow[$j]['pic_desc'],
          'TITLE' => $recentrow[$j]['pic_title'],
          'POSTER' => $recent_poster,
          'TIME' => create_date($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']),
          'VIEW' => $recentrow[$j]['pic_view_count'],
          'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. append_sid("album_rate.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $lang['Rating'] . '</a>: ' . $recentrow[$j]['rating'] . '<br />') : '',
          'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid("album_comment.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $lang['Comments'] . '</a>: ' . $recentrow[$j]['comments'] . '<br />') : '')
        );
      }
    }
  }
  else
  {
    // No Pics Found
    $template->assign_block_vars('no_pics', array());
  }
}
else
{
  // No Cats Found
  $template->assign_block_vars('no_pics', array());
}
// End add  - Photo Album Block
$template->assign_vars(array(
  'WELCOME_TEXT' => $CFG['welcome_text'],
  'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
  'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
  'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
  'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
  'L_FORUM' => $lang['Forum'],
  'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
  'L_STATISTICS' => $lang['Statistics'], 
  'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
  'L_POSTED' => $lang['Posted'],
  'L_COMMENTS' => $lang['Comments'],
  'L_VIEW_COMMENTS' => $lang['View_comments'],
  'L_POST_COMMENT' => $lang['Post_your_comment'],
  'L_SEND_PASSWORD' => $lang['Forgotten_password'],
  'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
  'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '<a href="' . append_sid("profile.$phpEx?mode=register") . '">', '</a>'),
  'L_REMEMBER_ME' => $lang['Remember_me'],
  'L_VIEW_COMPLETE_LIST' => $lang['View_complete_list'],
  'L_POLL' => $lang['Poll'],
  'L_VOTE_BUTTON' => $lang['Vote'], // Start add - Photo Album Block
  'S_COLS' => $album_config['cols_per_page'],
  'S_COL_WIDTH' => (100/$album_config['cols_per_page']) . '%',
  'TARGET_BLANK' => ($album_config['fullpic_popup']) ? 'target="_blank"' : '',
  'L_NEWEST_PICS' => $lang['Newest_pics'],
  'L_NO_PICS' => $lang['No_Pics'],
  'L_PIC_TITLE' => $lang['Pic_Title'],
  'L_VIEW' => $lang['View'],
  'L_POSTER' => $lang['Poster'],
  'L_POSTED' => $lang['Posted'],
  // End add - Photo Album Block, // ChatBox
  'L_WHO_IS_CHATTING' => $lang['Who_is_Chatting'],
  'TOTAL_CHATTERS_ONLINE' => sprintf($lang['How_Many_Chatters'], $howmanychat),
  'CHATTERS_LIST' => sprintf($lang['Who_Are_Chatting' ],$chatters),
  'L_LOGIN_TO_JOIN_CHAT' => $lang['Login_to_join_chat'],
  'L_CLICK_TO_JOIN_CHAT' => $lang['Click_to_join_chat'],
  'S_JOIN_CHAT' => append_sid("chatbox_mod/chatbox.$phpEx"),
  'CHATBOX_NAME' => $userdata['user_id'] . '_ChatBox', // Recent Topics
  'L_RECENT_TOPICS' => $lang['Recent_topics'],

  // Welcome Avatar
  'L_NAME_WELCOME' => $lang['Welcome'],
  'U_NAME_LINK' => $name_link,
  'AVATAR_IMG' => $avatar_img)
);

//
// Fetch Posts from Announcements Forum
//
if(!isset($HTTP_GET_VARS['article']))
{
  $template->assign_block_vars('welcome_text', array());

  $fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);

  for ($i = 0; $i < count($fetchposts); $i++)
  {
    if( $fetchposts[$i]['striped'] == 1 )
    {
      $open_bracket = '[ ';
      $close_bracket = ' ]';
      $read_full = $lang['Read_Full'];
    }
    else
    {
      $open_bracket = '';
      $close_bracket = '';
      $read_full = '';
    }

    $template->assign_block_vars('fetchpost_row', array(
      'TITLE' => $fetchposts[$i]['topic_title'],
      'POSTER' => $fetchposts[$i]['username'],
      'TIME' => $fetchposts[$i]['topic_time'],
      'TEXT' => $fetchposts[$i]['post_text'],
      'REPLIES' => $fetchposts[$i]['topic_replies'],
      'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
      'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&amp;t=' . $fetchposts[$i]['topic_id']),
      'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),
      'L_READ_FULL' => $read_full,
      'OPEN' => $open_bracket,
      'CLOSE' => $close_bracket)
    );
  }
}
else
{
  $fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);

  $i = intval($HTTP_GET_VARS['article']);

  $template->assign_block_vars('fetchpost_row', array(
    'TITLE' => $fetchposts[$i]['topic_title'],
    'POSTER' => $fetchposts[$i]['username'],
    'TIME' => $fetchposts[$i]['topic_time'],
    'TEXT' => $fetchposts[$i]['post_text'],
    'REPLIES' => $fetchposts[$i]['topic_replies'],
    'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
    'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&amp;t=' . $fetchposts[$i]['topic_id'])
    )
  );
}
//
// END: Fetch Announcements
//

//
// Fetch Poll
//
$fetchpoll = phpbb_fetch_poll($CFG['poll_forum']);

if (!empty($fetchpoll))
{
  $template->assign_vars(array(   
    'S_POLL_QUESTION' => $fetchpoll['vote_text'],
    'S_POLL_ACTION' => append_sid('posting.'.$phpEx.'?'.POST_TOPIC_URL.'='.$fetchpoll['topic_id']),
    'S_TOPIC_ID' => $fetchpoll['topic_id'],
    'L_SUBMIT_VOTE' => $lang['Submit_vote'],
    'L_LOGIN_TO_VOTE' => $lang['Login_to_vote']   
    )
  );

  for ($i = 0; $i < count($fetchpoll['options']); $i++)
  {
    $template->assign_block_vars('poll_option_row', array(
      'OPTION_ID' => $fetchpoll['options'][$i]['vote_option_id'],
      'OPTION_TEXT' => $fetchpoll['options'][$i]['vote_option_text'],
      'VOTE_RESULT' => $fetchpoll['options'][$i]['vote_result'],
      )
    );
  } 
}
else
{
  $template->assign_vars(array(   
    'S_POLL_QUESTION' => $lang['No_poll'],
    'DISABLED' => 'disabled="disabled"'
    )
  );
}

//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Mon Nov 29, 2004 11:07 pm    Post subject: Reply with quote

sorry for the late reply,

mybbsum on works with a .php extension however you can made it work on html pages if you use iframe to call the mybbsum file

eg:

<iframe src="mybbsum.php" name="myFrame" width="100%" height="220" align="default" border="0" frameborder="0">


You can also use another php file to call mybbsum by using include

eg :
<? include "mybbsum.php" ; ?>
Back to top
View user's profile Send private message Send e-mail
tmroman
Super Coder


Joined: 01 Nov 2004
Posts: 41

PostPosted: Tue Nov 30, 2004 8:01 am    Post subject: Reply with quote

also you can use httpd.conf or .htaccess (with mod_rewrite) to allow works html pages as php
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    myWebland Forum Index -> PHP Script Talk All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
TNX?

Error. Page cannot be displayed. Please contact your service provider for more details. (19)




Powered by phpBB © 2001, 2005 phpBB Group
Contact Us