58 F
Los Angeles
Sunday, April 28, 2024

Trump Lawyer Resigns One Day Before Trial To Begin

Joseph Tacopina has filed with the courts that he will not represent Donald J. Trump. The E. Jean Carroll civil case is schedule to begin Tuesday January 16,...

Judge Lewis A. Kaplan Issues Order RE Postponement

On May 9, 2023, a jury found Donald J. Trump liable for sexual assault and defamation. The jury awarded Ms. Carroll $5 million in damages. Seven months ago,...

ASUS Announces 2023 Vivobook Classic Series

On April 7, 2023, ASUS introduced five new models in the 2023 Vivobook Classic series of laptops. The top laptops in the series use the 13th Gen Intel® Core™...
StaffCreating a Post to Forum Page

Creating a Post to Forum Page

After watching students work with the website www.thechembook.com, a single page dedicated to posting to a forum seemed appropriate. Building this page has been a challenge.

BuddyPress forums (modified bbPress) were installed last year. Posting through the forum/index.php page has been possible, however, students dislike waiting for the “Ask a Question’ button to load. Many students start adding information into the form before the page is fully loaded. A single page dedicated to posting should make it easier.

A template (named question.php) with the following code was uploaded:

[code] <?php
/*
Template Name: Question
*/
?>

<?php get_header(); ?>

<div id="bp-container">

<div class="padder">

<div id="new-topic-post">

<?php if ( is_user_logged_in() ) : ?>

<div class="info">

<p><h5>How To Ask A Great Question And Get It Answered</h5>
Maybe you are stuck on a homework problem or do not understand a particular concept. Don’t panic. TheChemBook.com is a great place to ask your questions.
First search to see if someone else has asked about the problem. Next, search <a href="/wiki/index.php/">The Chemistry Text</a> by reading the section on the topic.
If none of this helps, start a new topic by completing the form below.
Start with a great headline. Avoid saying, "I’m lost" or "how do I do problem 12?"
A great headline might be "Determining Significant Figures – Captured Zeros"
Next, type as much detail as possible, for example, add the exact wording of the problem you are trying to answer.
Finally, explain the problem <strong>and what you have tried</strong>.
The more details you add then the faster someone can help you.
Teachers are available at irregular intervals, therefore, make sure that you help others with their questions, too.</p>
</div>

<br><br>

<?php if ( bp_has_groups( ‘user_id=’ . bp_loggedin_user_id() . ‘&type=alphabetical&max=100&per_page=100’ ) ) : ?>

<form action="/tutoring" method="post" id="forum-topic-form" class="standard-form" enctype="multipart/form-data">

<?php do_action( ‘question_before’ ); ?>

<a name="post-new"></a>
<h5><?php _e( ‘Post a New Question:’, ‘buddypress’ ); ?></h5>

<label><?php _e( ‘Question:’, ‘buddypress’ ); ?></label>
<input type="text" name="topic_title" id="topic_title" value="" />

<label><?php _e( ‘Content:’, ‘buddypress’ ); ?></label>
<textarea name="topic_text" id="topic_text"></textarea>

<label><?php _e( ‘Tags (comma separated):’, ‘buddypress’ ); ?></label>
<input type="text" name="topic_tags" id="topic_tags" value="" />

<label><?php _e( ‘Choose the Best Forum:’, ‘buddypress’ ); ?></label>
<select id="topic_group_id" name="topic_group_id">

<option value="">—-</option>

<?php while ( bp_groups() ) : bp_the_group(); ?>

<?php if ( bp_group_is_forum_enabled() && ‘public’ == bp_get_group_status() ) : ?>

<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>

<?php endif; ?>

<?php endwhile; ?>

</select><!– #topic_group_id –>
<br /><br />

<?php do_action( ‘question_after’ ); ?>

<br /><br />

<div class="bp-submit">
<input type="submit" name="submit_topic" id="submit" value="<?php _e( ‘Post Topic’, ‘buddypress’ ); ?>" />
<input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( ‘Cancel’, ‘buddypress’ ); ?>" />
</div>

<?php wp_nonce_field( ‘bp_forums_new_topic’ ); ?>

</form><!– #forum-topic-form –>

<?php else : ?>

<div id="message" class="info">
<p><?php printf( __( "You are not a member of any groups so you don’t have any group forums you can post in. To start posting, first find a group that matches the topic subject you’d like to start. If this group does not exist, why not <a href=’%s’>create a new group</a>? Once you have joined or created the group you can post your topic in that group’s forum.", ‘buddypress’ ), site_url( BP_GROUPS_SLUG . ‘/create/’ ) ) ?></p>
</div>

<?php endif; ?>

<?php else : ?>

<div id="message" class="info">
<p>You need to <a href="<?php echo site_url( ‘wp-login.php’ ) ?>">log in</a> <?php if ( bp_get_signup_allowed() ) : ?> or <?php printf( __( ‘ <a class="create-account" href="%s" title="Create an account">create an account</a>’, ‘buddypress’ ), site_url( BP_REGISTER_SLUG . ‘/’ ) ) ?><?php endif; ?> to participate in the tutoring area.</p>
</div>

<?php endif; ?>

</div>

</div>

</div>

<?php get_footer(); ?>
[/code]

A page was created, choosing the template question, so that the form for posting loads. Here is the result:

Problems left to resolve:
The bb-attachments plugin does not load on this new page. To test, I’ve written a hook and function, placed these in different locations, and tried to figure out why the plugin will not load.

Let me know if you have any ideas!

Latest news

Related news

1 COMMENT

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments