I’d like a link on each listed topic that takes you to the last post in the topic. Any help?
I’m not sure i’m doing it right. The idea is good, but nothing seems to happen. Here’s what i have:
In the plugin:
function fel_indicatenew($title)
{
global $topic, $bb_current_user;
if ( bb_is_user_logged_in() )
{
$feluser = bb_get_user($bb_current_user->ID);
if( ($topic->topic_time > $feluser->last_visit) && ( $topic->topic_last_poster != $feluser->ID ) )
{
//$title = '<span style="color: #9d0a0e;">' . $title . '</span>';
$topic->new = true;
}
}
return($title);
}
.. and in the theme’s front-page.php:
<?php if( $topic->new ) : ?>
blah
<?php endif; ?>
I’ve also tried:
<?php if( $topic->new ) { ?>
blah
<?php } ?>
.. but none of these seem to do anything.
It’s not a plugin. Add this to the top of the file, after the <?php:
/*
Plugin Name: Nerr
*/
How are you installing the plugin? Are you downloading it directly or are you using the ‘Plugin browser for bbPress’ plugin? If the latter, then I think it’s not downloading properly, you need to do it manually by downloading the current ZIP file, unzipping it and follow the instructions in the readme.txt file.
Here is the Avatar Upload plugin in the bbPRess Plugin Browser, the newest version of the code is always to be found on that page:
https://bbpress.org/plugins/topic/46
Click on the link “Download latest version” — or just click the following download link for now:
https://bbpress.org/plugins/download/avatar-upload.0.7.zip
What do Tom and Jerry have to do with any of this?
So replace the code that adds the <span class=””> to this:
$topic->new = true;
Then when you want to find out if it’s a new topic, you do this:
if( $topic->new ) {
//blah
}
Should work. Unless I misunderstood your wishes again.
Then i’m Jerry.
Fel, i think you misunderstood me with the new-post class. I wanted it away from the title, as a new variable of some sort. I guess this plugin is only for the topic text, and can not be modified to my wishes.
That’s the maxlength property of input fields.
You can still edit the HTML, though, and submit your crazy username. A serverside check is best.
Like so? http://192.168.1.29/blogs/bb-admin
I think $bb_path should be /blogs/test/forums/ and $bb_domain should be http://192.168.1.29
Oh, amazing … i feel like Tom from Tom & Jerry :p
I don’t know who you have to sleep with to get _that_ plugin. It’s not me. I’m shying away from implementing it because I’m not sure what a good method is.
Do you know if it would be possible to modify the plugin to differentiate between a .no_new_topic and a .new_topic class, for use in CSS instead?
Yeah. Change the function fel_indicatenew() to this (note that I’m using classes ‘no-new-topic’ and ‘new-topic’ here):
function fel_indicatenew($title)
{
global $topic, $bb_current_user;
if ( bb_is_user_logged_in() )
{
$feluser = bb_get_user($bb_current_user->ID);
if( ($topic->topic_time > $feluser->last_visit) && ( $topic->topic_last_poster != $feluser->ID ) )
{
$title = '<span class="new-topic">' . $title . '</span>';
} else {
$title = '<span class="no-new-topic">' . $title . '</span>';
}
}
return($title);
}
Not sure if you have found the solution, but if you put the absolute path to your wp-blog-header.php, it should work fine.
Example: /home/yourusername/public_html/wp-blog-header.php.
i did that and did a diff on all the files and they’re all the same. where do i get the code for avatar.php?
I have never coded sql, but i agree for some unknown reason that i don’t think it’s difficult to code. I’m just curious as to why noone ever did so before. In my opinion, this is the only obstacle in bbPress.
If anyone should decide to give this a go and try to make the plugin, i just have one (more?) request.. and that is that the plugin also indicates a new topic in the forums part, and not only in the latest discussions. The Indicate New Posts plugin fails to do this.
Who do i have to sleep with to get this plugin?
I think it should not be hard to code such a plugin. It would have to create a new database table, like bb_read, with the following fields:
– bb_user
– bb_post
– bb_last_comment_read
This way you could modify the posts query, left joining it with this table. If the join is NULL (please correct me if i’m wrong, i haven’t done these things in a lot of time), then the user has never read the post. If bb_last_comment_read is less than the actual number of comments or replies, then he hasn’t read the last post.
Another interesting alternative is what the folks at wordpress.org are doing … for non-visited links they have a font with a font-weight: bold style. So you can see which topics are new.
Hi fel.
I already modified the -strong- part, to some <span style=”color: #123456;”>, but i have to admit that i have never heard of the content-before tag for CSS.
I looked at google, i guess the tag looks like :before (or :after), but i also found this page:
http://www.quirksmode.org/css/contents.html
.. which states that it doesn’t work in IE browsers. FreekinĀ“ Microsoft..
Good idea though, but unfortunately IE is too popular.
In my theme i have a table, with two columns. First column is the one i would like to be able to modify (even if only with a CSS tag), second column holds the title of the topic.
Do you know if it would be possible to modify the plugin to differentiate between a .no_new_topic and a .new_topic class, for use in CSS instead?
I’m sorry, that was maybe a little bit strong.
(But I see _iframes_ and things just go red …
)
Do you want it CSS-driven? It’s trivial to modify the Indicate New plugin. Just look for where it says <strong> and </strong> (near the bottom) and change that to <span class="new"> and </span>. You can then use content-before to add the NEW or do whatever else.
What’s new and what isn’t isn’t yet implemented.
What would bb be looking up? It knows the link type and it already has $topic->topic_last_poster_name as well as $topic->topic_last_poster.
awesome, just what i was looking for! thanks
> update: actually this is not directly your fault, though you are trying to use a bb-admin function that was meant for local file access to do remote file access?
If you check the short “to do” list at the top of the plugin you’ll see that I plan to address that issue in the future. I might just copy and paste the code from that internal function and then hack in my own curl/fopen alternative function.
> If I am not mistaken, you just found a bbpress security loophole.
Explain your concerns, how do you think this would be exploited? If it can be we should patch it up.
> ps. any concerns about eventually 2,000-20,000 bbpress users hammering the svn with so many file downloads to examine all the plugin headers?
36 downloads so far, let’s start worrying at 1,000
Never mind, I found the variable in config.php. Pretty obvious.
'// The number of topics that show on each page.
$bb->page_topics = 15;
Is there a way to either modify the “Indicate New Posts” plugin, or inspire someone to make a plugin, so that i can add something like this in my theme:
<?php if ($newpost) : ?>
NEW
<?php else : ?>
OLD
<?php endif; ?>
I have looked all over google – and on this site – for a plugin that allowed me to see new posts/topics when i visit my forum, but so far the only one i could find is the “Indicate…”. In all honesty, i can’t use bold marked topics for much.. i need something more CSS like, something not only affecting the topic.
I’ve coded themes for phpBB for years, but i recently found bbPress and i just love how simple and easy it is to code themes here. With a plugin to display new posts/topics (which in my own humble opinion SHOULD be standard in bbPress), i could gladly help spreading the word of a (relatively) new BB, by making some new themes.
If i could decide the function entirely, it should work in such way that both new topics as well as new posts would be affected, and they would continue to show as unread until i actually read them. Also, it should be database driven, so that i could log in to my account on another computer, and still see the posts/topics that would be new for me.
Please don’t make me go back to phpBB…
Actually, I just realized there is a cheat way to do zero extra mysql queries and link to the profile.
<td class="num"><a href="/forums/profile.php?id=<? echo $topic->topic_last_poster; ?>"><?php topic_last_poster(); ?></a></td>
untested but should work in theory
This will just use the stored last posted id # instead of forcing bbpress to lookup all their meta data and profile link in the database.
If your forum uses permalinks, it will just rewrite the url on display.