Search Results for 'test'
-
AuthorSearch Results
-
March 27, 2009 at 7:18 am #72590
In reply to: Multiple Templates Simultaniously!
_ck_
ParticipantJust install my bbpress theme switcher plugin, disable the dropdown.
Then replace
function bb_ts_get_theme() {
with something like this (untested, will need some editing)
function bb_ts_get_theme() {
$theme="kakumei"; // default fallback
$domain=strtolower($_SERVER['HTTP_HOST']);
if (strpos($domain,"first-domain.com")!==false) {$theme="1st-theme";}
if (strpos($domain,"second-domain.com")!==false) {$theme="2nd-theme";}
return $theme;
}March 26, 2009 at 11:19 pm #5071Topic: no email and no run
in forum TroubleshootingDTI
MemberI have two problems after I have installed bbpress 0.90.4 .
1, when I registered new user in server for testing, it can’t sent a email, so I can’t get a password.
2, the forum only run in my server computer, user’s computer got 404 error after registered and click the button. Why doesn’t run in user computer?
How to fix these problems?
March 26, 2009 at 9:14 pm #70339In reply to: Basic integration screencast
adeboy
MemberWell i didn’t get the 0.9 WP integration to work so couldn’t stop myself using the alpha with the help of the screencast and it seems to work fine with just the Akismet and Human Test plugins.
There was one bug i found when deleting the only topic in a forum but that has been resolved in the trunk so i was able to copy that fix.
March 25, 2009 at 7:43 pm #72199citizenkeith
ParticipantThat seems to work. We’re still testing it out but I think we’re in the clear.
That said, I also added Anne’s notification hack, and we’re not getting any notifications.
March 25, 2009 at 6:55 pm #4757Topic: Remove a forum category from latest discussion.
in forum Requests & Feedbackmerlin214365
MemberIs there a way remove a specific forum category from the latest discussion list?
I have tried editing in functions.bb-topics.php
From
function get_latest_topics( $args = null ) {
$defaults = array( ‘forum’ => false, ‘page’ => 1, ‘exclude’ => false, ‘number’ => false );
to
function get_latest_topics( $args = null ) {
$defaults = array( ‘forum’ => false, ‘page’ => 1, ‘exclude’ => 13, ‘number’ => false );
13 being the category number I wish to remove. This does work in removing forum 13 from latest discussion unfortunately it also removes forum 13 completely lol
March 25, 2009 at 2:15 pm #72198_ck_
ParticipantIt’s possible because I was testing it on 1.0 that 1.0 automatically escapes the mysql values passed and that 0.9 does not. I can’t remember.
Try adding this before the $bbdb->query
$pmtitle=mysql_real_escape_string($pmtitle);
$message=mysql_real_escape_string($message);and see if it helps or if it just add slashes to your text instead and breaks it.
It may also be a quote problem but I thought the bbpress pre/post text filters should encode quote or any other problematic characters.
March 25, 2009 at 2:41 am #72638_ck_
ParticipantI guess it would be a good alternative to akismet (or even in addition to).
Your code can be cleaned up and condensed considerably.
It also could benefit from some security checks on the $_POST data being injected into the url.
Here is an untested, condensed version with some mild security checks on the $_POST
(there is also an alternative to curl in there for the 50% that don’t have it on their server)
I took out some of the extended manipulation of the returned data that you didn’t need.
March 25, 2009 at 1:54 am #72037In reply to: WordPress 2.7 options
antonio_pt
MemberThanks. I’ll give it a try on a test installation.
did it work?
March 25, 2009 at 12:20 am #71930In reply to: Instant Password
pierrottorreip
MemberBluehost – the latest for everything – tested on Firefox 3 and Safari – all on a Mac.
Hope that helps!
March 25, 2009 at 12:06 am #71929In reply to: Instant Password
_ck_
ParticipantTell me more about your server – OS, PHP version – and what browser you are using to test
March 24, 2009 at 10:16 pm #5058Topic: New Stop Forum Spam API Plugin; Block Fake User Registrations
in forum Pluginsrank2
MemberHey Guys,
I get hundreds of fake forum users who register on my forums here: http://reviewtrip.com/traveltalk
Even though I use the plugin Human Test, I still get these spam users. So I decided to create a plugin that hooks into StopForumSpam API to stop these guys.
You can download and find the instructions here:
http://reviewtrip.com/blog/stop-forum-spam-api-plugin-for-bbpress
Let me know what you guys think!
March 23, 2009 at 9:15 pm #72633In reply to: Functions.php came with unexpected t string
wpitn2shape
MemberI only visited the forum URL which leads to install page. I couldn’t get further.
I just downloaded the latest version. Didn’t set any language or upload language folders (I read that was optional.)
I’m not sure how to compare on my server versus the one on my computer, which is default. Well I think I might know how, but I’m really tired right now, I’ll attempt that soon.
I don’t have secret keys. Did I miss that in the install instructions?
The whole error message is:
Parse error: syntax error, unexpected T_STRING in /home/.ufo/elladesigner/new.pursedlips.net/forum/bb-includes/functions.php on line 2256
Thanks, I’ll look into it more when I’m able.
March 23, 2009 at 4:22 pm #5053Topic: exluding “user on” from topic feed title
in forum TroubleshootingAvaz
MemberI’m displaying latest forum posts using RSS:
<?php require_once(ABSPATH . WPINC . '/rss.php');
wp_widget_rss_output('http://localhost/bbpress/rss.php', array('items' => 5, 'show_author' => 1, 'show_date' => 1));
?>and the code above displays as follows:
admin on “Test topic” 13/03/2009 admin
Now, how can I exclude “admin on” part from the title?
March 22, 2009 at 4:00 am #66149In reply to: WordPress + bbPress Integration 101
Billy S
MemberHey all. After much help from reading these forums and tinkering endlessly, I have gotten cross site logins working between WP2.6 and bbpress 0.9 . I don’t know if you’d call it ‘integration’, but it allows a user to log in once and gain access to all appropriate site resources. Although probably not the best solution, what I did is create my own cookie login, which is caught before wordpress or bbpress load, and creates a new user object which is universal to WP and BBPress (and any other webapps you use). It does take a little…alteration…of core WP and BBPress files. I strongly encourage you to make backups before doing this, and proceed at your own risk. It worked for me, but I cannot guarantee that it will fork for you. Also, it took a bit of hacking before I came up with this solution, so it may contain minor errors or accidental omissions as I am having to backtrack to recall what exactly I did.
okay, here goes…
First, we have to configure bbpress to use the wp_users table. That is done in the admin area of bbpress (settings->wordpress integration). Check ‘Show Advanced Database Settings’ and enter your database information for the wordpress install. Also, enter the wordpress database secret code near the top of the settings page.
Next, I created a file in the document root called ‘cookie_login.php’:
<?php
if($_SERVER['REQUEST_URI'] == '/cookie_login.php'){die('Cannot access directly');}
//Initial Setup of Variables
$SECRET_KEY = 'SECRET_KEY_DEFINED_IN_BBPRESS_AND_WP';//use a real secret key
$site_user = false;
//Do the DB thing
$the_db= mysql_connect('SERVER','USER','PASS');
mysql_select_db('DATABASE',$the_db);
//Start Session!
session_set_cookie_params(1800,'/','.SITE.com'); //30 minute session
session_start();
if (isset($_COOKIE['site_cookie'])){ //cookie has been set, proceed to get user info!
$tmp = explode(':',$_COOKIE['site_cookie']); //this will make sense later
$tmpusr = $tmp[0];
$wpid = $tmp[1];
$tmphash = $tmp[2];
$hashShouldBe = md5($tmpusr . $SECRET_KEY . $wpid); //what the hash should be - prevent tampering!
if ($tmphash == $hashShouldBe){
if (isset($_SESSION['user'])){
$site_user = $_SESSION['user'];
}else{
$qry = "SELECT * from wp_users WHERE ID = ".mysql_real_escape_string($wpid,$the_db) . " LIMIT 1";
$result = mysql_query($qry,$the_db);
$site_user = mysql_fetch_assoc($result);
$qry = "SELECT meta_key, meta_value from wp_usermeta where user_id = ".mysql_real_escape_string($wpid,$the_db);//get additional data, just for fun
$resulta = mysql_query($qry,$the_db);
$temp_arr = array();
while ($row = mysql_fetch_assoc($resulta)){
$tmp_value = unserialize($row['meta_value']) ? unserialize($row['meta_value']) : $row['meta_value'];//if it a serialized array, unserialize it. otherwise, dont.
$temp_arr[$row['meta_key']] = $tmp_value;
}
$site_user = $temp_arr + $site_user;
$_SESSION['user'] = (object)$site_user;//Object just out of preference, but doesn't have to be
}
}else{//tsk tsk, bad hash
$_SESSION['user'] = array();
setcookie('site_cookie',$_COOKIE['site_cookie'],time()-9600,'/','.SITE.com');
setcookie('PHPSESSID',$_COOKIE['PHPSESSID'],time()-9600,'/','.SITE.com');
setcookie(session_name(), session_id(), time()-9600, '/');//may be unnecessary...not sure...but can't hurt! (famous last words)
session_destroy();
}
}
if (!isset($_COOKIE['site_cookie']) && isset($_SESSION['user'])){//attempt to gain access?
$_SESSION['user'] = array();
setcookie('site_cookie',$_COOKIE['site_cookie'],time()-9600,'/','.SITE.com');
setcookie('PHPSESSID',$_COOKIE['PHPSESSID'],time()-9600,'/','.SITE.com');
setcookie(session_name(), session_id(), time()-9600, '/');//may be unnecessary...not sure...but can't hurt! (famous last words)
session_destroy();
}
session_write_close();
unset($SECRET_KEY,$hashShouldBe,$tmp,$wpid,$tmphash,$tmpusr,$result,$_SESSION['user'],$resulta,$temp_arr);//burn the evidence!
include ('site_functions.php'); //optional, can hook another file with functions (universal to all sites) to deal with this new user object
?>After I finished the cookie_login.php, I rolled up my sleeves and dove into the WordPress and BBPress core to allow my login to occur.
in the /wp-config.php file, define the cookie domain:
define('COOKIE_DOMAIN', '.SITE.com');
Also, that secret key you used earlier in cookie_login…define it here as well
define('SECRET_KEY', 'Same Key from Earlier. IMPORTANT to make sure it's identical');
Next, I hooked in my cookie_login file to wordpress and bbpress by adding an include to the top of BOTH bb-config.php AND wp-config.php
include $_SERVER['DOCUMENT_ROOT'] . '/cookie_login.php';
To set up the ‘site_cookie’ properly, open up /wp-includes/user.php and find wp_signon function (was the first one for me). At the bottom of the function, after
if ( is_wp_error($user) )
return $user;Add the following:
$hashValue = $credentials['user_login'] . SECRET_KEY . $user->data->ID;
$crossCookieValue = $credentials['user_login'] . ':' . $user->data->ID . ':' . md5($hashValue);
setcookie('site_cookie',$crossCookieValue,0,'/','.SITE.com');
wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie);
do_action('wp_login', $credentials['user_login']);//this may have already been there, don't rememberRemember how I mentioned the site_functions.php which can be included at the bottom of cookie_login.php? That is a perfect place to put the next function, for bbpress login, but it can just as well go inside cookie_login.php itself. The function overwrites the bbpress native wp_validate_auth_cookie function, found in /bb-includes/pluggable.php, with one of our own, which is as follows:
function wp_validate_auth_cookie($cookie = '') {
global $site_user;
if (!isset($site_user->ID)){
return false;
}else{
return $site_user->ID;
}
}This is used internally by bbpress to allow the login to proceed.
Next, open /wp-login.php and find the case: logout section, and add the following right after it:
setcookie('site_cookie',$_COOKIE['site_cookie'],time()-9600,'/','.SITE.com');
setcookie('PHPSESSID',$_COOKIE['PHPSESSID'],time()-9600,'/','.SITE.com');'
Finally, and this may be only applicable for subdomain usage, open /wp-includes/pluggable.php and find the function wp_safe_redirect. Add subdomains you want redirects to in the $allowed_hosts array, for example:$allowed_hosts[]=”bbpress.SITE.com”;
$allowed_hosts[]=”test_wordpres.SITE.com”;`
etc…
That’s all (I think) that I had to do. This is probably not ideal, as there are now two copies of a user when hey login, one defined in our new system and one in the wordpress/bbpress systems; however I found this necessary to have happen since I didn’t want to go through all the core code and edit out mention of $user.
Let me know if this works for you, I hope it was coherant enough. I may have accidentally omitted sections since, as I said before, this is the result of a few weeks of on-and-off tweaks and changes. I can always dig into code and find things I missed if I know what problems are occurring. Also, if anyone is interested, I altered a private messenging system I found which was a little outdated (http://www.pixel2life.com/publish/tutorials/608/simple_private_messaging_system/) to work with this model as well. Users can PM one another from within the wordpress dashboard, and message indicators are noted in the header throughout their visit (in wordpress, bbpress, and other subsites).
March 22, 2009 at 1:05 am #72570In reply to: How to get the link to the second post?
Null
MemberHi,
Thanks for the reply, I’ll try your suggested “untested theoretical plugin”. But what does the 999 stand for? Just learning
March 21, 2009 at 10:52 pm #72569In reply to: How to get the link to the second post?
_ck_
Participantuntested theoretical plugin
add_filter('post_text','first_reply',999);
function first_reply($text) {global $bb_post;
if (!is_bb_feed() && (int) $bb_post->post_position==1) {$text.="<a name='first-reply'></a>";}
return $text;
}Then to get the first-reply link for any topic,
<?php echo "<a href='".get_topic_link()."#first-reply'>replies</a>"; ?>
March 21, 2009 at 3:26 am #72448In reply to: How do I disable registration temporarily?
biodrama
MemberThanks John,
I was running HumanTest 0.9.0, which is the latest version so far as I can tell. The spammers must have been getting in a back door. Chris mentioned I should look in my logs to see where they were getting in, but I don’t know how to do this. The bogus registration emails stopped cold when I disabled register.php.
March 20, 2009 at 11:25 pm #5039Topic: deleting one word from forum category title
in forum InstallationZanti
MemberI can not seem to find a way to delete a repeated word in my forms category title. I have a repeated word and not sure how I got it.
But, here is what is happening. I have bbPress 0.9.4 and WP 2.7.1 integrated using Anne’s plugin. No problem there. Most of CK’s plugins, no problem there either. In the Category title of my forums I have a repeated worked and don’t know how to remove it. What I mean by the category tile is, like the title of Latest Discussion, and the discussions below it my issue is the title above the forum categories. Hope that explains it well. The repeat is Forums Forums. My site is still a work in progress, so there are no post, except test ones.
Thanks for the help.
March 20, 2009 at 10:08 pm #72586In reply to: Logged into one – logged into all.
kevinjohngallagher
MemberI hardly think that it is fair to imply that I don’t ‘care for BBpress (sic) development’
I didn’t say that nor suggest it, i said that “Name calling, on an anonymous internet forum, is hardly the way to get help, and i think that’s a true statement. If you call people “dick” and “bitch”; you are less likely to get help. I don’t think that is a false statement, and if you’re taking more from it than i had intended then i think you’re just trying to look for a fight rather than apologising for calling me a “dick” for trying to help you.
After all, i did try and help.
English is not my first language (nor my second – so my tone may be very off), but i wasn’t being intentionally rude or argumentative. I think it’s fair to say that people who have English as a non-primary language sometimes write sentences in a way that people some people find harsh or blunt – especially on internet forums where tone and intination do not come across. If that’s not something that you or anyone else who reads this agrees with then i’m sorry, it’s my experience that some cultures say things in a different way to others.
As for the unasked for advice, it was asked for. You asked what your next step should be, and in my honest opinion it should be to test everything on a development enviroment. You may think it “self righteous” of me to say so, but there have been many examples of people on these forums who upload and install on a live environment first (there are 3 on the first page of this forum btw), so i was being honest and offering you and answer to the question YOU ASKED. I didn’t get bored and decide to write you an email, you asked for help and i took time to answer. If you think that was unasked for, then i apologise.
You know man it’s like this, folks like me try our best. We try and asnwer in the best way possible in a language thats not our own, and if you go around picking out phrases out of context and saying things like we “tried to imply” – you’re reading way too much into simple sentances. If i wnted to say something i would, i wouldn’t hide behind an implication or worse, hide behind an attempted implication of something i really wanted to say. It’s hard to post here in English and we do our best. We dont expect to be called a “dick” or suggesting that we’re a “bitch” for doing so. And if you think that’s acceptable behavior to someone who was trying to help, then thats your own thing man, frankly i think it’s a little uncool – but if you think swearing at someone who is trying his best to help you is cool then there’s nothing i can add to that. Namecalling never got anyone anywhere, and i’d be surprised it if got you help on this forum either.
Good luck in your endeavours.
March 20, 2009 at 8:52 pm #72525In reply to: Overwriting Template functions
kevinjohngallagher
MemberIt’s not stupid mate, it might be the answer. At this stage i’m up for trying anything.
I don’t have it and will go test it now.
Thank you!
March 20, 2009 at 8:50 pm #72584In reply to: Logged into one – logged into all.
kevinjohngallagher
MemberWow,
PierrottorreiP, i was only trying to help, i think you could drop the attitude man. Rest assured, i’ll not try to help again.
My first point, about using a development environment, is a sound technical point. The point of doing things locally is to plan/develop/test until it’s right then push live. If as you said you “I did put the site together locally and realized that I wanted them to talk to each other after I made it live.” that just shows poor planning, and it’s not my fault for not realising that you had decided to make things on your live server different from your testing environment.
That said, your site currently has 1 user, you, so taking down the forums until you fix it locally isn’t going to be a disaster.
As for my suggesting you only include a link when needed, again, it wasn’t to persecute or “bitch”, but was honest advice. If you have something you want us to look at please include a link by all means, but make it a link to your forums and or the page you’re having an issue with. ‘bumping’ your website via views from a BBpress support forum aren’t going to help (of the top 10 google links form your website name are from this website – and many people have tried to bump their site this way before which is why i mentioned it).
You also have to accept that English isn’t everyone’s first language, and while not bad at it myself, taking offence because of the way something is worded – especially in a post that gave you step by step instructions on how to fix your issue – is frankly very bad form.
Name calling, on an anonymous internet forum, is hardly the way to get help from those of us who care for BBpress’ development.
March 20, 2009 at 5:56 pm #72581In reply to: Logged into one – logged into all.
kevinjohngallagher
MemberHi PierrottorreiP,
May i first suggest that the first step be to not do this sort of testing on a live environment?
This is probably the way forward in my opinion:
– Install them all on the same databse as your wordpress instal.
– Use different table prefixes for each one.
– Make people register on wordpress, with the redirect going back to the forum they came from.
– Do a little dance.
– Make a little love.
Also, there’s not need to post a link to your site here man, if it’s not something wrong with a specific page we can see, it’s just a random link that’s not helpful.
March 20, 2009 at 5:45 pm #72576In reply to: What’s the state of WordPress theme integration?
kevinjohngallagher
MemberHi Vernal,
In terms of integration in a software sense, you have to answer yourself this:
1) Do they need to look the same?
2) Do I need shared login ?
3) Do i need shared wordpress functions (menu, sidebar, otehr cool wordpress stuff) ?
If you answered yes to 1) and no to 2) and 3) you only need to make your style sheets and HTML look similar and dont need any integration.
If you answered yes to 1) and 2) and no to 3) then you should be able to use the latest alpha and latest wordpress and all should be fine. Personally, i’d not ouch with with a bargepole and i’d use BBpress 0.9 and WP 2.7.1 with _ck_’s Freshly Baked Cookies plugin (link coming up in a bit).
If you answered yes to 1) 2) and 3) then you need to use Ann’s plugin (again link coming up).
In terms of fixing your BBpress to integrate into your wordpress theme easily, that one is simple. Replace the code in your header.php file with this:
<body id="<?php bb_location(); ?>">
<div id="page">
<div id="wrapper">
<div id="header">
<div id="headerimg">
<h1 id="blog-title"><!-- PUT YOUR WP LINK HERE --></h1>
<div id="blog-description">
<div class="description">
<!-- PUT YOUR WP DESCRIPTION HERE -->
</div> <!-- #description -->
</div> <!-- #blog-description -->
</div> <!-- #headerimg -->
<!--
K2 USERS
THIS IS WHERE YOU PUT YOUR MENU CODE
-->
</div>
<div id="access">
<div class="skip-link"><a href="#content" title="Skip to content">Skip to content</a></div>
<div id="menu">
<!--
SANDBOX USERS:
THIS IS WHERE YOU PUT YOUR MENU CODE
-->
</div>
</div><!-- #access -->
<div id="container">
<div id="primary">
<div id="current-content">
<div id="content">
<div id="post">
<div id="main">
<h1><a>"><?php bb_option('name'); ?></a></h1>
<?php if ( bb_get_option('description') ) : ?><p class="description"><?php bb_option('description'); ?>
<?php endif; ?>
<?php login_form(); ?>
<?php if ( is_bb_profile() ) profile_menu(); ?>March 20, 2009 at 3:41 pm #72557In reply to: Install help
DTI
MemberChrishajer, thank you for your detailed help.
Before I installed the bbpress, I have created a database as below:
1, mysql> create database MyForum_database;
2, mysql> show database; it is displayed.
3, to create a dbconnect.php file to test it,
<?php
$con = mysql_connect(“localhost:3306″,”myname”,”mypassword”);
if (!$con)
{ die(‘Could not connect: “.mysql_error());}
else
echo “Successful connect.”
mysql_select_db(“MyForum_database”, $con);
?>
4, to run this dbconnect.php file in the
http://localhost/mrm/bbforum/dbcon.php //mrm is root of my website
To get the “Successful connect.”
This means my website host is “localhost” and the database is on the same server as the web site, then this probably should remain localhost in Database Host.
5, my web site host is ‘localhost’ in my Apache setting in my server.(We have static IP address)
6, please see my setting in bbpress installation:
Database name: MyForum_database
Database user: myname
Database password: mypassword
Database host: localhost
Database character set: utf8
Database character collation: forum
bbPress cookie secret key: skyisblue
Table name prefix: f_
Where is I wrong? My MyForum_database has been connected, why bbPress installation can’t connect it.
My database and website are on same server, same host.
So I wander why…
Please help again.
March 20, 2009 at 1:04 pm #72575In reply to: What’s the state of WordPress theme integration?
Postmatic
MemberHey kevin,
Thanks a lot for your great info. I hope that someone in the know picks up your request.
In the meantime, is there anything you could point me to that will at least get me started in allowing some WordPress template tags to function from within bbpress? I’m using a shared database, 2.7.1, and the latest bb alpha.
Does that still work?
And of course, I ‘d love to hear more about your plugin if things get fixed up on it.
Best,
Jason
-
AuthorSearch Results