Search Results for 'code'
-
Search Results
-
Topic: Plugin Private Posts/Blog
Basically I’m working on a plugin for bbpress that will skip wordpress all together ( no offense wordpress
)
Frankly I think wordpress is too advanced for the average “myspace” type user / target visitor. And, I want to have a community like system like myspace or livejournal.
So I want to basically add a blog section to bbpress where you can keep a private journal… with privacy options on each blog entry to either Private or Public, and if you select Public it will put it in a Forum as a new topic for people to discuss.
I was hoping to get a few pointers as to what functions to look at to help me achieve this through bbpress or if I should even continue doing this and try to customize wordpress-mu instead to fit the visitor
Heres what I have looked at so far:
1) Add new topic / Write blog
bb-templates/post-form.php
......
<label for=”forum_id”><?php _e(‘Pick a section:’); ?>
<?php forum_dropdown(); ?>
</label>
<!– DIRT_PRIVACY –>
Set the privacy:
<select name=”dirt_privacy” id=”dirt_privacy” tabindex=”6″>
<option value=”public” selected>Public</option>
<option value=”private”>Private</option>
</select>
<small>**Choose ‘Private’ if you want this to be a blog only readable by you</small>
<!– END DIRT_PRIVACY –>
<?php endif; ?>
<p class=”submit”>
<input type=”submit” id=”postformsub” name=”Submit” value=”<?php _e(‘Send Post’); ?> »” tabindex=”4″ />
bb-includes/functions.php -> bb_new_topic();
function bb_new_topic( $title, $forum, $tags = '' ) {
// function bb_new_topic( $title, $forum, $tags, $dirt_privacy = ” ) {
global $bbdb, $bb_cache, $bb_current_user;
$title = apply_filters(‘pre_topic_title’, $title, false);
$forum = (int) $forum;
$now = bb_current_time(‘mysql’);
if ( $forum && $title ) {
// if ($dirt_privacy==’public’){
// ADD AS NORMAL TOPIC HERE (depending on whether ‘adding new topic’ or ‘writting new blog’, determine whether to add as default normal Forum Topic (public) or include in users blog but also as public Blog Forum Topic
$bbdb->query(“INSERT INTO $bbdb->topics
(topic_title, topic_poster, topic_poster_name, topic_last_poster, topic_last_poster_name, topic_start_time, topic_time, forum_id)
VALUES
(‘$title’, $bb_current_user->ID, ‘{$bb_current_user->data->user_login}’, $bb_current_user->ID, ‘{$bb_current_user->data->user_login}’, ‘$now’, ‘$now’, $forum)”);
$topic_id = $bbdb->insert_id;
if ( !empty( $tags ) )
add_topic_tags( $topic_id, $tags );
$bbdb->query(“UPDATE $bbdb->forums SET topics = topics + 1 WHERE forum_id = $forum”);
$bb_cache->flush_many( ‘forum’, $forum_id );
do_action(‘bb_new_topic’, $topic_id);
return $topic_id;
//} elseif ($dirt_privacy == ‘private’) {
// ADD TO DB AS PRIVATE BLOG HERE
//}
} else {
return false;
}
}
Sorry if I’m a bit confusing as I am a bit confused right now
Again, any functions/documentation/help I should look at would be appreciated.
-BHensley.com
-Bakedlog.com
I have successfully integrated WordPress and BBPress (http://bbpress.org/forums/topic/12?replies=25#post-2502) but I am having 1 problem..
When I log in as admin in BBPress, it seems to be logging me in with the ‘admin’ account from WordPress, and not giving it admin privileges on the BBPress system, (ie: i can’t go to /bb-admin to edit anything).
The only thing i can think of is somehow excluding the ‘admin’ account integration when you log into bbpress, something like
if ($user=='admin') { #skip integration }
Or is there something I am missing..?
Thanks,
-BHensley.com
-Bakedlog.com
I’ve modified search.php a bit to make the results a little more readable (to my eye) and I was wondering how to get the poster name, to display with the results for recent posts and relevant posts.
I would like to display something like:
<a href="<?php post_link(); ?>"><?php topic_title($bb_post->topic_id); ?></a> <small><?php _e('Posted') ?> <?php echo date(__('F j, Y, h:i A'), bb_get_p
ost_time()); ?></small> [BY MEMBER]
the [BY MEMBER] part, to get the name of the member who made the post that is listed is the part I need help with. Thank you.