Search Results for 'code'
-
AuthorSearch Results
-
November 30, 2006 at 9:55 pm #51555
In reply to: Full Content of Most Recent Post on Front-Page?
ardentfrost
Memberyou can do
echo get_user($topic->topic_last_poster);
EDIT:
Oops, better way
echo $topic->topic_last_poster_name;
November 30, 2006 at 9:18 pm #51554In reply to: Full Content of Most Recent Post on Front-Page?
Null
MemberPerfect thank you so much
One more question, this way I can also add things like topic_poster right?
Can you give me one more excample of how to add the topic poster to this code as well? I think I get the hang of this and can figure things like topic_time etc out myself if I get that last part I asked!
Greetz
November 30, 2006 at 8:55 pm #51553In reply to: Full Content of Most Recent Post on Front-Page?
so1o
Participant<?php
foreach($forum_one_topics as $topic) :
$forum_one_topic_posts = get_thread( $topic->topic_id);
?>
<?php topic_title(); ?><br/>
<?php
echo $forum_one_topic_posts[0]->post_text;
endforeach;
?>
November 30, 2006 at 8:48 pm #51552In reply to: Full Content of Most Recent Post on Front-Page?
Null
MemberMade some changes, but this works:
<?php
$forum_id = 1;
$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,10") ?>
<?php foreach($forum_one_topics as $topic) :
?>
<a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><br />
<?php endforeach; ?>
but it doesnt show the typed text only the title of the forum. What to add to also show the typed text (NOT the replies ofcourse)
Many thx
November 30, 2006 at 8:17 pm #51551In reply to: Full Content of Most Recent Post on Front-Page?
so1o
Participantsorry Null .. but this is the core code.. that will give you the topics..
you will have to write a loop to display the topics eg:
$forum_id = 1;
$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,10")
foreach($forum_one_topics as $topic) :
?>
<a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
<?php
endforeach;
again: i warn watch where you put it. there are a lot of global variables. dont put in place where you are displaying other topics and stuff
November 30, 2006 at 8:08 pm #51550In reply to: Full Content of Most Recent Post on Front-Page?
Null
MemberOw I forgot the forum_id…
K I now have this in frontpage.php:
<?php
$forum_id = 1;
$topics = $bbdb->get_results(“SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,10”) ?>
This takes away the error but doesn’t display anything either..
Greetz The Noob
November 30, 2006 at 7:41 pm #51763thomasklaiber
MemberIt can be done by a plugin, using the actions
bb_new_user
andextra_profile_info
.But the problem would be, that an random password must be generated (no access to tweak insert-function) and then updated to the password the user has chosen. The the user would receive an email with his random password and not with his chosen password. This isn’t cool
Does somebody know, if there is a plugin-way to overwrite/rewrite a whole function (like
bb_new_user();
)?November 30, 2006 at 5:47 pm #51667In reply to: Plugin: Post Notification
spencerp
MemberYou’re awesome thomasklaiber!! Thanks so much!!
Once I get my new domain name situated and stuff, Im going to install it.. thanks again!
spencerp
November 30, 2006 at 5:37 pm #51666In reply to: Plugin: Post Notification
thomasklaiber
MemberFor english version, you have a typo. Favorite vs. Favorit
I don’t really know whats right …? (Pupil from Germany O_o)
November 30, 2006 at 5:33 pm #51665In 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!
-
AuthorSearch Results