Search Results for 'forum css'
-
Search Results
-
Topic: newbie css customisation
hey guys,
i have little coding experience, i could do a fair pimp of my myspace page but that’s about it – this php stuff is all new to me. I’ve just installed bbpress as a subdirectory of my wordpress blog, and I want to do something really simple: I want to change the color of the rollovers when you mouse over the forum topic. On this guide I read, it said to change this line:
#latest tr:hover, #forumlist tr:hover, #favorites tr:hover { background: #330099; }
(specifically, the ‘background’ tag), but as you can see, although I’ve entered in a bright color and re-uploaded the style.css file, it remains a vague greyish sorta color.. where am I going wrong here?
Thanks in advance folks..
Hi all.
(Sorry for my bad english. I tried to be verbose in order to avoid my bad english affect your understanding)
I wrote a plug-in, in order to have the best rewrite rules (in my opinion :p ) in the world.
this plugin achieves two things:
One: I need to show, in the URL, the logical parent-to-child relation between forums and topics, so
http://www.example.com/bbpress/topic/my-sweet-dog
URL has to show the forum that contains the topic, and become
http://www.example.com/bbpress/forum/pets-discussions/topic/my-sweet-dog
when performing the rewrite, the rules totally ignore the forum part, so it’s only a visual thing.
and, more difficult,
Two: I need to shorten the URL and have fewer subdirectories, so
http://www.example.com/bbpress/forum/pets-discussions/topic/my-sweet-dog
has to lose the useless “/forum/” and the useless “/topic/” parts, and become
http://www.example.com/bbpress/pets-discussions/my-sweet-dog
ATTENTION: you cannot do the second thing without the first thing. you must be able, in rewrite rules, to discriminate between a topic and a forum. you then will have that forums have one string (the forum slugged name), while topics have two strings (the forum slugged name and the topic slugged name), so you can do that, and /pets-discussion/my-sweet-dog will belong to “My Sweet Dog” topic in “Pets Discussions” forum
In order to do so, I need to
– modify forum link creation
– modify topic link creation
– modify rewrite rules
– avoid a forum to have a reserved name, as using bbpressfolder/forumname to reach a forum is risky! I have to prevent a forum from having a slugged name like “bb-admin”!!! here’s a list of reserved words:
– all words with a dot. those are files, like style.css and so on. the slugged names never have a dot. I have only to avoid rewrite of dotted words.
– all bbpress subfolders and special folders. these are all that start with
bb-* , my-*
– every other reserved word already used by rewrite engine:
tag, profiles, view, rss
All this is achieved adding a “r-” string in front of the slugged string. so a forum named “My Forum!” will have “r-my-forum” as slugged name. Unfortunately, this filter operates also for topic names and maybe other things. this mean that a topic named “rss” will have “r-rss” as slugged name. Not so bad, in facts.
So these are the operations:
– add a filter to get_forum_link (delete the “/forum” part)
– add a filter to get_topic_link (add the “forum/slug-forum-name” in the link, and eliminate the “/forum” and “/topic” parts)
– modify the rewrite rules (I used IIS isapirewrite, but apache is pretty the same)
– add a filter to bb_slug_sanitize (avoid a forum to have a reserved word as slugged-name, like “rss”, “profiles”, “my-plugins”, etc
And there is the code for these operations:
function my_get_forum_link_filter( $link , $forum_id = 0 ) {
//retrieve the forum object
$forum = get_forum( get_forum_id( $forum_id ));
//check for rewrite
$rewrite = bb_get_option( 'mod_rewrite' );
if ( $rewrite ) {
//what kind of rewrite there is? slug use "forum_slug" column, else the column is "forum_id"
$column = ($rewrite === 'slugs')?('forum_slug')'forum_id');
// change /forum/pets-discussions in /pets-discussions
// this work only if the rewrite module is modded!
// and this work only if the slugged name will NEVER
// be a reserved word like "rss" or "bb-images"
// and this is achieved by a filter on bb_slug_sanitize
$link = str_replace('forum/' . $forum->$column , $forum->$column, $link);
}
return $link; // Very important line!
}
add_filter( 'get_forum_link', 'my_get_forum_link_filter' );
function my_get_topic_link_filter( $link, $topic_id = 0) {
//retrieve the topic object
$topic = get_topic( get_topic_id( $topic_id ));
//retrieve the forum object that is the topic container
$forum = get_forum( get_forum_id( $topic->forum_id ));
//check for rewrite
$rewrite = bb_get_option( 'mod_rewrite' );
if ( $rewrite ) {
//what kind of rewrite there is? slug use "forum_slug" column, else the column is "forum_id"
$column = ($rewrite === 'slugs')?('forum_slug')'forum_id');
//create the "forum/pets-discussions" chunk to show the hierarchical relation forum->topic
$forum_nice_uri = "forum/" . $forum->$column . "/";
//attach the hierarchical chunk to the link
$link = str_replace(bb_get_option('uri'), bb_get_option('uri') . $forum_nice_uri, $link);
// change /forum/pets-discussions/topic/my-sweet-dog in /pets-discussions/my-sweet-dog
// this work only if the rewrite module is modded!
// and this work only if the slugged name will NEVER
// be a reserved word like "rss" or "bb-images"
// and this is achieved by a filter on bb_slug_sanitize
$link = str_replace('forum/' . $forum->$column , $forum->$column, $link);
$link = str_replace('topic/' . $topic->$column , $topic->$column, $link);
}
return $link; // Very important line!
}
add_filter( 'get_topic_link', 'my_get_topic_link_filter' );
function my_bb_slug_sanitize_filter( $text_slug, $text_original = '', $length = 0 ) {
// add "r-" by regex when the string begins with "bb-" or "my-" or is a reserved word
return preg_replace('/^(my-.*|bb-.*|rss|tags|view|profiles)$/', 'r-$1', $text_slug);
}
add_filter( 'bb_slug_sanitize', 'my_bb_slug_sanitize_filter' );And there’s the rewrite rules! ATTENTION!!!!! these rules are for IIS isapirewrite, so these are to be modded to work with apache! sorry but I don’t have any apache installation to play with. It’s a simple task, anyway. Every regex guru and regex accolite can do that. Even a regex wannabe can find out googling.
# first we rewrite the pages for normal slug-rewrite usage
RewriteRule /bbpress/tags/([^/?]+)/page/([0-9]+)(??(.*))? /forum2/tags.php?tag=$1&page=$2?3&$3: [I,L]
RewriteRule /bbpress/tags/([^/?]+)/?(??(.*))? /forum2/tags.php?tag=$1?2&$2: [I,L]
RewriteRule /bbpress/tags/?(??(.*))? /forum2/tags.php(?1?$1:) [I,L]
RewriteRule /bbpress/profile/([^/?]+)/page/([0-9]+)(??(.*))? /forum2/profile.php?id=$1&page=$2?3&$3: [I,L]
RewriteRule /bbpress/profile/([^/?]+)/([a-z-]+)(??(.*))? /forum2/profile.php?id=$1&tab=$2?3&$3: [I,L]
RewriteRule /bbpress/profile/([^/?]+)/([a-z-]+)/page/([0-9]+)(??(.*))? /forum2/profile.php?id=$1&tab=$2&page=$3?4&$4: [I,L]
RewriteRule /bbpress/profile/([^/?]+)/?(??(.*))? /forum2/profile.php?id=$1?2&$2: [I,L]
RewriteRule /bbpress/view/([a-z-]+)/page/([0-9]+)(??(.*))? /forum2/view.php?view=$1&page=$2?3&$3: [I,L]
RewriteRule /bbpress/view/([a-z-]+)(??(.*))? /forum2/view.php?view=$1?2&$2: [I,L]
RewriteRule /bbpress/rss/(??(.*))? /forum2/rss.php?1&$1: [I,L]
RewriteRule /bbpress/rss/forum/([0-9]+)(??(.*))? /forum2/rss.php?forum=$1?2&$2: [I,L]
RewriteRule /bbpress/rss/topic/([0-9]+)(??(.*))? /forum2/rss.php?topic=$1?2&$2: [I,L]
RewriteRule /bbpress/rss/tags/([a-z-]+)(??(.*))? /forum2/rss.php?tag=$1?2&$2: [I,L]
RewriteRule /bbpress/rss/profile/([0-9]+)(??(.*))? /forum2/rss.php?profile=$1?2&$2: [I,L]
# then we have a rule for special words, so they are left as they are, and the isapi module does not proceed further
RewriteRule /bbpress/(my-.*|bb-.*|rss|tags|view|profiles)(/.*)? /forum2/$1$2 [I,L]
# then we have the forum and topic rules.
# ATTENTION: we DO NOT rewrite a dottet word, because dotted words can be files like style.css and so on
# before there are the topic rewrites, that are longer
# ATTENTION: note that the forum name is totally skipped trough ?: notation. In facts, bbpress doesn't need the forum name when reading a topic
RewriteRule /bbpress/(?:[^./?]+)/([^./?]+)/page/([0-9]+)(??(.*))? /forum2/topic.php?id=$1&page=$2?3&$3: [I,L]
RewriteRule /bbpress/(?:[^./?]+)/([^./?]+)/?(??(.*))? /forum2/topic.php?id=$1?2&$2: [I,L]
# and after there are the forum rewrites, that are shorter
RewriteRule /bbpress/([^./?]+)/page/([0-9]+)(??(.*))? /forum2/forum.php?id=$1&page=$2?3&$3: [I,L]
RewriteRule /bbpress/([^./?]+)/?(??(.*))? /forum2/forum.php?id=$1?2&$2: [I,L]
And that’s all. I hope someone can use this plugin
Gus
email: shiawase at gmail dot com
Hello. I’m always interested when a new forum crops up. Just some comments about what I’ve seen just by having a quick look in regards to a standards-based approach to design. Please don’t take this personal at all. These are just my personal observations.
1. I notice that you’re serving the forum as XHTML 1.1 with a content type of text/html, regardless of the user agent. I thought maybe that you were attempting content negotiation, but I see that’s not the case, unfortunately.
2. Inline styling is used for the “tag cloud” could cause more maintenance down the road. Consider using CSS styles.
3. The table you are using for the listing of topics for a forum can be improved in terms of accessibility. (summary, caption, scope, etc)
4. Anyone with a colour deficiency might have an issue differentiation between the topics. The contrast between the white and the light grey is a bit subtle.
5. Title attributes could be used more than it is now. (Especially in the topic table)
6. For the most part, the HTML and CSS validate, with the exceptions of such things like <br clear=”all” />
That’s just a quick glance. Again, take this with a grain of salt. I’m just genuinely interested in any new forums that come out. Over all, not too bad of a job.
Regards,
crazybat (aka Marco)
Hi.
This is probably a very simple question, but I couldn’t find an easy straight answer.
What code should I add (to the header.php and the style.css), in order to get a nice manu for the forum ?
(I am using the style-rtl.css)
( I just wish people to be able to navigate back to my blog, and to the search page).
Thanks,
Tal.