Search Results for 'code'
-
AuthorSearch Results
-
June 15, 2009 at 9:37 pm #74602
In reply to: Limit one forum to topics started today
leggo-my-eggo
MemberOK, I think I have this one solved. I modified my forum.php file to include this block right before the $topics foreach loop.
<?php if( $forum_id == '4' ) { // If this is the "Today Only" forum (#4), replace the $topics query
$today = date('omd');
$today_topics_query = new BB_Query( 'topic',
array(
'forum_id' => 4,
'started' => $today,
'order_by' => 'topic_start_time',
'topic_status' => 'all',
'open' => 'all',
'count' => true,
'per_page' => 20
)
);
$topics = $today_topics_query->results; // Here's the array of topics the query returned.
} ?>I’ll let you know for sure if it works tomorrow.
June 15, 2009 at 8:10 pm #74433In reply to: Nginx Rewrite Rules for Pretty Permalinks
Ashish Kumar (Ashfame)
ParticipantI am sure that I am doing something wrong here.
This is the vhost for the domain :
server {
listen 80;
server_name mydomain.com;
rewrite ^/(.*) http://www.mydomain.com/$1 permanent;
}
server {
listen 80;
server_name www.mydomain.com;
access_log /home/public_html/mydomain.com/log/access.log;
error_log /home/public_html/mydomain.com/log/error.log;
location / {
root /home/public_html/mydomain.com/public/;
index index.php index.html;
# Basic version of WordPress parameters, supporting nice permalinks.
# include /usr/local/nginx/conf/wordpress_params.regular;
# Advanced version of WordPress parameters supporting nice permalinks and WP Super Cache plugin
include /usr/local/nginx/conf/wordpress_params.super_cache;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/public_html/mydomain.com/public/$fastcgi_script_name;
}
}I have added the rewrite rules for bbPress in
/usr/local/nginx/conf/bbpress_params.regular
Now where should I add
include /usr/local/nginx/conf/bbpress_params.regular;
in my vhost file?June 15, 2009 at 7:01 pm #73594In reply to: bbPress Integration plugin for WPMU
ITguy
MemberTHANK! That did the trick
Will let you know how the rest of the integration goes.
June 15, 2009 at 6:43 pm #73592In reply to: bbPress Integration plugin for WPMU
ITguy
Member@johnjamesjacoby, thanks for yoyr quick response and offer to help. I found the following bb_ entries in the wp_usermeta table:
umeta_id user_id meta_key meta_value
14 1 bb_capabilities a:1:{s:6:"member";b:1;}
16 0 bb_capabilities a:1:{s:6:"member";b:1;}
24 2 bb_capabilities a:1:{s:6:"member";b:1;}
55 3 bb_capabilities a:1:{s:6:"member";b:1;}
75 4 bb_capabilities a:1:{s:6:"member";b:1;}
102 5 bb_capabilities a:1:{s:6:"member";b:1;}
112 1 bb_topics_replied 1
17 1 bb_user_settings m0=o&m1=o
18 1 bb_user_settings_time 1243961396The only odd entry may be the one for user id ‘0’ since there is no entry for that user id in the wp-users table.
June 15, 2009 at 6:16 pm #73590In reply to: bbPress Integration plugin for WPMU
ITguy
Member@johnjamesjacoby, I have the same setup and problem as hempsworth. I have repeated the install process now 10 times, same error. I deleted the forum folder (bbpress) deleted the database tables and deleted the cookies. I even tried a different user name instead of ‘admin’, same error. And just for fun I also used a different browser, same error
June 15, 2009 at 6:02 pm #74570In reply to: Integrating WPMU trunk and bbPress RC2
John James Jacoby
KeymasterHere is what worked for me, on my WPMU sub-domain setup. (Sam, when you go through this, I understand that bbPress stores the salts in the DB and that they aren’t needed here, but for some reason I just feel better inside knowing I put them there the same as they are in wp-config.php
)
2:05pm eastern time – UPDATE: I have confirmed these settings work on both WPMU subdomain and subdirectory installs. All logins/logouts, cookie clears, posting, and admin panel access works 100%.
WordPress MU is installed on the domain root, bbPress is installed in a SUB-DIRECTORY called “support”
Terms
SUB-DIRECTORY = Name of directory that bbPress is installed in
HASH-FROM-FIREFOX = Cookie hash taken from pre-integrated login cookie
GENERATED = String generated by WordPress key/salt generatorbb-config.php
// DEEP INTEGRATION AT THE VERY TOP
// (Sam, I can see you shaking your head right now)
if ( !defined('ABSPATH') & !defined('XMLRPC_REQUEST') & !defined('BB_IS_ADMIN')) {
define('WP_USE_THEMES', false);
include_once( '/absolute/path/to/domain.com/wp-blog-header.php' );
//unset($wp_object_cache);
header("HTTP/1.1 200 OK");
header("Status: 200 All rosy") ;
}
// Typical database stuff - blah blah blah
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '/');
define('COOKIEHASH', 'HASH-FROM-FIREFOX' );
define('BB_AUTH_KEY', 'GENERATED');
define('BB_SECURE_AUTH_KEY', 'GENERATED');
define('BB_LOGGED_IN_KEY', 'GENERATED');
define('BB_NONCE_KEY', 'GENERATED');
define('BB_AUTH_SALT', 'GENERATED');
define('BB_LOGGED_IN_SALT', 'GENERATED');
define('BB_SECURE_AUTH_SALT', 'GENERATED');
$bb->bb_xmlrpc_allow_user_switching = true;
// WordPress database integration speedup
$bb->wp_table_prefix = 'wp_';
$bb->wordpress_mu_primary_blog_id = 1;
$bb->user_bbdb_name = '';
$bb->user_bbdb_user = '';
$bb->user_bbdb_password = '';
$bb->user_bbdb_host = '';
$bb->user_bbdb_charset = '';
$bb->user_bbdb_collate = '';
$bb->custom_user_table = '';
$bb->custom_user_meta_table = '';
// WordPress cookie integration speedup
$bb->wp_siteurl = 'http://domain.com'; // no trailing slash
$bb->wp_home = 'http://domain.com'; // no trailing slash
$bb->cookiedomain = '';
$bb->cookiepath = '/';
$bb->authcookie = 'wordpress_HASH-FROM-FIREFOX';
$bb->secure_auth_cookie = 'wordpress_sec_HASH-FROM-FIREFOX';
$bb->logged_in_cookie = 'wordpress_logged_in_HASH-FROM-FIREFOX';
$bb->admin_cookie_path = '/SUB-DIRECTORY/bb-admin';
$bb->core_plugins_cookie_path = '/SUB-DIRECTORY/bb-plugins';
$bb->user_plugins_cookie_path = '/SUB-DIRECTORY/my-plugins';
$bb->sitecookiepath = '';
$bb->wp_admin_cookie_path = '/wp-admin';
$bb->wp_plugins_cookie_path = '/wp-content/plugins';
define('WP_AUTH_COOKIE_VERSION', 1);wp-config.php
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '/');
define('COOKIEHASH', 'HASH-FROM-FIREFOX');
define('AUTH_KEY', 'GENERATED');
define('SECURE_AUTH_KEY', 'GENERATED');
define('LOGGED_IN_KEY', 'GENERATED');
define('NONCE_KEY', 'GENERATED');
define('AUTH_SALT', 'GENERATED');
define('LOGGED_IN_SALT', 'GENERATED');
define('SECURE_AUTH_SALT', 'GENERATED');June 15, 2009 at 4:17 pm #74499amistad
MemberI think so … thank you very much
June 15, 2009 at 4:01 pm #74601In reply to: New Post Notification
johnhiler
MemberTry this plugin?
https://bbpress.org/plugins/topic/moderator-new-post-notification/
There are some tweaks to the code mentioned in the comments of that link… definitely check those out if you hit any issues.
June 15, 2009 at 3:28 pm #54991In reply to: Translate into Simple Chinese.
_ck_
ParticipantChinese:
https://bbpress.org/forums/topic/localization-traditional-chinese-language-file
http://lonelyer.googlepages.com/bbpress_trandational_chinese_languag.zip
http://dupola.googlecode.com/files/bbPress_0.9.0.2_zh_CN.zip
Chinese (CN)
http://bbshowcase.org/forums/bb-includes/languages/zh_CN.mo
Chinese (HK)
June 15, 2009 at 2:09 pm #74536In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
Arturo
Participantis wp normal (not mu)
i’ve removed the dot but nothing change, seeing the cookie have a dot in front… i’m waiting! thanks for all Sam for your patience
June 15, 2009 at 1:39 pm #74367In reply to: Final release candidate 1.0-RC-2 is available.
the_Wish
MemberThe “fix” won’t fix any text which is already malformed. Once you edit the text to repair it shouldn’t happen again.
Sorry to say but even new syntax with attributes like this
<a href="http://bbpress.org">This is a link</a>
is still converted to
<a href="//bbpress.org"">This is a link</a>
Same goes for Singlequotes.
June 15, 2009 at 1:37 pm #74431In reply to: Nginx Rewrite Rules for Pretty Permalinks
Sam Bauers
ParticipantThis will probably work:
rewrite ^/page/([0-9]+)/?$ /index.php?page=$1 last;
rewrite ^/forum/([^/]+)/page/([0-9]+)/?$ /forum.php?id=$1&page=$2 last;
rewrite ^/forum/([^/]+)/?$ /forum.php?id=$1 last;
rewrite ^/forum/?$ / permanent;
rewrite ^/topic/([^/]+)/page/([0-9]+)/?$ /topic.php?id=$1&page=$2 last;
rewrite ^/topic/([^/]+)/?$ /bbpress/topic.php?id=$1 last;
rewrite ^/topic/?$ / permanent;
rewrite ^/tags/([^/]+)/page/([0-9]+)/?$ /tags.php?tag=$1&page=$2 last;
rewrite ^/tags/([^/]+)/?$ /tags.php?tag=$1 last;
rewrite ^/tags/?$ /tags.php last;
rewrite ^/profile/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&page=$2 last;
rewrite ^/profile/([^/]+)/([^/]+)/?$ /profile.php?id=$1&tab=$2 last;
rewrite ^/profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&tab=$2&page=$3 last;
rewrite ^/profile/([^/]+)/?$ /profile.php?id=$1 last;
rewrite ^/profile/?$ /profile.php last;
rewrite ^/view/([^/]+)/page/([0-9]+)/?$ /view.php?view=$1&page=$2 last;
rewrite ^/view/([^/]+)/?$ /view.php?view=$1 last;
rewrite ^/rss/?$ /rss.php last;
rewrite ^/rss/topics/?$ /rss.php?topics=1 last;
rewrite ^/rss/forum/([^/]+)/?$ /rss.php?forum=$1 last;
rewrite ^/rss/forum/([^/]+)/topics/?$ /rss.php?forum=$1&topics=1 last;
rewrite ^/rss/topic/([^/]+)/?$ /rss.php?topic=$1 last;
rewrite ^/rss/tags/([^/]+)/?$ /rss.php?tag=$1 last;
rewrite ^/rss/tags/([^/]+)/topics/?$ /rss.php?tag=$1&topics=1 last;
rewrite ^/rss/profile/([^/]+)/?$ /rss.php?profile=$1 last;
rewrite ^/rss/view/([^/]+)/?$ /rss.php?view=$1 last;
if ( !-e $request_filename ) {
rewrite ^ /index.php last;
}June 15, 2009 at 12:29 pm #14992Topic: One for Sam? Core/Theme discrepancy
in forum Troubleshootingmichael3185
MemberUsing 0.9.0.5, I created a custom theme, doing it as instructed by copying template files into a my-templates/my-theme folder. I then created a new ‘role’ as one thread suggested, by modifying capabilities.php. No problems, and all works well.
For the Guest role I added, I allowed them to post replies, but not create new topics. Then I noticed that ‘Create Topic’ was showing on the topics page, but with no input area beneath it. I went through the theme template files over and over, but couldn’t find out where the [H2]Create Topic[/h2] (and similar for Reply) were. Odd. I finally tracked it down to a function in template-functions.php, around lines 136 – 142, where the titles are output, and then the post page called.
What this means is that A) the titles are not part of the post form (ie input area), and
a theme can’t be properly customised without hacking a core file, which will then be overwritten by an upgrade. I’ve hacked my template-functions.php, and will have to do so again when I upgrade. The good thing is that my theme template files now have the titles where they ought to be, and they can be easy customised.
I didn’t want to mess with the template-functions.php code in case I broke it, so I just remmed out the follow line, then added the titles to post-form.php and topic.php;
// echo ‘<h2 class=”post-form”>’ . $h2 . ‘</h2>’ . “n”;
I don’t know if this has been changed in 1.0, but don’t you think it should be? I realise that the ‘role’ change I made hacked a core file, but at least upgrading to 1.0 (when it’s marked as stable) will give me proper roles.
June 15, 2009 at 8:19 am #74594In reply to: HOW do i write a plugin
massbase
Memberok, ill try that out (windows) if it wont work ill wait for the wiki.
my plugin plan:-
– User albums – in each profile a small image gallery of all uploaded images will be shown.
– Faviroute users – each user can follow another / bookmark a user.
– items-4-sale – users list their items for sale on their profiles.
– thumbnails for posts – so posts can be turned via themeing into a blog style post on frontpage.
so prepare for more annoying posts from me as i learn, believe it!
soon this lite forum can be turned into a social platform without the need of hefty BuddyPress
June 15, 2009 at 7:52 am #74593In reply to: HOW do i write a plugin
Sam Bauers
ParticipantGo into the bbPress directory in a terminal (Mac/Linux/Unix)
All filters:
grep -r -n apply_filterss*( . | grep -v .svn/ | grep -v @uses
All actions:
grep -r -n do_actions*( . | grep -v .svn/ | grep -v @uses && grep -r -n do_action_ref_arrays*( . | grep -v .svn/ | grep -v @uses
June 15, 2009 at 5:44 am #74532In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
Sam Bauers
ParticipantThe fix on the WordPress side is to remove these defines from
wp-config.php
:define('COOKIEHASH', 'whatever');
define('SITECOOKIEPATH', '/wp-admin');The plugin will be updated soon, but remove those if you are running WordPress standard (i.e. Non-WPMU)
June 15, 2009 at 5:28 am #74567In reply to: Integrating WPMU trunk and bbPress RC2
John James Jacoby
KeymasterSomething must be up with the trunk…
If I install bbPress in a sub folder of WordPress, what seems to happen regardless of my settings or fudges, is that the bbPress login cookie is dropped with a “Host: domain.com” and a login via WordPress drops a cookie with a “Domain: .domain.com”
I’ve matched the URL’s, used with and without the integration speedup short-cut, deep/shallow integration, etc… Basically I’ve tried wiggling the settings back and forth, to no avail.
I was actually going to start my integration screen casts, so I suppose this will wait until tomorrow. haha!
I was able to get a WordPress login to drop cookies like “Host: domain.com” but the cookies the integration plugin drops are still “Domain: .domain.com” (If it dropped “Host: domain.com”, or if bbPress knew to look for “Domain: .domain.com” I suspect they’d work just fine.)
Note: I swear this WAS working earlier last week, as I’ve integrated two sites successfully with login/logout working from either direction.
June 15, 2009 at 4:39 am #74529In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
Sam Bauers
ParticipantThere is a problem with the integration plugin. Some code which was meant to distinguish between WordPress and WPMU is now failing.
I’ll have a new plugin out soon. When you upgrade the plugin, you will need to remove the settings it previously instructed you to use in wp-config.php and then check the admin page in WordPress for the new settings to use.
June 15, 2009 at 3:23 am #74362In reply to: Final release candidate 1.0-RC-2 is available.
Sam Bauers
ParticipantThe bad quoting issue is fixed, it was caused by the move to the new
esc_html()
function from WordPress.Here’s the quick fix. In
bb-includes/functions.bb-formatting.php
go to line 83 and replace:$text = esc_html( $text );
with:
$text = wp_specialchars( $text, ENT_NOQUOTES );
June 15, 2009 at 2:49 am #66490In reply to: TalkPress suggestions
John James Jacoby
KeymasterI think I’ve been salivating for 10 months waiting for this.
June 15, 2009 at 2:36 am #74527In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
norights
MemberI was having the same troubles as the original poster. WordPress 2.8 and BBPress 1.0 RC2, whenever I logged into BBP I couldn’t log into WP without logging out of BBP first. All the settings matched in both configs and adding in the suggested code (be it from the WP plugin which gave me a COOKIEHASH, a COOKIE_DOMAIN, a SITECOOKIEPATH, and a COOKIEPATH or from the BBP integration page which gave me just a COOKIE_DOMAIN and a COOKIEPATH) didn’t change anything. I tried junsuijin’s suggestions and now when I log into one it logs me out of the other. Anybody know how to get this running properly?
June 15, 2009 at 1:27 am #74524In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
Tynan Beatty
MemberOk arturo84, make the changes Sam suggested by dropping the www from your cookie domain settings in each config, then put the Integration plugin code back into wp-config. In wp-config the Integration plugin recommends the following settings among others:
define('SITECOOKIEPATH', '/wp-admin');
define('COOKIEPATH', '/');change SITECOOKIEPATH to match COOKIEPATH like this:
define('SITECOOKIEPATH', '/');
define('COOKIEPATH', '/');Then for the bb-config you should include the recommended integration speedups from the bottom of your bb-admin/options-wordpress.php page, and make sure that the cookiedomain doesn’t have www, and that both cookiepath and sitecookiepath are / as well:
$bb->cookiepath = '/';
$bb->sitecookiepath = '/';Then go into bb-settings.php (in the base bbpress folder). Look to line 768 if you have rc-2. Change line 768 from:
$bb->sitecookiepath = rtrim( trim( $bb->sitecookiepath ), " tnrx0B/" );
to this:
$bb->sitecookiepath = rtrim( trim( $bb->sitecookiepath ), " tnrx0B" );
$_bb_sitecookiepath = rtrim( trim( $bb->sitecookiepath ), " tnrx0B/" );Notice the removed / before the ” and that you need to add the second variable below it as that variable is used to set the other cookie paths.
Upload the altered bb-settings.php over your current one and it should fix the problem. Please come back and let us know if it works for you too
peace~
June 14, 2009 at 5:33 pm #74522In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
Tynan Beatty
MemberOk I think I found a fix for this and I’m submitting a patch to trac now
June 14, 2009 at 5:17 pm #65554In reply to: Official themes repository
johnhiler
MemberHopefully we can leverage the WordPress theme directory code:
https://wordpress.org/extend/themes/
In the mean time, do you know of any extra themes beside the ones on bbshowcase?
http://bbshowcase.org/forums/view/available-themes
If we assemble a list of available themes, we’ll be all ready to go when the bbPress theme directory comes out eventually!
June 14, 2009 at 4:28 pm #74521In reply to: cookie integration problem wp2.8 – bb 1.0 rc-2
Tynan Beatty
MemberThis gave me a couple ideas to fix both our problems. Changing
define('SITECOOKIEPATH', '...');
to match
define('COOKIEPATH', '...');
fixed half of my problem (in other words, removing the wp-admin from the end of SITECOOKIEPATH, since I noticed that having it there sets a cookie with a Path like /yawp/wp-adminwp-admin), I can at least include the Integration plugin’s suggested settings in wp-config now. But I still get a second logged_in cookie when logging into the bbp side, that logging out from WP cannot remove. IE, /yawp/ and /yawp for the Path:I haven’t figured out how to make bbP stop giving the second cookie without the trailing / but at least it now removes the one with the trailing / when logging out from WP (WP still thinks it is logged in due to the non-trailing slash cookie and shows the site admin link in meta, but won’t allow me re-enter the admin after logging out. At that point it acts as the situation arturo84 describes as his original problem, but also fails to logout from the bbp side)!
-
AuthorSearch Results