Search Results for 'code'
-
AuthorSearch Results
-
December 17, 2008 at 4:53 am #69946
In reply to: bbpress is slow like godaddy says?
vannak
Membermy site is getting slower and having more error after raising this topic. ok i need to stop posting now and do a backup fast in case i’ll lose everything
December 17, 2008 at 4:36 am #70069In reply to: PLEASE Create 2 Versions of bbpress!
lolos
MemberFirst of all, thank you so much, especially David and Sam. I really appreciate your help and input.
David, I followed your steps and I think your explanation is very straight forward and detailed. However, it gives me this error:
“Warning: main(/wp-load.php) [function.main]: failed to open stream: No such file or directory in /…/…/…/…/…/www/root folder/forum/bb-config.php on line 4.
Warning: main(/wp-blog-header.php) [function.main]: failed to open stream: No such file or directory in /…/…/…/…/…/www/root folder/forum/bb-config.php on line 7.”
It gave me the error above no matter how I write down the “full path:”
if ( !defined( 'ABSPATH' ) ) {
include_once( '/Full/Path/To/wp-load.php' );
}
require_once('/Full/Path/To/wp-blog-header.php');I translated the /Full/Path/To/wp-load.php –> /wp-load.php and /www/root folder/wp-load.php
December 17, 2008 at 4:25 am #70000In reply to: Windows (Apache2/PHP/5.2.6/MySQL5.1.30)
Sam Bauers
ParticipantOK, so should we manually set “sendmail_from”…
ini_set( 'sendmail_from', 'me@example.com' );Which only affects Windows servers anyway I believe.
December 17, 2008 at 3:11 am #70067In reply to: PLEASE Create 2 Versions of bbpress!
davidbaldwin
Memberlolos,
first of all, if you are doing this with WordPress 2.6 or newer, you have to run 1.0-alpha. If you are running an older version of wordpress you can use the stable version. I attempted to roll back to an older version of wordpress, but i was unsuccessful, so this method is for 1.0-alpha users.
I found the intigration information at:
https://bbpress.org/documentation/integration-with-wordpress/
https://bbpress.org/forums/topic/first-pass-at-a-fix-for-deep-integration-in-trunk#post-21572
you need to add the following to the bb-config.php file, after <?php
if ( !defined( 'ABSPATH' ) ) {
include_once( '/Full/Path/To/wp-load.php' );
}
require_once('/Full/Path/To/wp-blog-header.php');the full paths have to be absolute paths on the servers, not the domain paths.
this will load wordpress when bbpress is loaded.
and then you need to add this line to the very top of every page that has this line: <?php bb_get_header(); ?>
<?php get_header(); ?>please note that the line above has to be line #1 in every page that already calls the bb header, if it does not call the bb header, do not add this, the final result should look like this:
<?php get_header(); ?>
<?php bb_get_header(); ?>this will load the wordpress header when the bbpress header is called. you can edit the bbpress header to remove all the unnecessary code. (like the title, etc.)
and then you need to add this line to the very bottom of every page that has this line: <?php bb_get_footer(); ?>
<?php get_footer(); ?>please note that the line above has to be the last line in every page that already calls the bb footer, if it does not call the bb footer, do not add this, the final result should look like this:
<?php bb_get_footer(); ?>
<?php get_footer(); ?>this will load the wordpress footer when the bbpress footer is called. you can edit the bbpress footer to remove all the unnecessary code. (like the title, etc.)
I hope this helps. if you have any questions, please feel free to ask!
david
December 17, 2008 at 2:12 am #70131In reply to: bbPress 1.0-alpha-4 released
Ipstenu (Mika Epstein)
Moderatortomwi – Two easy options.
1) Use the build in RSS sidebar widget in wordpress.
2) Add the PHP Widget plugin and then toss in something like this:
<?php require_once (ABSPATH . WPINC . '/rss-functions.php');
$today = current_time('mysql', 1);
// insert the feed URL here
$rss = @fetch_rss('http://domain.net/forums/rss');
if ( isset($rss->items) && 0 != count($rss->items) ) {
echo '<ul>';
// set the number of items from the feed to display (5)
$rss->items = array_slice($rss->items, 0, 5);
foreach ($rss->items as $item ) {
echo '<li><a href="';
echo wp_filter_kses($item['link']);
echo '">';
echo wp_specialchars($item['title']);
echo '</a></li>';
}
echo '</ul>';
}; ?>December 17, 2008 at 1:10 am #69943In reply to: bbpress is slow like godaddy says?
vannak
Memberhi _ck_ i did add this ‘$bb->load_options = true;’ into bb-config.php but i wonder that there is no functions.php in my template folder. it is strange isn’t it? anyway, thank for your help so far. maybe hostmonster is a better choice.
December 16, 2008 at 11:39 pm #4451Topic: Separating the first post of each topic
in forum Themesganzua
MemberHi!
I want to separe the first post of each topic from the loop ol list but I can find out how. In topic.php here;
<ol id="thread" start="<?php echo $list_start; ?>">
<?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
<li id="post-<?php post_id(); ?>"<?php alt_class('post', $del_class); ?>>
<?php bb_post_template(); ?>
</li>
<?php endforeach; ?>
</ol>I’d like to change the loop so I can insert a h6 header after the first post and threads look like this;
h6 -> “Topic title”
First post
h6 -> “Responses; “
ol li -> rest of the posts
Is it possible to build a custom loop that only shows the first post and then insert a second loop for the rest of the post with an offset of 1?
December 16, 2008 at 11:28 pm #70244ganzua
MemberSorry, I answer to my own quistion;
After deep integration bbpress uses wp language file, I just cheked it. I think this way is better because then you don’t need to load two language files.
December 16, 2008 at 11:20 pm #70243ganzua
MemberOk, thanks

and does bbpress use wp language file or do you need to have a separated .mo for bbpress? if so, inside what folder? bb-includes/languages?
December 16, 2008 at 11:09 pm #69590In reply to: WordPress and BBPress Theme
lolos
MemberImmeldoy, can you upload your theme and send me the link please?
I want to do the same thing and tried to do everything but I keep failing! I just want to have bbpress inside my word press theme! Is that a hard thing to accomplish?!!!
December 16, 2008 at 10:34 pm #70191In reply to: Installation Complete…BUT…Forum “Page Not Found”
chrishajer
ParticipantI’ve been working with Brad to help resolve this. We’ve finally made some progress.
1. We needed to use the iis_fix plugin from _ck_. Otherwise, any page other than the first page just gets stuck in a reloading loop. Installing this plugin, as an autoload plugin or manually activated plugin, takes care of that problem.
2. When the index.php file is renamed to default.php, the site works fine. When it’s left named index.php, the forum comes up as a 404 error for the front page of the forum only. You can access other pages directly, by adding to the URL. But if you try to load http://www.beardownarizona.com/forums/ or http://www.beardownarizona.com/forums/index.php you get a 404 error. If you rename index.php to default.php, http://www.beardownarizona.com/forums/ loads the front page of the forum just fine.
GoDaddy serves the DirectoryIndex file in this order:
http://help.godaddy.com/article/61
So renaming index.php to default.php (or even leaving index.php there and just copying it to a file called default.php) works just fine.
I also found, with the plugin installed, and this line commented out in index.php, that index.php works fine, and the forums will also load fine when accessed at http://www.beardownarizona.com/forums/ .
/* bb_repermalink(); */So long as that function is not called in the index.php, index.php works just fine on this server.
So, here are the questions:
1. will bbPress work OK without an index.php and just a default.php being the DirectoryIndex file? (it seems to be fine)
2. can the
bb_repermalink();line be commented out in index.php if the site is not using permalinks? Would commenting it out affect anything else negatively?3. What does that function do that would cause the index.php file to come up as a 404 when it’s clearly there? It’s almost like it’s trying to load index.php, index.php says “rewrite the URL to {something else}” then it fails to find index.php.
Any thoughts? Thanks.
December 16, 2008 at 9:43 pm #70237In reply to: Will a template engine be used (e.g. smarty)?
John James Jacoby
Keymaster@Sam:
You know, I think about this everyday, but between you and me (and everyone else reading) I’m convinced more and more that no one really has any idea how to code XHTML, or what kind of object should rightfully be used to encapsulate content.
For the first 20 years of the modern web, everything was done in tables. For the last 5 years of the modern web, everything is being done in lists, divs, and paragraphs. Half the time things are marked up as paragraphs even though they aren’t actually blocks of text. The other half things are marked up as lists even though they contain 1 link. (WordPress and bbPress both suffer from this type of issue, specifically in the pagination and previous/next functions.)
One thing that the Smarty engine does promote, is keeping ALL of the XHTML out of the source code, allowing “template designers” to focus ONLY on the mark-up and then inserting the Smarty tags where the dynamic content belongs.
I’ve noticed that Automattic products tend to really try to think ahead in terms of a typical layout and what their audiences want, and that’s not a bad idea usually… But when the audience changes their mind and wants to go from UL’s to DL’s, inserting a DT becomes impossible and the function is immediately flawed by design. A Smarty type of engine avoids this all together.
Smarty is way too big and fat to include in either WP or BBP in my opinion. We’d be better off with a slimmed down version that’s used in CHBB, which I would LOVE to see implemented personally…
December 16, 2008 at 8:56 pm #70238In reply to: WordPress required??
csseur3
Memberno, you can use only bbpress if you want. WordPress is not required

bye
December 16, 2008 at 6:29 pm #67834In reply to: Get Current Forum ID?
reclaimyourskin
BlockedSorry guys, I thought my problem was resolved but it looks like i’ve spoke to soon.
The code _CK_ suggested below, worked wonders to add a new “on” class on my forum links:
<li<?php if ($current_forum_id=get_forum_id()) {echo " class='on'";} ?>>
Problem!
The trouble is that the unique “on” class is being displayed on every forum link, when I need it to only display when i’m viewing forum 2 for example. Basically, i need a unique css class and current forum marker so the user knows which forum they are currently viewing.
Below is the souce code for all of forum.php (if anyone has time to have a quick look i’d really appreciate it).
<?php bb_get_header(); ?>
<h3><?php forum_name(); ?> Forum</h3>
<ul id=”forumnav”>
<li<?php if ($current_forum_id=get_forum_id()) {echo ” class=’on'”;} ?>>” title=”Latest homepage”><span>Latest<img src=”images/white-arrow.gif” style=”padding: 0 0 3px 5px” width=”10″ height=”5″ border=”0″ /></span>
<li<?php if ($current_forum_id=get_forum_id()) {echo ” class=’on'”;} ?>>forum/forum2″ title=”Forum 2″><span>Forum 2</span>
<li<?php if ($current_forum_id=get_forum_id()) {echo ” class=’on'”;} ?>>forum/forum3″ title=”Forum 3″><span>Forum 3</span>
<li class=”<?php echo $class;?>”>forum/forum3″ title=”Forum 3″><span>Forum 3</span>
<?php if ( $topics || $stickies ) : ?>
<table id=”latest”>
<tr>
<th><?php _e(‘Topic’); ?> — <?php bb_new_topic_link(); ?></th>
<th><?php _e(‘Posts’); ?></th>
<th><?php _e(‘Last Poster’); ?></th>
<th><?php _e(‘Freshness’); ?></th>
</tr>
<?php if ( $stickies ) : foreach ( $stickies as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><?php bb_topic_labels(); ?> <big>“><?php topic_title(); ?></big></td>
<td class=”num”><?php topic_posts(); ?></td>
<td class=”num”><?php topic_last_poster(); ?></td>
<td class=”num”>“><?php topic_time(); ?></td>
</tr>
<?php endforeach; endif; ?>
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><?php bb_topic_labels(); ?> “><?php topic_title(); ?><?php topic_page_links(); ?></td>
<td class=”num”><?php topic_posts(); ?></td>
<td class=”num”><?php topic_last_poster(); ?></td>
<td class=”num”>“><?php topic_time(); ?></td>
</tr>
<?php endforeach; endif; ?>
</table>
<div id=”viewdiv”>
<ul id=”views”>
<li class=”view”>” class=”rss-link”><?php _e(‘<abbr title=”Really Simple Syndication”>RSS</abbr> feed for this forum’); ?>
</div>
<div class=”nav”>
<?php forum_pages(); ?>
</div>
<?php endif; ?>
<?php if ( bb_forums( $forum_id ) ) : ?>
<h2><?php _e(‘Subforums’); ?></h2>
<table id=”forumlist”>
<tr>
<th><?php _e(‘Main Theme’); ?></th>
<th><?php _e(‘Topics’); ?></th>
<th><?php _e(‘Posts’); ?></th>
</tr>
<?php while ( bb_forum() ) : ?>
<?php if (bb_get_forum_is_category()) : ?>
<tr<?php bb_forum_class(‘bb-category’); ?>>
<td colspan=”3″><?php bb_forum_pad( ‘<div class=”nest”>’ ); ?>“><?php forum_name(); ?><small><?php forum_description(); ?></small><?php bb_forum_pad( ‘</div>’ ); ?></td>
</tr>
<?php continue; endif; ?>
<tr<?php bb_forum_class(); ?>>
<td><?php bb_forum_pad( ‘<div class=”nest”>’ ); ?>“><?php forum_name(); ?><small><?php forum_description(); ?></small><?php bb_forum_pad( ‘</div>’ ); ?></td>
<td class=”num”><?php forum_topics(); ?></td>
<td class=”num”><?php forum_posts(); ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; ?>
<?php post_form(); ?>
</div> <!– End Content –>
<?php bb_get_footer(); ?>
Thanks again sambauers, _CK_ and other mods – you’re doing a great job.
December 16, 2008 at 4:34 pm #70123In reply to: bbPress 1.0-alpha-4 released
lorenzocoffee
Memberhi all, hi cookye/code Godness.
I’m a small useless human with many needs,
greatest one now it is NOT to have blog users sharing login,
but it’s only and ‘simply’ to ‘automatically’ import IN BBpress
Wp’s posted articles (even not the old ones)
Would this new beta help in that,given my WP config (2.7) has not
1 or more requested ash /salt/pepper/ things?
Your…faithfully
If working solution will come up
I’ll commit to start english class too.
December 16, 2008 at 3:05 pm #70241ganzua
MemberHi Sam! thanks for your answer;
A my-languages directory would probably be the way to go.
Well, then bb-config.php needs to have last lines changed
; // Change this to localize bbPress. A corresponding MO file for the
// chosen language must be installed to bb-includes/languages.
// For example, install de.mo to bb-includes/languages and set BB_LANG to 'de'
// to enable German language support.
define('BB_LANG', '');I tried a my-languages and a bb-languages folder but no way.
Can you link to the language files you were trying to use?
I had an old .mo file stored in my hard drive. I think it was for bbpress 0.7 or a previous version, not sure.
December 16, 2008 at 2:54 pm #70235In reply to: Will a template engine be used (e.g. smarty)?
Ipstenu (Mika Epstein)
ModeratorUsing Gallery (which uses Smarty) is mostly an annoyance. Getting layouts to work as I want in Smarty is harder than hjust mucking around with CSS, I’ve had to hack code which to me defeats the purpose. Also you have to purge your template cache every time you make a change to the layout, which is a pain.
Smarty’s a nice idea, but it’s ONE MORE thing to learn for a PHP/SQL driven site.
December 16, 2008 at 2:40 pm #70240Sam Bauers
ParticipantIt should be possible to load both language files, in fact some changes were made to WordPress to address the problem specifically.
Can you link to the language files you were trying to use?
* Side note: We should probably move where languages are stored. A
my-languagesdirectory would probably be the way to go.December 16, 2008 at 2:35 pm #69998In reply to: Windows (Apache2/PHP/5.2.6/MySQL5.1.30)
Sam Bauers
ParticipantWell, that’s different…

But I just realised you are using bbPress 0.9 – the bb_mail() function has been replaced in 1.0-alpha with one more like wp_mail() in WordPress.
It was replaced in part because people had problems sending from Windows environments. You have probably just pinpointed the cause of that. Just a few months too late unfortunately!
For now I would just hack the core of 0.9 if I were you – it is unlikely to see any more updates. The replacement function in 1.0 should take care of this, although I would appreciate it if you could test 1.0-alpha for the same problem if you have some time.
December 16, 2008 at 2:05 pm #70227In reply to: ETA of bbPress 1.0 ?
Ipstenu (Mika Epstein)
ModeratorThey’re no where near the point where they want to pimp a finalized product. Personally, I’ve seen far too many projects like this fail because they promoted themselves before they were ready. Right now, even though there is a stable version, the whole site is pretty much a big public test. There’s too much going on to be able to guess a date, and based on the past, if you held a gun to my head, I’d make things up. Which is what developers do when our bosses want to know how long it will take to build the next toy for our companies. We don’t know, sometimes. Creativity (and yes, coding is just that) is hard to measure.
So. It’ll be done when it’s done. Not by years end. Hopefully us posters can help hammer out the big issues to get them to a live 1.0 version sooner, but it’ll take time
December 16, 2008 at 1:51 pm #69939In reply to: bbpress is slow like godaddy says?
Sam Bauers
ParticipantSo in summary…
No, bbPress is not slow like GoDaddy says.
December 16, 2008 at 1:44 pm #70234In reply to: Will a template engine be used (e.g. smarty)?
Sam Bauers
ParticipantThere are no plans nor do I think their should be.
The premise of Smarty is screwy to me.
There is some idea that out there somewhere are “template developers” that aren’t allowed to touch “teh sacred PHP”. So we need an abstracted templating language so that they can do loops and conditionals in their HTML templates.
I don’t believe these people actually exist and that if they do, they should just use PHP and be trained to a point where they are trust-worthy.
99% of Design should be held in the CSS now anyway. The code/display separation thing has moved up a level these days.
December 16, 2008 at 5:22 am #4441Topic: Installing bbPress 1.0 Alpha 4
in forum Installationbrik182
MemberDB Error in bb_insert_topic: Incorrect integer value: '' for column 'topic_id' at row 1INSERT INTO bb_topics (
topic_id,topic_title,topic_slug,topic_poster,topic_poster_name,topic_last_poster,topic_last_poster_name,topic_start_time,topic_time,topic_open,forum_id) VALUES (”,’Your first topic’,’your-first-topic’,’1′,’admin’,’1′,’admin’,’2008-12-16 05:10:50′,’2008-12-16 05:10:50′,’1′,’1′)This problem has been around since the previous 1.0 alpha releases. The installation would say that it was successful but it would not create a topic as that error in the last stage would indicate.
The first forum is created and it says there is 1 post but upon clicking said forum it presents you with a “New Topic in this Forum” form. When you post a new topic, it gives you an error: “This topic has been closed.”
Apache 2.2.10
MySQL 5.1.0
PHP 5.2.6
Windows Server 2003
Database Collation: utf8_general_ci
December 16, 2008 at 12:03 am #70208In reply to: How to get users to be able to post in forums
s7icky
MemberI used that one
sorry about that i think it has something to do with the user roles maybe im not really sure
December 15, 2008 at 11:29 pm #4442Topic: Will a template engine be used (e.g. smarty)?
in forum Installationnewsjunkie
MemberCurious to know if plans exist to ever use a templating engine like Smarty in order to separate logic for design.
So that no more code and HTML are in the same file
-
AuthorSearch Results