Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add CSS to user pages

  • Loading branch information...
commit 3d82ae06a8bb6bf8af3bcab0b479238b42f20e57 1 parent 0882c77
Scott authored
20 qa-plugin.php
View
@@ -32,3 +32,23 @@
qa_register_plugin_module('page', 'qa-user-activity.php', 'qa_user_activity', 'User Activity Plus');
qa_register_plugin_layer('qa-uact-layer.php', 'User Activity Layer');
qa_register_plugin_phrases('qa-uact-lang-*.php', 'useractivity');
+
+
+
+/* worker functions */
+
+function uact_css()
+{
+ return
+ "<style>\n" .
+ ".qa-useract-page-links { margin: 16px 0; color: #555753; font-size: 16px; text-align: center; }\n" .
+ ".qa-useract-page-links > a { font-weight: bold; }\n" .
+ ".qa-useract-stats { margin: 8px 0; text-align: center; }\n" .
+ ".qa-useract-stat { display: inline-block; margin: 0 16px 8px; }\n" .
+ ".qa-useract-count { font-size: 18px; font-weight: bold; }\n" .
+ ".qa-useract-wrapper .qa-q-item-main { width: 658px; }\n" .
+ ".qa-useract-wrapper .qa-a-count { height: auto; border: 1px solid #ebeaca; border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius:8px; }\n" .
+ ".qa-useract-wrapper .qa-a-snippet { margin-top: 2px; color: #555753; }\n" .
+ ".qa-useract-wrapper .qa-q-item-meta { float: none; }\n" .
+ "</style>\n\n";
+}
9 qa-uact-layer.php
View
@@ -6,6 +6,15 @@
class qa_html_theme_layer extends qa_html_theme_base
{
+ function head_css()
+ {
+ parent::head_css();
+ if ( $this->template === 'user' )
+ {
+ $this->output( uact_css() );
+ }
+ }
+
function q_list_and_form($q_list)
{
qa_html_theme_base::q_list_and_form($q_list);
16 qa-user-activity.php
View
@@ -88,21 +88,7 @@ function process_request( $request )
// display CSS for stat summary
if ( !$hidecss )
- {
- $qa_content['custom'] =
- "<style>\n" .
- ".qa-useract-page-links { margin: 16px 0; color: #555753; font-size: 16px; text-align: center; }\n" .
- ".qa-useract-page-links > a { font-weight: bold; }\n" .
- ".qa-useract-stats { margin: 8px 0; text-align: center; }\n" .
- ".qa-useract-stat { display: inline-block; margin: 0 16px 8px; }\n" .
- ".qa-useract-count { font-size: 18px; font-weight: bold; }\n" .
- ".qa-useract-wrapper .qa-q-item-main { width: 658px; }\n" .
- ".qa-useract-wrapper .qa-a-count { height: auto; border: 1px solid #ebeaca; border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius:8px; }\n" .
- ".qa-useract-wrapper .qa-a-snippet { margin-top: 2px; color: #555753; }\n" .
- ".qa-useract-wrapper .qa-q-item-meta { float: none; }\n" .
- "</style>\n\n";
- }
-
+ $qa_content['custom'] = uact_css();
// list of questions by this user
if ( $post_type === 'questions' )
1  sample.css
View
@@ -1,4 +1,3 @@
-
/* User Activity plugin */
.qa-useract-page-links {
Please sign in to comment.
Something went wrong with that request. Please try again.