Search Results for 'code'
-
AuthorSearch Results
-
June 7, 2009 at 12:06 pm #74074
In reply to: Confused about HTML Meta tags & SEO
timskii
MemberBelow is the code I wrote for “SEO”-related tweaks. It tries to fill the description meta with something relevant, and adds keywords based on a combination of tags and site-wide words (added via the admin screen). It’s still rough round the edges. For example, it will produce duplicate descriptions on multi-page topics, and descriptions may not be terribly different from the title tag.
<?php
/*
Plugin Name: SEO Tweaks
Description: Adds description and keywords meta to the header.
Author: Tim Howgego
Author URI: http://timhowgego.com/
Version: 0.1.rc
*/
add_action('bb_admin_menu_generator', 'seo_config_menu');
add_action('bb_admin-header.php', 'seo_config_process');
add_action('bb_head', 'seo_meta_description');
add_action('bb_head', 'seo_meta_keywords');
function seo_meta_description() {
switch ( bb_get_location() ) {
case 'topic-page':
$description = get_topic_title()." - ".bb_get_option( 'description' );
break;
case 'forum-page':
$description = get_forum_description();
break;
case 'tag-page':
if ( is_bb_tag() ) {
$description = __('Topics tagged')." ".bb_get_tag_name();
} else {
$description = __('List of tagged topics.');
}
break;
case 'profile-page':
$description = __('Profile for')." ".get_user_display_name()." - ".__('includes contact information and posting history.');
break;
case 'view-page':
$description = get_view_name()." - ".bb_get_option( 'description' );
break;
default:
$description = bb_get_option( 'description' );
break;
}
echo '<meta name="description" content="'.attribute_escape( $description ).'" />'."n";
}
function seo_meta_keywords() {
// Includes enhancements by _ck_
global $tags;
$keywords = array();
if ( !empty( $tags ) ) {
foreach ( $tags as $t ) {
$keywords[] = $t->raw_tag;
}
}
$default_keywords = bb_get_option( 'seo_keywords' );
if ( count( $default_keywords ) >0 ) {
$keywords[] = $default_keywords;
}
if ( count( $keywords ) >0 ) {
echo '<meta name="keywords" content="'.attribute_escape( implode( ", ", $keywords ) ).'" />'."n";
}
}
function seo_config_menu() {
bb_admin_add_submenu(__('SEO'), 'manage_plugins', 'seo_config_page');
}
function seo_config_page() {
?>
<h2><?php _e('SEO Tweaks Configuration'); ?></h2>
<form class="options" method="post" action="">
<fieldset>
<p><strong><label for="seo_keywords"><?php _e('Default keywords') ?></label></strong> (<?php _e('these words will be attached to every page, so only use words that describe the forum's overall content'); ?>):</p>
<textarea name="seo_keywords" id="seo_keywords" cols="100" rows="4"><?php bb_form_option( 'seo_keywords' ); ?></textarea>
<p><?php _e('Separate keywords with a comma. No formatting.'); ?></p>
</fieldset>
<fieldset>
<?php bb_nonce_field( 'seo_config' ); ?>
<input type="hidden" name="action" id="action" value="update_seo_config" />
<input type="submit" name="submit" id="submit" value="<?php _e('Save Changes »') ?>" />
</fieldset>
</form>
<?php
}
function seo_config_process() {
if ($_POST['action'] == 'update_seo_config') {
bb_check_admin_referer( 'seo_config' );
if ($_POST['seo_keywords']) {
$value = htmlentities( trim( $_POST['seo_keywords'] ) , ENT_NOQUOTES );
if ($value) {
bb_update_option( 'seo_keywords', $value );
} else {
bb_delete_option( 'seo_keywords' );
}
} else {
bb_delete_option( 'seo_keywords' );
}
$goback = add_query_arg( 'seo_updated', 'true', wp_get_referer() );
bb_safe_redirect( $goback );
exit;
}
if ($_GET['seo_updated']) {
bb_admin_notice( __('Changes saved.') );
}
}
?>June 7, 2009 at 8:36 am #14920Topic: Cannot begin installation
in forum Installationexchequer598
MemberI have WP-MU 2.7.1 + BuddyPress 1.0.1 installed and set up at http://huddle.inversekarma.in. I have copied bbPress 1.0 Rc-1 to http://huddle.inversekarma.in/forums. Now when I try to navigate to this address, I get the “The page you were looking for was not found” error. Is there something wrong with my htaccess? Please help! Thanks
June 7, 2009 at 3:35 am #74185In reply to: Lost this thing – can anyone help?
Atsutane
MemberActually u can archive that using JavaScript, CSS and Bbpress action hook. You can use CSS to hide the “Post Form” and make it visible back using JavaScript.
It kinda like using JavaScript to expand navigation menu. Well that should give you some idea
June 7, 2009 at 12:05 am #74153In reply to: For hacky peeps
_ck_
ParticipantI had started to write my own xref type of code to show how bbPress worked with a function reference and a action/filter reference but I never finished it.
But you can use grep to grab a list of all the function names and all the actions/filters.
Some people have run bbpress through phpxref and you can find that around the web via google, I don’t find such listings helpful myself though.
June 6, 2009 at 10:40 pm #14917Topic: Lost this thing – can anyone help?
in forum Requests & Feedbackmichael3185
MemberI saw a bbPress forum somewhere, where the ‘Create New Topic’ and ‘Reply’ sections were not a visible input box, but a link like; ‘Reply »’ When you click the link, the input box appears in its place. Does anyone know where it is so I can look at the code? Or is it a plugin? (Can’t find anything like that). Thanks.
June 6, 2009 at 11:02 am #74072In reply to: Confused about HTML Meta tags & SEO
Atsutane
MemberTo add meta tag using plugin…
add_action('bb_head', 'meta_bb_header');
function meta_bb_header() {
echo 'Your meta tag here';
}Maybe you can use ping service like Ping-o-Matic that were design for blog, to notify other service that you have update your forum. Never try it yet with bbpress so kinda don’t know how it gonna be
Another alternative maybe submit sitemap at Google Webmaster.
June 6, 2009 at 8:22 am #73741In reply to: WP 2.7.1 with BBpress 1.0 rc1 integration problem
Ramoonus
Memberstill haven`t found the solution
June 6, 2009 at 4:53 am #74109Tynan Beatty
MemberYou should only need the
define('WP_AUTH_COOKIE_VERSION', 1);
part added to the bb-config.php, not the rest (if you upgrade to WP2.8, then you don’t need any of those additions to the bb-config.php file). The WP bbPress Integration plugin’s settings page lists some things you’ll need to add to your wp-config.php file though. Namely, you’ll need to add at least something likedefine('COOKIEPATH', '/');
, depending on your wordpress’ installation path. Try just adding that part and see how things work. If they don’t work, try adding the other things the WP bbPress Integration Plugin settings page suggests (I added all of it’s suggestions using the latest WP2.8 and the latest bbPress 1.0-rc-1 and it broke my WP login; but with just the cookipath definition, most everything except logging in from bbP and then logging out from WP [somewhat trivial], integrates as expected).peace~
June 6, 2009 at 4:42 am #74110Tynan Beatty
MemberHello. Please read this post of mine and also this post that the previous post references
peace~
June 5, 2009 at 10:47 am #71260Sam Bauers
ParticipantTry the new 0.9.0.5 release, this problem should be fixed there.
June 5, 2009 at 10:44 am #73800In reply to: Alphabetize Forums
Sam Bauers
ParticipantSee [2133]
Running the latest trunk you need this to start your forum loops…
<?php if ( bb_forums( array( 'order_by' => 'forum_name' ) ) ) : ?>
...
<?php endif; ?>June 5, 2009 at 7:48 am #74151In reply to: For hacky peeps
Atsutane
MemberYou can find basic action/filter hook inside
pluggable.php
andtemplate-functions.php
And for function that not need any action/filter hook, u need to create it by imagination
June 5, 2009 at 5:01 am #74039In reply to: bbPress v1’s eventual release
michael3185
Member@johnhiler – I guess you’re not alone in not wanting an ‘authority’, though all I mean by the word is those creating and maintaining bbPress being seen as an authority in ‘the outside world’, as opposed to ‘the inner world’ of bbPress forum users. It’s already being done in a way, internally, by us getting to know who we trust most. Perhaps I’m letting my enthusiasm for a great product carry me away..?
Maybe just this thread and the comments from various members is enough in itself, as like any other, it raises awareness. For myself, I already have a few names in my head of those I trust when it comes to plugins, which are an essential part of bbPress. _ck_’s comments are funny in a way, about only writing plugins for fun or to show what can be done, hers(?) turning out to be among the very best! Perhaps I am barking up the wrong tree, and it should just be left as it is; to be fun, a hacking ground for those who want to hack, with gems coming up here and there from the talented coders. As you say _ck_, it spreads the workload and encourages new input, perhaps in ways that just wouldn’t happen if it wasn’t Open Source.
In any case, I’m grateful to those who invest time and effort into extending bbPres. My needs are few, as almost everything I want exists already. I’d like user roles in a stable version, and may have to go the way another thread suggests, and edit a file to add my own. I’d also like a sticky topic sort order plugin, but don’t have the skills to create it (yet). Tell you what I will do though, regardless of any standards for plugins, etc. I’m going to advertise bbPress personally; word of mouth, on my sites, etc.
Returning to my original thought; “bbPress v1’s eventual release”… I’ll have user roles when that version is considered stable enough for general use. For now, 0.9.0.5, completely free, is excellent.
June 5, 2009 at 1:37 am #74038In reply to: bbPress v1’s eventual release
johnhiler
Member@Michael3185 – Personally I wouldn’t trust a top-down authority to validate plugins. But some sort of bottoms up thing, I could get behind.
But if you want to take the lead on it, you could draft a proposal and post it in a new thread! Maybe some other users would be into it.
June 4, 2009 at 10:44 pm #70353In reply to: Basic integration screencast
quiltingwithmoxie
MemberI get all the way to the end of the installation in step 3 at http://quiltingwithmoxie.com/guild and there is no user present in the Key Master box. However, I have a user…me! I tried to enter the user info manually and got this error:
Database installation failed!!!
Referrer is OK, beginning installation…
>>> Setting up custom user table constants
>>>>>> Removed user tables from schema
Step 1 – Creating database tables
>>> Database installation failed!!!
>>>>>> Halting installation!
If I leave it blank it won’t go any further. What is wrong? Why can I not get this installed? I meticulously followed the videos directions. Thanks for any help you can give
June 4, 2009 at 9:55 pm #74037In reply to: bbPress v1’s eventual release
_ck_
ParticipantPeople don’t write software to see their name in lights.
I think the point is being missed by some who haven’t kept up with bbPress history.
bbPress wasn’t invented by Matt to create a better forum for the masses.
It was invented to serve the needs of Automattic needing (faster) support forums.
It just happens to be open source so others can improve it, write plugins for it, etc.
You’ll never have “certified plugins”, that would have no useful purpose to Automattic. On the flip side I would never have written a single plugin if I thought it was being held to some kind of standard, I wrote them for “fun”, to see if I could do it, or to show others it was possible.
Releasing a product as open source is a way for business to get additional labor on their products for free by encouraging adoption. That’s not a criticism, that’s how it works in general. Matt used code from other open source projects so he’s motivated to also share his projects as open source.
Sure there are some projects that are made from scratch to try to serve the greater good. But there’s no reward for that, you can never please more than a handful of people with whatever you try to do, given how many different opinions and experiences there are in any community.
Some of the wishes expressed in this topic were expressed last year, the year before that and will be said next year and the year after that. Don’t use bbPress if any of those issues are important to you, because WordPress has been around for six+ years and it still has those issues and always will.
June 4, 2009 at 7:56 pm #74036In reply to: bbPress v1’s eventual release
michael3185
MemberYeah, I use NightGunner’s PM, and it’s a gem. As to the legal side, I know so-called civilisation has become litigation mad, but you just put it in a nutshell yourself; “bbPress Certified”. If it’s in quotes, it’s ‘a quote from someone’, and not legally binding as a testimonial (at least here in the UK, which is why all our adverts are wrapped in quotes). I’m sure with the millions of dollars Automatic were given recently, they could easily get advice on making it litigation safe too.
You know, it doesn’t have to be much of a big thing from this end, but it’d inspire confidence in ‘the outside world’, by which I mean those who want Open Source software, but not problems, as they’re not coders or forum hounds. On the inside it could be very simple indeed, ie;
1. Is the code neat and readable? 1 star.
2. Uses the the proper hooks and function calls? +1 star.
3. Works instantly with the current ‘safe’ release? + 1 star.
4. Doesn’t affect, and isn’t affected by, other plugins? +1 star.
etc.
User ratings could go alongside it as an extra, and us forum hounds can carry on as usual. However – and it’s a big however in the eyes of the outside world – the creators of bbPress (and their other systems) gain massive kudos, and therefore, a larger user base. Imagine a press release;
“Sammy Surfer, creator of burblePress said today; We’re into the next generation of forum software. What we’ve realised is that most folks want it to run straight out of the box. We have a compact and powerful core engine, and are announcing our new certification system for plugins. Plugins allow users to develop additional functionality, and while we can’t guarantee code others produce, we do look at and rate plugins. In fact, plugins are key to making burblePress do what you want it to do, so get involved!”
Etc., etc., ad nauseam.
Funny, don’t you think, that no Open Source forum producers have had the balls to do this yet..? But I’ll tell you this: the first one who does will have their name in lights. Do M$ produce amazing, unbeatable code which rules the world? Do they hell. Have they grabbed the world’s attentions and millions of users simply because they set their own standards? You bet your damned underpants. I hope Sam reads this, and throws his own undies to the wind.
June 4, 2009 at 5:20 pm #74034In reply to: bbPress v1’s eventual release
michael3185
MemberI can see what you mean, but I don’t think it’s going the wrong way at all, and it’s not contrary to Open Source. (Open Source is not another name for ‘A Flaming Mess’). It’s common sense. It needs to be implemented in an easy-going way, but be there as a label so users know that plugins have been looked at and given a thumbs-up by those in the know. And those in the know don’t have to create a huge system and lots more work for themselves either. They’re already glancing at plugins from what I’ve been told. All that’s needed are some simple guidelines as a standard.
As I said, the current user rating system is useless. I downloaded a bunch of 5 Star plugins and they crashed badly. Since then, I ignore the star ratings. I also look at the code before installing a plugin. If it looks like granny’s hair in a tornado, I dump it. Anyone who writes code without caring how it reads is unlikely to write code that works. You either care, or you don’t.
Bear in mind that I’m talking about end users here, not forum fiends who love to delve into things (and I’ve quickly become one of those!) Picture someone like my voluntary sector clients, and others, who want to download, install, and play. They don’t want hassle, and they don’t want to hang around forums looking for fixes to plugins which provide functions they need. They want the star system to mean something, and they want the people who created the software in the first place to authorise plugins in some way.
It doesn’t have to be Big Brother. For those who aren’t coders or forum hounds, it just has to work. having something like ‘bbPress Certified’ or whatever, would give some idea as to whether it’s going to plug and play, or whether you plug and pray. Sadly, at the moment, the latter is more likely. Just read through the forums! (And yes, I very much do respect the time and effort people put into developing plugins).
June 4, 2009 at 3:28 pm #74141In reply to: Am I a bozo?
michael3185
MemberYeah, I was a bozo the other day due to including a URL. I’m still a bozo today, though not in the eyes of bbPress.
June 4, 2009 at 11:15 am #74032In reply to: bbPress v1’s eventual release
timskii
MemberTo clarify my optimization comment slightly:
It may be optimized for memcached, since all those individual pieces of user information rarely change, so all those queries will fall straight to the memory, which becomes ruthlessly efficient. If all the information used on each page is queried together, memcached would fill up with page-specific results, rather than user-specific results: So many individual queries is logically more efficient if you are caching the results of those queries.
There is some logic in this: The structure still works reasonably well on smaller (often shared) setups, where caching can be technically difficult to implement. However BBPress is aiming to support large scale deployment, which is almost inevitably going to mean the use of caching. If you can only write the code optimally for one of those users, optimizing it for someone that can save whole machines in the process, is sensible.
June 4, 2009 at 7:02 am #14897arandomdan
MemberI’m running WP 2.7.1 and bbPress Version 1.0-rc-1 on
localhost
. WP has been installed to/3dd/
and I installed bbPress to/3dd/bbpress/
today and have done all the proper steps for syncing in the bbPress admin.I have added the following code to
bb-config.php
:require(BB_PATH . '../wp-blog-header.php');<br />
define('WP_AUTH_COOKIE_VERSION', 1);<br />
$bb->bb_xmlrpc_allow_user_switching = true;I can login to both WP and bbPress with my WP user account (yay!), but <b>the problem is that WP doesn’t know when I logged in to bbPress and vice versa</b> (i.e. when I am logged into WP, bbPress still shows the login form). In addition, <b>when I login to bbPress, WP logs me out; and when I login to WP, I am no longer logged in on bbPress</b>. I have cleared my cookies many times and tried it in both IE and Firefox, same result.
Together, WP and bbPress create the following cookies (aside from the wp-settings and test cookies):
Domain Cookie name<br />
/3dd/ wordpress_logged_in_*<br />
/3dd/wp-admin wordpress_*<br />
/3dd/wp-content/plugins wordpress_*<br />
/3dd/bbpress/bb-admin wordpress_*<br />
/3dd/bbpress/bb-plugins wordpress_*<br />
/3dd/bbpress/my-plugins wordpress_*<br />
/3dd wordpress_logged_in_*<br />I believe the last 4 are created by bbPress and it should be noted that there is no trailing slash on the wordpress_logged_in_* cookie path.
Does anyone know what the problem might be?
June 4, 2009 at 2:43 am #74030In reply to: bbPress v1’s eventual release
johnhiler
MemberTrying to grok the vision here… bbPress would have a top-down certification model, where someone would audit the code of all plugins and do testing to certify that the plugins work in various bbPress versions?
June 4, 2009 at 2:07 am #74029In reply to: bbPress v1’s eventual release
michael3185
MemberAha. Then Go sambauers, Go sambauers, Go sambauers – YAY! (Pretty girls doing athletic stuff here. Well, it can’t hurt, can it?)
If Sam’s the man, then listen up Sam. Standards for plugins are essential. Really. Essential. Yep, really essential. Can’t say it enough. I’ll say it again: If bbPress and associated systems want to be taken seriously in the working world, then standards for plugin development are absolutely essential. Really, absolutely, and any other words that mean really and absolutely.
Leave the rest of the ‘bb developers’ behind. Simply calling plugins ‘bbPress Certified’ will make the world assume that those behind bbPress are an authority who have the power to authorise things. M$ did it, and millions of people believe in them. Do it Sam, and you’ll quickly become an authority. People will believe in you, and plugin coders will soon learn to adhere to your standards. In fact, they’ll have to. Those who produce cool ideas but crap code, or cool code but no admin settings so users have to hack (and can’t or don’t want to), will become a thing of the past.
Those of us who aren’t programmers will be able to download and use certified plugins that do what bbPress core does: just click and go. Think of the kudos. Think of the subscriptions. Think of the write-ups in The Times, etc. bbPress: click, go.
June 3, 2009 at 10:45 pm #71259johnhiler
MemberThe easiest way is to your server to use PHP5?
https://bbpress.org/forums/topic/warning-cannot-yet-handle-mbcs-in-html_entity_decode-in-home2
June 3, 2009 at 10:44 pm #71258adman22
MemberI continue to have the same problem, Any other suggests?
-
AuthorSearch Results