Search Results for 'code'
-
AuthorSearch Results
-
November 30, 2006 at 5:33 pm #51665
In reply to: Plugin: Post Notification
November 30, 2006 at 4:43 pm #51154In reply to: Private Forum script
so1o
Participanti think this would be safer option..
function my_check_private_forum() {
global $bb;
$login_page = $bb->path . 'bb-login.php';
if (!bb_is_user_logged_in() && $_SERVER['PHP_SELF'] != $login_page) {
header('Location: ' . $bb->domain . $bb->path . 'bb-login.php');
}
}
add_action( 'bb_init', 'my_check_private_forum');
any thoughts?.. any one?
November 30, 2006 at 4:13 pm #51151In reply to: Private Forum script
so1o
Participanti would think it is standalone..
are you sure you aren’t logged in.. it would redirect the user to login.php if he isnt logged in. if you are logged in it would load normally
also check the bb-settings.php file.. check what is the name of the hook for initialization. as i mentioned the hook name was changed from init to bb-init.
if the bb-settings file has this
do_action('init', '');
then change the last line of the plugin to
add_action( 'init', 'my_check_private_forum');
November 30, 2006 at 3:55 pm #51546In reply to: Full Content of Most Recent Post on Front-Page?
Null
MemberOke and in what file do I put this? And also where do I put the 1? (1 = forum id)
Sorry I am noob
November 30, 2006 at 3:37 pm #51150In reply to: Private Forum script
Aaron
Participantso1o: does this plugin need to be used with the code posted earlier in this thread, or is it standalone?
If it is standalone (ment to function on its own) I am not getting any results. I put the plugin into my-plugins and no results. Everything loads as normal.
Any pointers.
November 30, 2006 at 3:11 pm #51149In reply to: Private Forum script
so1o
Participanthere is the plugin..
please note that the bb hook for initialization was change after the blix release (0.73). it was changed from ‘init’ to ‘bb_init’
function my_check_private_forum($test='') {
global $bb,$bb_current_user;
$login_page = $bb->path . 'bb-login.php';
if ($_SERVER['PHP_SELF'] != $login_page) {
if ( !$bb_current_user ) {
header('Location: ' . $bb->domain . $bb->path . 'bb-login.php');
}
}
}
add_action( 'bb_init', 'my_check_private_forum');
November 30, 2006 at 3:10 pm #51480In reply to: My first plugin (post count)
ardentfrost
MemberThe change wasn’t hard, just added an additional check to the SQL query and I apparently saw your post soon after you made it…
Looks impressive though doesn’t it? You posted a request and 24 minutes later, I filled it?
November 30, 2006 at 2:32 pm #51545In reply to: Full Content of Most Recent Post on Front-Page?
so1o
Participantyou can use this
$topics = get_latest_topics( $forum_id);
but this will give you number of topics/page that you set in your config
to get just 10 topics from the forum
$topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,10")
November 30, 2006 at 1:58 pm #51952In reply to: Latest bbPress Posts In WordPress
spencerp
MemberYeah true.. Trent, thanks for clarifying that for everyone, and me!
spencerp
/Me didn’t get to bed yet, so.. my brain is now working in reverse, compared to your’s.. since you got the sleep.. lol!!
November 30, 2006 at 1:53 pm #51951In reply to: Latest bbPress Posts In WordPress
Trent Adams
MemberNeeds to be an option though because with that code in there, it will exclude when most users wouldn’t really need anything excluded. As well, that is only for the sidebar part, not the widget.
Trent
November 30, 2006 at 1:34 pm #51950In reply to: Latest bbPress Posts In WordPress
spencerp
MemberThis is the block of database code that Trent had “fixed” up for me, to exclude the one forum.
(Found near end of plugin file)
function wp_bb_get_discuss_sidebar() {
global $wpdb,$bbpath;
$bbtopic = $wpdb->get_results("SELECT * FROM bb_topics WHERE topic_status = 0 AND forum_id NOT IN ('3') ORDER BY topic_time DESC LIMIT 10");
Where => (‘3’) is the forum id to exclude..
spencerp
November 30, 2006 at 1:28 pm #51664In reply to: Plugin: Post Notification
spencerp
MemberNice one!! Hey thomasklaiber, could there be one made up for getting Notifications, on any one’s posts? Example, Me replying here now, to your thread.. (not a favorite).. and you’d get an email on it? Just was curious…
spencerp
November 30, 2006 at 1:05 pm #51844In reply to: To display [Resolved], by the thread’s title
spencerp
MemberYou’re so awesome!! It works!! Thanks a ton!!
<?php
/*
Plugin Name: My Resolve Title
Plugin URI: https://bbpress.org/forums/topic/338?replies=4#post-1764
Description: Puts [Resolved] by the thread's title, for threads that are marked as Resolved.
Author: so1o
Version: 0.1
Author URI: http://www.adityanaik.com/forums/
*/
function my_resolve_title($id){
global $topic;
if ('yes' == $topic->topic_resolved)
return sprintf(__('[Resolved] %s'), $topic->topic_title);
return $topic->topic_title;
}
add_filter( 'topic_title', 'my_resolve_title');
?>
spencerp
November 30, 2006 at 12:48 pm #51843In reply to: To display [Resolved], by the thread’s title
so1o
ParticipantHey Spencer
create a plugin with this code.. that should do the trick.. i think..
function my_resolve_title($id){
global $topic;
if ('yes' == $topic->topic_resolved)
return sprintf(__('[resolved] %s'), $topic->topic_title);
return $topic->topic_title;
}
add_filter( 'topic_title', 'my_resolve_title');
November 30, 2006 at 12:36 pm #51479In reply to: My first plugin (post count)
Trent Adams
MemberI put the plugin code under the username. Compare the following code to your post.php in your templates. Make sure you are editing post.php and placing it in /my-templates/post.php.
<div class="threadauthor">
<p><strong><?php post_author_link(); ?></strong><br />
<small><?php post_author_type(); ?></small><br />
<small><?php post_count(); ?></small></p>
</div>
<div class="threadpost">
<div class="post"><?php post_text(); ?></div>
<div class="poststuff"><?php _e('Posted:'); ?> <?php bb_post_time(); ?> <a href="<?php post_anchor_link(); ?>">#</a> <?php post_ip_link(); ?> <?php post_edit_link(); ?> <?php post_delete_link(); ?></div>
</div>
This is the entire post.php, but obviously where I have the code is near the top.
Trent
November 30, 2006 at 12:34 pm #51661In reply to: Plugin: Post Notification
thomasklaiber
MemberStrange … maybe i should use a download-script
Try this one.
Did a small fix again and gave the .zip a new name ^^
Thanks a lot for your patience!
November 30, 2006 at 12:29 pm #51949In reply to: Latest bbPress Posts In WordPress
Trent Adams
MemberIt isn’t put in as an option, (though it would be easy to do), but all it really is, is adding SQL statement to exclude a forum. Maybe a guy should put a plugin code option for number of posts displayed as well as excluding a forum.
Trent
November 30, 2006 at 10:20 am #51948In reply to: Latest bbPress Posts In WordPress
Atsutane
MemberGlad to see someone is using my plugin
The plugin has been listed before but it gone now, thank’s for re-posting it.
Maybe u can send me the fix and i add it into the plugin.
November 30, 2006 at 3:37 am #51842In reply to: To display [Resolved], by the thread’s title
spencerp
MemberAnyone? Do you think we can get the “file changes” or whatever, to be able to display [Resolved], by the thread’s title, that are marked Resolved? Just was wondering..
I noticed this in: formatting-functions.php near the end, for [Closed]..
function closed_title( $title ) {
global $topic;
if ( '0' === $topic->topic_open )
return sprintf(__('[closed] %s'), $title);
return $title;
}
Maybe if there’s a way to add one for [Resolved]… ? lol!!
spencerp
November 30, 2006 at 1:15 am #51910In reply to: Help with a plugin
spencerp
Memberso1o, you’re awesome! Thanks alot!
In /index.php, made it like this:
$topics = get_latest_topics(0,1,3,4,’2′);
Now the ones from the “Blog Article Discussion” forum, are NOT showing in the “Latest Discussion” section..
Thanks again!
However.. when I did try that plugin option, it deleted ALL the threads, except for the Blog Article Discussion posts.. but, I think that’s because I used the wrong id for the forum.. lol..
When hovering over the “Blog Article Discussion” forum, it shows as “3” being the “id”.. but, in the admin control panel.. I assigned “2” for it.. so, that’s what the problem was.. Anyway.. she’s working now! Thanks again!!
spencerp
November 30, 2006 at 12:59 am #51909In reply to: Help with a plugin
so1o
ParticipantSpencer
two ways..
1) edit /index.php
change line 12 to
$topics = get_latest_topics(0,1,'x');
where x is the forum id of the ‘Blog Article Discussions’ forum
2) plugin
create a file named my-own-blog-forum-filter.php plugin in the my-plugins directory.. or any name you want.. and have the following code in it
<?php
function my_frontpage_forum_filter($where) {
$where .= " AND forum_id NOT IN ('x') ";
}
add_filter('get_latest_topics_where', 'my_frontpage_forum_filter');
?>
again replace x with the forum id that you need
November 30, 2006 at 12:46 am #51908In reply to: Help with a plugin
spencerp
Memberardentfrost, maybe you can help me..? I’m using the bbPress Post (0.02) by mByte, and with his plugin.. I had made a forum for the blog posts to show up, however.. I would like to make the blog posts, stay ONLY IN the “Blog Article Discussions” forum..
Instead of them showing up in the “Latest Discussions” part of the forums index page.. And just have ONLY the threads made in the forums, show in the “Latest Discussions” section of the forum.. Is there maybe something that could be done for this?
I’m basically asking to exclude one of the forums, from the “Latest Discussions” section. Thanks in advanced..
spencerp
November 30, 2006 at 12:36 am #51281In reply to: question about exporting from bbpress
BrendonKoz
MemberSince Ahni was interested, and I’ve been itching to do a conversion script to see how easy/hard it can be, I figured I’d chime in. I’m not familiar with either application’s inner workings, but looking at a database and comparing — now that I can get into!
So, technically, I’m only interested to do a direct convert based on what he wants, if I get around to it at all (don’t want to make any promises here). Anyone else would be more than welcome to modify whatever code I write later on. I can make it publically available. Should be pretty simple, I would think.
November 30, 2006 at 12:24 am #50837In reply to: Error for tags.php
so1o
Participantdouble check the $bb->domain and $bb->path variables..
make sure you have the latest code..
disable any plugins you have… specially if they have a filter applied to bb_tags.php
also do you have custom templates or have you modified templates..
November 29, 2006 at 10:10 pm #51916In reply to: bbPress plugin(s) not grabbing user’s email addy..
spencerp
MemberTrent, you’re so awesome!! After talking with Trent on GoogleTalk, he has helped me get this problem squashed! And, I had to slap myself twice, because I didn’t upload the bbPress Integration plugin, to my wp-content/plugins folder…
Thanks again for letting me know that Trent.. as well as the cookiedomain settings you gave above!
spencerp
-
AuthorSearch Results