Search Results for 'code'
-
Search Results
-
Topic: Sytling the Admin Screens
I am working on a project where I will use bbPress in a large corporate environment and styling it very differently then a standard forum. Sorry, I can’t show it to you because it is part of our Intranet. I have the front end layed out almost exactly as I want it and presented the prototype to our CIO. He likes the front end, but did not like the back end (admin) area.
The problem is that he manage forums page is not very intuitive to the non-technical person. Because we will have non-technical people managing the forums, I need to change how the manage forums page looks, without editing core code if possible. I will also be adding links in the front end to those people who have access to manage a given forum to edit the forum details.
This leads to the second part. Each forum is supposed to have a short intro, long intro and an associated photo. Are there any plugins that add fields and/or photos to a forum, or will I need to write that? I have searched here but haven’t found any yet. The less code I have to right the better, just need to know where to start this process.
Thanks.
Topic: Let ask again …
Are you working for Automattic, Sam? Is it your job bbpress developing? I’m asking because of
- http://bbpress.org/blog/2008/01/the-future-for-bbpress/
- There are 18 open bugs – http://trac.bbpress.org/query?status=new&status=assigned&status=reopened&milestone=!1.5&type=defect&order=priority
- 5 days there are NOT any code uploads – http://trac.bbpress.org
I believe I have a simple but highly effective fix.
Since the vast majority of forum traffic is for non-logged in users AND, since the only time a forum page changes is if a POST is made … why not implement a very basic disk caching system that caches the content for the FrontPage and Topic page for non-logged in users.
Here is the pseudo code:
// Front page
if (not logged in)
…….. serve disk cache
…………….if (disk cache not present)
……………………generate page and save to disk
else (logged in user)
……..generate page (PHP)
// Topic page
if (not logged in)
……..serve disk cache
……..if (disk cache not present)
…………….generate page and save to disk
else (logged in user)
……..generate page (PHP)
// post a comment function
delete Topic cache for non-logged in users
delete Front page cache for non-logged in users
The benefit being, now for any non-logged in user – the Front page and individual Topic pages will be cached once some submits a new comment.
And if you are logged in, non of this effects you.
Thoughts?
I can’t add links in posts properly

When I try to add a link I do it like that:
<a href="http://www.mysite.com/">My Site</a>but the link generated by bbPress in the post isnt linking to
but to
I would like to modify the bb_list_tags to show who the author of that tag was (to moderators)
So I created a functions.php in my theme and have copied function bb_list_tags from functions.bb-templates.php file. And done the following (note the changes to the function have not yet been made)
<?php
// to override bb_list_tags to show tag author
remove_filter('bb_list_tags', 'bb_list_tag');
function bb_list_tag( $args = null ) {
$defaults = array(
'tags' => false,
'format' => 'list',
'topic' => 0,
'list_id' => 'tags-list'
);
$args = wp_parse_args( $args, $defaults );
extract( $args, EXTR_SKIP );
if ( !$topic = get_topic( get_topic_id( $topic ) ) )
return false;
if ( !is_array($tags) )
$tags = bb_get_topic_tags( $topic->topic_id );
if ( !$tags )
return false;
$list_id = attribute_escape( $list_id );
$r = '';
switch ( strtolower($format) ) :
case 'table' :
break;
case 'list' :
default :
$args['format'] = 'list';
$r .= "<ul id='$list_id' class='tags-list list:tag'>n";
foreach ( $tags as $tag )
$r .= _bb_list_tag_item( $tag, $args );
$r .= "</ul>";
endswitch;
echo $r;
}
add_filter('bb_list_tags', 'bb_list_tag');
?>Is this the correct way to change a core function? Changing anything within it doesn’t appear to override the original function.
Topic: Change Design of Pagination
[Sorry if this is the wrong place to ask, I couldn’t find a better one]
I know it a lot to ask but could someone help me with a short piece of code please? I never worked with PHP and would like to insert a bit of HTML into a piece pf PHP. I would really appreciate any help.
The Problem:
I have some not so web savvy users at my board and I’d like to make the pagination of threads better to see for them.
At the moment it’s kinda tiny and has no spaces between the page numbers for some strange reason.
(Screenshot of how it looks at my board: http://f.imagehost.org/0070/toosmall.png)
I guess I found the place to change it in the post-template.php
$output = '';
if ( $multipage ) {
if ( 'number' == $next_or_number ) {
$output .= $before;
for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {
$j = str_replace('%',"$i",$pagelink);
$output .= ' ';
if ( ($i != $page) || ((!$more) && ($page==1)) ) {
if ( 1 == $i ) {
$output .= '<a href="' . get_permalink() . '">';
} else {
if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
$output .= '<a href="' . get_permalink() . '&page=' . $i . '">';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
}
}
$output .= $link_before;
$output .= $j;
$output .= $link_after;
if ( ($i != $page) || ((!$more) && ($page==1)) )
$output .= '</a>';
}
$output .= $after;
} else {
if ( $more ) {
$output .= $before;
$i = $page - 1;
if ( $i && $more ) {
if ( 1 == $i ) {
$output .= '<a href="' . get_permalink() . '">' . $link_before. $previouspagelink . $link_after . '</a>';
} else {
if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
$output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $link_before. $previouspagelink . $link_after . '</a>';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $previouspagelink . $link_after . '</a>';
}
}
$i = $page + 1;
if ( $i <= $numpages && $more ) {
if ( 1 == $i ) {
$output .= '<a href="' . get_permalink() . '">' . $link_before. $nextpagelink . $link_after . '</a>';
} else {
if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
$output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $link_before. $nextpagelink . $link_after . '</a>';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $nextpagelink . $link_after . '</a>';
}
}
$output .= $after;
}
}
}
if ( $echo )
echo $output;
return $output;
}And I would like to change the visual output to this
<p><strong> Next Page ></strong></p>for “Next”
and
<p><strong>< Previous Page </strong></p>for “Previous”
Thanks for your time

[and please excuse my poor English xD]
Topic: No Table Prefix, Really
After a successful installation, the main page shows as follow:
” You must specify a table prefix in your bb-config.php file. “
I AM sure my config.php has defined table prefix as follow:
” $bb_table_prefix = ‘bb_’; “
after I add the code, my main page shows as follow:
” $bb_table_prefix = ‘bb_’;You must specify a table prefix in your bb-config.php file. “
What is going wrong?
This one should go to the “documentation” section as an entry or something like this.