Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,301 through 23,325 (of 32,468 total)
  • Author
    Search Results
  • #79695

    In reply to: Need A Project ShowOff

    Also 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! :P

    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.

    chandersbs
    Member

    Actually I don’t. I tried your code, but its still showing the same.

    SELECT * FROM bb_forums WHERE forum_id <> 1 AND forum_id <> 2 AND topics <> 0 ORDER BY forum_order ASC LIMIT 10

    Got the idea?

    chandersbs
    Member

    How 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; ?>

    #79147
    chandersbs
    Member

    Yeah, 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.

#75590
joseffb
Member

I’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/&#8217; );

// 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/&#8217;;

$bb->wp_siteurl = ‘http://thisissite2.com/&#8217;;

// 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’, ” );

#79462

I 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

#79461

function 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_prefix would 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?

#79690

Don’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));

#79143
chandersbs
Member

i tried this code as well, to generate a list of 10 last topics in my sidebar. But its not showing any topics at all.

#79679

In reply to: target=blank in Topic

InvTrdr
Member

Got 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);

?>

#78942
InvTrdr
Member

Hey Kawuso. Can you re-post the correct code. I am having the same problem as BaraBajen had.

Thanks.

#79669
InvTrdr
Member

Just 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.

#79460

I 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.

#78802
Mark Kehn
Member

I found out after a couple hours more searching on the web that you can use this code below to hide php errors, enable a private log of the errors, and also protect the error log from outsiders.

# suppress php errors from showing publicly

php_flag display_startup_errors on

php_flag display_errors on

php_flag html_errors on

# enable PHP error logging

php_flag log_errors on

php_value error_log ../PHP_errors.log

# prevent access to PHP error log

<Files PHP_errors.log>

Order allow,deny

Deny from all

Satisfy All

</Files>

@SharpMouth – was this what you were referring too? Is this what you used to stop the error messages from showing? This would hide the error messages but it doesn’t fix the actual problem. Can you tell me if you ever got the actual problem fixed, and if so, how?

Much appreciated.

#31863

I just recently upgraded to WP 2.8 and am facing this problem again. It’s happened before and I fixed it because values in both WP and BB were different, however this time they’re the same. I can only be logged into one script at a time, either WP or BB. Logging into WP logs me out of BB and vice-versa. My auth and all those things are set as the same in each respective config file, and I have the proper code inserted into my wp-config file from the bbIntegration plugin, so I don’t know the problem.

If anybody can help, here’s the forum: http://scrawlfx.com/forum

#78801
Mark Kehn
Member

I have this exact same problem as Sharpmouth in his first post up top here. EXACT, same error messages, same line numbers everything. DITTO for the second image he posted.

I also did the integration with wordpress during the install of bbpress and I followed it exactly, I had no trouble whatsoever, I skipped nothing but after clicking the final button to finish the installation I got the message it installed, but with errors.

@ ashfame you said, “Possibility is that you missed out something as the tutorial works flawlessly.”

I think your comment was snarky in my opinion. The tutorial got me through the installation but it doesn’t mean it worked flawlessly because following the instructions still ended up with results at end of install. Truth is I don’t think these errors have anything to do with the documentation on how to install, it has to do with the bbpress code itself. The code is broke regardless what a piece of paper (the tutorial) says about it.

@SharpMouth – your final message says you got it to work but to me it only sounds like a bandaid but the issue is still there even though you figured a way to hide the messages. You said you fixed it, does that mean you can click on the links to go to the bbpress Admin area or to LogOut, LogIn without getting the “headers already sent out” garbage?

How did you turn off error reporting? Better yet, what steps exactly did you take to fix everything to finally get it all to work? Remember, I am having the exact same results as you after the install, so please tell me what you did to get everything to work for you. Much appreciated, thanks.

Here are some extra screenshots, ones that SharpMouth didn’t post himself when he was having issues.

This first one was barely visible it had the error messages as white text on white background so I selected all the text so you could read it.

http://www.flickr.com/photos/16731818@N00/3948343005/sizes/l/

These next two are just showing the installation log. I blacked out personal info not needed by you.

http://www.flickr.com/photos/16731818@N00/3948343007/sizes/o/

http://www.flickr.com/photos/16731818@N00/3948343009/sizes/o/

For the screenshot below – As you see here in the red message box it says it completed but with minor errors. It isn’t referring to the error messages I highlighted in the first screenshot it is referring to the error about keymaster email not going out.

http://www.flickr.com/photos/16731818@N00/3948343013/sizes/o/

#79422

Whoops, I need to use more test data next time.

Change:

foreach ($current_tags as $tag_key => $tag ) {
if( in_array( $tag->name, $allowed_tags ) )
unset( $allowed_tags[ $tag_key ] );
}

to

$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!

The closing ?> isn’t really important if there’s no non-PHP data after it

#79421

You, sir, are awesome.

As soon as I can test this out, I will. One question: for the plugin, should I add a ?> to the end of the chunk of code you’ve put there?

#79674

In reply to: target=blank in Topic

It’s target="_blank", make sure you have the underscore. Otherwise, got an example? Are you using __ck__’s plugin to add _blank?

#79420
<?php
/*
Plugin Name: Restrict Topic Tags
Description: Restricts tags to a pre-defined list.
Author: Kawauso
Version: 0.1
*/

$allowed_tags = array(
'test',
'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 );
foreach ($current_tags as $tag_key => $tag ) {
if( in_array( $tag->name, $allowed_tags ) )
unset( $allowed_tags[ $tag_key ] );
}

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' );

Then in your theme’s topic-tags.php, change <?php tag_form(); ?> to:

<?php
if( function_exists( 'restrict_topic_tags_form' ) )
restrict_topic_tags_form();
else
tag_form();
?>

#79666
johnhiler
Member

Here you go:

https://bbpress.org/forums/topic/hot-tags#post-16484

Btw – I don’t really know all this stuff… I’m just using Google to search the bbpress forums! :-)

#79647

In reply to: Admin Link in Sidebar

There are template function lists if you Google around, but I don’t know if any are up-to-date for 1.0.2

I think bb_admin_link() and get_bb_admin_link() would do what you’re trying to do.

#31856

Topic: Admin Link in Sidebar

in forum Themes
mantraofdoom
Member

Hi everyone, I just started a site that uses WP and BBP together, and aside from a few outstanding issues, things are working out nicely.

I built a theme for the forum that matches the WP theme, and it has a sidebar. When the user is logged in, it shows Welcome [username] and shows the avatar, a link to edit profile, my favorites, and log out.

How can I have if the keymaster/admin/mod is logged in, a link to the dashboard? I tried some code from the default template, but nothing really seems to give me a direct link to admin. Is there a templates tag list for bbpress like the one for wordpress?

#79614
Peter A. Gebhardt
Participant

When trying to tackle the “Deprecated” warning, by using a similar functions as an “one-to-one” replacement instead of say “eregi()” in below code, an error is returned:

Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in ....htdocsversambb-versbb-includes[em]gettext.php on line 295[/em]

I’m not a php-programmer, but I start to wonder how much coding effort would be needed to switch to the required new php-functions?

Could somebody provide a matchmaking list eventually (or point to helpful further info), of what should (can) be replaced by what function? The php docs – when looking up the functions in question – are not of much help describing the transition issues.

TIA

Viewing 25 results - 23,301 through 23,325 (of 32,468 total)
Skip to toolbar