Search Results for 'code'
-
AuthorSearch Results
-
December 17, 2008 at 4:54 pm #70378
In reply to: Looking for alternatives
Ipstenu (Mika Epstein)
ModeratorI guess it depends on what you want a forum to do.
Make a list of what you need, being firm with yourself to separate your WANTS from your NEEDS. For example, for me a PM system is nice, but it’s not a deal breaker for me. Whereas sharing IDs and Passwords (and cookies) with WP is a must have. Include things like ‘cost’ and support. Do you want to be able to call up the company, or is a support forum okay.
Then check out a place like http://www.forummatrix.org/ to compare some of them. Like a quick check comparing SMF, bbPress and Vanilla may help you out (see my results).
bbPress is a young product, it’s not even ‘live’ yet, and having been there as a user for SMF back when it was YABB and then YABBSE and THEN when it moved on to SMF (not to mention IPB, the big bad daddy of fat forum software) … well, I’ve tried a lot of forums. They all start out about this level and some improve and some don’t. It’s hard to tell at this stage, but bbPress feels like it’s headed the right way to me
I do understand why it’s not right for everyone, though!
December 17, 2008 at 4:28 pm #70376ganzua
MemberI’m aware of that
but sooner or later, template things should be placed in the templates folder, I don’t know, perhaps a new functions.php in all templates.
BTW John, do you know where can I find some info in custom loops? I’d like to build a loop like this one that I described here; https://bbpress.org/forums/topic/separating-the-first-post-of-each-topic
December 17, 2008 at 4:04 pm #4456ganzua
MemberThis is just a suggestion;
I noticed that there is a lot of stuff in functions.bb-template.php file that should be moved to templates. There are h2 tags in post_form function plus a lot of words that need translation in localization cases.
Besides, I can’t find information on building custom loops. Is there any literature available?
December 17, 2008 at 2:38 pm #70369In reply to: Cookies in WP and BBpress only works on logout
Ipstenu (Mika Epstein)
ModeratorIn bb-config.php
define('BB_AUTH_KEY', 'WP's AUTH KEY halmstad');
define('BB_SECURE_KEY', 'WP's SECURE KEY halmstad');
define('BB_LOGGED_IN_KEY', 'WP's LOGGED IN KEY halmstad');Also make sure you have the salts:
define('BB_AUTH_SALT', 'WP's AUTH SALT');
define('BB_LOGGED_IN_SALT', 'WP's LOGGED IN SALT');And that you have these defined:
$bb->secure_auth_cookie = 'wordpress_sec_456c71223b3bb9958349ec3d65b850f6';
$bb->logged_in_cookie = 'wordpress_logged_in_456c71223b3bb9958349ec3d65b850f6';Personally, I set my cookie domain to .domain.se for both WP and BB.
December 17, 2008 at 8:50 am #70071In reply to: PLEASE Create 2 Versions of bbpress!
John James Jacoby
KeymasterFirstly, while there’s two ways to skin a cat, david’s method kills the kitty in the process. My advice is not to do it that way. If you need to get the absolute path of a directory I made a quick file to do it…
Put this code in a php file, I named mine “abs.php”
<?php
$p = getcwd();
echo $p;
?>Then upload that file to the directory you want to find the path to, and visit it in a web browser. It will echo the absolute path for you. Copy the output. Delete the file. Done!
Duplicating the themes is really the best way to do this, and I promise that once you’ve included WordPress into bbPress properly, it’s a really straightforward and rewarding process.
Firstly, download Notepad++. It’s free, and it rules.
Firstly.5, make copies of your WordPress header.php/footer.php files, and save them someplace safe. We will be modifying these files and don’t want to ruin the actual working WordPress ones.
Secondly, open the header.php/footer.php files for both the stock bbPress theme, and the copied ones I just mentioned. In Notepad++ you should now have 4 files open.
We’re basically working from the outside in.
Thirdly, take all of the relevant bbPress PHP code from it’s header.php/footer.php files, and start copy and pasting them to the equivalent places in the WP copy header.php/footer.php files. Like in mine, I actually have:
<?php
bb_feed_head();
wp_get_archives('type=monthly&format=link');
wp_head();
bb_head();
?>Which loads all of the WP and BBP head related functions inside my BBP forums. Because I want links to my feeds and what-not…
Fourthly, once you’re done with this, then you start poking around the other BBP theme files, and modify all of those files to work within the same construct as your WP theme does, with the same DIV classes and names and what-not.
Because we’ve included the WordPress functions inside bbPress, and because we’re using the same original WP theme header.php file, all of the same style-sheets and JS from that theme are already coded and loaded, even though you’re looking at bbPress. The rest is just tweaking all of the files to look how you want them to.
This is the process I used at http://www.delsolownersclub.com, and I think it’s worked really super well.
December 17, 2008 at 4:53 am #69946In 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-languages
directory 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
-
AuthorSearch Results