Search Results for 'code'
-
AuthorSearch Results
-
July 21, 2008 at 3:03 am #64539
In reply to: How to Add custom Nav Bar to Theme?
RossB
MemberCould someone please post an example line of code that could be added to the appropriate php page to add a navigation button to the header, or just under the header, of a bbPress forum?
I have added a bbPress forum to a website, and just need a nav button on the bbPress forum that can take a user stright back to the home page of the website. I have no idea about php, though, so would be great if someone could add an example link showing the part I should customise in bold, or something like that.
Also, could someon please explain how I position the nav button on bbPress so that it is left-aligned to the header, or just below the header?
Apologies for this demonstration of coding ignorance!
Cheers
Ross
July 21, 2008 at 1:51 am #66222In reply to: Can only post in Firefox
_ck_
ParticipantI have another idea why it might only work in firefox.
It’s possible you are somehow sending malformed HTML with a damaged or buggy template and only Firefox is able to interpret it correctly while the other browsers munge the bad code and therefore leave out the missing hidden input fields.
Look carefully at your
post-form.phptemplate and see if there is any incorrect HTML. Also try doing a direct download of that?new=1page instead of looking at it in a browser and study the source for malformed HTML, for example an<inputfield without the closing>.(you could even temporarily replace
post-form.phptemplate from the original kakumei theme just to see if it works)July 21, 2008 at 1:37 am #66221In reply to: Can only post in Firefox
_ck_
ParticipantHmm, this is going to require some thought…
That error occurs when bbPress thinks the source of the post is not coming from bbPress (ie. a spammer trying to do a direct post without first visiting the topic)
The way that’s done is there’s something called a “nonce” which is vaguely like a hidden captcha code that is automatically sent along with the post (via POST data) to tell bbPress it’s genuine.
So for some reason it’s not getting that “nonce” other than Firefox, which is incredibly strange. Do you happen to have a personal firewall or some kind of add-on that’s blocking certain data like that?
I would do a “view source” in both firefox and IE on a page with a textarea (http://support.westciv.com/?new=1) and look at the fields inbetween
<form> </form>. See if anything is different.July 21, 2008 at 1:21 am #65926In reply to: bbpress update soon?
_ck_
ParticipantAgain, I’m not an official voice for bbPress, but I don’t see how any of the points listed above are incompatible with the idea that bbPress isn’t a finished program. All of the points are true, it’s a useful and usable program, but it’s not done yet.
Over time, based on feedback and user code contributions I am very confident that integration will become virtually painless and almost instantaneous.
bbPress is only a year old in code development. I’m not sure if you realize that. Polished products like vbulletin are EIGHT years old (and $85 a year plus support plus most plugins and themes are commercially sold)
If you are curious about future features you can always browse the TRAC which will give you a rough idea (ignore the date schedule, they’re just vague estimates). Remember, it’s a community project, you can suggest features and contribute bug fixes too via TRAC.
July 21, 2008 at 1:13 am #3650Topic: Can only post in Firefox
in forum Troubleshootingguyleech
MemberAs of fairly recently, other users and I have only been able to post in Firefox. In all other browsers the error message of “Your attempt to create this topic has failed.” comes up.
The bbPress is not hooked up to a WordPress install, and is running no plugins. I haven’t touched the core code, only the template files (and I’m aware they’re slightly out in IE).
I’ve tried with both a newly registered account, and using my Admin account – both work in FF, but not in anything else.
If anyone could offer some guidance as to why this may be, it would be greatly appreciated.
The URL is: http://support.westciv.com
Cheers
Guy
July 21, 2008 at 12:14 am #66206hyperhookup
Memberanonymous posting – I did see that plugin but it doesn’t say it works with bbpress 9.0.xxx Does it work with the newest version?
Ck’s attchment plugin- Where do I get it?
banning option- yes by ip maybe a custom ban page or something
no registration- meant hide or disable registration
moderation – What do you mean to some extent? Any plugin to extend it more?
Accept tos- Any idea how I would modify it. I am not much of a coder.
Video would it have to be resized?
Thanks
July 20, 2008 at 8:22 pm #65953In reply to: Hiding Subforums’ Subforums from Subforum Pages
755628
InactiveHi,
Okay, so I tried using the code. And it just makes every subforum and its subforums disappear. So everything is there, but with no links to any forums.
July 20, 2008 at 5:06 pm #65134In reply to: Private Messaging Extended
Detective
MemberI don’t know how to do it on the same, but you could easily make a
$bbdb->querycall with your own query.July 20, 2008 at 4:52 pm #3645Topic: Flickr on sidebar
in forum Troubleshootingthion
MemberUntil now, I never had problems with Flickr rss (I mean these cool latest 75×75 images) because I was using WordPress plugins. But now, I have no idea how to put latest images from Flickr group in my bbPress. I was reading API docs for two days now, and I don’t understand it completely
.Can anybody help? Or more, anyone have proper plugin?
.
July 19, 2008 at 3:49 pm #65889In reply to: Show (gr)avatar on frontpage
thion
MemberLong or short, still you should write about it here so:
1. People won’t spam your mailbox;
2. People won’t post another topics like this thing will be here
.I could use something like this for my new project.
July 19, 2008 at 3:20 pm #65948In reply to: Hiding Subforums’ Subforums from Subforum Pages
_ck_
ParticipantThe way I hide sub-forums on the front-page is to wrap the code that lists the forums in this simple code:
<?php if (!$forum->forum_parent) { ?><– this<tr<?php bb_forum_class(); ?>>blah blah
</tr><?php } ?><– and thisIt essentially just checks if the forum has a parent and doesn’t show it. Now on the forum page that’s a problem because any forum listed would have a parent. Gotta think about that one for a minute…
Oh wait, I know what to do, we just have to check if the forum_parent is equal to the current forum id. This is untested but in theory should work:
<?php $forum_parent=$forum_id; ?>
<?php while ( bb_forum() ) : ?>
<?php if ($GLOBALS['forum']->forum_parent==$forum_parent) { ?>
<tr<?php bb_forum_class(); ?>>
<td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><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 } ?>
<?php endwhile; ?>July 19, 2008 at 3:10 pm #65924In reply to: bbpress update soon?
_ck_
ParticipantNote that bbPress is not a finished final product. It’s pre-release and therefore in a state of flux. bbPress has always been a bit behind WordPress changes. If you are using bbPress, you are considered an “early adopter” and therefore you have to accept that things aren’t going to be perfect.
No one but maybe Sam or MDA can say when bbPress will have a release that’s 2.6 compatible. There is code in the trunk that supposedly will work but I wouldn’t recommend using the trunk. It has to be ported to the 0.9 branch and then tested. I suspect they may even wait for the 1.0 beta release and I don’t know if that’s two weeks away or two months away.
Again, there is nothing special about the WP 2.6 release – it only has a handful of extra features and no security bug fixes over 2.5.1 – in fact people are having a bunch of little problem with 2.6 still so why rush to upgrade? I was able to easily downgrade back to 2.5.1 with no problems.
July 19, 2008 at 3:40 am #66201In reply to: Administrator Recount
_ck_
ParticipantIt’s kinda (good) crazy but there’s actually a role key for “recount”.
update: you can make a plugin to give recount access – it will only work for those that can access admin panel
make this into a plugin:
<?php
/*
Plugin Name: Add Extra Caps
*/
function add_extra_caps($caps) {
$caps['recount'] =__('Access the recount administration panel');
return $caps;
}
add_filter( 'get_assignable_caps', 'add_extra_caps');
?>Install and activate it, edit their profile and check the ability for them. Then they should be able to access it.
You don’t even need to keep the plugin running after that, it can be deactivated/deleted until you want to take away the ability.
July 19, 2008 at 2:20 am #3643Topic: check out this very nice R-t-L Arabic bbPress
in forum Showcase_ck_
ParticipantI don’t know who set this up but they did a fantastic job:
Apparently they also shared their R-t-L/Arabic modification so others can get online with bbPress more easily:
http://code.google.com/p/bbpressar/
It’s a shame we don’t do unicode support for usernames.
Wasn’t someone looking at making a patch for that?
July 18, 2008 at 10:32 pm #66006In reply to: WordPress + bbPress Integration 101
_ck_
ParticipantSecurity considerations and table of contents added.
A bit more later.
Ragekage, to make a plugin, just copy all of the code for the function from pluggable.php inbetween the IF statemate and then edit as desired. Add the simple plugin comment header and save to your desired filename.
July 18, 2008 at 11:59 am #65920In reply to: bbpress update soon?
malfhok
MemberActually, I’ve been logged into both admins since I upgraded, and it hasn’t asked for my password since the initial upgrade. Any ideas why I’m seeing this “bug” and nobody else is?
Serious, though. Nobody take that as a sure sign that bbPress 0.9 works with WP 2.6. _ck_ knows more about bbPress than I do.
July 18, 2008 at 7:34 am #66003In reply to: WordPress + bbPress Integration 101
_ck_
Participant== Security Considerations when Integrated ==
If for some reason you are on a shared server that uses subdomains and you do not own/control the entire domain (ie. myblog.example.com johnsblog.example.com) or your URL has a tilde in it (“~”) ie. example.com/~myblog/ and you do not own the entire domain (ie. earthlink.com) my cookie advice above is not a good idea and you will have to customize – ask for help.
The reason why is related to some of the cookie changes in WordPress 2.6 – essentially cookies set to the
domain of “.example.com” will get transmitted to the server for ANY subdomain on the server (myblog.example.com will also see the cookies for johnsblog.example.com) The same thing goes for the cookie path in that cookies set to the path of webroot (“/”) will be sent to both example.com/~myblog/ as well as example.com/~johnsblog/ – malicious code on another subdomain or path could snoop on the cookies and steal your admin access to your blog/forum or pretend to be another user.
WordPress 2.6 (and a future version of bbPress) use separate cookies for admin access that can be locked down to very specific paths as well as different cookies for SSL access. This is an attempt to make sure that cookies which give admin access get transmitted as little as possible and only to the specific server/account that needs it so snooping hackers can’t spoof you.
Note this is only a concern if you do NOT control your own server (ie. other people can run PHP on YOUR domain name) or perhaps if you run a WPMU setup. Otherwise, setting the dotted cookie domain and webroot path is the simplest way to get integration cookie sync.
July 18, 2008 at 5:06 am #65998In reply to: WordPress + bbPress Integration 101
_ck_
Participant== The Shared User List (table) ==
The most essential concept to all integration is that WordPress and bbPress just share the same list of users in the database.
This is where some people make a mistake right at the start and accidentally create or keep using two separate copies of the user lists (usually one complete with many users and the other just themselves because it’s a fresh install of bbPress).
If you find that after your integrated install of bbPress that it cannot “see” any of your WordPress uses, you must check that bbPress is using both the correct DATABASE, and the correct TABLE.
The most common name for the user table is called WP_USERS
The WP_ is what we call the prefix and indicates that it’s part of WordPress by default. If bbPress is running by itself and not integrated, the prefix is likely BB_. Unless you are doing reverse integration and don’t want to change the table name, there is a 99.9% chance that your user table should be WP_USERS.
If your bbPress cannot see the WordPress users, check your “User database table prefix” in the bbPress integration admin menu OR add this to the bottom of bb-config.php
$bb->wp_table_prefix = 'wp_';July 18, 2008 at 4:45 am #65995In reply to: WordPress + bbPress Integration 101
_ck_
Participant== Instant Integration for Power Users ==
If you’ve just installed bbPress 0.9 into a WordPress 2.5 website and followed the integration setup questions but it’s just not integrating correctly and you feel you are fairly web savvy you can try this “shortcut”. (Or read the other posts below for more “theory”.)
** If you have lost admin access entirely, do steps #4+ first and then come back to 1,2,3
1. open this url in a browser window to edit:
http://your-website-url.com/bbpress/bb-admin/options-wordpress.php
(/bbpress/ is your install directory for bbpress)
2. open this url in another browser window for reference:
http://your-website-url.com/wordpress/wp-admin/options.php
(/wordpress/ is your install directory for wordpress)
3. you MUST copy the secret text
from
/wordpress/wp-admin/options.phpto WordPress database secret
on
/bbpress/bb-admin/options-wordpress.phpThey *MUST* be IDENTICAL
4. open to Edit
bb-config.phpin the bbPress directory5. open to Edit
wp-config.phpin the WordPress directory6. bbPress 0.9
the
define("SECRET_KEY","blahblahblah")inyour WordPress
wp-config.phpMUST MATCH thedefine("BB_SECRET_KEY","blahblahblah")inyour bbPress
bb-config.phpbbPress 1.0
instead of SECRET_KEY in 1.0 there are 3 replacements
AUTH_KEY
SECURE_AUTH_KEY
LOGGED_IN_KEY
you can go here to generate a complex secret_key(s):
bbPress 0.9: https://api.wordpress.org/secret-key/1.0/
bbPress 1.0: https://api.wordpress.org/secret-key/1.1/
(note you must add the BB_ part for the bb-config.php)
7. Copy all these items into the bottom of bb-config.php and edit as required:
$bb->wp_siteurl = 'http://your-site-url.com/blog/';// that’s your WordPress URL, not bbPress
$bb->wp_home = 'http://your-site-url.com/blog/';// almost always the same as siteurl unless you tinker
$bb->wp_table_prefix = 'wp_';// should almost always be wp_ unless you tinkered
$bb->user_bbdb_name = 'username_wordpress';// this is the MYSQL database name for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_user = 'username_wp';// this is the MYSQL user name for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_password = 'blahblahblah-changeme';// this is the MYSQL password for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_host = 'localhost';// 99.9% of the time it’s going to be localhost, unless you are on DreamHost or some other weird ISP
$bb->custom_user_table = 'wp_users';// 99.9% of the time it’s going to be wp_users
$bb->custom_user_meta_table = 'wp_usermeta';// 99.9% of the time it’s going to be wp_usermeta
$bb->authcookie = 'wordpress_12345678901234567890123456789012';// in theory you should be able to leave this out
// but this is going to be copied from WordPress cookie
// this *must* match the WordPress setting
// do NOT use the 1234567 part, use your own cookiehash from WordPress – see the note at the very bottom
$bb->cookiedomain = '.your-domain-name.com';// note the leading DOT – this is important
// this *must* match the WordPress setting
$bb->cookiepath = '/';// I *highly* recommend you set the cookie path to /
// this *must* match the WordPress setting
$bb->sitecookiepath = '/';// I *highly* recommend you set the cookie path to /
// this *must* match the WordPress setting
8. Copy all these items into the bottom of wp-config.php and edit as required:
$wp->cookiedomain = '.your-domain-name.com';define(COOKIE_DOMAIN,'.your-domain-name.com');// note the leading DOT – this is important
// we list both for WordPress legacy compatibility
$wp->cookiepath = '/';$wp->sitecookiepath = '/';define('COOKIEPATH', '/' );define('SITECOOKIEPATH', '/');// I *highly* recommend you set the cookie path to /
Once you get all of the above in sync, you definitely should have login integration between WordPress and bbPress. If not, you’ve either made a typo/mistake or you have a more complex setup (ie. reverse integration)
The hardest part of the above might be the wordpress cookie hash (authcookie). In theory you should be able to leave it out and bbPress should automatically create the same hash as WordPress if the secret keys and salt are the same but sometimes it gets it wrong for one reason or another and you have to force it to be correct.
Unfortunately WordPress does not list the cookie hash on the options page and if you don’t know how to examine your wordpress cookies, this is impossible. Fortunately there is a plugin to look at (and even change) your wordpress cookies:
http://www.2diabolos.com/blog/wp-content/uploads/_setCookieParams.zip
or you can use this bookmarklet to show all the cookies your browser has for a website:
July 18, 2008 at 12:09 am #65991In reply to: Adding bbPress to WordPress
724719
Inactiveok i found out how to put bbPress in WP . all i did was put this in wp-config.php:-
define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
require_once('path/to/bbpress/config.php');
?>…..But how do I show a list of the latest 5 topics ?
July 17, 2008 at 7:31 pm #65943In reply to: using bb_get_profile_link
parthatel
MemberThis is the warning that appears on the top of the page.
<b>Warning</b>: parse_url(/%3Ca%20href=%27http://mydomain.com/links/profile.php?id=2%27%3EView%20your%20profile%3C/a%3E) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in <b>/home/domain/public_html/links/bb-includes/functions.php</b> on line <b>1794</b>This is what the My Profile link links to:
http://mydomain.com/%3Ca%20href='http://mydomain.com/links/profile.php?id=2'>View%20your%20profile</a>July 17, 2008 at 4:14 pm #65835In reply to: Infinite Loops on posts and profiles with IIS
_ck_
ParticipantI have a crazy idea to try to “fake out” bbPress and make it think request_uri actually exists on the IIS server so it doesn’t try to (incorrectly) calculate it itself.
Try saving and installing this as a plugin with a leading underscore, ie.
_IIS-fix.php<?php
/*
Plugin Name: IIS request_uri fix
*/
if (isset($_SERVER['HTTP_REQUEST_URI'])){
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REQUEST_URI'];
}
else{
if(isset($_SERVER['SCRIPT_NAME']))
$_SERVER['HTTP_REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
else
$_SERVER['HTTP_REQUEST_URI'] = $_SERVER['PHP_SELF'];
if($_SERVER['QUERY_STRING']){
$_SERVER['HTTP_REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REQUEST_URI'];
}
?>no activation required, should auto-activate – just delete if it causes problems
July 17, 2008 at 3:44 pm #65834In reply to: Infinite Loops on posts and profiles with IIS
_ck_
ParticipantI’m taking a look at this now for what it’s worth.
Not sure if I’ll be able to help but let’s see.
IIS is sending a refresh header:
Refresh 0;url=http://www.louisecooper.com/journal/messageboard/topic.php?id=20content length is zero, so nothing is being sent
Apparently IIS returns “request_uri” differently than other servers. I suspect it’s a similar problem to what they went through with drupal here: http://drupal.org/node/166095
Unfortunately it’s way over my head to fix. I suspect it will take someone like MDA to fix it.
July 17, 2008 at 3:03 pm #65969In reply to: Why is integration so troublesome?
755833
InactiveWell I fixed it, if anyone (incl. developers) are interested. Unfortunately it requires modifying a line of core application code…
pluggable.php in bb-includes
Line 502
$bbdb->insert( $bbdb->users,
compact( ‘user_login’, ‘user_pass’, ‘user_nicename’, ‘user_email’, ‘user_url’, ‘user_registered’ )
);
Replace with
// bbPress / WordPress bug fix added display name to wordpress
$display_name = $user_login;
$bbdb->insert( $bbdb->users,
compact( ‘user_login’, ‘user_pass’, ‘user_nicename’, ‘user_email’, ‘user_url’, ‘user_registered’, ‘display_name’ )
);
July 17, 2008 at 2:38 pm #65968In reply to: Why is integration so troublesome?
_ck_
ParticipantIf you are getting anonymous users, I suspect you haven’t setup integration properly and they are not sharing the same user table.
As far as your other observations (and I felt he same way in the beginning too) you have to realize that (easy) integration was only a priority starting with 0.9
(you can see how complicated the process used to be under 0.8 here – note most of that is not needed now)
Until 0.9, bbPress was just something that ran wordpress.org for Matt and there was no attitude to make integration work. There were tons of problems with usernames etc. and all integration had to be done manually with lots of plugins to fix things.
Then attitudes changed when Matt got funding and decided to use the bbPress code to power TalkPress (essentially forums for users on WordPress.com) Sam and MDA have done a great deal of work to make integration work better but it definitely has a way to go (and should become painless and super-easy IMHO).
So 0.9 has made integration easier but keep in mind bbPress is not even 1.0 yet, so officially it’s not even a released product. The radical cookie changes in 2.6 will take awhile for bbPress to catchup, it’s always been that way.
ps. if it’s not obvious, I am in no way officially associated with Automattic/WordPress/bbPress. Just a plugin developer. And I am not paid. My opinions are definitely just my own and not any kind of official statement.
-
AuthorSearch Results