Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,601 through 29,625 (of 32,432 total)
  • Author
    Search Results
  • #59309

    In reply to: Noobish CSS Question

    fel64
    Member

    There’s no direct solution. You can do one of these:

    • Change <?php tag_heat_map(); ?> to <?php tag_heat_map('limit=30'); ?>. The default limit is 40 I think, if you set it to 30 or any appropriate number they won’t go so far down. But you’d want to change that again later.
    • Put the footer inside the wrapper. I’m not sure how your templates are arranged, but in kakumei you’d just have to open footer.php and move the codeblock that produces the div footer up a few lines, just above the previous </div>. Permanent change, now the footer is on the white, but the white will always stretch down sufficiently.
    • Wait it out – eventually there’ll be enough topics to stretch the page :)

    I think there are a few other things you could do, but that second point is probably the best if you need it changed now.

    #59228
    so1o
    Participant

    i dont see any plugins in the list either.. i dont have any other plugin except this one..

    am i doing something wrong! :)

    #59260
    _ck_
    Participant

    You mean the one by GamerZ S010?

    I’ve watched him improve that over the past year or two, actually sent some bug fixes and improvements. Still doesn’t do quite everything I’ve seen in other advanced polls but he’s got the multi-vote option so that’s good.

    It uses the metadata so it would be fairly easy to convert, the only problem is his creation and management menus are all meant for the admin interface so a new creation routing would have to be written for the regular user interface. Then there is the problem of the trigger and attachment. I guess it gets attached to the topic-info box.

    Now if we could only get him to switch from simple machines forum to bbpress we’d have a shedload of new bbpress plugins within a month ;-)

    #59302

    In reply to: Custom fields

    so1o
    Participant

    and you can catch this field in bb_post.php action to process the post.

    #56714

    In reply to: Plugin: Avatar Upload

    Detective
    Member

    It appears just in the upload avatar template. Everything else works fine :)

    #59212
    outchy
    Member

    YES!!! oh, you’ve made my week, thank you so much :)

    the log in text is here in template-functions.php:

    if ( ( is_topic() && bb_current_user_can( ‘write_post’, $topic->topic_id ) && $page == $last_page ) || ( !is_topic() && bb_current_user_can( ‘write_topic’, $forum->forum_id ) ) ) {

    echo “<form class=’postform’ name=’postform’ id=’postform’ method=’post’ action='” . bb_get_option(‘uri’) . “bb-post.php’>n”;

    bb_load_template( ‘post-form.php’, array(‘h2’ => $h2) );

    bb_nonce_field( is_topic() ? ‘create-post_’ . $topic->topic_id : ‘create-topic’ );

    if ( is_forum() )

    echo “<input type=’hidden’ name=’forum_id’ value=’$forum->forum_id’ />n”;

    else if ( is_topic() )

    echo “<input type=’hidden’ name=’topic_id’ value=’$topic->topic_id’ />n”;

    do_action(‘post_form’);

    echo “n</form>”;

    } elseif ( !bb_is_user_logged_in() ) {

    echo ‘<p>’;

    printf(__(‘You must log in to post.’), attribute_escape( bb_get_option(‘uri’) . ‘bb-login.php’ ));

    echo ‘</p>’;

    }

    do_action(‘post_post_form’);

    }

    this is the last piece of the puzzle for me :D

    #59301

    In reply to: Custom fields

    fel64
    Member

    You can use a hook to add an input field. Your code would look something like this:

    add_action('post_form', 'addmyinputfield');

    function addmyinputfield() {
    echo '<input type="text" name="mine" id="mine" />';
    }

    You would need another hook to then get the value when it’s been posted. I’m not sure about this one, but I think the hook would be pre_post. Again you use it in the same way as above: add_action('hook_name', 'function_name'); There’s a list of hooks here, http://bbpulp.org/wiki/API/actions if that wasn’t the one you wanted. Maybe post_form_pre_post?

    #59211
    fel64
    Member

    It’s in front-page.php at the very bottom. You can see at the start it checks if $forums is set, and if it isn’t (line 75, where it says else : $forums) it delivers the page to make a new topic (and in the background $forums isn’t set if the url has ?new=1). That’s where the post_form() is too. Finding that one out took a while :P

    I don’t know. Where is the you must log in to post text?

    #59210
    outchy
    Member

    sweet, thanks.

    now the only one i’m getting hung up on is the “add new topic” page because the page url is http://www.example.com/bbpress/?new=1 and i can’t see which page that actually is referring to (i can usually see something like “/topic.php?id=35&page&replies=2” in the url to know what page to edit. i know the actual form itself resides in post-form.php but the <h2> i’m trying to alter isn’t actually in that file. same goes with the line breaks before it, they would go in the same place.

    i can see where it is in the template-functions.php:

    elseif ( is_bb_tag() || is_front() )

    $h2 = __(‘Add New Topic’);

    i simply can’t find it elsewhere in the code and i’m going mad and blind!

    all your help is much appreciated.

    ps: one more thing! do you know where would i change the “you must log in to post” text?

    #59209
    fel64
    Member

    You do the same thing, but in different templates. If you look at the code, if $h2 is empty (ie. you didn’t tell it what to set) then it checks where it is – in a topic, in a forum, on a tag page or on the front page. But you can always tell it what to put instead. So if you want something else on a tag page, open the tag pages (tags.php, tag-single.php I think) in your template, look for <?php post_form(); ?> and change it to <?php post_form('No pizza for you!'); ?>. That’s a change that will happen only on the pages whose template you modified.

    To add line breaks in HTML you use <br />. But I’m not sure you can have that inside an <h2> element. You can probably just put that right above the <?php post_form(); ?>, like so:

    <br />
    <br />
    <?php post_form('Macaroni Cheese'); ?>

    #59284
    fel64
    Member

    Thanks for posting it here anyway :) bugs go on trac for fixing, and this particular one’s already been addressed. I can’t tell if it went into the latest version (.8.2.1) or not but it should be fixed in trunk.

    #56713

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    Hi, the error you are reporting appears to be a problem with the bbPress core code, specifically the user ‘capabilities’ class.

    Have I understood this correct:

    – You are using the latest bbPress version (0.8.2.1) ?

    – The error only appeared AFTER you upgraded to the latest Avatar Upload plugin to version (0.6.2)?

    – Does the error appear on EVERY page, or just the Avatar Upload template in the profile area?

    #59287
    _ck_
    Participant

    Ah I totally forgot I’ve got visitor tracking which adds some calls but doesn’t explain why it’s more than a dozen calls by design.

    If anyone’s interested, I’ve ported the “query diagnostics” plugin from wordpress so you can see each mysql call used, hidden as a report at the end of each page (for administrators).

    <?php

    /*
    Plugin Name: bb-benchmark
    Plugin URI: http://CKon.WordPress.com
    Version: 0.10
    Description: Prints simple benchmarks and mysql diagnostics, hidden in page footers.
    based on Jerome Lavigne's Query Diagnostics for WordPress http://vapourtrails.ca/wp-plugins
    Author: _ck_
    Author URI: http://CKon.WordPress.com
    */

    /* INSTRUCTIONS:

    1. add this line to your bbpress config.php file: @define('SAVEQUERIES', true);
    2. install & activate plugin
    3. do a "view source" on any bbpress page to see hidden results at bottom

    */

    function bb_benchmark_output() {
    if (bb_current_user_can( 'administrate' ) ) :
    if (SAVEQUERIES) :
    global $bbdb;
    echo "<!-- n === benchmark & query results === n ";

    while($qposition < $bbdb->num_queries){
    $qsubtime=$bbdb->queries[$qposition][1];
    if ($qsubtime>$qmaxtime) {$qmaxtime=$qsubtime;$qmaxquery=$bbdb->queries[$qposition][0];}
    $qtotal += $qsubtime;
    $qposition++;
    }

    $timer_stop=bb_timer_stop(0);

    echo @shell_exec("uptime")."n";
    echo "query count: ".$bbdb->num_queries." nn";
    echo "total query time: ".round($qtotal,4)." seconds nn";
    echo "total page time: ".round($timer_stop,4)." seconds.nn";
    echo "page render difference: ".(round($timer_stop-$qtotal,4))." seconds nn";
    echo "slowest call was: ".$qmaxquery."n at ".round($qmaxtime,4)." seconds nn";

    if (phpversion() >5.0 && function_exists(memory_get_peak_usage()) && function_exists(memory_get_usage())) {
    echo "nn === memory usage === n";
    echo "peak memory ".memory_get_peak_usage()." nn";
    echo "total memory ".memory_get_usage()." nn";
    }

    // echo "nn === resource usage === n";
    // print_r (getrusage());

    echo "nn === mysql queries used === n";
    print_r($bbdb->queries);

    echo "-->";
    endif;
    endif;
    }

    add_action('bb_foot', 'bb_benchmark_output');

    ?>

    #59286
    _ck_
    Participant

    If it makes you feel any better, wordpress doesn’t deal with it well either.

    I have to trick it into enforcing trailing slashes like this:

    RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteCond %{REQUEST_URI} !..+$
    RewriteCond %{REQUEST_URI} !/$
    RewriteRule (.*) $1/ [R=301,L,QSA]

    and that doesn’t even work half the time depending on what other htaccess trickery I’ve got going on

    But I notice if I have slugs turned on in bbpress, it will remove the trailing slash always. If I have slugs turned off, it won’t tolerate a trailing slash at all and will 404

    I did manage to get the topmost rss feed to tolerate slash or not using this obvious mod

    RewriteRule ^rss(/|)$ /forums/rss.php [L,QSA]

    One thing that is important to do in bbpress vs how it’s typically done in wordpress, is not re-use/re-load the bbpress core engine if there is a redirect (which doubles the mysql calls) but to try to do it through htaccess

    #56712

    In reply to: Plugin: Avatar Upload

    Detective
    Member

    Hi,

    I just upgraded to the last version and now my forum prints this message:

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'stdClass::has_cap' was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘stdClass::has_cap’ was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘stdClass::has_cap’ was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘stdClass::has_cap’ was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Sadly i don’t know what it is. :(

    #59041
    sailorman
    Member

    Thank you :)

    #2134
    kehlers
    Member

    I’m not sure if this is a bug, or just something I have wrong, but my husband noticed it right away. I missed it even though I’ve been working with bbPress for several weeks and have installed it on three different sites! LOL

    Anyhow, it’s a relatively minor issue, but has anyone seen this?

    When a user registers, the success message reads “Your registration as was successful…”. I thought it was a simple typo, but when I looked at the code it goes like this:

    <?php printf(__('Your registration as <strong>%s</strong> was successful. Within a few minutes you should receive an email with your password.'), $user_login) ?>

    BTW, I have the same result when I register on this support forum. I think the main issue is that the variable $user_login, created in register.php, is no longer available after bb_load_template( 'register-success.php' );.

    Does anyone know if there is a variable containing this info? Since the user is not logged in at that time, I can’t use any of the current user info. As I said, this is quite minor – the success message would be almost as good without the user login ID in there.

    tisme
    Member

    eh, sorry I was trying to say: “I’m not going to modify a production core” ;-)

    fel64
    Member

    yes, I’m not giong to modify a core

    buh – do I misunderstand you? You just modified a core file. template-tags.php is as core as anything else.

    But yes, submitting this as a feature request on trac I think is a good idea. :)

    #59040
    fel64
    Member

    Log In with the account you use here, then click New Ticket and describe the problem. :)

    #59207
    fel64
    Member

    Cool. You’ll find it is an improvement. :)

    That’s really simple. Just change post_form() to post_form('Take some Pizza') or whatever else you want in there.

    (The only reason I know this is I looked into template-functions.php and searched for post_form, then saw this:

    function post_form( $h2 = '' ) {

    which tells me it wants $h2 as an argument. $h2 is the <h2>text here</h2> as you can imagine.)

    #2133
    EgyptUrnash
    Member

    Hey all, I’m trying to commit a plugin I built and failing. Any help would be appreciated.

    I’m using the command-line client, version 1.4.2. This is the sequence I’m doing:

    > svn co http://plugins-svn.bbpress.org/textile/
    bbpress-textile

    A bbpress-textile/trunk
    A bbpress-textile/branches
    A bbpress-textile/tags
    Checked out revision 506.

    ( finder: copy my files from the bbpress directory
    I initially developed them in to bbpress-textile/trunk )

    > cd bbpress-textile/trunk
    > ls
    readme.txt textile textile.php

    > svn add *
    A readme.txt
    A textile
    A textile/classTextile.php
    A textile.php

    > svn ci -m "Initial commit." --username egypturnash
    --password [REDACTED]

    Adding trunk/readme.txt
    svn: Commit failed (details follow):
    svn: CHECKOUT of '/!svn/ver/490/textile/trunk':
    403 Forbidden (http://plugins-svn.bbpress.org)

    …and then I’m left puzzled, since I’m not _trying_ to do a checkout. I’ve fiddled with subversion on my local machine, but never tried doing a remote commit with it. Any suggestions? I get the same error if I try doing it up in the main source-controlled directory.

    (And yes, I did get the email saying my plugin hosting request has been approved. *grin*)

    tisme
    Member

    yay, now it works completely as a plugin without having to modify a template in several places! thank you.

    it’s interesting, I’ve tried to change echo output to:

    echo apply_filters('post_time', _bb_time_function_return( $time, $args ));

    but that gave me post time in the following format: 2007-07-19 00:00:00

    I would never get it myself that I should apply_filter() with a bogus (new, not used) tag (like ‘tpl_post_time’).

    topic_class() is called in the template just before topics list displayed (* is a typo).

    yes, I’m not giong to modify a core –> could possibly be a trouble on upgrade etc, I see.

    much better would be to submit a patch to post_time() ;-)

    #59206
    outchy
    Member

    i got the upgrade to work, thank you for your advice. and your php code worked great. now the only thing i need to know is, how do i change the word “reply” to “post a reply” without altering the template-functions.php? or any other predetermined text for that matter?

    fel64
    Member

    The difference between actions and filters is unclear. In principle, filters are supposed to let you modify data and actions give you a chance to respond to events. This is reflected most in the fact that with a filter, you have to return some data which will be used instead of the data given to you in the first place. For actions, you don’t.

    The syntax is this:

    do_action('action_name', [$argument1, [$argument 2 [...]]]);
    apply_filters('filter_name', [$argument1, [$argument 2 [...]]]);

    I don’t recommend making changes to the core, of course. But if you have to, you would change the last line of topic_time() from this:

    echo _bb_time_function_return( $time, $args );

    to this:

    echo apply_filters('template_time', _bb_time_function_return( $time, $args ));

    and then change the line in the plugin further up to this:

    add_filter('template_time', 'freshness_latestlink', 101);

    taking out the // that comment it out. Also, I’m not sure what topic_class*() is?

    But yeah, don’t modify the core. Much better to stick to the template change from above. :)

Viewing 25 results - 29,601 through 29,625 (of 32,432 total)
Skip to toolbar