Jump to content
Sign in to follow this  
julesmoretti

Platform Pro Forum template sidebar.

Recommended Posts

bryan-hadaway    3
bryan-hadaway

Forwarding for developer help. Thanks, Bryan

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

This is probably an issue with the `exec php` plugin. I'm guessing it doesn't like the `<?php` at the very first (just a guess) Why aren't you using the child theme to add php?

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

yes your right i removed the plugin. and now it shows up but at the bottom. How can i get it to the top?

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

try putting the HTML form that was added before this line `pagelines_draw_sidebar($this->id, $this->name, 'template.dwidgets');?>`

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

K so I have given it a go and Unfortunatly that did not work as expected. Could you copy me more code that shows what it should be like:

<?php
	/*
	
		Section: Tertiary Sidebar
		Author: Andrew Powers
		Description: The main widgetized sidebar
		Version: 1.0.0
	
	*/
	
	class TertiarySidebar extends PageLinesSection {
	
	   function __construct( $registered_settings = array() ) {
	
			$name = __('Tertiary Sidebar', 'pagelines');
			$id = 'sidebar_tertiary';
	
			$settings = array(
				'description' 	=> 'A tertiary widgetized sidebar for the theme that can be used in standard sidebar templates.',
				'workswith' 	=> array('sidebar1', 'sidebar2', 'sidebar_wrap'),
				'folder' 		=> 'sidebars',
				'init_file' 	=> 'section.sb_tertiary.php',
				'icon'			=> CORE_IMAGES . '/admin/sidebar.png'
			);
	
		   parent:GDN__construct($name, $id, $settings);
	   }
	
	   function section_persistent() {
			$setup = pagelines_standard_sidebar($this->name, $this->settings['description']);
			register_sidebar($setup);
		}
	
	function section_template() {
	
		<form action="" method="post" id="forums-search-form" class="dir-form">
				<h3><?php if ( is_user_logged_in() ) : ?>  <?php _e( 'Create New Topic', 'buddypress' ) ?><?php endif; ?></h3>  </form>
	
		 	pagelines_draw_sidebar($this->id, $this->name, 'template.dwidgets');?>
	
		 <?php
		}
	
	}
	
	/*
		End of section class
	*/[/code]

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

Here is what I have from the function section_template all the way to the end of the file ` function section_template() { ?>

<?php if ( is_user_logged_in() ) : ?> <?php _e( 'Create New Topic', 'buddypress' ) ?><?php endif; ?>

<?php pagelines_draw_sidebar($this->id, $this->name, 'template.dwidgets');?> <?php } } /* End of section class */ `

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

That worked perfectly, and was much clearer for me to get. Thank you

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

Ok so another request. Is there a way to trigger this script depending on what page we are. So If forum page then that button shows up. If group page then another script that says create group shows up? Thank you

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

Oh and I forgot. Is there a way to have this button enabled and disabled depending on member status?

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

Actually scratch the last message it does that already.

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

So I tried with: bp_is_group_forum() bp_is_group_forum_topic() bp_is_group_forum_topic_edit() With no luck. This is the code that I was using:

<?php
	/*
	
		Section: Tertiary Sidebar
		Author: Andrew Powers
		Description: The main widgetized sidebar
		Version: 1.0.0
	
	*/
	
	class TertiarySidebar extends PageLinesSection {
	
	   function __construct( $registered_settings = array() ) {
	
			$name = __('Tertiary Sidebar', 'pagelines');
			$id = 'sidebar_tertiary';
	
			$settings = array(
				'description' 	=> 'A tertiary widgetized sidebar for the theme that can be used in standard sidebar templates.',
				'workswith' 	=> array('sidebar1', 'sidebar2', 'sidebar_wrap'),
				'folder' 		=> 'sidebars',
				'init_file' 	=> 'section.sb_tertiary.php',
				'icon'			=> CORE_IMAGES . '/admin/sidebar.png'
			);
	
		   parent:GDN__construct($name, $id, $settings);
	   }
	
	   function section_persistent() {
			$setup = pagelines_standard_sidebar($this->name, $this->settings['description']);
			register_sidebar($setup);
		}
	
	function section_template() { ?>
	<?php if ( bp_is_group_forum() ) : ?>
		<form action="" method="post" id="forums-search-form" class="dir-form">
				<h3 align="center"><?php if ( is_user_logged_in() ) : ?>  <?php _e( 'Create New Topic', 'buddypress' ) ?><?php endif; ?></h3>
	
		</form><? endif; ?>
		<?php pagelines_draw_sidebar($this->id, $this->name, 'template.dwidgets');?>
	
		<?php }
	
	}
	
	/*
		End of section class
	*/[/code]

Share this post


Link to post
Share on other sites
bryan-hadaway    3
bryan-hadaway

Forwarding to developer again to update them. Thanks, Bryan

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

Here is what I have for the section template function and down and it works for me ` function section_template() { ?> <?php if(bp_is_group_forum()):?>

<?php if ( is_user_logged_in() ) : ?> <?php _e( 'Create New Topic', 'buddypress' ) ?><?php endif; ?>

<?php endif;?> <?php pagelines_draw_sidebar($this->id, $this->name, 'template.dwidgets');?> <?php } } /* End of section class */ `

Share this post


Link to post
Share on other sites
julesmoretti    0
julesmoretti

No luck for me. Oh well Ill wait a bit and try out the bbpress version to see how that works.

Share this post


Link to post
Share on other sites
bryan-hadaway    3
bryan-hadaway

Thanks Jules, be sure to update us at that time. Thanks, Bryan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×