Skip to:
Content
Pages
Categories
Search
Top
Bottom

current bbpress support forum template – time for update?


  • _ck_
    Participant

    @_ck_

    Any chance you’ll switch to the new wider template here?

    Narrow templates require too much up/down action and look kinda 1990′s-ish – might be turning off some potential new <s>victims</s> users.

    Also, did the overflow:auto get removed for posts? I am noticing this week that posts with wide code seem to be overflow:hidden and the text gets cut off. Didn’t do that before… used to get scroll arrows…

Viewing 16 replies - 1 through 16 (of 16 total)
  • You mean having a template that is completely ‘auto’ driven so that it adjusts to each browser window width? I know that I constantly get users a little mad at me because I like ‘big resolution’ on my computers and my users are still at 800 X 600 screens so my sites have a tendency to have to be scrolled. ;)

    Not sure about the overflow as I don’t use the default theme myself. Anyone else?

    Trent


    _ck_
    Participant

    @_ck_

    I guess I meant Kakumei which will use either 800×600 or 1024×768 much more appropriately than this old layout.

    This layout isn’t even 800×600, it’s 600px wide, not because there is a sidebar or anything, just because.

    There’s no-one left using 640×480. If they are using a mobile browser they can just use the rss feeds and a converter.

    Wait are you saying we can change the theme here ourselves? I guess you really meant on your own site(s).

    Ah….here! That would make sense for sure since even the wordpress.com forums are using a larger layout for posts! I will pass it along up the chain!

    Trent


    _ck_
    Participant

    @_ck_

    Yeah the only problem I can foresee is that the plugin browser looks like a semi-custom job and I am uncertain if it’s hard coded into the template.

    (In other news I finally figured out how to use SVN last night and posted my two little plugins directly… we’ll need to have a “100 plugins party” when bbpress hits that many… ;-)

    Changing the width of the theme is easy; all it takes is a single change in a CSS file. If they hard-coded the width into the HTML, they deserve the extra work. :P

    I think that if you use they backticks on an inline basis the overflow is hidden, but if you use it for paragraphs (specifically: backtick is in line above your code, I think) the overflow remains.

    For example, a really long path like var/www.mywebsite.com/htdocs/wordpress/bbpress/bb-includes/template-functions.php or whatever will be cut off. If there had been spaces, it should wrap.

    But a paragraph of code will have the scrollbar.

    <?php
    /*
    Plugin Name: o/
    */
    function withareallylongnamethatjustneverstopsandthefunctiondoesn'tevendoanythinguseful() {
    return true;
    }

    +1 for wider (800px) template.

    also, default “Reply” input textarea is too small (get scrolled) and

    ‘background: url(images/bg.png) #ccc fixed center top;’ makes it somewhat slow.

    so far, wp.com forums layout by the Matt Thomas is the best layout of all bb forums I had a chance to see.

    nice addition would be to have a link to the “Latest Post” on the front page/forum posts index table — it’s a matter of just a couple of lines to be added to the front-page.php/forum.php — makes a big deal to quickly get on a last post of multi-page posts w/o having to redundantly load a 1st page of the thread.

    I wrote a plugin to do that. Just upload and activate this.

    <?php
    /*
    Plugin Name: Page &raquo;
    Plugin URI:
    Description: Adds &raquo; to the end of topic titles, linking to latest post.
    Author: fel64
    Version: 0.7
    Author URI: http://www.loinhead.net/
    */

    if (!function_exists('is_tags')) {
    function is_tags()
    {
    return is_tag();
    }
    }

    if (is_front() || is_forum() || is_tags()) {
    add_filter('topic_title', 'fel_addlatestlink', 101);
    }

    function fel_addlatestlink($title)
    {
    global $topic;
    $felgtlpl = get_topic_last_post_link($topic->topic_id);
    $title = $title . ' <a href="' . $felgtlpl . '">&nbsp;&raquo;&nbsp;</a>';

    return $title;
    }
    ?>

    oh, implementing this as a plugin even cooler, thank you!

    is it possible modify it by a similar way just a little bit, so that “Topic Freshness” (topic_time() ?) would return a hyper-link to the topic_last_post_link()?

    Ooh. Probably. Nice idea.

    <?php
    /*
    Plugin Name: Freshlink
    Description: Turns freshness into a link to the latest post
    Author: tisme, fel64
    */
    function freshness_latestlink( $fresh ) {
    global $topic;
    $felgtlpl = get_topic_last_post_link($topic->topic_id);
    return "<a href='$felgtlpl'>$fresh</a>";
    }

    //add_filter('', 'freshness_latestlink', 101);
    ?>

    Unfortunately there doesn’t seem to be a filter for it – only for modifying the actual time, not the text output. Since topic_time() also directly writes to the HTML, you can’t modify it first. You have to change the template, from

    <?php topic_time(); ?>

    to

    <?php echo freshness_latestlink( get_topic_time() ); ?>

    > You have to change the template

    he-he that’s what I *had to* do initially. so, it appears not all the template_functions.php are ‘pluggable’.

    could the actual template be remade in such a way that most functions it uses everywhere (like post_time) to be pluggable (like the post_title), or it’s too late on the template level and core post_time() has to be modified to allow formatting filters to be applied?

    In principle it’s possible to do so by replacing all the template functions with custom functions that call a custom filter first, but it probably wouldn’t work out overall (not everyone would do it, plugins would still have to be written for forums without this, changes to the core would have to be replicated …).

    Probably better to say that not all functions have _hooks_ or _filters_, since pluggable refers to them being overwritable with another function (see bb-includes/pluggable.php). :)

    You could request this in trac I suppose. Might be quite a decent feature in the future.

    > Probably better to say that not all functions have _hooks_ or _filters_, since pluggable refers to them being overwritable with another function (see bb-includes/pluggable.php). :)

    oh, yes right you are, thanks for pointing that out!

    so, evidently post_time() just doesn’t have a hook to callback our custom filter. I failed to modify it by the proper way.

    fel, could you please show me how it should be modified to have an apply_filter hook?

    PS

    couldn’t get the subtle difference between ‘filters’ and ‘actions’:

    > *Actions* Your plugin can respond to the event by executing a PHP function, which might do one or more of the following:

    Modify what is displayed in the browser screen (admin or end-user)

    > *Filters* are functions that WordPress passes data through, at certain points in execution, just before taking some action with the data (such as adding it to the database or sending it to the browser screen).

    which filter or action for instance could be added to the topic_class*() if any?

    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. :)

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

    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. :)

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

Viewing 16 replies - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.