Skip to:
Content
Pages
Categories
Search
Top
Bottom

My own theme – 3 questions


  • infected
    Participant

    @infected

    Hi!

    I´m new to bbPress and try to create a theme that suites to my wp-theme. It´s based on the blank theme by refueled. At the moment i have 3 little questions:

    1) I´d like to show the amount of db-queries and the duration of loading the page in my footer. In WP i can add this information by adding a code like this <?php echo $wpdb->num_queries; ?> Queries, <?php timer_stop(1); ?> Seconds. Is there something similar in bbPress?

    2) Is there a way to display a text if a post was edited by a user? Something like “this post was last edited on X at X?

    3) The last point: In the backend i can define how long a post is editable. Is it possible to display this value somewhere above the textarea when writing a post? I´d like to add a short notice like “You can edit your post for X minutes after saving it.” The X-value should change if i change it in the backend.

    That´s it for now… :-) I hope someone can help me.

    Thanks in advance!

    infected

Viewing 10 replies - 1 through 10 (of 10 total)
  • 1. Yup, there’s something similar in bbPress! Both versions are listed here:

    https://bbpress.org/forums/topic/bbpress-faster-than-wordpress#post-20920

    2. This plugin should do the trick:

    https://bbpress.org/plugins/topic/edit-history/

    3. That’s a tough one! I don’t know how to do it. Are you going to be changing X a lot? If not, maybe it’s a pain but you could hardwire X into the template…


    infected
    Participant

    @infected

    Thanks for your reply, johnhiler!

    1) Thank you, the linked code works fine.

    2) The plugin works but this is more than i need ;-) Is it not possible to place a short text with the last date/time of edit by a template tag? By the way is there anywhere a overview about available template tags?

    3) Yes, i could hardcode it into the template. I don´t know how often i change the value yet. But everytime i change the value i also have to edit the template. So I wanted to avoid it.

    1) Glad to hear it!

    2) I don’t know… there’s no guide to template tags at this point. But a Codex with documentation will be started soon, I think. I wonder if studying the plugin might shed some light on potential tags to use…

    3) Hopefully someone else can help ya with this one! :-)


    chrishajer
    Participant

    @chrishajer

    3) You can put this in you template’s post-form.php:

    <p>You will be able to edit this reply for <?php echo bb_get_option('edit_lock'); ?> minutes after posting.</p>

    I believe that will show the number of minutes from your admin setting.

    I think it would be neat to put this next to the edit link of the reply as well, so people see that they have some amount of time they can edit, and when the message is gone, the edit link is gone. You could extend this in a lot of ways. I think the edit_lock option is the one you want though. Even neater would be to show how many minutes left before they can no longer edit their reply…

    I have no idea what happens if you exclude some users from ever locking editing on their replies (like moderators and admins.) Probably just displays the same option even though they have been exempted from the edit_lock restriction.

    A minor note: I think that if you set the edit_lock variable to -1, then members can edit their comments forever. It shouldn’t impact your echo of the edit_lock variable, since you’ll probably be setting it to positive numbers. :-) But just thought I’d mention it!


    infected
    Participant

    @infected

    @chrishajer: Thank you, that works fine!


    @johnhiler
    : You´re right. If i set the value to -1 i´m always able to edit the posts. But this is something i doesn´t really need.

    Okay, then there´s only one point left, the edit thing… I will have a look at the plugin and will see how it works.

    Although… I got one more point to figure out. It´s a css thing. At the moment this is my testforum: http://www.test.be-infected.de/forum/topic/test-der-bbcode-buttons

    If you take a look at the 2 post with the smilies in it, you can see that there´s a lot of space in this postings. I tried several things to strip this, but can´t find a solution. I think it´s the css class .threadpost that i have to edit. I know it sounds strange, but in this free space the bbsignatures plugin was showing the users signatures before. Could this relate to it?

    Any help is welcome ;-)


    deadlyhifi
    Participant

    @tomdebruin

    Hi infected,

    it looks as thought the ‘poststuff’ is the cause of the issue. If I apply a ‘float:right;’ to it everything wraps nicely.

    Try moving it within the ‘post’ class, and amending the margins and padding to suit.


    infected
    Participant

    @infected

    Well done, it seems to be working now. I had to remove the clear:both in .poststuff. Then i had to realign some paddings (for positioning the dashed borders between each post). Now it looks okay in Firefox 3, Opera 9 and IE8. I hope it looks the same in IE7… I can´t test it.

    Thanks for your help tomdebruin! Now i can go on with some other customization to suits it to my wp-theme.


    deadlyhifi
    Participant

    @tomdebruin

    Take a look at https://browserlab.adobe.com/ for basic (non interactive) testing.


    infected
    Participant

    @infected

    Thank you for the link. It looks interesting. But at the moment it seems to be full @ browserlab and they´re temporarly not accepting new users :( I´ll will try it once again later.

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