phpBB.com     phpBB Academy     phpBB Modders     phpBB Weekly     ktuk     phpBB Hacks     Vlad Studio  

[FUNCTION] get_announcements

Pull latest X topic titles from a certain forum and diplay them on any page.

Not enough for a full proper MOD, but too useful not to share
Forum rules
Please read over our forum guidelines

[FUNCTION] get_announcements

Postby kenny » 13 Aug 2008, 23:33

Needed something for the new homepage, so I drafted up this little announcements function this afternoon. It can actually be made into a MOD very easily and there's scope for an ACP config, but the simple format it's in just now works great :)
Basically, create a functions_announce.php file with the following content:
Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: functions_announce.php 0013 17:07 17/08/2008 kenny
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

/**
* Pull info for latest announcements // cherokee red - 08/13/2008

* $forum_id is the forum you want to pull info from
* $topic_limit is the amount of topics to display
* $title is the name you want to give to the block i.e. Announcements, or Latest Posts
*
*/
function get_announcements($forum_id, $topic_limit, $title)
{

    global $db, $template;
    global $phpbb_root_path, $phpEx;

    $an_sql = 'SELECT topic_id, forum_id, topic_title
        FROM '
 . TOPICS_TABLE . '
        WHERE forum_id = '
 . $forum_id . '        
        ORDER BY topic_id DESC'
;
        
    
//query the db
    $result = $db->sql_query_limit($an_sql, $topic_limit);

    // Lets build a page ...
    $template->assign_vars(array(
        'U_FORUM'        => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
        'L_TITLE'         => $title)
    );

    while ($announce = $db->sql_fetchrow($result)) 
    
{
        $template->assign_block_vars('announce_row', array(
            'TOPIC_TITLE'         => $announce['topic_title'],
            'U_ANNOUNCE'         => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $announce['forum_id'] . '&amp;' . 't=' . $announce['topic_id']),
        ));    
    
}
    $db->sql_freeresult($result);

    $template->set_filenames(array(
        'content' => 'announce_body.html',
    ));

    // Thanks Vic ^_^
    $content = $template->assign_display('content', '', true);

    return $content;
}
?>

Here is the HTML you'll need. Create a file called announce_body.html and place it in your templates folder with the following code.
Code: Select all
   <div class="navbar">
         <div class="inner"><span class="corners-top"><span></span></span>
      <h3><a href="{U_FORUM}" title="{L_TITLE}">{L_TITLE}</a></h3>
      <span style="font-size: 1.1em;">
         <!-- BEGIN announce_row -->
               <a href="{announce_row.U_ANNOUNCE}" title="{announce_row.POST_SUBJECT}" style="font-size: 1.1em;">{announce_row.TOPIC_TITLE}</a><br />
         <!-- END announce_row -->
      </span>
         <span class="corners-bottom"><span></span></span></div>
   </div>
   <br />

Ok, now in the php file that will be serving the template, you need to include the function file.
So look at the top of the php file for the file includes and add a new one underneath
Code: Select all
include($phpbb_root_path . 'includes/functions_announce.' . $phpEx);

And look for where the file assigns variable to the template
Code: Select all
$template->assign_vars(array(

and in there add our function :)
Code: Select all
   'ANNOUNCEMENT'    => get_announcements('2', '5', 'Insert Block Title Here'),

The numbers in the brackets corresponds to our function file. The 1st number is the forum id we want to take the announcements from and the 2nd number is the amount of announcements. The last part is the title you want to show at the top of the block. It's seriously that simple.

Lastly, you need to edit the template file that corresponds to the php file you are using to show the announcements i.e. index_body.html for index.php, viewtopic_body.html for viewtopic.php
Simply add {ANNOUNCEMENT} wherever you want your announcement to show and you're set 8-)

There's a bug in the new code where you can't use the function more than once on a page, but i'm in the process of fixing it. Should be able to have it fully working in the next few days :)

Edit: Add a quick posting option - follow the code in this post :)
Last edited by kenny on 27 Aug 2009, 09:48, edited 8 times in total.
Reason: Changed positioning of $db->sql_freeresult($result);
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Donate to 6 String MODs
If you like any of the work that I do here, please consider donating.
click the image on the left for a list of some of the advantages of donating



[FUNCTION] get_announcements

Postby kenny » 17 Aug 2008, 17:58

Ok, 1st post updated with new code. Overwrite the includes/functions_announce.php with the new file. Create a file called announce_body.html and put it in your templates folder - fill it with the HTML code from the 1st post. You'll need to update your function call too, as I added the block title as a 3rd argument ;)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

[FUNCTION] get_announcements

Postby blasphemie » 25 Aug 2008, 04:50

Hello thanks for this I could use alittle help with it though.

I am confused where to put:

Code: Select all
include($phpbb_root_path 'includes/functions_announce.' $phpEx);

$template->assign_vars(array(

   
'ANNOUNCEMENT'    => get_announcements('2''5''Insert Block Title Here'), 


here is my page code:

Code: Select all
<?php
/*
*
* @package phpBB3 Portal  a.k.a canverPortal  ( www.phpbb3portal.com )
* @version $Id: portal.php,v 1.11 2008/02/09 08:18:13 angelside Exp $
* @copyright (c) Canver Software - www.canversoft.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

// Note: If you would like to have the portal in a different location than in the main phpBB3 directory
// You must change the following variable, and change the 'U_PORTAL' template variable in functions.php
define('IN_PHPBB'true);
define('IN_PORTAL'true);
define('PHPBB_ROOT_PATH''./');
define('PORTAL_ROOT_PATH','./portal/');

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
$portal_root_path = (defined('PORTAL_ROOT_PATH')) ? PORTAL_ROOT_PATH './portal/';

$phpEx substr(strrchr(__FILE__'.'), 1);
include(
$phpbb_root_path 'common.' $phpEx);
include(
$portal_root_path '/includes/functions.'.$phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('portal');

// show login box and user menu

//  acp de aç/kapa yok, dil dosyasýna ek: hiç doðumgünü yoksa evet seçili olsa bile blok görünmez.
// SQL bilgisi yok -  - SQL eklenirse dil deðiþkeni de eklenmeli
//if ($config['portal_user_menu'])
//{
    // only registered user see user menu
    
if ($user->data['is_registered'])
    {
        include(
$portal_root_path '/block/user_menu.'.$phpEx);
    }
    else
    {
        include(
$portal_root_path '/block/login_box.'.$phpEx);
    }
//}



if ($config['portal_recent']) 

    include(
$portal_root_path '/block/recent.'.$phpEx);
}

if (
$config['portal_advanced_stat'])
{
    include(
$portal_root_path '/block/statistics.'.$phpEx);
}

if (
$config['portal_minicalendar'])
{
    include(
$portal_root_path '/block/mini_cal.'.$phpEx);
}



if (
$config['portal_load_last_visited_bots'])
{
    include(
$portal_root_path '/block/latest_bots.'.$phpEx);
}

if (
$config['portal_recruitment'])
{
    include(
$portal_root_path '/block/recruitment.'.$phpEx);
}

if (
$config['portal_progression'])
{
    include(
$portal_root_path '/block/progression.'.$phpEx);
}

if (
$config['portal_topmenux'])
{
    include(
$portal_root_path '/block/topmenux.'.$phpEx);
}

if (
$config['portal_center'])
{
    include(
$portal_root_path '/center.'.$phpEx);
}

if (
$config['portal_vent'])
{
    include(
$portal_root_path '/block/vent.'.$phpEx);
}

if (
$config['portal_ginfo'])
{
    include(
$portal_root_path '/block/ginfo.'.$phpEx);
}

if (
$config['portal_linksx'])
{
    include(
$portal_root_path '/block/linksx.'.$phpEx);
}

if (
$config['portal_loots'])
{
    include(
$portal_root_path '/block/loots.'.$phpEx);
}

if (
$config['portal_loot'])
{
    include(
$portal_root_path '/block/loot.'.$phpEx);
}

if (
$config['portal_welcome'])
{
    
$template->assign_vars(array(
        
'S_DISPLAY_WELCOME'     => true,
        
'PORTAL_WELCOME_INTRO'    => $config['portal_welcome_intro'],
    ));
}

if (
$config['portal_announcements'])
{
    include(
$portal_root_path '/block/announcements.'.$phpEx);
    
$template->assign_vars(array(
        
'S_ANNOUNCE_COMPACT' => ($config['portal_announcements_style']) ? true false,
    ));
}

if (
$config['portal_news'])
{
    include(
$portal_root_path '/block/news.'.$phpEx);
    
$template->assign_vars(array(
        
'S_NEWS_COMPACT' => ($config['portal_news_style']) ? true false,
    ));
}

if (
$config['portal_pay_s_block'] or $config['portal_pay_c_block'])
{
    include(
$portal_root_path '/block/donate.'.$phpEx);
}


if (
$config['portal_ads_small'])
{
    
$template->assign_vars(array(
        
'S_ADS_SMALL'     => ($config['portal_ads_small_box']) ? true false,
        
'ADS_SMALL_BOX'    => $config['portal_ads_small_box'],
    ));
}

if (
$config['portal_ads_center'])
{
    
$template->assign_vars(array(
        
'S_ADS_CENTER'         => ($config['portal_ads_center_box']) ? true false,
        
'ADS_CENTER_BOX'    => $config['portal_ads_center_box'],
    ));
}


// acp de aç/kapa yok - SQL bilgisi yok - SQL eklenirse dil deðiþkeni de eklenmeli
if ($user->data['is_registered']/* and $config['portal_friends']*/)
{
    include(
$portal_root_path '/block/friends.'.$phpEx);
}

// acp de aç/kapa yok - SQL bilgisi yok - SQL eklenirse dil deðiþkeni de eklenmeli
// dil dosyasýna ek: hiç doðumgünü yoksa evet seçili olsa bile blok görünmez.
//if ($config['show_birthdays'])
//{
    
include($portal_root_path '/block/birthday_list.'.$phpEx);
//}

// acp de aç/kapa yok - SQL bilgisi yok - SQL eklenirse dil deðiþkeni de eklenmeli
//if ($config['show_whois_online'])
//{
    
include($portal_root_path '/block/whois_online.'.$phpEx);
//}

// acp de aç/kapa yok - SQL bilgisi yok - SQL eklenirse dil deðiþkeni de eklenmeli
//if ($config['show_search'])
//{
    
include($portal_root_path '/block/search.'.$phpEx);
//}

// acp de aç/kapa yok - SQL bilgisi yok - SQL eklenirse dil deðiþkeni de eklenmeli
//if ($config['change_style'])
//{
//    include($portal_root_path . '/block/change_style.'.$phpEx); // stil seçince hata veriyor
//}

$template->assign_vars(array(
    
'S_DISPLAY_JUMPBOX'     => true// SQL + ACP eklenecek
    
'PORTAL_LEFT_COLLUMN'     => $config['portal_left_collumn_width'],
    
'PORTAL_RIGHT_COLLUMN'     => $config['portal_right_collumn_width'],
));

// output page
page_header($user->lang['PORTAL']);
//page_header($config['sitename']);

$template->set_filenames(array(
    
'body' => 'portal/portal_body.html'
));

// SQL + ACP eklenecek
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));

page_footer();

?>




Also is there a way to make it show the post instead of just links?
User avatar
blasphemie
Registered User
Registered User
 
Posts: 1
Joined: 25 Aug 2008, 04:45

[FUNCTION] get_announcements

Postby kenny » 25 Aug 2008, 08:46

It's explained in the 1st post where to add the code in your file ;)
The include should go just before // Start session management and the ANNOUNCEMENT goes inside your $template->assign_vars(array( - which is at the bottom of your file.
blasphemie wrote:Also is there a way to make it show the post instead of just links?

There is, but it would require a partial re-write of the script, or doing a new one - this snippet was only meant for creating a simple block. I believe there are already a few scripts out there that will grab full posts - Handyman's Display Posts Anywhere or there is the News MOD by Erik (Both in the MODs Development forums) :)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

[FUNCTION] get_announcements

Postby a_h_uk » 29 Aug 2008, 18:12

I've tried everything. It just doesn't show up for me....I'm not sure if I understood you correctly when you mentioned the "php file that will be serving the template". Which PHP file should I edit exactly? I've edited the index.php in the main root folder. Here it is:

Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: index.php 8638 2008-06-09 17:11:26Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/functions_announce.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

display_forums('', $config['load_moderators']);

// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts   = $config['num_posts'];
$total_topics   = $config['num_topics'];
$total_users   = $config['num_users'];

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';

// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
   $sql = 'SELECT group_id, group_name, group_colour, group_type
      FROM ' . GROUPS_TABLE . '
      WHERE group_legend = 1
      ORDER BY group_name ASC';
}
else
{
   $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
      FROM ' . GROUPS_TABLE . ' g
      LEFT JOIN ' . USER_GROUP_TABLE . ' ug
         ON (
            g.group_id = ug.group_id
            AND ug.user_id = ' . $user->data['user_id'] . '
            AND ug.user_pending = 0
         )
      WHERE g.group_legend = 1
         AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
      ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);

$legend = '';
while ($row = $db->sql_fetchrow($result))
{
   $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';

   if ($row['group_name'] == 'BOTS')
   {
      $legend .= (($legend != '') ? ', ' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
   }
   else
   {
      $legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
   }
}
$db->sql_freeresult($result);

// Generate birthday list if required ...
$birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
   $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
   $sql = 'SELECT user_id, username, user_colour, user_birthday
      FROM ' . USERS_TABLE . "
      WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
         AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
   $result = $db->sql_query($sql);

   while ($row = $db->sql_fetchrow($result))
   {
      $birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);

      if ($age = (int) substr($row['user_birthday'], -4))
      {
         $birthday_list .= ' (' . ($now['year'] - $age) . ')';
      }
   }
   $db->sql_freeresult($result);
}

// Assign index specific vars
$template->assign_vars(array(
        'ANNOUNCEMENT'  => get_announcements('1', '3', 'Latest Announcements'),
   'TOTAL_POSTS'   => sprintf($user->lang[$l_total_post_s], $total_posts),
   'TOTAL_TOPICS'   => sprintf($user->lang[$l_total_topic_s], $total_topics),
   'TOTAL_USERS'   => sprintf($user->lang[$l_total_user_s], $total_users),
   'NEWEST_USER'   => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),

   'LEGEND'      => $legend,
   'BIRTHDAY_LIST'   => $birthday_list,

   'FORUM_IMG'            => $user->img('forum_read', 'NO_NEW_POSTS'),
   'FORUM_NEW_IMG'         => $user->img('forum_unread', 'NEW_POSTS'),
   'FORUM_LOCKED_IMG'      => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
   'FORUM_NEW_LOCKED_IMG'   => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),

   'S_LOGIN_ACTION'         => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
   'S_DISPLAY_BIRTHDAY_LIST'   => ($config['load_birthdays']) ? true : false,

   'U_MARK_FORUMS'      => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
   'U_MCP'            => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=front', true, $user->session_id) : '')
);


// Output page
page_header($user->lang['INDEX']);

$template->set_filenames(array(
   'body' => 'index_body.html')
);

page_footer();

?>
User avatar
a_h_uk
Registered User
Registered User
 
Posts: 3
Joined: 29 Aug 2008, 18:08

[FUNCTION] get_announcements

Postby kenny » 29 Aug 2008, 18:22

Sorry, when I say "php file that will be serving the template" - I mean the php file that is going to be used for you announcements :) Your index file looks fine, you just need to not edit index_body.html and add {ANNOUNCEMENT} which I now realise I've missed from the 1st post :lol:
Will add that instruction now ;)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

[FUNCTION] get_announcements

Postby a_h_uk » 29 Aug 2008, 19:23

Thanks for the fast reply!
User avatar
a_h_uk
Registered User
Registered User
 
Posts: 3
Joined: 29 Aug 2008, 18:08

[FUNCTION] get_announcements

Postby a_h_uk » 29 Aug 2008, 21:28

Another problem :?

I try editing the announce_body.html file, but it doesn't effect the display of the forums.

Do I have it in the right place. My style is currently the default prosilver style.

This is currently my location of the file:
Code: Select all
public_html/forums/styles/prosilver/template/announce_body.html


Is that right?
User avatar
a_h_uk
Registered User
Registered User
 
Posts: 3
Joined: 29 Aug 2008, 18:08

[FUNCTION] get_announcements

Postby kenny » 30 Aug 2008, 13:45

That's correct yes, but you need to make sure that you purge the cache in your ACP after making changes to any HTML files :)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

[FUNCTION] get_announcements

Postby Lucky » 21 Sep 2008, 05:26

I can not get this to work at all.

Code: Select all
Parse error: parse error, unexpected T_VARIABLE, expecting ')' in /home/content/s/t/c/stcloudscoots/html/forums/testing.php on line 17


Here are my files
testing.php
Code: Select all
<?php
    define
('IN_PHPBB'true);
    
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
    
$phpEx substr(strrchr(__FILE__'.'), 1);
    include(
$phpbb_root_path 'common.' $phpEx);
    include(
$phpbb_root_path 'includes/functions_announce.' $phpEx);

    
// Start session management
    
$user->session_begin();
    
$auth->acl($user->data);
    
$user->setup();

    
page_header('St. Cloud Scots');

    
$template->set_filenames(array(
    
'body' => 'testing_body.html'
$template->assign_vars(array(
'ANNOUNCEMENT' => get_announcements('8''24''Insert Block Title Here'),
));
    
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
    
page_footer();
?>


functions_announce.php
Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: functions_announce.php 0013 17:07 17/08/2008 kenny
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
   exit;
}

/**
* Pull info for latest announcements // cherokee red - 08/13/2008
*
* $forum_id is the forum you want to pull info from
* $topic_limit is the amount of topics to display
* $title is the name you want to give to the block i.e. Announcements, or Latest Posts
*
*/
function get_announcements($forum_id$topic_limit$title)
{

   global 
$db$template;
   global 
$phpbb_root_path$phpEx;

   
$an_sql 'SELECT topic_id, forum_id, topic_title
      FROM ' 
TOPICS_TABLE '
      WHERE forum_id = ' 
$forum_id '      
      ORDER BY topic_id DESC'
;
      
   
//query the db
   
$result $db->sql_query_limit($an_sql$topic_limit);

   
$db->sql_freeresult($result);

   
// Lets build a page ...
   
$template->assign_vars(array(
      
'U_FORUM'      => append_sid("{$phpbb_root_path}viewforum.$phpEx"'f=' $forum_id),
      
'L_TITLE'       => $title)
   );

   while (
$announce $db->sql_fetchrow($result))
   {
      
$template->assign_block_vars('announce_row', array(
         
'TOPIC_TITLE'       => $announce['topic_title'],
         
'U_ANNOUNCE'       => append_sid("{$phpbb_root_path}viewtopic.$phpEx"'f=' $announce['forum_id'] . '&amp;' 't=' $announce['topic_id']),
      ));   

   }

   
$template->set_filenames(array(
      
'content' => 'announce_body.html',
   ));

   
// Thanks Vic ^_^
   
$content $template->assign_display('content'''true);

   return 
$content;
}
?>


announce_body.html
Code: Select all
<div class="navbar">
         <div class="inner"><span class="corners-top"><span></span></span>
      <h3><a href="{U_FORUM}" title="{L_TITLE}">{L_TITLE}</a></h3>
      <span style="font-size: 1.1em;">
         <!-- BEGIN announce_row -->
               <a href="{announce_row.U_ANNOUNCE}" title="{announce_row.POST_SUBJECT}" style="font-size: 1.1em;">{announce_row.TOPIC_TITLE}</a><br />
         <!-- END announce_row -->
      </span>
         <span class="corners-bottom"><span></span></span></div>
   </div>
   <br />


testing_body.html
Code: Select all
<!-- INCLUDE overall_header1.html -->

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>

   <div class="content">
      <p>
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>St. Cloud Scoots</title>
<meta name="Keywords" content="Scooter, Vespa, LX, 125, 50, 150, cc, buddy, metro, parka, club, scooters" />
<meta name="Description" content="Your Friendly Neighborhood Scooter Club" />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<div id="header">
</div>

<body>

<div id="content">
   <div id="colOne">
      <h3>Supporters</h3>
{ANNOUNCEMENT} <br><br>
<h3>Money Raised</h3>
<b>2007:</b><br>
Food Shelf: $481 & 60 Food Items<br>
<b>2008:</b><br>
Food Shelf: $201<br>
Breast Cancer: $445
</div>
   <div id="colTwo">
      <h2>Welcome</h2>
      <p>St. Cloud Scoots is Central Minnestoa's place on the internet for motor scooter fun.  Whether it be for help with maintenance or finding someone to ride with, this is the place.</p>
                  <p>We are the home of <b>Scoot For Food</b>.<br>Scoot For Food is a pledge drive/motor scooter ride for local food shelves.  In our first year we took in more than $480 and 60 food items.  In our second year we took in more then $200.</p>
               <p>Please visit the forums and make this your motor scooter home on the internet.</p>   
   <h3>History</h3>
      <p><img src="image/jer.jpg" alt="" width="120" height="120" class="image" /></p>
      <p>Way back in November of 2005 I purchased my Vespa LX150.  I thought it would be fun to ride with others.  I did not know anyone else with a scooter at that time.  There was no place for Central Minnesota motor scooterists to find or set up rides.  In January of 2006 I took what I know best and I created that place. I created St. Cloud Scoots.<br></p>
    </div>
   <div style="clear: both;">&nbsp;</div>
</div>
<!-- phpmyvisites -->
<a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics"
onclick="window.open(this.href);return(false);"><script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';

var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.stcloudscoots.com/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="http://www.stcloudscoots.com/phpmv2/phpmyvisites.js" type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
<img src="http://www.stcloudscoots.com/phpmv2/phpmyvisites.php" alt="Statistics" style="border:0" />
</p></noscript></object></a>
<!-- /phpmyvisites -->
<script type="text/javascript" src="/phpmv2/plugins/clickheat/libs/js/clickheat.js"></script><noscript><a href="http://www.labsmedia.com/index.html">Free marketing tools</a></noscript><script type="text/javascript"><!--
clickHeatSite = 1;clickHeatGroup = 'index';clickHeatServer = '/phpmv2/plugins/clickheat/libs/clickpmv.php';initClickHeat(); //-->
</script>
</body>
</html>
      </p>
   </div>

   <span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
St. Cloud Scoots is Central Minnesota's Online Scooter Community.
St. Cloud Scoots
User avatar
Lucky
Registered User
Registered User
 
Posts: 4
Joined: 21 Sep 2008, 05:19

Next



Return to Code Snippets

Who is online

Alexa [Bot], Yahoo [Bot]


cron