Skip to:
Content
Pages
Categories
Search
Top
Bottom

One for Sam? Core/Theme discrepancy


  • michael3185
    Member

    @michael3185

    Using 0.9.0.5, I created a custom theme, doing it as instructed by copying template files into a my-templates/my-theme folder. I then created a new ‘role’ as one thread suggested, by modifying capabilities.php. No problems, and all works well.

    For the Guest role I added, I allowed them to post replies, but not create new topics. Then I noticed that ‘Create Topic’ was showing on the topics page, but with no input area beneath it. I went through the theme template files over and over, but couldn’t find out where the [H2]Create Topic[/h2] (and similar for Reply) were. Odd. I finally tracked it down to a function in template-functions.php, around lines 136 – 142, where the titles are output, and then the post page called.

    What this means is that A) the titles are not part of the post form (ie input area), and B) a theme can’t be properly customised without hacking a core file, which will then be overwritten by an upgrade. I’ve hacked my template-functions.php, and will have to do so again when I upgrade. The good thing is that my theme template files now have the titles where they ought to be, and they can be easy customised.

    I didn’t want to mess with the template-functions.php code in case I broke it, so I just remmed out the follow line, then added the titles to post-form.php and topic.php;

    // echo ‘<h2 class=”post-form”>’ . $h2 . ‘</h2>’ . “n”;

    I don’t know if this has been changed in 1.0, but don’t you think it should be? I realise that the ‘role’ change I made hacked a core file, but at least upgrading to 1.0 (when it’s marked as stable) will give me proper roles.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey Michael – I struggled with something similar, but then I found a plugin by ck which enabled this… along with some suggested template tweaks which allow you to hide the posting link if you’re not allowed to post:

    https://bbpress.org/plugins/topic/read-only-forums/#post-1025

    Not sure if that touches on what you were asking about… but thought I’d share the link in case it was helpful!


    michael3185
    Member

    @michael3185

    Thanks for the link johnhiler. I did pretty much the same thing _ck_ did some time back, but it’s not really a proper fix. It would take only a minute or two at most to make this good.

    Essentially, the titles for creating a New Topic or posting a Reply should be in the templates. That way, a custom theme can change the text and also alter the font/size, etc. Makes perfect sense.

    Come on Sam, delete the line I REMed and chuck the titles into post-form.php and topic.php – you know it makes sense!


    Sam Bauers
    Participant

    @sambauers

    Try this…

    post_form( array( 'h2'  => 'Woot!' ) );


    michael3185
    Member

    @michael3185

    Cheers Sam, buuut… Don’t you think just putting the H2 titles in the appropriate templates makes more sense? I guess I could put;

    post_form( array( ‘h2’ => ” ) );

    here and there, but it’s adding stuff where I shouldn’t need to.

    Surely putting the H2s in the relevant templates makes more sense, as they can be edited once and forgotten? Having the H2 titles appear by default – and outside of the templates – makes no sense to me at all. Mind you, I didn’t write bbPress, so it’s only a suggestion. :)

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar