Search Results for 'code'
-
AuthorSearch Results
-
July 25, 2007 at 6:34 am #2154
mikelothar
MemberIs 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…
July 25, 2007 at 6:15 am #58941_ck_
ParticipantActually, 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.
July 25, 2007 at 1:52 am #59375In reply to: paragraph breaks bust loose
outchy
Memberi feel like i should send you a check, fel.
thanks
July 25, 2007 at 1:40 am #59374In reply to: paragraph breaks bust loose
fel64
MemberThat’s because you have these seriously weird rules:
* > .box p {style.css (line 683)
margin-top:-100px;
}You have them twice, too. Looks like you copied the same code from somewhere twice. Right at the end of the file.
I recommend that you make a _single_ change, test, repeat. Then you know what’s responsible when stuff breaks.
[Edit] Yeah. Get rid of the hack. That will fix it.
Ardentfrost recommended this alternative hack a while back. http://ardentfrost.rayd.org/?p=136
July 24, 2007 at 11:02 pm #52948In reply to: usually forums would have…
riddle
MemberMistainu, by “breadcrumb structure” do you mean that the family tree of a sub-forum should be displayed? That’s high on my wishlist.
In other words, right now a subforum’s breadcrumbs look like:
Food Forums – winesaps
When I wish they looked like:
Food Forums – fruit – apples – winesaps
I’m reluctant to use subforums at all if I can’t give the user good feedback about where they are in the forum structure.
So: does your breadcrumb code address this problem? And if so, is it coherent enough that I can glue it into place myself without being an expert about bbPress internals? (I do know enough PHP to be dangerous.)
July 24, 2007 at 8:06 pm #58788In reply to: Plugin: Show Top Posters
Rhys Wynne
ParticipantCheers fel

Regarding the plugin, there’s a slight niggle. At the moment the plugin builds the profile URL from scratch. So it’s an extra (and I believe unessecary) option that you define if you have pretty permalinks or not.
Is there like a hook (similar to user_profile_link) that grabs the profile URL?
fel64
MemberSorry Crowspeak, I’m not immediately sure what the problem could be. I’ll mull it over and go through the code again sometime. Hopefully it’s not too much of a problem for you.
July 24, 2007 at 7:34 pm #58787In reply to: Plugin: Show Top Posters
fel64
MemberDownload something like TortoiseSVN. For Tortoise, right-click on a folder, select TortoiseSVN > Repo-browser, enter the URL you want to add to and use the interface provided.
July 24, 2007 at 7:22 pm #58786In reply to: Plugin: Show Top Posters
Rhys Wynne
ParticipantAlso, I have no clue how to use the subversion repository. Is there a guide anywhere so I can upload my plugin there?

I have been accepted, just not sure what to do!
bobbyh
MemberCongrats! Also, since you don’t have IE7, I’ll confirm here that your theme also looks good on IE7.
July 24, 2007 at 6:20 pm #58939_ck_
Participantoutchy, this plugin is for a completely different purpose.
You already have the latest posters on the front page, if you want to turn their names into profile links you need to do something like this in your front-page.php
<td class="num"><a href="<? user_profile_link( get_post_author_id( ) ); ?>"><?php topic_last_poster(); ?></a></td>(untested)
Note because of the way user data is not cached on the front page, this will cause several extra queries per topic listed and probably not a good idea for very busy forums.
July 24, 2007 at 5:44 pm #2153Topic: css help
in forum Installationoutchy
Memberi hate asking this because i thought i was pretty good with css but i must swallow my pride
could you guys help me figure out why IE is dropping the “Latest Discussions” part below the “Top Posters” sidebar? it works in Firefox!!http://www.manonfire.cc/sk6ers/
here’s the css:
http://www.manonfire.cc/sk6ers/bb-templates/superbold/style.css
July 24, 2007 at 4:26 pm #56729In reply to: Plugin: Avatar Upload
fel64
MemberHere’s a hacked workaround, though I am not sure it’s a good idea to tap into the user_cache directly. I’d otherwise suggest nicely using bb_get_user() as it checks the cache first but the problem with that is it fetches ALL the data if not in the cache which is overkill. Too bad there isn’t a bb_get_user_meta($id,’metaname’) but oh well – for now replace this top section of code:
The user _must_ be in the cache at this point if his details are being displayed next to the post, right? Implying that bb_get_user would never need to use a single query.
There _is_ a bb_get_usermeta() already: https://trac.bbpress.org/ticket/691. It’s in the latest.
July 24, 2007 at 4:22 pm #57314In reply to: Plugin: bb-Topic-Views
_ck_
ParticipantI’ve now come up with an extremely easy/fast way to grab and display the views per forum in the forum list on the front page (or forums with sub-forums.
Here’s the plugin:
function forums_views_append($forums) {
global $bbdb; $sum_meta_value="SUM(meta_value)";
$forums_views = $bbdb->get_results(" SELECT $sum_meta_value,forum_id FROM $bbdb->topicmeta LEFT JOIN $bbdb->topics ON $bbdb->topicmeta.topic_id = $bbdb->topics.topic_id WHERE $bbdb->topicmeta.meta_key='views' GROUP BY $bbdb->topics.forum_id");
foreach ($forums_views as $forum_views) {$forums[$forum_views->forum_id]->views=$forum_views->$sum_meta_value; }
return $forums;
}
add_filter('get_forums','forums_views_append');To display the views, edit your front-page.php template and insert a views header and views column like so:
<th><?php _e('Views'); ?></th>
<th><?php _e('Topics'); ?></th>
<th><?php _e('Posts'); ?></th>.
<td><?php echo $forum->views; ?></td>
<td><?php forum_topics(); ?></td>
<td><?php forum_posts(); ?></td>Since there is no clean way to store forum meta data right now in bbpress (apparently an oversight) this will run on every time the forums list is displayed. Maybe not such a good idea for very busy forums, even though it’s a single mysql query (nifty eh?).
Eventually I’ll figure out a nice way to store this and only update upon new posts or new topics to reduce overhead (or a cron job perhaps).
July 24, 2007 at 2:18 pm #59233In reply to: Plugin: Plugin browser for bbPress
_ck_
ParticipantWould it be possible for you to properly use fsockopen or curl instead of “file()” for remote files? Like many hosts, I disable file() for remote urls for security vulnerability reasons which cripples your plugin. You’re likely to get many complaints that “nothing happens”
Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/example/public_html/forums/bb-admin/admin-functions.php on line 798.
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 I am not mistaken, you just found a bbpress security loophole.
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?
July 24, 2007 at 12:45 pm #56727In reply to: Plugin: Avatar Upload
LMD
ParticipantOk, version 0.7 is released: including the changes by SamBauers as well as an image sharpening (unsharp mask) function.
@Sam – Using the latest version of your plugin, I tried installing the new version of Avatar Uplaod, but it still wouldn’t read the
additional-filesdirectory. This is what it looks like over FTP: screenshot (NOTE: if there is a problem viewing it — error 403 — try cutting and pasting the URL instead – it’s probably my over-zealous image-hotlinking prevention).July 24, 2007 at 6:54 am #56726In reply to: Plugin: Avatar Upload
_ck_
Participant@box87, be aware that single upload class is larger than most of the the entire bbpress core code itself – massive overkill unless you really, really really need it’s extra features?
@louisedade – I found a major caching bug where you are not taking advantage of user meta data that has already been loaded previously in the same execution – this causes 10-30 extra mysql queries for every topic that is displayed depending on how many posts are displayed at once.
Here’s a hacked workaround, though I am not sure it’s a good idea to tap into the user_cache directly. I’d otherwise suggest nicely using bb_get_user() as it checks the cache first but the problem with that is it fetches ALL the data if not in the cache which is overkill. Too bad there isn’t a bb_get_user_meta($id,’metaname’) but oh well – for now replace this top section of code:
function avatarupload_get_avatar($id, $fulluri=1, $force_db=0)
{
global $bbdb, $user, $bb_user_cache;
if ($force_db == 0 && ($id == $user->ID || !empty($bb_user_cache[$id])) )
{
if (!empty($user->avatar_file)) {
$a = explode("|", $user->avatar_file);
} else {
if (!empty($bb_user_cache[$id]->avatar_file)) {
$a = explode("|", $bb_user_cache[$id]->avatar_file);
}
else {return false;}
}
}
elseDrops my topic queries by 20 per page while still functioning correctly in all other cases.
Discovered this problem via bb-benchmark
July 23, 2007 at 8:02 pm #59311In reply to: Noobish CSS Question
M
MemberIn Safari/Camino, it still has issues.
#hottags{height: 100%;}helps that one.Quick fix, not guaranteed to work… thus, I resort to an acronym: YMMV.
July 23, 2007 at 5:12 pm #59354In reply to: mysql_query() OR $bbdb->get_results() ?
Null
MemberOkay okay, 1 day
(just kidding)
July 23, 2007 at 3:58 pm #52445In reply to: blockquote?
fel64
Memberverbatim in my bb-admin/style.css file does no goodbecause there are no blockquotes in bb-Admin. Apply them to your theme, which should be in my-templates/themename/style.css. I agree, kakumei needs default blockquote support. I’ll add a trac ticket or sumthin’.
July 23, 2007 at 3:44 pm #58683In reply to: I want to change bbPress’ default text
M
MemberFunny you mention this… I’m doing some work for a client at the moment using WordPress and I wanted to change some of the admin backend text without modifying core files. Localization using an
en.mofile turned out to be the way to go.I believe bbPress supports localization as well. It’s probably going to be the route you’ll want to take. (edit: it does, BBLANG in config.php, drop the .mo file in
/bb-includes/languages/I would assume)The file you’ll need to edit is a compiled binary, so you’ll have to get the bbpress.pot file, probably from the bbPress site somewhere. (edit: http://svn.automattic.com/bbpress-i18n/pot/tags/)
Once you’ve got the file, check out poEdit (http://sourceforge.net/projects/poedit/). It’s an open-source cross-platform mo/po/pot editor. Create a
New catalog from .pot file, make sure the option to compile to .mo is checked in the preferences, and you should be good to go.The top-left box contains the text to be translated, the bottom-left contains the “translation.” Ctrl-F, find the string, and you’re good from there.
Note: I haven’t tried this with bbPress but it works great with WordPress. Hope it helps.
July 23, 2007 at 3:43 pm #56724In reply to: Plugin: Avatar Upload
LMD
ParticipantThanks Sam! That’s awsome. I’ve downloaded and reviewed the code and I’ve made a couple of small modifications – added an option to the admin page and a tiny bit of validating (so that you can’t have a non-numerical or zero max_width etc — actually setting the sizes to zero will now reset the options to their “factory defaults”).
@Plugin Users: I’m adding an unsharp mask routine to the reszing code before I commit the updates, so it might not be ready until tomorrow. If you’ve downloaded Sam’s update, you will have to do another update later.
July 23, 2007 at 3:41 pm #52444In reply to: blockquote?
azizpoonawalla
MemberI just installed bbpress yetserday on a new domain and have integrated it with wordpress using the plugin, etc. I also have found that the default template has no blockquote support. Even by including the blockquote definition given above by Trent verbatim in my bb-admin/style.css file does no good, here is a view source excerpt of the source file:
<blockquote><p>[Shakir 5:57] O you who believe! do not take for guardians those who take your religion for a mockery and a joke...</p></blockquote>as a test…
testing blockquote here in bbpress support
nope. above line doesnt render in blockquoted indent either.
i think the problem is the insertion of <p></p> tags around every paragraph. Since blockquote is an inline style, the p tags override it. we could get around this by using a div class=blockquote kind of construction instead but wouldt it be nicer if blockquote just worked out of the box?
July 23, 2007 at 3:10 pm #58682In reply to: I want to change bbPress’ default text
outchy
Memberwhere can i change this default text for these links at the bottom of topic.php:
<?php topic_delete_link(); ?> <?php topic_close_link(); ?> <?php topic_sticky_link(); ?>
i can’t find it except in template-functions.php, which i won’t ever touch again
July 23, 2007 at 10:31 am #56719In reply to: Plugin: Avatar Upload
LMD
ParticipantWell, yes, the plugin includes a file that must be placed into the bbPress root as well as another file that must be moved into the templates folder (either
bb-templates/kakumeiormy-templates/template-name). Not to mention the creation of theavatarsfolder and uploading of thedefaultavatar.I can not see any way around this other than uploading all files to the
my-plugins/avatar-uploadfolder and then using the script to move them to the right locations. Although, the file that remains in themy-pluginswould still need to be manually edited to set the plugin’s options. Likewise, the folder creation could be done with a script rather than the current manual creation (as SamBauers suggested on the Plugin Browser thread).Is there a hook for when a plugin is activated? Looking around bbPulp I found the following…
bb_deactivate_pluginXXX
bb_activate_plugin_XXX… but no information on how they are used.
-
AuthorSearch Results