Search Results for 'code'
-
AuthorSearch Results
-
December 16, 2007 at 10:55 pm #62047
In reply to: Having trouble integrating WP functions
livibetter
MemberSeems you will use a lot of stuff from WordPress. If your WordPress template is already written in German, then you should have no problems. If not or some functions use
gettextfunctions, then you will see many text in original language.December 16, 2007 at 10:51 pm #62045In reply to: Having trouble integrating WP functions
livibetter
MemberThis is a quick workaround:
if ( defined('BBLANG') && '' != constant('BBLANG') ) {
if ( function_exists('load_default_textdomain') ) :
global $l10n;
$locale = BBLANG;
$mofile = BBLANGDIR . "$locale.mo";
load_textdomain('default', $mofile);
else:
include_once(BBPATH . BBINC . 'streams.php');
include_once(BBPATH . BBINC . 'gettext.php');
endif;
}
if ( !( defined('DB_NAME') || defined('WP_BB') && WP_BB ) ) { // Don't include these when WP is running.
require( BBPATH . BBINC . 'kses.php');
if ( !function_exists('load_default_textdomain') )
require( BBPATH . BBINC . 'l10n.php');
}It should drops WordPress’ language file, and replaces with bbPress’. That means translations need to be done in WordPress won’t be translated since this code drops language file. This wont happen when you read your blog. However, I don’t have any language files, so this is coded by guessing.
This is not a solution, just a temporary fix. I will file a ticket.
December 16, 2007 at 10:24 pm #62042In reply to: Having trouble integrating WP functions
livibetter
MemberReproduced.
I didn’t use any language files. But after I put a language code in
bb-config.php(for r988) andwp-config.php, I got a blank page.Don’t know if I can fix this.
December 16, 2007 at 9:55 pm #62040In reply to: Having trouble integrating WP functions
livibetter
MemberThen, you should trace in bbPress’ code to find out where causes an exit.
BTW, you can also test
error_log(get_option('blogname'));to make sure WordPress loaded database correctly.PS. debugging with no debugger is a crazy thing. You have to guess by experiences for best shot.
December 16, 2007 at 9:40 pm #62038In reply to: Having trouble integrating WP functions
livibetter
MemberI don’t have any clues to solve you problem.
If I were you, I will
1. put
error_log('WordPress loaded');after thatrequest_onceto make sure wp has been loaded.2. check error log for
WordPress loaded, if I get that, that means the problem should be on bbPress, or on WordPress.3. keep using error_log, find out where causes a program end.
This is my no-debugger-debugging method.
December 16, 2007 at 8:38 pm #62035In reply to: Having trouble integrating WP functions
livibetter
MemberWell, I didn’t mean that kind of error message. If your hosting provider gives you cpanel, there should be a “Error Logs”
And put that line top of original
config.phpis correct, but to bottom isn’t.Maybe you can try to use relative path? (I don’t think this will help…)
What are the versions of WordPress and bbPress which you are using?
Still need the error log.
December 16, 2007 at 4:39 pm #62026In reply to: constant BBDB_HOST problem
chrishajer
ParticipantIt will support a host name, but are you trying to use a port or a socket? I use MySQL servers on different hosts all the time, but they are always on the default port of 3306.
Can you post the
BBDB_HOSTline from your config.php?Also, you didn’t post the actual warnings: what were those?
livibetter
Memberfel64 is right. So I made a change.
<?php
// from wp_trim_excerpt() in WordPress 2.3.1 formatting.php, just removed few lines
function make_excerpt($text) { // Fakes an excerpt if needed
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text);
$excerpt_length = 55;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, '[...]');
$text = implode(' ', $words);
}
return $text;
}
if ( $topics ) :
$last_post_ids = array();
foreach ( $topics as $topic )
$last_post_ids[] = $topic->topic_last_post_id;
global $bbdb;
$post_ids = $bbdb->get_col( "SELECT post_id, post_text FROM $bbdb->posts WHERE post_id IN (" . implode(',', $last_post_ids) . ")");
$post_texts = $bbdb->get_col( null, 1 );
$post_excerpts = array();
foreach($post_ids as $idx => $post_id)
$post_excerpts[$post_id] = make_excerpt( $post_texts[$idx] );
endif;
?>
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
<?php echo $post_excerpts[$topic->topic_last_post_id]; ?>
</td>
<td class="num"><?php topic_posts(); ?></td>
<td class="num"><?php topic_last_poster(); ?></td>
<td class="num"><small><?php topic_time(); ?></small></td>
</tr>
<?php endforeach; endif; // $topics ?>On my test forum, 15 posts, without excerpts takes .119 sec, with excerpts takes .127 sec. Previous code takes .140 sec.
livibetter
MemberReplace the similar part with it in front-page.php (Kakumei):
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
<?php
// from wp_trim_excerpt() in WordPress 2.3.1 formatting.php, just removed few lines
function make_excerpt($text) { // Fakes an excerpt if needed
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text);
$excerpt_length = 55;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, '[...]');
$text = implode(' ', $words);
}
return $text;
}
echo make_excerpt( get_post_text( $topic->topic_last_post_id ) );
?>
</td>
<td class="num"><?php topic_posts(); ?></td>
<td class="num"><?php topic_last_poster(); ?></td>
<td class="num"><small><?php topic_time(); ?></small></td>
</tr>
<?php endforeach; endif; // $topics ?>It generates an excerpt of latest reply of topic.
December 16, 2007 at 12:11 am #61976In reply to: Forums working great, but we cant log in S.O.S.
toxicshocktv
MemberI’m going to try a fresh reinstall and see if I can get it working, otherwise I’m off to Vbulletin.
December 15, 2007 at 11:46 pm #62020In reply to: database MINOR issue
Trent Adams
MemberGlad to help

Trent
December 15, 2007 at 11:18 pm #61974In reply to: Forums working great, but we cant log in S.O.S.
Trent Adams
MemberLogins and such are best used with default everything until you know they work. Try the default template again and report back any specific things you have going on there. As well, once you start fiddling with integrating with WP in the config.php it will use the WordPress members. Another thing if you don’t have Akismet setup would be to put:
$bb->akismet_key = false;Trent
December 15, 2007 at 11:15 pm #62010Trent Adams
Member#1) This is simple enough as MU is built for that.
#2) If you are talking about each member having their own bbPress forum as well in #2, I would suggest that would be a massive problem. If you just mean having them using a single forum, I think this can be done.
#3) Avatars can be down with many plugins you can find in these forums or over at https://bbpress.org/plugins/ . Combining with MU might be a little difficult or require a plugin. I would suggest looking around to see if anyone on MU has come up with a solution already. That or use Gravatar

#4) Combination of plugins and RSS feed grabbers could do that without very much hassle. What is written already might be sufficient from the plugins area, but a couple different database requests would make new plugins for this quickly I am sure.
#5) You didn’t have one

#6) People out there have successfully integrated bbPress and WordPressMU logins, but you might need to search a bit over at http://mu.wordpress.com/forums/ as well for the answer
It also depends on your answer to #2 though…..#7) You already know the answer and Null helped with the others.
Trent
Doobus
MemberI’m mediocre at best when it comes to php, so I’m a bit confused as to what to call, all I really know are the functions for WordPress, any code suggestions would be greatly appreciated.
December 15, 2007 at 9:41 pm #62008talbina
MemberCome on in guys
.
fel64
MemberComment duplication fixed,
ns gotten rid of as far as I can tell! o/December 15, 2007 at 3:36 pm #62016In reply to: Would copying the theme of bbpress.org be illegal?
Trent Adams
MemberThe forum theme I put up was also with permission of Matt himself before I even put it up for download

Trent
December 15, 2007 at 2:36 pm #62015In reply to: Would copying the theme of bbpress.org be illegal?
Sam Bauers
ParticipantI believe the theme for this forum is available for download somewhere, it might even be Trent’s theme?
The GPL doesn’t work that way. The idea of “linking” is very compiler specific terminology, it doesn’t really apply to php scripts calling other php scripts.
Changing GPL code is OK and you can’t be forced to redistribute it (hand over source), but if you do, the source must be made available and the licensing must remain the same GPL license.
العاب
MemberHello all …
I need more

I need to adds description and keywords meta tags for both is_topic and is_forum.
i was search in this forum i see one plugin but it wasn’t work with 0.8.3
December 15, 2007 at 10:16 am #62002In reply to: font size and color plugin
itissue
MemberNevermind. I created a plugin that I can modify anytime I want. Here’s the code if you’re interested. You don’t even need the add image plugin.
<?php
/*
Plugin name: Extra html tags
plugin author: Sue
plugin description: Allow extra html tags, even depreciated
*/
function allow_extra_tags( $tags )
{
$tags['a'] = array(
'href' => array(),
'title' => array(),
'rel' => array(),
'target' => array(),
'alt' => array()
);
$tags['i'] = array();
$tags['b'] = array();
$tags['del'] = array();
$tags['p'] = array(
'style'=> array()
);
$tags['strike'] = array();
$tags['img'] = array(
'src'=> array(),
'alt' => array(),
'title' => array(),
'width' => array(),
'height' => array(),
'style' => array()
);
$tags['font'] = array(
'style' => array(),
);
$tags['br'] = array();
$tags['h1'] = array();
$tags['h2'] = array();
$tags['h3'] = array();
$tags['h4'] = array();
return $tags;
}
add_filter( 'bb_allowed_tags', 'allow_extra_tags' );
?>December 15, 2007 at 9:49 am #2701Topic: font size and color plugin
in forum Pluginsitissue
MemberI was wondering if there’s a plugin already out there for font size and font color. They should enable the font tag or style=””; in the tags. Also, why can’t we use heading tags such as
<h1>or choose an image width and height in our image tags?December 15, 2007 at 2:57 am #57589In reply to: Allow Image plugin question
itissue
MemberI tried what post #2 did but it doesn’t work. I’m not sure why but it doesn’t. If only you can set the width in the
<img/>tag.December 15, 2007 at 1:25 am #61998hishamabu
MemberThank you so much for your response livibetter, but I’m not getting this at all. I’m not a programmer/coder by any stretch of the imagination. My abilities go no further than copy & pasting code.
With regards to Unix sockets, I’m on a Dreamhost hosting package if that helps at all.
Can you please tell me how the trac thing work?
Thank you again.
livibetter
MemberIf you just call the template functions of WordPress, that won’t work. I meant get the part you need. (sorry for misleading)
PS. If you still can’t get it work, please paste your code and error message, if any.
December 14, 2007 at 9:23 pm #61986In reply to: New bbPress Theme: Misty Morning
Trent Adams
MemberThat is a beauty! I really like that one and might have to come up with a use for it

Trent
-
AuthorSearch Results