Search Results for 'code'
-
AuthorSearch Results
-
September 9, 2009 at 1:23 am #78825
In reply to: How to Get Rid of The Mysterious Brackets
Mark
MemberIn the meantime you can pass new configuration settings to
bb_topic_admin()to change the way this looks.Current configuration options default to:
array(
'id' => 0,
'before' => '[',
'after' => ']',
'delete_text' => false,
'undelete_text' => false,
'redirect' => true
);Change before to ” and after to ‘ – ‘ and instead of the brackets, you just have an extra dash floating around. Or you can edit
bb_get_topic_move_dropdown()and just remove$beforeand$afterfrom$r.
September 9, 2009 at 12:09 am #78712In reply to: Change position for post inputfield
thekmen
MemberIf you don’t have a functions.php in tour theme folder, just create one & add the above code, just make sure to include the opening & closing functions, so it would look like
<?php
function bb_reset_newpostlink() {
global $link, $topic_id;
$link = get_topic_link( $topic_id );
}
add_action( 'bb-post.php', 'bb_reset_newpostlink' );
?>September 8, 2009 at 10:06 pm #31674Topic: comments_popup_link
in forum InstallationSeptember 8, 2009 at 9:54 pm #78690In reply to: call register form via php tag
johnnydoe
Memberi see i see! i have a lot to learn.
ok thank’s kawauso and olaf, it’s been a pleasure… as always
September 8, 2009 at 9:08 pm #78806In reply to: No Analytics for Admins
Adam Harley (Kawauso)
Member<?php if ( !bb_current_user_can('manage_options') ) : ?>
GOOOOOGLE
<?php endif; ?>or
<?php if ( !bb_current_user_can('manage_options') ) { ?>
GOOOOOGLE
<?php } ?>bbPress/WordPress have a boolean function for pretty much everything
September 8, 2009 at 9:08 pm #77666In reply to: Cutting /forum/forum/ down to /forum/
Mark
MemberIt’s actually a pretty simple hack, though I caution you that I worked it out in the last five minutes.
First, modify the following three lines of your bbpress .htaccess;
RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /bbpress/forum.php?id=$1&page=$2 [L,QSA]
RewriteRule ^forum/([^/]+)/?$ /bbpress/forum.php?id=$1 [L,QSA]
RewriteRule ^forum/?$ /bbpress/ [R=302,L,QSA]change
^forum/to whatever you want the permalink to be, such as^sub/or^purplepolkadots/, whatever works for you. Then open functions.bb-template.php and go to line 711 inside functionget_forum_link()(line numbers may vary). It should look something like:$link = bb_get_uri('forum/' . $forum->$column . $page, null, $context);…and change ‘forum/’ to whatever you put in your .htaccess – this seemed to work for me immediately, however as I mentioned, I haven’t done any thorough testing of it.
September 8, 2009 at 9:06 pm #78723In reply to: How to load the header of my theme?
pixelgirl
Member#2: Good idea with the nav, resolved this one, thanx!
I only need to know where bb_topic_admin(); leads to…#1: This is not supposed to happen, unless my integration went wrong, but that is a different topic.
Again, thanx for your help guys!

pxlgirl.
September 8, 2009 at 8:23 pm #78722In reply to: How to load the header of my theme?
gerikg
Memberpixelgirl #1, I wrote a similar question but a user told me; if it’s deep integration then there is no difference between bbpress and wp
I had to just write
<a href="it out without generating it, just plain html. and put the class=”selected” in the BB header. Since the header is not use for anything other than Forum it will always be selected, if that makes sense.#2, sorry I know it’s
<?php bb_topic_admin(); ?>but exactly where it pulls it from beats me.September 8, 2009 at 8:16 pm #78405In reply to: Open forum on it's own page
Adam Harley (Kawauso)
MemberIf you’re trying to get the forum list on the front page visible without anything else, just put something like:
<?php if( !isset( $_GET[ 'forumsonly' ] ) ) : ?>after<?php if ( $forums ) : ?>infront-page.php, then before<?php if ( bb_forums() ) : ?>put<?php endif; // forumsonly ?>.That would allow you to put
?forumsonlyin the URL to turn off the extra bits of the front page.The other option would be to copy index.php into a new file and change the template it loads to something else and take out the parts you don’t want in there, but if bbPress changes anything in index.php in a new version, you’d miss out on the changes.
September 8, 2009 at 8:14 pm #31679Topic: No Analytics for Admins
in forum ThemesAdventureCanoe
MemberWhat if I wanted to only display my Google Analytics code for everyone but me…
I know this is probably simple but I don’t want to mess it up and loose tracking. I need something that says
if <> admin then
display google tracking code
end if
The problem is I am an old ASP guy and trying to learn this php stuff.
-James
September 8, 2009 at 6:50 pm #78721In reply to: How to load the header of my theme?
pixelgirl
MemberProblem 1: Might be a problem with cookies. The members link on the navi appears as selected, although I’m not on the members page, but the forums, which is not selected at all. Here’s a part of my header.php of the bb theme template:
<?php if ( function_exists( 'bp_blogs_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
<?php } ?>
<li<?php if ( bp_is_page( 'forums' ) ) {?> class="selected"<?php } ?>><a href="/bbpress/" title="Forums">Forums</a></li>'I used the default template and moved some code around.
Problem 2: I think a pic says more than a 1000 words here: http://yfrog.com/56screen1opj I want to get rid of those “[]” and I have no idea in which file to do that.
pxlgirl.
September 8, 2009 at 3:47 pm #76647In reply to: Change "add new topic" link?
kirpiit
MemberAs we’re here, one might want to browse this thread as well
https://bbpress.org/forums/topic/kin-kakumei-gold-kakumeiThere’s a focus on the “look” of the button there, which might well be a good complement…
September 8, 2009 at 3:45 pm #67526In reply to: Plugin suggestions
chandersbs
MemberI would like to code a plugin to prevent double posting in a certain period of time. For example, i’m adding this reply to this topic, and in 5 minutes i could add another. This plugin would take the second reply and append it to the first one, instead of making a new post (if no one else replied in those 5 minutes).
I’d love this plugin very much as well, I’ve seen this in action in vBulletin. It also prevents users for “artificially” increasing their post count.
September 8, 2009 at 3:08 pm #78796In reply to: Errors After Pure Install
Adam Harley (Kawauso)
MemberThe “Depreciated” error is caused by PHP complaining that the code is using an old-fashioned way of passing variables. The 2nd error is complaining that PHP has just output text when it shouldn’t have done (since it just gave error text).
The short-term fix would be to look in your PHP’s
php.iniand checkallow_call_time_pass_referenceis set toOn, but I don’t know why your xampp would’ve shipped with itOffsince mine cameOnor why it’s calling things like that in bbPress. So yep, re-download. That’s not an error caused specifically by a trunk build though
September 8, 2009 at 2:53 pm #78762In reply to: Display the latest discussions titles into a webpage
Adam Harley (Kawauso)
MemberHaha or that
I work with a server that’s almost completely firewalled in most of the time, makes doing anything that easy impossible
September 8, 2009 at 2:51 pm #78761In reply to: Display the latest discussions titles into a webpage
kirpiit
MemberI got it!
You just download a folder [1] into your server and make a call with the proper parameters.
Templates are trivial to edit.
Looks the right thing for dummies like me

So, the raw problem is solved.
Now let’s go bor a better solution, if there is any.
I’ll try your code, kawauso, and let you know.
—-
[1]
http://www.feedforall.com/free-php-script.htmSeptember 8, 2009 at 2:29 pm #78759In reply to: Display the latest discussions titles into a webpage
Adam Harley (Kawauso)
MemberAh the plugin is intended for WordPress installs only I’m afraid.
A quick way of doing it:
In your bbPress directory, make a file called
javascript.phpcontaining:<?php
// Taken from index.php
// Load everything up
require('./bb-load.php');
do_action( 'bb_index.php_pre_db' );
$forums = bb_get_forums(); // Comment to hide forums
if ( $topics = get_latest_topics( false, $page ) ) {
bb_cache_last_posts( $topics );
}
bb_load_template( 'html_include.php' );
?>then in your template directory, make a file called
html_include.phpcontaining:<?php if ( $forums && $topics ) : ?>
<table id="latest_discussions">
<tr>
<th><?php _e('Topic'); ?></th>
<th><?php _e('Posts'); ?></th>
<!-- <th><?php _e('Voices'); ?></th> -->
<th><?php _e('Last Poster'); ?></th>
<th><?php _e('Freshness'); ?></th>
</tr>
<?php foreach ( $topics as $topic ) : ?>
<tr>
<td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
<td class="num"><?php topic_posts(); ?></td>
<!-- <td class="num"><?php bb_topic_voices(); ?></td> -->
<td class="num"><?php topic_last_poster(); ?></td>
<td class="num"><a href="<?php topic_last_post_link(); ?>" title="<?php topic_time(array('format'=>'datetime')); ?>"><?php topic_time(); ?></a></td>
</tr>
<?php endforeach; // $topics loop ?>
</table>
<?php else : ?>
No discussions.
<?php endif; ?>and finally, in the page where you want to load the list, put something like:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>$.get("javascript.php", { rand: Math.random() }, function(data){ document.getElementById('latest').innerHTML = data; } );</script>
<div id="latest"></div>Old-fashioned way of loading the HTML in there and use a local copy of jQuery or whatever library you use, but that’s the general idea really.
html_include.phpis just a cut down version offront-page.phpso you can edit it the same as any other template.javascript.phpdoesn’t load in stickies, but that’s just how I felt like doing things, it’s a cut down version ofindex.phpso it’s easy enough to put back.Even more cut down version of
html_include.php(so you really do just get a list):<?php if ( $forums && $topics ) : ?>
<ul>
<?php foreach ( $topics as $topic ) : ?>
<li><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></li>
<?php endforeach; // $topics loop ?>
</ul>
<?php else : ?>
No discussions.
<?php endif; ?>September 8, 2009 at 2:03 pm #78758In reply to: Display the latest discussions titles into a webpage
kirpiit
MemberInstead, that /rss/topics thing looks promising: if I only could find the source of that page, and throw away most of the code, just to keep the last 5 or so entries with no formatting, that would be more than enough.
There is a rss.php file inside the bbpress folder, but there is too much code and I get lost into it.
September 8, 2009 at 1:47 pm #78757In reply to: Display the latest discussions titles into a webpage
kirpiit
MemberThey could surely be worth inspecting, if I only really knew anything about coding.

So, you mean that if I place this piece of php code [1] into any web page I’ll show a list of entries? I tried but it doesn’t seem to work at all.
So, the idea of just swapping wordpress variables with bbpress ones is not enough.
No. I’m afraid it would be beyond my skills.
—-
[1]
https://bbpress.org/plugins/topic/wordpress-latest-post/September 8, 2009 at 1:31 pm #67525In reply to: Plugin suggestions
Olaf Lederer
Participantlol I guess I read the opening post only 11 month ago

edit: btw I will publish the geshi plugin later on my website
September 8, 2009 at 1:23 pm #78710In reply to: Change position for post inputfield
Adam Harley (Kawauso)
MemberHmm… easy way of doing that

function bb_reset_newpostlink() {
global $link, $topic_id;
$link = get_topic_link( $topic_id );
}
add_action( 'bb-post.php', 'bb_reset_newpostlink' );Put that in either
functions.phpor a plugin, it’ll overwrite the redirect link with the general topic one.September 8, 2009 at 1:02 pm #78776In reply to: integration problems after upgrad
Adam Harley (Kawauso)
MemberWhat bbpress integration plugin are you using? You should be able to integrate 2.8 and 1.0 without any plugins installed in either, just set the bbPress up with the same settings as WordPress under
Settings -> WordPress Integrationin the bbPress admin.September 8, 2009 at 12:45 pm #78755In reply to: Display the latest discussions titles into a webpage
Adam Harley (Kawauso)
MemberThere’s the latest topics RSS feed at
/rss/topicsand the WordPress Latest Post plugin: https://bbpress.org/plugins/topic/wordpress-latest-post/, either of those help?September 8, 2009 at 8:13 am #78689In reply to: call register form via php tag
Olaf Lederer
ParticipantI think a sitewide form is easier to integrate using the full code inside the functions.php file (like comment list on wordpress)
September 8, 2009 at 7:58 am #67522In reply to: Plugin suggestions
Olaf Lederer
Participant@chandersbs, this topic is about geshi syntax highlighting
-
AuthorSearch Results
i’m looking for a way to use the same output like in wp for the comments like:
<?php comments_popup_link('no comments', 'one comment', ' % comments'); ?>instead of<?php forum_topics(); ?> <?php _e('post(s) or comment(s)'); ?>.so is there a php pendant in bbpress to count comments or posts the wordpress way?
thank’s in advance