Index: tags.php
===================================================================
--- tags.php	(revision 791)
+++ tags.php	(working copy)
@@ -11,13 +11,10 @@
 if ( $tag_name && $tag ) :
 
 	$topics = get_tagged_topics($tag->tag_id, $page);
-	do_action( 'bb_tag-single.php', $tag->tag_id );
 
-	bb_load_template( 'tag-single.php', array('tag', 'tag_name', 'topics') );
+	bb_load_template( 'tag-single.php', array('tag', 'tag_name', 'topics'), $tag->tag_id );
 else :
 
-	do_action( 'bb_tags.php', '' );
-
 	bb_load_template( 'tags.php' );
 endif;
 ?>
Index: profile.php
===================================================================
--- profile.php	(revision 791)
+++ profile.php	(working copy)
@@ -28,7 +28,5 @@
 $posts = get_recent_user_replies( $user_id );
 $threads = get_recent_user_threads( $user_id );
 
-do_action( 'bb_profile.php', $user_id );
-
-bb_load_template( 'profile.php', array('reg_time', 'profile_info_keys', 'updated', 'threads') );
+bb_load_template( 'profile.php', array('reg_time', 'profile_info_keys', 'updated', 'threads'), $user_id );
 ?>
Index: bb-includes/template-functions.php
===================================================================
--- bb-includes/template-functions.php	(revision 792)
+++ bb-includes/template-functions.php	(working copy)
@@ -1,6 +1,6 @@
 <?php
 
-function bb_load_template( $file, $globals = false ) {
+function bb_load_template( $file, $globals = false, $action_arg = null ) {
 	global $bb, $bbdb, $bb_current_user, $page, $bb_cache,
 		$posts, $bb_post, $post_id, $topics, $topic, $topic_id,
 		$forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view;
@@ -19,6 +19,12 @@
 	}
 
 	$template = apply_filters( 'bb_template', $template, $file );
+
+	if ( !is_null($action_arg) )
+		do_action( 'bb_' . $template, $action_arg );
+	else
+		do_action( 'bb_' . $template );
+
 	include($template);
 }
 
Index: rss.php
===================================================================
--- rss.php	(revision 791)
+++ rss.php	(working copy)
@@ -23,7 +23,7 @@
 	$forum_id = (int) get_path(2);
 
 $bb_db_override = false;
-do_action( 'bb_rss.php_pre_db', '' );
+do_action( 'bb_rss.php_pre_db' );
 
 if ( !$bb_db_override ) :
 if ( isset($topic_id) ) {
@@ -55,7 +55,7 @@
 }
 endif;
 
-do_action( 'bb_rss.php', '' );
+do_action( 'bb_rss.php' );
 
 bb_send_304( $posts[0]->post_time );
 
Index: index.php
===================================================================
--- index.php	(revision 791)
+++ index.php	(working copy)
@@ -3,7 +3,7 @@
 require('./bb-load.php');
 
 $bb_db_override = false;
-do_action( 'bb_index.php_pre_db', '' );
+do_action( 'bb_index.php_pre_db' );
 
 if ( isset($_GET['new']) && '1' == $_GET['new'] ) :
 	$forums = false;
@@ -13,8 +13,6 @@
 	$super_stickies = get_sticky_topics();
 endif;
 
-do_action( 'bb_index.php', '' );
-
 bb_load_template( 'front-page.php', array('bb_db_override', 'super_stickies') );
 
 ?>
Index: view.php
===================================================================
--- view.php	(revision 791)
+++ view.php	(working copy)
@@ -21,8 +21,6 @@
 	do_action( 'bb_custom_view', $view, $page );
 endswitch;
 
-do_action( 'bb_view.php', '' );
-
 bb_load_template( 'view.php', array('view_count', 'stickies') );
 
 ?>
Index: topic.php
===================================================================
--- topic.php	(revision 792)
+++ topic.php	(working copy)
@@ -38,8 +38,6 @@
 	post_author_cache($posts);
 endif;
 
-do_action( 'bb_topic.php', $topic_id );
+bb_load_template( 'topic.php', array('bb_db_override', 'user_tags', 'other_tags', 'list_start'), $topic_id );
 
-bb_load_template( 'topic.php', array('bb_db_override', 'user_tags', 'other_tags', 'list_start') );
-
 ?>
Index: bb-admin/admin-functions.php
===================================================================
--- bb-admin/admin-functions.php	(revision 792)
+++ bb-admin/admin-functions.php	(working copy)
@@ -7,7 +7,7 @@
 }
 
 function bb_get_admin_footer() {
-	do_action('bb_admin-footer.php', '');
+	do_action('bb_admin-footer.php');
 	include('admin-footer.php');
 }
 
Index: forum.php
===================================================================
--- forum.php	(revision 791)
+++ forum.php	(working copy)
@@ -17,8 +17,6 @@
 	$stickies = get_sticky_topics( $forum_id, $page );
 endif;
 
-do_action( 'bb_forum.php', $forum_id );
+bb_load_template( 'forum.php', array('bb_db_override', 'stickies'), $forum_id );
 
-bb_load_template( 'forum.php', array('bb_db_override', 'stickies') );
-
 ?>

