Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,751 through 29,775 (of 32,491 total)
  • Author
    Search Results
  • #50458

    In reply to: Google sitemap

    creatiu
    Member

    This plugin is not working property, actually is creating not valid URLS inside the sitemap like this:

    <url>

    <loc>://?</loc>

    <lastmod>2007-07-14</lastmod>

    <changefreq>monthly</changefreq>

    <priority>0.014705882352941</priority>

    </url>

    This happens with the latest version of bbPress (0.8.2.1)

    #58999
    Inquirer
    Member

    [If you plan on integrating WP and bbPress, it is best to have a running copy of WP up and going.]

    I already have WordPress up and running.

    [Then just install your bbPRess in the same database as WP. WordPress will have the database prefix of wp_ and bbPress with bb_]

    I have WordPress installed in my public_html directory in a directory named blog

    Do you mean install bbPress in the blog directory?

    In other words, don’t create a separate directory forum to install bbPress?

    I think I want mywebsitedomainname/blog and mywebsitedomainname/forum to be separate urls

    But to integrate WordPress with bbPRess do they have to have the same url?

    Thanks


    On a separate note

    I should be able to use WinSCP to login to my server via SSH, then access my database with a MySQL login, then drop the bb_ tables from the failed bbPress install.

    I imagine this could be done through the WinSCP Console

    I realize the phpAdmin is a more user friendly interface than the WinSCP Console.

    I sent an e-mail to my web hosting support, but they haven’t responded.

    #2092

    Topic: Punbb -> BBPress

    in forum Plugins
    annathea
    Member

    I took Bruno Torres’ converter script as a foundation, and re-wrote it to work with the Punbb database architecture. Also, added in a tiny bit of string clean up, since Punbb allows foreign characters in the username field, and BBPress does not.

    Here’s the code to look at:

    http://utopian.net/code/punbb-importer.phps

    And in a handy .zip for download:

    http://utopian.net/code/punbb-importer.zip

    A few important notes, since this is NOT at all pretty –

    1) It uses a lot of memory, so make sure PHP has access to at least 16mb in php.ini. If I had more than 20 minutes to devote to this, I’d look into that and try to improve it, but hey.

    2) If you’re importing a lot of data, you may need to split up the resultant sql file into smaller files less than 2mb in size. Add this to the list of things I would automate if I needed to use this script more than once.

    3) I am using BBPress integrated with WPMU and included lines for importing into the WordPress user tables. After I noted and fixed the problem converting Punbb’s lax, apostrophe-laden usernames to nice and sanitary WP-friendly ones, the script ran like a charm. Seriously, if I’d known it would be this easy I would have done this six months ago.

    4) The forum-parent to forum relationship imported correctly into the database, but displayed a little funny, so I manually re-ordered the forum items in the database and massaged the template a little bit to recognize forum parents a little bit differently, more PunBB style.

    5) A clean WPMU and BBPress install is ideal, but I already had ten existing WP users, half of whom had a user account in the PunBB data I was merging. For such a small data set, it was very easy to manually correct this by deleting the PunBB users and making sure that the imported topics and posts for those users pointed to their current id.

    Hopefully this will be a good start for those of us looking to move existing PunBB forums to BBPress & WordPress. Good luck, and let me know if you use it!

    #58986
    _ck_
    Participant

    Offhand I’d guess that the last poster function is meant to be “in the loop” for a per topic basis. Because you are trying to use it for an entire sub-forum, it’s missing a topic id reference. You’d have to calculate the last topic that the last poster posted in.

    Posting the code to that part of the template would help (at least for me)

    #2090
    #54382
    thierryyyyyyy
    Participant

    I have the same error on LOCALHOST, and also with windows. (my forum hosted on web works :) )

    (thierry is the name of my computer, and is synonyme of “localhost”)

    link I click on to activate my template is such : (there are 2 “”)

    http://thierry/forum/bb-admin/themes.php?theme=D%3A%5C%5CMes+Documents%5C%5Csites_web%5C%5C2diabolos.com%5C%5Cforum%2Fmy-templates%2F2diabolos%2F&_wpnonce=0ecdd913e2

    I tried the “patch_to_url_2” in vain.

    a “brillant” idea made me change the themes.php :

    if ( !in_array($activetheme, $themes) ) {
    $activetheme = BBPATH . 'my-templates/2diabolos/'; // THIS LINE WAS 'bb-templates/kakumei/' ...
    bb_update_option( 'bb_active_theme', $activetheme );
    remove_action( 'bb_admin_notices', $theme_notice );
    bb_admin_notice( __('Theme not found. Default theme applied.'), 'error' );
    }

    works well (hopefully)

    (after reflection, I think the following line don’t help)

    I tried to debug a little bit. I put in themes.php

    print_r($themes);
    echo "<br>";
    echo "the theme you want to activate : " . $_GET['activated'] ;

    the result for the first line is good, the “$_GET ” is empty.

    #2089

    Topic: Attchment Uploader

    in forum Plugins
    Jaithn
    Member

    Hey guys,

    wordpress already has an attchment uploader, doesn’t it? is there a chance to build a plug-in for bbpress using that code?

    grz,

    jaithn

    #58946
    citizenkeith
    Participant

    Well, I don’t know the first thing about writing plugins, so if somebody can help out, I’d appreciate it. :)

    #58973
    fel64
    Member

    Not a clue. Maybe that host’s MySQL version doesn’t support SQL_CALC_FOUND_ROWS on *? Or something. Your best bet is to report this problem on trac as the bug it is. :)

    #58945
    fel64
    Member

    You need to write a plugin that will be called on a hook in the profile, where it adds to the associative array $profile_info_keys an entry with key ‘bb_title’ – I think. To see how to do that, look at some other plugin that adds fields to the profile info thingy.

    #57843
    _ck_
    Participant

    Apparently WordPress allows dots (periods) in usernames as well?! (it did at some point, not sure if it still does but I have users with nicknames like that)

    So I had to modify this plugin with a dot

    return preg_replace('/[^ ta-z0-9_.-]/i', '', str_replace("%20"," ",$raw));

    apparently php is very sensitive as to what order the pattern is in, that dot has to be right there in the sequence or it throws a shedload of errors.

    #58967
    _ck_
    Participant

    Fourth time is the charm? Ugh. Sorry!

    <?php
    /*
    Plugin Name: Admin Can Post Anything
    Plugin URI:
    Description: allows keymaster/administrators to post any content regardless of tag restrictions
    Author: _ck_
    Author URI: http://CKon.wordpress.com
    Version: 0.04
    */

    function bb_admin_post_anything($text) {
    if (bb_current_user_can('administrate') ) {
    remove_filter('pre_post', 'encode_bad' );
    remove_filter('pre_post', 'bb_encode_bad' );
    remove_filter('pre_post', 'bb_filter_kses', 50);
    remove_filter('pre_post', 'addslashes', 55);
    remove_filter('pre_post', 'bb_autop', 60);
    $text=bb_autop(addslashes($text)); // I don't completely understand why this is necessary here but it is

    // the following two lines are untested code to allow compatibility with the allow images plugin
    // it's safe to remove it's filters because this only happens if admin are trying to post
    remove_filter( 'pre_post', 'allow_images_encode_bad', 9 );
    remove_filter( 'pre_post', 'allow_images', 52 );
    }
    return $text;
    }
    add_filter('pre_post', 'bb_admin_post_anything',8);
    ?>

    #58930
    _ck_
    Participant

    I’ve been studying to see if there’s anyway via plugins instead of hacking the code for both WP and BB to consolidate the common javascript routines they both use.

    Not only do they load half a dozen scripts at certain times, one of them, prototype.js is 50k in size. But they seem to be common for both.

    All we would need is choose a common script path.

    I guess it’s possible to

    remove_action(‘bb_head’, ‘bb_print_scripts’);

    and then plugin your own.

    But what kills me is bbPress doesn’t need ANY of those scripts except for thinks like deleting posts to forward correctly and the ajax actions.

    I really dislike ajax, especially when it’s used where it’s not needed.

    #58965
    Trent Adams
    Member

    If you email me the code, I can change your first post as we go.

    trent dot adams at gmail dot com

    Trent

    #58964
    _ck_
    Participant

    Okay by adding these to the remove_filters list, you can also run allow images:

    remove_filter( 'pre_post', 'allow_images_encode_bad', 9 );
    remove_filter( 'pre_post', 'allow_images', 52 );

    It may also be necessary to increase my filter priority to 8, ie.

    add_filter('pre_post', 'bb_admin_post_anything',8);

    Since I can’t edit my first post I will try to add it to the repository with the changes?

    #58963
    _ck_
    Participant

    I will look at the code for allow images but I suspect it’s because they must run one of the three bad filters after my filter runs.

    I think I tried adding to the repository and nothing happened but I’ll try again.

    #58959
    Trent Adams
    Member

    I tested it on my onvertigo.com site which is not using the default template either. It doesn’t work for me with any themes!

    http://onvertigo.com/topic/media-types-played-in-this-forum?replies=12#post-38

    Strange…..using:

    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/2G_AHHxSctE"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/2G_AHHxSctE" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

    Trent

    #58957
    _ck_
    Participant

    Just tested a youtube embed copied right from their site and it works tested in IE and Firefox.

    I don’t use the default bbpress template however, I wonder if that is affecting it somehow.

    Are you using the updated v0.02 that I posted, not v0.01 ?

    If it still doesn’t work, can you view source on the outputed page and copy just the part with that one post with full html here (between code tags obviously) so I can see what it is doing?

    #2084
    _ck_
    Participant

    Been meaning to do this for awhile, didn’t realise how easy it was. This makes bbPress behave more like WordPress in that admin (keymasters/administrators) can post any content regardless of tag restrictions for the rest of members. This includes images, javascript, objects like flash video player, etc.

    <?php
    /*
    Plugin Name: Admin Post Anything
    Plugin URI:
    Description: allows keymaster/administrators to post any content regardless of tag restrictions
    Author: _ck_
    Author URI: http://CKon.wordpress.com
    Version: 0.02
    */

    function bb_admin_post_anything($text) {
    if (bb_current_user_can('administrate') ) {
    remove_filter( 'pre_post', 'encode_bad' );
    remove_filter( 'pre_post', 'bb_encode_bad' );
    remove_filter('pre_post', 'bb_filter_kses', 50);
    $text=addslashes($text);
    $text=bb_autop($text);
    }
    return $text;
    }
    add_filter('pre_post', 'bb_admin_post_anything',9);
    ?>

    #57788
    ylcncn
    Member

    wow nice site ;)

    #58851
    retrospec
    Member

    Hello,

    The fault was found and suggested to me at wordpress forum and it is due to magic quotes runtime being turned on.

    I’d strongly recommend as an interim you modify your installation instructions to state clearly that magic quotes runtime should be turned off for the software to work.

    And for any future stable/svn release you should perform a check on magic quotes and code around this issue.

    Neil.

    #58919
    _ck_
    Participant

    I bet they mean like in wordpress where the cookie will be set for a year instead of a week?

    What’s the bbpress cookie default, I’ll have to go look at the code.

    I get around this problem by forcing the wp login from everywhere.

    There was another request for this feature here:

    https://bbpress.org/forums/topic/remember-me-option-at-login?replies=3

    _ck_
    Participant

    This is so simple I bet I am duplicating what someone else has already done. I am not sure why this isn’t in bbPress by default and it doesn’t even begin to address what I would consider basic moderation tools but it’s a start.

    Install and check under “content” submenu. Why the posts menu =deleted posts in bbpress’s default I have no clue.

    <?php
    /*
    Plugin Name: bbPress Recent Posts
    Plugin URI: http://bbpress.org/plugins/
    Description: shows most recent posts with (extremely limited) moderation options
    Author: _ck_
    Author URI: http://CKon.wordpress.com
    Version: 0.01
    */

    function recent_posts_admin_page() {
    if ( !bb_current_user_can('browse_deleted') ) {die(__("Now how'd you get here? And what did you think you'd being doing?"));}
    global $bbdb, $bb_posts, $bb_post, $page;
    $bb_posts=get_latest_posts(0,$page);
    $total = bb_count_last_query();
    ?>
    <h2>Recent Posts</h2>
    <ol id="the-list">
    <? bb_admin_list_posts(); ?>
    </ol>
    <?php echo get_page_number_links( $page, $total );
    }

    function recent_posts_admin_menu() {
    global $bb_submenu;
    $bb_submenu['content.php'][] = array(__('Recent Posts'), 'use_keys', 'recent_posts_admin_page');
    }
    add_action( 'bb_admin_menu_generator', 'recent_posts_admin_menu' );

    #58771

    In reply to: rebuilding topics DB

    fel64
    Member

    If you use $bbdb->users you should get the appropriate table name instead.

    #58770

    In reply to: rebuilding topics DB

    _ck_
    Participant

    tested working – at least for my setup:

    function rebuild_topics() {
    global $bbdb;
    // currently only rebuilds last post pointers, last poster name, last poster id, last topic post date
    // todo: rebuild entire topics table
    // warnings: hard coded for WP user table - backup your DB before using
    // run the built-in post/topic recount first

    echo "t<br>n";
    if ( $topics = (array) $bbdb->get_results("SELECT topic_id,post_id,poster_id,post_time FROM <code>bb_posts</code> a WHERE post_position=(SELECT MAX(post_position) FROM <code>bb_posts</code> WHERE topic_id=a.topic_id) AND post_status = '0' GROUP BY topic_id ") ) :
    echo "tt" . __('Calculating last posters for each topic...') . "n";
    foreach ($topics as $t) {
    echo $t->topic_id."... ";
    $user_login=$bbdb->get_var("SELECT user_login FROM wp_users WHERE ID='$t->poster_id'");
    $bbdb->query("UPDATE $bbdb->topics SET topic_time='$t->post_time',topic_last_poster= '$t->poster_id', topic_last_poster_name='$user_login', topic_last_post_id='$t->post_id' WHERE topic_id = '$t->topic_id'");
    }
    endif;
    echo "<br> tt" . __('Done calculating last posters.');
    }

Viewing 25 results - 29,751 through 29,775 (of 32,491 total)
Skip to toolbar