Search Results for 'code'
-
AuthorSearch Results
-
September 25, 2009 at 8:38 pm #79742
In reply to: WordPress Integration
c4central
Memberashfame – it was your tutorial that I tried so many times.
When I say the login doesn’t work, I mean when I try to login to bbpress it says the user “admin” doesn’t exist!
ashfame, I also sent you an email after trying your tutorial over and over, asking for help.
gerikg, I will give that a try. I did not upgrade from an old wordpress, this is a fresh installation. I should have a few minutes to try that this afternoon.
Once we get this up and running, maybe you guys can point me in the right direction to get the themes/header matching. Actually, that is a project for another day

I’ll post my results!
September 25, 2009 at 8:29 pm #79741In reply to: WordPress Integration
gerikg
MemberUse this link: https://api.wordpress.org/secret-key/1.1/salt It has 8 keys.
NOTE: do NOT use any “www.” anywhere when entering information.
1. Open wp-config line replace your new keys with the one from that link. (lines 55-61)
2. Copy the same keys to bb-config just add BB_ after define(‘ in each key so it will be
define('BB_AUTH_KEY', '(lines 41-44)3. Install & activate BBpress Intergration plugin https://wordpress.org/extend/plugins/bbpress-integration/
4. Get the information from the plugin and put it in line 20 in wp-config and line 13 in bb-config. (if you’re using WPMU take out the HASH line when you put it in bb-config)
5. Log into your BBpress admin section and navigate to SETTINGS -> WORDPRESS INTEGRATION enter all the information it ask for, save.
6. Clear you cache and you should be ready to go.
If you upgraded from a previous WP version take out
define( 'WP_AUTH_COOKIE_VERSION', 1 );because it doesn’t work on 2.8.4September 25, 2009 at 8:21 pm #79736gerikg
Memberhtml.css (line 329) calls for it…
ul, menu, dir {
display:block;
list-style-type:disc;
margin:1em 0;
}add this to your style.css
#navigation ul {
list-style-type:none;
}If you use Firefox get a plugin called firebug. http://getfirebug.com/ it will help you with all your css needs.
September 25, 2009 at 7:16 pm #79689In reply to: problem with using theme rather than default theme
gerikg
MemberI had a problem with a css file that wouldn’t import a php file.
(@import url(css/loader.php)
look at the main css file and see if there is any importing involved.
September 25, 2009 at 7:06 pm #79734In reply to: main background too wide, cant get a border to work.
gerikg
Member1. Add this to you style.css in your forum theme
#megaContainer {
background-color:#FFFFFF;
border-left:thin solid #666666;
border-right:thin solid #666666;
margin-left:auto;
margin-right:auto;
min-height:100%;
position:relative;
width:840px;
}2. change
<div class="megaContainer">to<div id="megaContainer">in your theme header.phpSeptember 25, 2009 at 5:10 pm #79663In reply to: HTML in Topics.
Peter A. Gebhardt
ParticipantAlthough someone could tweak the size of the Topic or Post Title to a a size which does not interfere with the positioning of the “Add Tag” section in the topic view – it would be nice we could use say
<br />too.As an example, I’ve changed this section of “topic.php” in “kakumei”:
From:
<div id="topic-info">
<span id="topic_labels"><?php bb_topic_labels(); ?></span>
<h2<?php topic_class( 'topictitle' ); ?>><?php topic_title(); ?></h2>To:
<div id="topic-info">
<!-- <span id="topic_labels"><?php bb_topic_labels(); ?></span> -->
<div style="width:500px"><h2<?php topic_class( 'topictitle' ); ?>><?php topic_title(); ?></h2></div>Which is required for all templates and prone to finetuning errors.
September 25, 2009 at 4:53 pm #77217brightcoconut
MemberNever mind – I got it, thanks to an old post from two years ago.
The code has changed a bit, so here’s how I fixed it:
1) open up /bb-includes/functions.bb-template.php
2) replace line 1074 with:
return stripslashes(apply_filters( ‘get_topic_title’, $topic->topic_title, $id ));
3) and line 1782:
return stripslashes(apply_filters( ‘get_post_text’, $bb_post->post_text, $bb_post->post_id ));
That did the trick for me.
September 25, 2009 at 3:38 pm #79427In reply to: Limit tags to a pre-defined list?
chrishajer
ParticipantTo answer your question about the closing
?>being missing, yes you can leave that off. wp-config.php starting coming like that. It concerned me at first but it turns out it’s OK and might be a good thing to do.http://activeblogging.com/info/can-you-leave-off-the-closing-php-tag-in-your-source-code/
September 25, 2009 at 3:33 pm #64936In reply to: Make BBPress a Page in WordPress???
chrishajer
ParticipantYes, that’s fine. If you create a Page in WordPress called Forums (actually the slug just needs to be
forums), you don’t even need any content on the page. WordPress will direct traffic there. That works with permalinks on. Not sure what happens if you don’t use permalinks. If you don’t create a Page called Forums, with a slug offorums, then you just won’t have a link in your menu to the forums. There are plugins to get around that though, if you need it. Try the Page first though and see if it works.September 25, 2009 at 1:10 pm #31876Topic: Aligning Logo
in forum InstallationInvTrdr
MemberI am using the code below for my logo in the header that can appear above or below the text and slogan. It aligns itself to the left. How do I get it to align to the center like the text and slogan? Missing something in the CSS stylesheet file?
Thank you.
<div class="art-Header">
<div class="art-Header-jpeg"></div>
<div class="art-Logo"> <img src="logo location"align="center"/>
<h1 id="name-text" class="art-Logo-name">
<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div id="slogan-text" class="art-Logo-text">
<?php bloginfo('description'); ?><img src="logo location"align="center"/></div>
</div>
</div>September 25, 2009 at 8:42 am #79425In reply to: Limit tags to a pre-defined list?
Adam Harley (Kawauso)
MemberAll my code is written against 1.0.2 SVN, so it’s not 0.9-only
and yeah, $allowed_tags is meant to be changed and then back again, not the cleanest way of doing things, but it should work. The copy that’s working live at the moment is below (I just realised I forgot to turn on the validation code too, oops):<?php
/*
Plugin Name: Restrict Topic Tags
Description: Restricts tags to a pre-defined list.
Author: Kawauso
Version: 0.1.1
*/
$allowed_tags = array(
'test4',
'test 3',
'test3',
'test2',
);
function restrict_topic_tags_form( $args = null )
{
$defaults = array( 'topic' => 0, 'submit' => __('Add ยป'), 'list_id' => 'tags-list' );
$args = wp_parse_args( $args, $defaults );
extract( $args, EXTR_SKIP );
if ( !$topic = get_topic( get_topic_id( $topic ) ) ) {
return false;
}
if ( !bb_current_user_can( 'edit_tag_by_on', bb_get_current_user_info( 'id' ), $topic->topic_id ) ) {
return false;
}
global $page, $allowed_tags;
$current_tags = bb_get_topic_tags( $topic->topic_id );
$allowed_tags = array_flip( $allowed_tags ); // CHANGE PLACES!
foreach( $current_tags as $tag ) {
if( isset( $allowed_tags[ $tag->name ] ) )
unset( $allowed_tags[ $tag->name ] );
}
$allowed_tags = array_flip( $allowed_tags ); // CHANGE PLACES!
if( is_array( $allowed_tags ) && !empty( $allowed_tags ) ) { ?>
<form id="tag-form" method="post" action="<?php bb_uri('tag-add.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>" class="add:<?php echo esc_attr( $list_id ); ?>:">
<p>
<select name="tag" id="tag">
<option value=""><?php _e("Select a tag")?></option>
<?php foreach( $allowed_tags as $tag ) { ?>
<option value="<?php echo $tag?>"><?php echo $tag?></option>
<?php } ?>
</select>
<input type="hidden" name="id" value="<?php echo $topic->topic_id; ?>" />
<input type="hidden" name="page" value="<?php echo $page; ?>" />
<?php bb_nonce_field( 'add-tag_' . $topic->topic_id ); ?>
<input type="submit" name="submit" id="tagformsub" value="<?php echo esc_attr( $submit ); ?>" />
</p>
</form>
<?php
} // End if
} // End function
function restrict_topic_tags( $tag ) {
global $allowed_tags;
if( !in_array( $tag, $allowed_tags ) )
return array();
return array($tag);
}
add_filter( 'bb_add_topic_tags', 'restrict_topic_tags' );September 25, 2009 at 3:58 am #79695In reply to: Need A Project ShowOff
Ashish Kumar (Ashfame)
ParticipantAlso you can ask fixes for CSS changes on the CSS forum of NAP Forums – http://needaproject.com/discussion/
>If you ask there, I will make sure it doesn’t go unanswered
>If someone is looking for help, please give him/her a reference
Thanks!
BTW no comments neither on the design nor on the implementation got me felling a lil weird!
P.S. – Don’t consider it spam!

I am just trying to help as many people as I can. I have many buddies signed up but they are among the ones who will answer queries. So, I am just looking for people who actually need to ask queries.
September 24, 2009 at 8:33 pm #69402chandersbs
MemberActually I don’t. I tried your code, but its still showing the same.
September 24, 2009 at 8:26 pm #69401Ashish Kumar (Ashfame)
ParticipantSELECT * FROM bb_forums WHERE forum_id <> 1 AND forum_id <> 2 AND topics <> 0 ORDER BY forum_order ASC LIMIT 10Got the idea?
September 24, 2009 at 8:23 pm #69400chandersbs
MemberHow exactly can I exclude some forums for showing up in this code, that generates a list of forums, or rather, HOW can i show only selected forums?
<?php if ( $topic ) : ?>
<h2>Forum List</h2>
<ul>
<?php
global $bbdb;
$query="SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10";
$results=$bbdb->get_results($query);
foreach ($results as $result) {
echo "<li><a href='/forum.php?id=".$result->forum_id."'>".$result->forum_name."</a></li>";
}
?>
</ul>
<?php endif; ?>September 24, 2009 at 7:42 pm #79147In reply to: How to Show Last Ten Posts in Sidebar?
chandersbs
MemberYeah, it has some very AWESOME code in there, this code generates a list of topics that was active as last:
<?php if ( bb_forums() ) : ?>
<h3>Actieve onderwerpen</h3>
<ul style="color:#bbb;">
<?php
global $bbdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 5";
$results=$bbdb->get_results($query);
foreach ($results as $result) {
echo "
- topic_id."'>".$result->topic_title." (".$result->topic_posts.")
";
}
?>
<?php endif; ?>
I did some adjustment in the code, to make it work. SWEET.
But not really what I was looking for, but o well.
September 24, 2009 at 7:21 pm #75590joseffb
MemberI’m not able to get WPMU 2.8.4 and BP 1 to SSO at all. I tried and can’t get it to work any help would be grateful.
I have the multi-domain plugin setup and also have the bbpress-integrate plugin in the “plugins” directory.
WP-Config.php
/**
* The base configurations of the WordPress.
*
**************************************************************************
* Do not try to create this file manually. Read the README.txt and run the
* web installer.
**************************************************************************
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH.
*
* This file is used by the wp-config.php creation script during the
* installation.
*
* @package WordPress
*/
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
Removed for Security
/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);
define(‘VHOST’, ‘yes’);
$base = ‘/’;
define(‘DOMAIN_CURRENT_SITE’, ‘thisissite1.com’ );
define(‘PATH_CURRENT_SITE’, ‘/’ );
define(‘SITE_ID_CURRENT_SITE’, 1);
define(‘BLOGID_CURRENT_SITE’, ‘1’ );
/**#@+
* Authentication Unique Keys.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
*
* @since 2.6.0
*/
define( ‘NONCE_KEY’, ‘&^YU8obCOZmNz)#udi$ghSLF’ );
define( ‘AUTH_KEY’, ‘t0d87hpJOq!DBA#gp7VZ#dez’ );
define( ‘AUTH_SALT’, ‘CdaJ42PU3iCsjehU(*h8V#6k’ );
define( ‘LOGGED_IN_KEY’, ‘LihT(0OQBtTkw82^c0jmT4ub’ );
define( ‘LOGGED_IN_SALT’, ‘NinP#50Uq(KU#LQ5h64on9v*’ );
define( ‘SECURE_AUTH_KEY’, ‘UYi3SxHzUXE48E!vvggXv&s8’ );
define( ‘SECURE_AUTH_SALT’, ‘c@p6I*b*hvcr8F^SMfr7JG^!’ );
/**bbpress integration **/
define(‘USER_COOKIE’, ‘wordpressuser’);
define(‘PASS_COOKIE’, ‘wordpresspass’);
define(‘COOKIEPATH’, $base);
define(‘SITECOOKIEPATH’, ‘/’);
define(‘COOKIE_DOMAIN’, ‘.thisissite2.com’); // same as bbPress
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = ‘wp_’;
/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de.mo to wp-content/languages and set WPLANG to ‘de’ to enable German
* language support.
*/
define (‘WPLANG’, ”);
// double check $base
if( $base == ‘BASE’ )
die( ‘Problem in wp-config.php – $base is set to BASE when it should be the path like “/” or “/blogs/”! Please fix it!’ );
// uncomment this to enable wp-content/sunrise.php support
//define( ‘SUNRISE’, ‘on’ );
// uncomment to move wp-content/blogs.dir to another relative path
// remember to change WP_CONTENT too.
// define( “UPLOADBLOGSDIR”, “fileserver” );
// If VHOST is ‘yes’ uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled)
// For example, the browser will redirect to http://examples.com/ for the following: define( ‘NOBLOGREDIRECT’, ‘http://example.com/’ );
// Set this value to %siteurl% to redirect to the root of the site
// define( ‘NOBLOGREDIRECT’, ” );
// On a directory based install you must use the theme 404 handler.
// Location of mu-plugins
// define( ‘WPMU_PLUGIN_DIR’, ” );
// define( ‘WPMU_PLUGIN_URL’, ” );
// define( ‘MUPLUGINDIR’, ‘wp-content/mu-plugins’ );
// Uncomment to disable the site admin bar
//define( ‘NOADMINBAR’, 1 );
define( “WP_USE_MULTIPLE_DB”, false );
/* That’s all, stop editing! Happy blogging. */
/** WordPress absolute path to the WordPress directory. */
if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(__FILE__) . ‘/’);
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);
/**bbpress integration **/
bb-config.php
<?php
/**
* The base configurations of bbPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys and bbPress Language. You can get the MySQL settings from your
* web host.
*
* This file is used by the installer during installation.
*
* @package bbPress
*/
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for bbPress */
Removed for security
/**#@+
* Authentication Unique Keys.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/bbpress/ WordPress.org secret-key service}
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
*
* @since 2.6.0
*/
define( ‘BB_NONCE_KEY’, ‘&^YU8obCOZmNz)#udi$ghSLF’ );
define( ‘BB_AUTH_KEY’, ‘t0d87hpJOq!DBA#gp7VZ#dez’ );
define( ‘BB_AUTH_SALT’, ‘CdaJ42PU3iCsjehU(*h8V#6k’ );
define( ‘BB_LOGGED_IN_KEY’, ‘LihT(0OQBtTkw82^c0jmT4ub’ );
define( ‘BB_LOGGED_IN_SALT’, ‘NinP#50Uq(KU#LQ5h64on9v*’ );
define( ‘BB_SECURE_AUTH_KEY’, ‘UYi3SxHzUXE48E!vvggXv&s8’ );
define( ‘BB_SECURE_AUTH_SALT’, ‘c@p6I*b*hvcr8F^SMfr7JG^!’ );
$bb->wp_table_prefix = ‘wp_’;
$bb->wp_home = ‘http://thisissite2.com/’;
$bb->wp_siteurl = ‘http://thisissite2.com/’;
// Integrating with mu
$bb->cookiepath = ‘/’;
$bb->cookiedomain = ‘.thisissite2.com’; // leading . allows subdomain sharing
$bb->usercookie = ‘wordpressuser’; // WPMU doesn’t hash cookies
$bb->passcookie = ‘wordpresspass’; // WPMU doesn’t hash cookies
// Load WordPress so we can use the same templates.
define(‘WP_BB’, ‘true’);
require_once(‘/home/content/82/4558682/html/wp-blog-header.php’);
/**#@-*/
/**
* bbPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$bb_table_prefix = ‘bb_’;
/**
* bbPress Localized Language, defaults to English.
*
* Change this to localize bbPress. A corresponding MO file for the chosen
* language must be installed to a directory called “my-languages” in the root
* directory of bbPress. For example, install de.mo to “my-languages” and set
* BB_LANG to ‘de’ to enable German language support.
*/
define( ‘BB_LANG’, ” );
September 24, 2009 at 5:17 pm #79462In reply to: hooking a function makes mysql query to return empty
Ashish Kumar (Ashfame)
ParticipantI got it. Thanks buddy!
Offtopic : Any pointers on how to add plugins to the extend section. i have the latest code in trunk. I will probably figure out to tag them too but how to add information on the plugin page itself
September 24, 2009 at 4:09 pm #79461In reply to: hooking a function makes mysql query to return empty
Adam Harley (Kawauso)
Memberfunction do_action($tag, $arg = '')do_action() has an arguments variable as it’s 2nd argument, sorry for not being clearer. That’s passed when it runs an action function and if nothing is passed, it defaults to an empty string.
$bb_table_prefixwould be the prefix for the bbPress tables though, wouldn’t it? In the case of a WP/bbP integration, the bbPress user data is stored in the WordPress user tables, so those aren’t under the same prefix as the bbPress tables. Unless it changes automatically for WordPress user tables somehow?September 24, 2009 at 12:16 pm #79690In reply to: Show the Reply form/box on every page
Ashish Kumar (Ashfame)
ParticipantDon’t hack the core files or you will lose changes when you upgrade. Instead do this
In your topic.php
replace
post_form();with
post_form(array('last_page_only' => false));September 24, 2009 at 10:46 am #79143In reply to: How to Show Last Ten Posts in Sidebar?
chandersbs
Memberi tried this code as well, to generate a list of 10 last topics in my sidebar. But its not showing any topics at all.
September 24, 2009 at 9:51 am #79679In reply to: target=blank in Topic
InvTrdr
MemberGot it working as I wanted. Used the code below for it. Thanks.
<?php
/*
Plugin Name: Open Links in New Window
*/
function bb_target_blank( $text ) {
$text = preg_replace('|<a (.+?)>|i', '<a $1 target="_blank">', $text);
return $text;
}
add_filter('post_text', 'bb_target_blank',255);
?>September 24, 2009 at 9:22 am #78942In reply to: open link within replys in a new window
InvTrdr
MemberHey Kawuso. Can you re-post the correct code. I am having the same problem as BaraBajen had.
Thanks.
September 24, 2009 at 8:46 am #79669In reply to: Number of Tags on Sidebar.
InvTrdr
MemberJust an ad on TV. Saw the post. How many tags are posted by default? Or without the code all tags show up by default.
Thanks.
September 24, 2009 at 7:23 am #79460In reply to: hooking a function makes mysql query to return empty
Ashish Kumar (Ashfame)
ParticipantI guess that's what do_action() does when it doesn't have any arguments?do_action() must be called with which action to do. no?
$bb_table_prefix already takes care of different table prefixes. I didn’t get your point.
-
AuthorSearch Results