Info
- 19 posts
- 4 voices
- Started 1 year ago by amandalin
- Latest reply from softinfo
- This topic is resolved
Highlight specific forum in the flow of other forums...
-
- Posted 1 year ago #
I want to highlight background and font properties for a specific forum in front page, with the flow of other forums by css control.
If you are user of freelacer site. you can easily understand this question.
See the example - ScreenshotIt would be also great if possible to highlight specific post or topic.
in my case what I need - See the other Screenshot
Thanks
-
- Posted 1 year ago #
Day Passed..Sorry for bumping
Nobody have answer?Zaerl, you must have :), if you are listening to me.
-
- Posted 1 year ago #
Hi Softinfo,
i think it is possible to write a small php script to use the forum-id or the forum-name as css class.
From the standard theme:
<tr class="bb-category bb-parent bb-follows-niece bb-root alt "></tr>
Here you can add the new class. Then you can use the CSS class analogous to the standard class "alt".
Greets Markus
black-forever
- http://black-forever.de
- http://twitter.com/blackforever_de -
- Posted 1 year ago #
sorry..i'm new here!
-
- Posted 1 year ago #
Markus Pezold thanks brother for your interest...
I'm looking forward to that small php script, which you've mentioned.
Can you write that code? -
- Posted 1 year ago #
Hi softinfo,
give me a few hours - i'll post an example.
Which template do you use? -
- Posted 1 year ago #
Markus Pezold take your time brother..
It will be my pleasure to wait your next post.Well, I'm using a custom theme. Its not available on internet.
But If you want from me to show off my template code, then please tell me. -
- Posted 1 year ago #
Ok - here is a small "solution" :)
For a specific forum you can use this code.
Put this in the front-page-php:id="forum_<?php echo get_forum_id()?>"_________________________________
Here is the example with the standard theme kakumei
<?php if ( bb_forums() ) : ?>
<h2><?php _e('Forums'); ?></h2>
<table id="forumlist"><tr>
<th><?php _e('Main Theme'); ?></th>
<th><?php _e('Topics'); ?></th>
<th><?php _e('Posts'); ?></th>
</tr>
<?php while ( bb_forum() ) : ?>
<?php if (bb_get_forum_is_category()) : ?>
<tr<?php bb_forum_class('bb-category'); ?> id="forum_<?php echo get_forum_id()?>">
<td colspan="3"><?php bb_forum_pad( '<div class="nest">' ); ?>"><?php forum_name(); ?><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
</tr>
<?php continue; endif; ?>
<tr<?php bb_forum_class(); ?> id="forum_<?php echo get_forum_id()?>>
<td><?php bb_forum_pad( '<div class="nest">' ); ?>"><?php forum_name(); ?><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
<td class="num"><?php forum_topics(); ?></td>
<td class="num"><?php forum_posts(); ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; // bb_forums() ?>So you can style with CSS the background and the font-color.
eg.#forum_1 {background-color: #ddd; color: #333} -
- Posted 1 year ago #
Zaerl, you must have :), if you are listening to me.
http://dl.dropbox.com/u/15741404/za-highlight.php
Change the 4 global vars:
$za_highlight_topics = array();
$za_highlight_topic_class = '';
$za_highlight_forums = array();
$za_highlight_forum_class = '';according to your needs. I do not provide support for this plugin.
-
- Posted 1 year ago #
For specific topics and post you can use:
get_topic_id();
post_id();Here you'll find the incomplete documentation:
http://bbpress.org/documentation/template-tagsBut I think for posts and topics there must be another, better solution. No one wants to write their own CSS definition for each ID. :)
Maybe it is better to use a term from the tagging to create the unique look of some Posts.
-
- Posted 1 year ago #
Hi Zaerl,
I see - your plugin is a better and bigger way to highlight many topics and forums. :)
You hang your code to the filter topic_class. The perfect solution.
@softinfo: You must use <?php bb_forum_class(); ?> in your custom theme.
-
- Posted 1 year ago #
Hi Zaerl, You are a great person, your method is working like charm.. thanks brother..
@Markus your method is also working, thanks for your time.
- One more question, Like in WordPress you can highlight the author comments in his/her post. I'm searching the almost same way with diffident edge
In my case - usually/mostly Keymasters (Like Matt on bbPress) don't write in their forums, they are busy guys. When they will came back that would be excited to highlight them?
--- So, Is it possible to highlight a specific author/keymaster/admin's every post?I want to highlight all Keymaster's posts in my forums.
Thanks again.
S. -
- Posted 1 year ago #
Here is one solution described for all keymasters and admins:
http://bbpress.org/forums/topic/different-style-for-key-master-and-administrator-replies-1
For admins you can also do something like this:
<?php if( is_bb_admin() ) { ?> class="highlight"<?php } ?> -
- Posted 1 year ago #
For individual classes for author post you can use
class="highlight_<?php post_author_id();?>"Anonther good starting point to search:
http://phpxref.ftwr.co.uk/bbpress/nav.html?_functions/index.htmlThere are always different ways to achieve an objective. It is only a question of whether the target should be achieved easily, quickly or safely.
:)
-
- Posted 1 year ago #
Markus, thanks again and sorry that I didn't find this solution over bbpress forum before my last post.
But I think it would be great and easy if it can be achieved with Zaerl's code??
I mean we can get this solution without touching front-page.php, topic.php, post.php or other files.And it would be also great to highlight multiple authors by their ids which zearl did for topics/forums.
want something like - $za_highlight_auhors = array(1,8,55,89); ??
Possible?
-
- Posted 1 year ago #
<?php if( is_bb_admin() ) { ?> class="highlight"<?php } ?>
This is wrong Markus.is_bb_admin(which is deprecated, usebb_is_admin) returns true if the page is an administrative page. It's just a wrapper that returns the value of the BB_IS_ADMIN constant. -
- Posted 1 year ago #
Possible?
Yes. But I am pretty busy right now and I can't update my work. You can do it, the file has no license (it's public domain).
-
- Posted 1 year ago #
Oh - fault. :/ thx for correction
-
- Posted 1 year ago #
Yes. But I am pretty busy right now and I can't update my work
Zaerl I respect your time and work. Its ok.. It will try myself.
Thanks you both guys.
-
You must log in to post.