Search Results for 'code'
-
AuthorSearch Results
-
September 16, 2009 at 1:27 pm #79236
In reply to: Link to Home Page.
Ipstenu (Mika Epstein)
ModeratorIt depends on your theme design.
In mine, I have four main divs: header, content, sidebar and footer
So on my
footer.php, at the top, I put in this:<?php require('/home/domain/www/forums/my-templates/themename/sidebar.php'); ?>and then built the sidebar as I wanted it.September 16, 2009 at 1:23 pm #79226In reply to: Google Analytics
Ipstenu (Mika Epstein)
ModeratorSo it works similar to WP but just that you cannot do it through Editor in WP, rather do it directly in the files on the server, correct?
Correct. There’s no theme editor built in to BB at this time, so you have to edit the template file.
And you can use the same GA code from WP to BB without changing anything, but as it’s a different page, you have to edit the bbPress and WordPress templates separately.
September 16, 2009 at 1:06 pm #79225In reply to: Google Analytics
InvTrdr
MemberSo it works similar to WP but just that you cannot do it through Editor in WP, rather do it directly in the files on the server, correct? If I have GA code on my site already, will it help as the forum is just an extension of the domain? Or not, as it is a different page altogether?
Thanks.
September 16, 2009 at 1:03 pm #79235In reply to: Link to Home Page.
InvTrdr
MemberThanks. Where exactly in the header.php do I add it and what is the code to add to it?
Thanks.
September 16, 2009 at 12:24 pm #79224In reply to: Google Analytics
chrishajer
ParticipantJust paste the Analytics code in your template’s footer.php.
September 16, 2009 at 12:21 pm #31763Topic: Google Analytics
in forum InstallationInvTrdr
MemberIs it possible to add Google Analytics code to a bbPress forum? Did not see Editor under Appearance.
Thank you.
September 16, 2009 at 9:20 am #79087In reply to: Tags area extends beyond the footer area
kirpiit
MemberThanks Kawauso, it does the trick!
The Case Is Closed

[Well, not so closed, actually, as long as the basic Kakumei suffers from this (although tiny) css bug. Maybe this should be noticed to the guys who maintain the theme.]
September 16, 2009 at 9:19 am #79199In reply to: Adding Images to a Topic.
chandersbs
MemberCopy and paste this code and save it as allow-images.php
<?php
/*
Plugin Name: Allow Images
Plugin URI: https://bbpress.org/#
Description: Allows <img /> tags to be posted in your forums. The image must be a png, gif or jpeg.
Author: Michael D Adams
Author URI: http://blogwaffe.com/
Version: 0.7.1
*/
// You can add more tags here
function allow_images_allowed_tags( $tags ) {
$tags = array(‘src’ => array(), ‘title’ => array(), ‘alt’ => array());
return $tags;
}
function allow_images_encode_bad( $text ) {
$text = wp_specialchars( $text );
$text = preg_replace(‘|
|’, ‘
‘, $text);foreach ( bb_allowed_tags() as $tag => $args ) {
if ( ‘br’ == $tag )
continue;
if ( $args )
$text = preg_replace(“|<(/?$tag.*?)>|”, ‘<$1>’, $text);
else
$text = preg_replace(“|<(/?$tag)>|”, ‘<$1>’, $text);
}
$text = preg_replace(“|
(.*?)|se”, “‘' . encodeit('$1') . '‘”, $text);return $text;
}
function allow_images( $text ) {
if ( preg_match_all(‘/<img(.+?)src=(“|’)(.+?)\2(.+?)>/i’, $text, $matches, PREG_SET_ORDER ) )
foreach( $matches as $match )
if (
preg_match(‘/src=/i’, $match[4]) // multiple src = someone’s trying to cheat
||
!in_array(substr($match[3], -4), array(‘.png’, ‘.jpg’, ‘.gif’)) // only match .jpg, .gif, .png
&&
‘.jpeg’ != substr($match[3], -5) // and .jpeg
)
$text = str_replace($match[0], ”, $text);
return $text;
}
remove_filter( ‘pre_post’, ‘encode_bad’ );
add_filter( ‘pre_post’, ‘allow_images_encode_bad’, 9 );
add_filter( ‘pre_post’, ‘allow_images’, 52 );
add_filter( ‘bb_allowed_tags’, ‘allow_images_allowed_tags’ );
?>
Upload it to your my-plugins folder, create if it doesn’t exist. And activate it.
September 16, 2009 at 5:24 am #79137In reply to: DB Error: cannot select
InvTrdr
MemberThe error message was “DB Error: cannot find”. Figured out that for some reason the database name filled in during step1 was not caught by the bbpress-config.php file as you can see in the code above. The BBDB_NAME has been left “bbpress” as in default. Changed it in the file and it worked. Now onto Step2.
Thanks.
September 16, 2009 at 4:18 am #79173In reply to: Installation: Fatal Error
chrishajer
ParticipantI just checked out 1.0.2 via svn and I see backpress is included as an external:
Fetching external item into 'bb-includes/backpress/pomo'
A bb-includes/backpress/pomo/mo.php
A bb-includes/backpress/pomo/sample
A bb-includes/backpress/pomo/sample/app.php
A bb-includes/backpress/pomo/sample/languages
A bb-includes/backpress/pomo/sample/languages/app.pot
A bb-includes/backpress/pomo/sample/languages/bg.mo
A bb-includes/backpress/pomo/sample/languages/app-side.pot
A bb-includes/backpress/pomo/sample/languages/bg-side.mo
A bb-includes/backpress/pomo/sample/languages/bg.po
A bb-includes/backpress/pomo/sample/languages/bg-side.po
A bb-includes/backpress/pomo/po.php
A bb-includes/backpress/pomo/streams.php
A bb-includes/backpress/pomo/entry.php
A bb-includes/backpress/pomo/translations.php
Checked out external at revision 191.It’s actually included in the packaged download here too:
https://bbpress.org/latest.zip
https://bbpress.org/latest.tar.gz
I don’t think using trac to grab the source is the same as actually downloading the package. Maybe that was the problem?
September 16, 2009 at 3:42 am #79188In reply to: making a link to /members/$username
Mark
MemberIt does.

<?php printf(__('%1$s'), bb_get_profile_link(bb_get_current_user_info( 'name' )));?>September 16, 2009 at 2:41 am #7916562gr
MemberI paste this code
into my-profile-fields.php file
into my-plugins
but its not working !!
this code :
<?php
/*
Plugin Name: My Profile Fields
Description: My profile fields for my lovely forums
Version 1.0
*/
function my_profile_fields( $fields ) {
/* This removes the Occupation profile field: */
unset( $fields );
/* This adds a new optional field called Favourite Band: */
$fields = array(0,’Favourite Band’);
/* This adds a new *required* field called State: */
$fields = array(1,’State’);
/* You must return the array at the end of the function: */
return $fields;
}
add_filter( ‘get_profile_info_keys’, ‘my_profile_fields’ );
?>
September 16, 2009 at 2:39 am #31755Topic: Something is overruling style.css and I don't know what it is…
in forum Themesmorgan-wick
MemberI’m trying to install a new bbPress forum at http://forums.morganwick.com. The “wrapper” div is set in style.css (the only file I’ve changed) to have position:static. It appears to be absolutely positioned, and I don’t see anything in either style.css or in the code that appears when I “view source” that would overrule style.css (the only places in style.css where anything is absolutely positioned either have “display” set to “none” or don’t appear on all pages) unless I have to go hunting through JavaScript. Having to deal with absolutely positioned elements is a pain for an amateur developer like me, and I’d much rather have elements appear as part of the normal flow, like I can do in WordPress; what’s the problem here?
UPDATE: I just removed the background image from “wrapper” and added it to “header”, but it doesn’t show up at all. I’m trying to make it look as much like http://www.morganwick.com as possible.
September 16, 2009 at 2:28 am #74583In reply to: Customizing Profile Fields
chandersbs
MemberI’m sure it has to do with if and else things but how to code it
September 16, 2009 at 1:26 am #79164johnhiler
MemberDid you paste the code into a my-profile-fields.php file, and move it into your my-plugins directory… then activate the plugin?
September 16, 2009 at 12:47 am #7916362gr
Membersorry but Its not working
Is there another way ?
For example, put in the code style.css ?
September 15, 2009 at 11:28 pm #79154In reply to: Storee Board – a different kind of forum
snails07
Member@batrachoid are you using IE 6 or IE 7 because I just checked the site in IE 7 and the login form and registration info were almost completely hidden.
I’ve fixed the problem now, although it still doesn’t look quite right in IE 7, but at least it can be seen and people can register now
September 15, 2009 at 9:48 pm #79151In reply to: Storee Board – a different kind of forum
Mark
Member? It’s right above the login form.

Looks good, the only thing I noticed you might want to address is that when you’re not logged in and viewing a post page, the “You must log in to post” appears floated to the right and a little above the “New Topic In This Forum” header.
September 15, 2009 at 9:45 pm #77304In reply to: Sneak peek at bbPress.org 2.0
Mark
MemberHonestly can’t say I’m a fan of the green, and I’m not too sure what the red, green and white dots are for either?
I don’t want to be the only person with issues, but I’m sure you guys are capable of handling criticism.
Outside of those two things, I think it’s looking pretty darn snazzy. Can’t wait to see it go live!
September 15, 2009 at 9:41 pm #50304In reply to: Combined Register + Post
Mark
MemberIt’s a microwave dinner world… I hate registering on sites that have a mile long page full of demographic information that is an absolute invasion of privacy – I usually move on when I come across those. But when registration consists of username+email+submit… if it ain’t microwaveable, it ain’t worth the effort, I guess.
September 15, 2009 at 9:40 pm #75802Mark
MemberThanks for the link, I downloaded that plugin to give it a go… but apparently it isn’t yet compatible with 1.0.2 as it won’t activate. Just keeps returning a failed notice.
September 15, 2009 at 8:18 pm #79170In reply to: Installation: Fatal Error
chrishajer
ParticipantThat very simple error means that the file is not there, or maybe it’s there but has wrong permissions.
Is this file present:
'/XXXXX/StealthEmployed/forum/bb-includes/backpress/class.bp-log.phpIf not, FTP the files up there again maybe one was missed. I don’t think it has anything to do with WordPress because it’s bb-settings.php complaining about a missing bbPress file.
September 15, 2009 at 7:53 pm #79105In reply to: Events plugin needed
Adam Harley (Kawauso)
MemberbbP’s database is essentially the same as WP’s
that’s how I can actually work out how to manipulate it most of the time. Basic functionality is the same, just different variables so you can get the table name for forums, etc. Give writing it a shot though, it’s not hard.
September 15, 2009 at 7:03 pm #79161In reply to: Forum could not be created!
crguy
MemberFixed it.
I logged into phpMyAdmin
Default Database Setting on My Server:
MySQL connection collation: utf8_unicode_ci
I changed it to utf8_general_ci and deleted the bb_ tables in the database and removed the bb-config.php file and went through installation again.
All appears to be good now.
September 15, 2009 at 5:08 pm #79103In reply to: Events plugin needed
Adam Harley (Kawauso)
MemberI’d do this but I simply haven’t got the time. It’d be easy enough to store meta data if you added an action hook for ‘bb-post.php’ that got all the event-related form data from the post form and WP’s database handling makes storing it a breeze, so that wouldn’t be too hard. Throw in a ‘bb_head’ action hook to pull up data for a given topic (do a is_topic() check and check the forum ID, that’s floating around in a global variable iirc, probably $forum), load it into global variables and then let those be added in by the template. Main issue for me would be the testing and actually having to support something after I write it for once
-
AuthorSearch Results