code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea { -moz-border-radius: 0 0 0 0 !important; -webkit-border-radius: 0 0 0 0 !important; background: none !important; border: 0 !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0 !important; outline: 0 !important; overflow: visible !important; padding: 0 !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: inherit !important; min-height: auto !important; } .syntaxhighlighter { width: 100% !important; margin: 1em 0 1em 0 !important; position: relative !important; overflow: auto !important; font-size: 1em !important; } .syntaxhighlighter.source { overflow: hidden !important; } .syntaxhighlighter .bold { font-weight: bold !important; } .syntaxhighlighter .italic { font-style: italic !important; } .syntaxhighlighter .line { white-space: pre !important; } .syntaxhighlighter table { width: 100% !important; } .syntaxhighlighter table caption { text-align: left !important; padding: .5em 0 0.5em 1em !important; } .syntaxhighlighter table td.code { width: 100% !important; } .syntaxhighlighter table td.code .container { position: relative !important; } .syntaxhighlighter table td.code .container textarea { box-sizing: border-box !important; position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border: none !important; background: white !important; padding-left: 1em !important; overflow: hidden !important; white-space: pre !important; } .syntaxhighlighter table td.gutter .line { text-align: right !important; padding: 0 0.5em 0 1em !important; } .syntaxhighlighter table td.code .line { padding: 0 1em !important; } .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { padding-left: 0em !important; } .syntaxhighlighter.show { display: block !important; } .syntaxhighlighter.collapsed table { display: none !important; } .syntaxhighlighter.collapsed .toolbar { padding: 0.1em 0.8em 0em 0.8em !important; font-size: 1em !important; position: static !important; width: auto !important; height: auto !important; } .syntaxhighlighter.collapsed .toolbar span { display: inline !important; margin-right: 1em !important; } .syntaxhighlighter.collapsed .toolbar span a { padding: 0 !important; display: none !important; } .syntaxhighlighter.collapsed .toolbar span a.expandSource { display: inline !important; } .syntaxhighlighter .toolbar { position: absolute !important; right: 1px !important; top: 1px !important; width: 11px !important; height: 11px !important; font-size: 10px !important; z-index: 10 !important; } .syntaxhighlighter .toolbar span.title { display: inline !important; } .syntaxhighlighter .toolbar a { display: block !important; text-align: center !important; text-decoration: none !important; padding-top: 1px !important; } .syntaxhighlighter .toolbar a.expandSource { display: none !important; } .syntaxhighlighter.ie { font-size: .9em !important; padding: 1px 0 1px 0 !important; } .syntaxhighlighter.ie .toolbar { line-height: 8px !important; } .syntaxhighlighter.ie .toolbar a { padding-top: 0px !important; } .syntaxhighlighter.printing .line.alt1 .content, .syntaxhighlighter.printing .line.alt2 .content, .syntaxhighlighter.printing .line.highlighted .number, .syntaxhighlighter.printing .line.highlighted.alt1 .content, .syntaxhighlighter.printing .line.highlighted.alt2 .content { background: none !important; } .syntaxhighlighter.printing .line .number { color: #bbbbbb !important; } .syntaxhighlighter.printing .line .content { color: black !important; } .syntaxhighlighter.printing .toolbar { display: none !important; } .syntaxhighlighter.printing a { text-decoration: none !important; } .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { color: black !important; } .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { color: #008200 !important; } .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { color: blue !important; } .syntaxhighlighter.printing .keyword { color: #006699 !important; font-weight: bold !important; } .syntaxhighlighter.printing .preprocessor { color: gray !important; } .syntaxhighlighter.printing .variable { color: #aa7700 !important; } .syntaxhighlighter.printing .value { color: #009900 !important; } .syntaxhighlighter.printing .functions { color: #ff1493 !important; } .syntaxhighlighter.printing .constants { color: #0066cc !important; } .syntaxhighlighter.printing .script { font-weight: bold !important; } .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { color: gray !important; } .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { color: #ff1493 !important; } .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { color: red !important; } .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { color: black !important; } .syntaxhighlighter { background-color: #0f192a !important; } .syntaxhighlighter .line.alt1 { background-color: #0f192a !important; } .syntaxhighlighter .line.alt2 { background-color: #0f192a !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #253e5a !important; } .syntaxhighlighter .line.highlighted.number { color: #38566f !important; } .syntaxhighlighter table caption { color: #d1edff !important; } .syntaxhighlighter .gutter { color: #afafaf !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #435a5f !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #435a5f !important; color: #0f192a !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: #428bdd !important; background: black !important; border: 1px solid #435a5f !important; } .syntaxhighlighter.collapsed .toolbar a { color: #428bdd !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: #1dc116 !important; } .syntaxhighlighter .toolbar { color: #d1edff !important; background: #435a5f !important; border: none !important; } .syntaxhighlighter .toolbar a { color: #d1edff !important; } .syntaxhighlighter .toolbar a:hover { color: #8aa6c1 !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #d1edff !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #428bdd !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #1dc116 !important; } .syntaxhighlighter .keyword { color: #b43d3d !important; } .syntaxhighlighter .preprocessor { color: #8aa6c1 !important; } .syntaxhighlighter .variable { color: #ffaa3e !important; } .syntaxhighlighter .value { color: #f7e741 !important; } .syntaxhighlighter .functions { color: #ffaa3e !important; } .syntaxhighlighter .constants { color: #e0e8ff !important; } .syntaxhighlighter .script { font-weight: bold !important; color: #b43d3d !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #f8bb00 !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: white !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #ffaa3e !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCoreMidnight.css
CSS
oos
8,680
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea { -moz-border-radius: 0 0 0 0 !important; -webkit-border-radius: 0 0 0 0 !important; background: none !important; border: 0 !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0 !important; outline: 0 !important; overflow: visible !important; padding: 0 !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: inherit !important; min-height: auto !important; } .syntaxhighlighter { width: 100% !important; margin: 1em 0 1em 0 !important; position: relative !important; overflow: auto !important; font-size: 1em !important; } .syntaxhighlighter.source { overflow: hidden !important; } .syntaxhighlighter .bold { font-weight: bold !important; } .syntaxhighlighter .italic { font-style: italic !important; } .syntaxhighlighter .line { white-space: pre !important; } .syntaxhighlighter table { width: 100% !important; } .syntaxhighlighter table caption { text-align: left !important; padding: .5em 0 0.5em 1em !important; } .syntaxhighlighter table td.code { width: 100% !important; } .syntaxhighlighter table td.code .container { position: relative !important; } .syntaxhighlighter table td.code .container textarea { box-sizing: border-box !important; position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border: none !important; background: white !important; padding-left: 1em !important; overflow: hidden !important; white-space: pre !important; } .syntaxhighlighter table td.gutter .line { text-align: right !important; padding: 0 0.5em 0 1em !important; } .syntaxhighlighter table td.code .line { padding: 0 1em !important; } .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { padding-left: 0em !important; } .syntaxhighlighter.show { display: block !important; } .syntaxhighlighter.collapsed table { display: none !important; } .syntaxhighlighter.collapsed .toolbar { padding: 0.1em 0.8em 0em 0.8em !important; font-size: 1em !important; position: static !important; width: auto !important; height: auto !important; } .syntaxhighlighter.collapsed .toolbar span { display: inline !important; margin-right: 1em !important; } .syntaxhighlighter.collapsed .toolbar span a { padding: 0 !important; display: none !important; } .syntaxhighlighter.collapsed .toolbar span a.expandSource { display: inline !important; } .syntaxhighlighter .toolbar { position: absolute !important; right: 1px !important; top: 1px !important; width: 11px !important; height: 11px !important; font-size: 10px !important; z-index: 10 !important; } .syntaxhighlighter .toolbar span.title { display: inline !important; } .syntaxhighlighter .toolbar a { display: block !important; text-align: center !important; text-decoration: none !important; padding-top: 1px !important; } .syntaxhighlighter .toolbar a.expandSource { display: none !important; } .syntaxhighlighter.ie { font-size: .9em !important; padding: 1px 0 1px 0 !important; } .syntaxhighlighter.ie .toolbar { line-height: 8px !important; } .syntaxhighlighter.ie .toolbar a { padding-top: 0px !important; } .syntaxhighlighter.printing .line.alt1 .content, .syntaxhighlighter.printing .line.alt2 .content, .syntaxhighlighter.printing .line.highlighted .number, .syntaxhighlighter.printing .line.highlighted.alt1 .content, .syntaxhighlighter.printing .line.highlighted.alt2 .content { background: none !important; } .syntaxhighlighter.printing .line .number { color: #bbbbbb !important; } .syntaxhighlighter.printing .line .content { color: black !important; } .syntaxhighlighter.printing .toolbar { display: none !important; } .syntaxhighlighter.printing a { text-decoration: none !important; } .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { color: black !important; } .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { color: #008200 !important; } .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { color: blue !important; } .syntaxhighlighter.printing .keyword { color: #006699 !important; font-weight: bold !important; } .syntaxhighlighter.printing .preprocessor { color: gray !important; } .syntaxhighlighter.printing .variable { color: #aa7700 !important; } .syntaxhighlighter.printing .value { color: #009900 !important; } .syntaxhighlighter.printing .functions { color: #ff1493 !important; } .syntaxhighlighter.printing .constants { color: #0066cc !important; } .syntaxhighlighter.printing .script { font-weight: bold !important; } .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { color: gray !important; } .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { color: #ff1493 !important; } .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { color: red !important; } .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { color: black !important; } .syntaxhighlighter { background-color: #222222 !important; } .syntaxhighlighter .line.alt1 { background-color: #222222 !important; } .syntaxhighlighter .line.alt2 { background-color: #222222 !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #253e5a !important; } .syntaxhighlighter .line.highlighted.number { color: white !important; } .syntaxhighlighter table caption { color: lime !important; } .syntaxhighlighter .gutter { color: #38566f !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #435a5f !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #435a5f !important; color: #222222 !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: #428bdd !important; background: black !important; border: 1px solid #435a5f !important; } .syntaxhighlighter.collapsed .toolbar a { color: #428bdd !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: lime !important; } .syntaxhighlighter .toolbar { color: #aaaaff !important; background: #435a5f !important; border: none !important; } .syntaxhighlighter .toolbar a { color: #aaaaff !important; } .syntaxhighlighter .toolbar a:hover { color: #9ccff4 !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: lime !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #428bdd !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: lime !important; } .syntaxhighlighter .keyword { color: #aaaaff !important; } .syntaxhighlighter .preprocessor { color: #8aa6c1 !important; } .syntaxhighlighter .variable { color: aqua !important; } .syntaxhighlighter .value { color: #f7e741 !important; } .syntaxhighlighter .functions { color: #ff8000 !important; } .syntaxhighlighter .constants { color: yellow !important; } .syntaxhighlighter .script { font-weight: bold !important; color: #aaaaff !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: red !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: yellow !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #ffaa3e !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCoreMDUltra.css
CSS
oos
8,659
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea { -moz-border-radius: 0 0 0 0 !important; -webkit-border-radius: 0 0 0 0 !important; background: none !important; border: 0 !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0 !important; outline: 0 !important; overflow: visible !important; padding: 0 !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: inherit !important; min-height: auto !important; } .syntaxhighlighter { width: 100% !important; margin: 1em 0 1em 0 !important; position: relative !important; overflow: auto !important; font-size: 1em !important; } .syntaxhighlighter.source { overflow: hidden !important; } .syntaxhighlighter .bold { font-weight: bold !important; } .syntaxhighlighter .italic { font-style: italic !important; } .syntaxhighlighter .line { white-space: pre !important; } .syntaxhighlighter table { width: 100% !important; } .syntaxhighlighter table caption { text-align: left !important; padding: .5em 0 0.5em 1em !important; } .syntaxhighlighter table td.code { width: 100% !important; } .syntaxhighlighter table td.code .container { position: relative !important; } .syntaxhighlighter table td.code .container textarea { box-sizing: border-box !important; position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border: none !important; background: white !important; padding-left: 1em !important; overflow: hidden !important; white-space: pre !important; } .syntaxhighlighter table td.gutter .line { text-align: right !important; padding: 0 0.5em 0 1em !important; } .syntaxhighlighter table td.code .line { padding: 0 1em !important; } .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { padding-left: 0em !important; } .syntaxhighlighter.show { display: block !important; } .syntaxhighlighter.collapsed table { display: none !important; } .syntaxhighlighter.collapsed .toolbar { padding: 0.1em 0.8em 0em 0.8em !important; font-size: 1em !important; position: static !important; width: auto !important; height: auto !important; } .syntaxhighlighter.collapsed .toolbar span { display: inline !important; margin-right: 1em !important; } .syntaxhighlighter.collapsed .toolbar span a { padding: 0 !important; display: none !important; } .syntaxhighlighter.collapsed .toolbar span a.expandSource { display: inline !important; } .syntaxhighlighter .toolbar { position: absolute !important; right: 1px !important; top: 1px !important; width: 11px !important; height: 11px !important; font-size: 10px !important; z-index: 10 !important; } .syntaxhighlighter .toolbar span.title { display: inline !important; } .syntaxhighlighter .toolbar a { display: block !important; text-align: center !important; text-decoration: none !important; padding-top: 1px !important; } .syntaxhighlighter .toolbar a.expandSource { display: none !important; } .syntaxhighlighter.ie { font-size: .9em !important; padding: 1px 0 1px 0 !important; } .syntaxhighlighter.ie .toolbar { line-height: 8px !important; } .syntaxhighlighter.ie .toolbar a { padding-top: 0px !important; } .syntaxhighlighter.printing .line.alt1 .content, .syntaxhighlighter.printing .line.alt2 .content, .syntaxhighlighter.printing .line.highlighted .number, .syntaxhighlighter.printing .line.highlighted.alt1 .content, .syntaxhighlighter.printing .line.highlighted.alt2 .content { background: none !important; } .syntaxhighlighter.printing .line .number { color: #bbbbbb !important; } .syntaxhighlighter.printing .line .content { color: black !important; } .syntaxhighlighter.printing .toolbar { display: none !important; } .syntaxhighlighter.printing a { text-decoration: none !important; } .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { color: black !important; } .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { color: #008200 !important; } .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { color: blue !important; } .syntaxhighlighter.printing .keyword { color: #006699 !important; font-weight: bold !important; } .syntaxhighlighter.printing .preprocessor { color: gray !important; } .syntaxhighlighter.printing .variable { color: #aa7700 !important; } .syntaxhighlighter.printing .value { color: #009900 !important; } .syntaxhighlighter.printing .functions { color: #ff1493 !important; } .syntaxhighlighter.printing .constants { color: #0066cc !important; } .syntaxhighlighter.printing .script { font-weight: bold !important; } .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { color: gray !important; } .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { color: #ff1493 !important; } .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { color: red !important; } .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { color: black !important; } .syntaxhighlighter { background-color: black !important; } .syntaxhighlighter .line.alt1 { background-color: black !important; } .syntaxhighlighter .line.alt2 { background-color: black !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #2a3133 !important; } .syntaxhighlighter .line.highlighted.number { color: white !important; } .syntaxhighlighter table caption { color: #d3d3d3 !important; } .syntaxhighlighter .gutter { color: #d3d3d3 !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #990000 !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #990000 !important; color: black !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: #ebdb8d !important; background: black !important; border: 1px solid #990000 !important; } .syntaxhighlighter.collapsed .toolbar a { color: #ebdb8d !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: #ff7d27 !important; } .syntaxhighlighter .toolbar { color: white !important; background: #990000 !important; border: none !important; } .syntaxhighlighter .toolbar a { color: white !important; } .syntaxhighlighter .toolbar a:hover { color: #9ccff4 !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #d3d3d3 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #ff7d27 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #ff9e7b !important; } .syntaxhighlighter .keyword { color: aqua !important; } .syntaxhighlighter .preprocessor { color: #aec4de !important; } .syntaxhighlighter .variable { color: #ffaa3e !important; } .syntaxhighlighter .value { color: #009900 !important; } .syntaxhighlighter .functions { color: #81cef9 !important; } .syntaxhighlighter .constants { color: #ff9e7b !important; } .syntaxhighlighter .script { font-weight: bold !important; color: aqua !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #ebdb8d !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #ff7d27 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #aec4de !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCoreEmacs.css
CSS
oos
8,662
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea { -moz-border-radius: 0 0 0 0 !important; -webkit-border-radius: 0 0 0 0 !important; background: none !important; border: 0 !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0 !important; outline: 0 !important; overflow: visible !important; padding: 0 !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: inherit !important; min-height: auto !important; } .syntaxhighlighter { width: 100% !important; margin: 1em 0 1em 0 !important; position: relative !important; overflow: auto !important; font-size: 1em !important; } .syntaxhighlighter.source { overflow: hidden !important; } .syntaxhighlighter .bold { font-weight: bold !important; } .syntaxhighlighter .italic { font-style: italic !important; } .syntaxhighlighter .line { white-space: pre !important; } .syntaxhighlighter table { width: 100% !important; } .syntaxhighlighter table caption { text-align: left !important; padding: .5em 0 0.5em 1em !important; } .syntaxhighlighter table td.code { width: 100% !important; } .syntaxhighlighter table td.code .container { position: relative !important; } .syntaxhighlighter table td.code .container textarea { box-sizing: border-box !important; position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border: none !important; background: white !important; padding-left: 1em !important; overflow: hidden !important; white-space: pre !important; } .syntaxhighlighter table td.gutter .line { text-align: right !important; padding: 0 0.5em 0 1em !important; } .syntaxhighlighter table td.code .line { padding: 0 1em !important; } .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { padding-left: 0em !important; } .syntaxhighlighter.show { display: block !important; } .syntaxhighlighter.collapsed table { display: none !important; } .syntaxhighlighter.collapsed .toolbar { padding: 0.1em 0.8em 0em 0.8em !important; font-size: 1em !important; position: static !important; width: auto !important; height: auto !important; } .syntaxhighlighter.collapsed .toolbar span { display: inline !important; margin-right: 1em !important; } .syntaxhighlighter.collapsed .toolbar span a { padding: 0 !important; display: none !important; } .syntaxhighlighter.collapsed .toolbar span a.expandSource { display: inline !important; } .syntaxhighlighter .toolbar { position: absolute !important; right: 1px !important; top: 1px !important; width: 11px !important; height: 11px !important; font-size: 10px !important; z-index: 10 !important; } .syntaxhighlighter .toolbar span.title { display: inline !important; } .syntaxhighlighter .toolbar a { display: block !important; text-align: center !important; text-decoration: none !important; padding-top: 1px !important; } .syntaxhighlighter .toolbar a.expandSource { display: none !important; } .syntaxhighlighter.ie { font-size: .9em !important; padding: 1px 0 1px 0 !important; } .syntaxhighlighter.ie .toolbar { line-height: 8px !important; } .syntaxhighlighter.ie .toolbar a { padding-top: 0px !important; } .syntaxhighlighter.printing .line.alt1 .content, .syntaxhighlighter.printing .line.alt2 .content, .syntaxhighlighter.printing .line.highlighted .number, .syntaxhighlighter.printing .line.highlighted.alt1 .content, .syntaxhighlighter.printing .line.highlighted.alt2 .content { background: none !important; } .syntaxhighlighter.printing .line .number { color: #bbbbbb !important; } .syntaxhighlighter.printing .line .content { color: black !important; } .syntaxhighlighter.printing .toolbar { display: none !important; } .syntaxhighlighter.printing a { text-decoration: none !important; } .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { color: black !important; } .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { color: #008200 !important; } .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { color: blue !important; } .syntaxhighlighter.printing .keyword { color: #006699 !important; font-weight: bold !important; } .syntaxhighlighter.printing .preprocessor { color: gray !important; } .syntaxhighlighter.printing .variable { color: #aa7700 !important; } .syntaxhighlighter.printing .value { color: #009900 !important; } .syntaxhighlighter.printing .functions { color: #ff1493 !important; } .syntaxhighlighter.printing .constants { color: #0066cc !important; } .syntaxhighlighter.printing .script { font-weight: bold !important; } .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { color: gray !important; } .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { color: #ff1493 !important; } .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { color: red !important; } .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { color: black !important; } .syntaxhighlighter { background-color: white !important; } .syntaxhighlighter .line.alt1 { background-color: white !important; } .syntaxhighlighter .line.alt2 { background-color: white !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #c3defe !important; } .syntaxhighlighter .line.highlighted.number { color: white !important; } .syntaxhighlighter table caption { color: black !important; } .syntaxhighlighter .gutter { color: #787878 !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #d4d0c8 !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #d4d0c8 !important; color: white !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: #3f5fbf !important; background: white !important; border: 1px solid #d4d0c8 !important; } .syntaxhighlighter.collapsed .toolbar a { color: #3f5fbf !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: #aa7700 !important; } .syntaxhighlighter .toolbar { color: #a0a0a0 !important; background: #d4d0c8 !important; border: none !important; } .syntaxhighlighter .toolbar a { color: #a0a0a0 !important; } .syntaxhighlighter .toolbar a:hover { color: red !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: black !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #3f5fbf !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #2a00ff !important; } .syntaxhighlighter .keyword { color: #7f0055 !important; } .syntaxhighlighter .preprocessor { color: #646464 !important; } .syntaxhighlighter .variable { color: #aa7700 !important; } .syntaxhighlighter .value { color: #009900 !important; } .syntaxhighlighter .functions { color: #ff1493 !important; } .syntaxhighlighter .constants { color: #0066cc !important; } .syntaxhighlighter .script { font-weight: bold !important; color: #7f0055 !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: gray !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #ff1493 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: red !important; } .syntaxhighlighter .keyword { font-weight: bold !important; } .syntaxhighlighter .xml .keyword { color: #3f7f7f !important; font-weight: normal !important; } .syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a { color: #7f007f !important; } .syntaxhighlighter .xml .string { font-style: italic !important; color: #2a00ff !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCoreEclipse.css
CSS
oos
9,020
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea { -moz-border-radius: 0 0 0 0 !important; -webkit-border-radius: 0 0 0 0 !important; background: none !important; border: 0 !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0 !important; outline: 0 !important; overflow: visible !important; padding: 0 !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; min-height: inherit !important; min-height: auto !important; } .syntaxhighlighter { width: 100% !important; margin: 1em 0 1em 0 !important; position: relative !important; overflow: auto !important; font-size: 1em !important; } .syntaxhighlighter.source { overflow: hidden !important; } .syntaxhighlighter .bold { font-weight: bold !important; } .syntaxhighlighter .italic { font-style: italic !important; } .syntaxhighlighter .line { white-space: pre !important; } .syntaxhighlighter table { width: 100% !important; } .syntaxhighlighter table caption { text-align: left !important; padding: .5em 0 0.5em 1em !important; } .syntaxhighlighter table td.code { width: 100% !important; } .syntaxhighlighter table td.code .container { position: relative !important; } .syntaxhighlighter table td.code .container textarea { box-sizing: border-box !important; position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border: none !important; background: white !important; padding-left: 1em !important; overflow: hidden !important; white-space: pre !important; } .syntaxhighlighter table td.gutter .line { text-align: right !important; padding: 0 0.5em 0 1em !important; } .syntaxhighlighter table td.code .line { padding: 0 1em !important; } .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { padding-left: 0em !important; } .syntaxhighlighter.show { display: block !important; } .syntaxhighlighter.collapsed table { display: none !important; } .syntaxhighlighter.collapsed .toolbar { padding: 0.1em 0.8em 0em 0.8em !important; font-size: 1em !important; position: static !important; width: auto !important; height: auto !important; } .syntaxhighlighter.collapsed .toolbar span { display: inline !important; margin-right: 1em !important; } .syntaxhighlighter.collapsed .toolbar span a { padding: 0 !important; display: none !important; } .syntaxhighlighter.collapsed .toolbar span a.expandSource { display: inline !important; } .syntaxhighlighter .toolbar { position: absolute !important; right: 1px !important; top: 1px !important; width: 11px !important; height: 11px !important; font-size: 10px !important; z-index: 10 !important; } .syntaxhighlighter .toolbar span.title { display: inline !important; } .syntaxhighlighter .toolbar a { display: block !important; text-align: center !important; text-decoration: none !important; padding-top: 1px !important; } .syntaxhighlighter .toolbar a.expandSource { display: none !important; } .syntaxhighlighter.ie { font-size: .9em !important; padding: 1px 0 1px 0 !important; } .syntaxhighlighter.ie .toolbar { line-height: 8px !important; } .syntaxhighlighter.ie .toolbar a { padding-top: 0px !important; } .syntaxhighlighter.printing .line.alt1 .content, .syntaxhighlighter.printing .line.alt2 .content, .syntaxhighlighter.printing .line.highlighted .number, .syntaxhighlighter.printing .line.highlighted.alt1 .content, .syntaxhighlighter.printing .line.highlighted.alt2 .content { background: none !important; } .syntaxhighlighter.printing .line .number { color: #bbbbbb !important; } .syntaxhighlighter.printing .line .content { color: black !important; } .syntaxhighlighter.printing .toolbar { display: none !important; } .syntaxhighlighter.printing a { text-decoration: none !important; } .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { color: black !important; } .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { color: #008200 !important; } .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { color: blue !important; } .syntaxhighlighter.printing .keyword { color: #006699 !important; font-weight: bold !important; } .syntaxhighlighter.printing .preprocessor { color: gray !important; } .syntaxhighlighter.printing .variable { color: #aa7700 !important; } .syntaxhighlighter.printing .value { color: #009900 !important; } .syntaxhighlighter.printing .functions { color: #ff1493 !important; } .syntaxhighlighter.printing .constants { color: #0066cc !important; } .syntaxhighlighter.printing .script { font-weight: bold !important; } .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { color: gray !important; } .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { color: #ff1493 !important; } .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { color: red !important; } .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { color: black !important; } .syntaxhighlighter { background-color: white !important; } .syntaxhighlighter .line.alt1 { background-color: white !important; } .syntaxhighlighter .line.alt2 { background-color: white !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #e0e0e0 !important; } .syntaxhighlighter .line.highlighted.number { color: black !important; } .syntaxhighlighter table caption { color: black !important; } .syntaxhighlighter .gutter { color: #afafaf !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #6ce26c !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #6ce26c !important; color: white !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: blue !important; background: white !important; border: 1px solid #6ce26c !important; } .syntaxhighlighter.collapsed .toolbar a { color: blue !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: red !important; } .syntaxhighlighter .toolbar { color: white !important; background: #6ce26c !important; border: none !important; } .syntaxhighlighter .toolbar a { color: white !important; } .syntaxhighlighter .toolbar a:hover { color: black !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: black !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #008200 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: blue !important; } .syntaxhighlighter .keyword { color: #006699 !important; } .syntaxhighlighter .preprocessor { color: gray !important; } .syntaxhighlighter .variable { color: #aa7700 !important; } .syntaxhighlighter .value { color: #009900 !important; } .syntaxhighlighter .functions { color: #ff1493 !important; } .syntaxhighlighter .constants { color: #0066cc !important; } .syntaxhighlighter .script { font-weight: bold !important; color: #006699 !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: gray !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #ff1493 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: red !important; } .syntaxhighlighter .keyword { font-weight: bold !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCoreDefault.css
CSS
oos
8,704
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ .syntaxhighlighter { background-color: black !important; } .syntaxhighlighter .line.alt1 { background-color: black !important; } .syntaxhighlighter .line.alt2 { background-color: black !important; } .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #2a3133 !important; } .syntaxhighlighter .line.highlighted.number { color: white !important; } .syntaxhighlighter table caption { color: #d3d3d3 !important; } .syntaxhighlighter .gutter { color: #d3d3d3 !important; } .syntaxhighlighter .gutter .line { border-right: 3px solid #990000 !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #990000 !important; color: black !important; } .syntaxhighlighter.printing .line .content { border: none !important; } .syntaxhighlighter.collapsed { overflow: visible !important; } .syntaxhighlighter.collapsed .toolbar { color: #ebdb8d !important; background: black !important; border: 1px solid #990000 !important; } .syntaxhighlighter.collapsed .toolbar a { color: #ebdb8d !important; } .syntaxhighlighter.collapsed .toolbar a:hover { color: #ff7d27 !important; } .syntaxhighlighter .toolbar { color: white !important; background: #990000 !important; border: none !important; } .syntaxhighlighter .toolbar a { color: white !important; } .syntaxhighlighter .toolbar a:hover { color: #9ccff4 !important; } .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #d3d3d3 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #ff7d27 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #ff9e7b !important; } .syntaxhighlighter .keyword { color: aqua !important; } .syntaxhighlighter .preprocessor { color: #aec4de !important; } .syntaxhighlighter .variable { color: #ffaa3e !important; } .syntaxhighlighter .value { color: #009900 !important; } .syntaxhighlighter .functions { color: #81cef9 !important; } .syntaxhighlighter .constants { color: #ff9e7b !important; } .syntaxhighlighter .script { font-weight: bold !important; color: aqua !important; background-color: none !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #ebdb8d !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #ff7d27 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #aec4de !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shThemeEmacs.css
CSS
oos
2,835
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d<c.9;d++)i[c[d]]=a}2 o(c){1 a=r.H("J"),d=3;a.K=c;a.M="L/t";a.G="t";a.u=a.v=2(){6(!d&&(!8.7||8.7=="F"||8.7=="z")){d=q;e[c]=q;a:{4(1 p y e)6(e[p]==3)B a;j&&5.C(k)}a.u=a.v=x;a.D.O(a)}};r.N.R(a)}1 f=Q,l=h.P(),i={},e={},j=3,k=x,b;5.T=2(c){k=c;j=q};4(b=0;b<f.9;b++){1 m=f[b].w?f[b]:f[b].S(/\\s+/),g=m.w();n(m,g)}4(b=0;b<l.9;b++)6(g=i[l[b].E.A]){e[g]=3;o(g)}}})();',56,56,'|var|function|false|for|SyntaxHighlighter|if|readyState|this|length|||||||||||||||||true|document||javascript|onload|onreadystatechange|pop|null|in|complete|brush|break|highlight|parentNode|params|loaded|language|createElement|autoloader|script|src|text|type|body|removeChild|findElements|arguments|appendChild|split|all'.split('|'),0,{}))
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shAutoloader.js
JavaScript
oos
1,451
<?php /* ************************************************************************** Plugin Name: SyntaxHighlighter Evolved Plugin URI: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/ Version: 3.1.3 Description: Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a>. <strong>TIP:</strong> Don't use the Visual editor if you don't want your code mangled. TinyMCE will "clean up" your HTML. Author: Viper007Bond Author URI: http://www.viper007bond.com/ ************************************************************************** Thanks to: * Alex Gorbatchev for writing the Javascript-powered synatax highlighter script * Andrew Ozz for writing the TinyMCE plugin **************************************************************************/ class SyntaxHighlighter { // All of these variables are private. Filters are provided for things that can be modified. var $pluginver = '3.1.3'; // Plugin version var $agshver = false; // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3) var $shfolder = false; // Controls what subfolder to load SyntaxHighlighter from (v2 or v3) var $settings = array(); // Contains the user's settings var $defaultsettings = array(); // Contains the default settings var $brushes = array(); // Array of aliases => brushes var $shortcodes = array(); // Array of shortcodes to use var $themes = array(); // Array of themes var $usedbrushes = array(); // Stores used brushes so we know what to output var $encoded = false; // Used to mark that a character encode took place var $codeformat = false; // If set, SyntaxHighlighter::get_code_format() will return this value var $content_save_pre_ran = false; // It's possible for the "content_save_pre" filter to run multiple times, so keep track // Initalize the plugin by registering the hooks function __construct() { if ( ! function_exists( 'esc_html' ) ) return; // Load localization domain load_plugin_textdomain( 'syntaxhighlighter', false, '/syntaxhighlighter/localization' ); // Display hooks add_filter( 'the_content', array( &$this, 'parse_shortcodes' ), 7 ); // Posts add_filter( 'comment_text', array( &$this, 'parse_shortcodes_comment' ), 7 ); // Comments add_filter( 'bp_get_the_topic_post_content', array( &$this, 'parse_shortcodes' ), 7 ); // BuddyPress // Into the database add_filter( 'content_save_pre', array( &$this, 'encode_shortcode_contents_slashed_noquickedit' ), 1 ); // Posts add_filter( 'pre_comment_content', array( &$this, 'encode_shortcode_contents_slashed' ), 1 ); // Comments add_filter( 'group_forum_post_text_before_save', array( &$this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress add_filter( 'group_forum_topic_text_before_save', array( &$this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress // Out of the database for editing add_filter( 'the_editor_content', array( &$this, 'the_editor_content' ), 1 ); // Posts add_filter( 'comment_edit_pre', array( &$this, 'decode_shortcode_contents' ), 1 ); // Comments add_filter( 'bp_get_the_topic_text', array( &$this, 'decode_shortcode_contents' ), 1 ); // BuddyPress add_filter( 'bp_get_the_topic_post_edit_text', array( &$this, 'decode_shortcode_contents' ), 1 ); // BuddyPress // Outputting SyntaxHighlighter's JS and CSS add_action( 'wp_head', array( &$this, 'output_header_placeholder' ), 15 ); add_action( 'admin_head', array( &$this, 'output_header_placeholder' ), 15 ); // For comments add_action( 'wp_footer', array( &$this, 'maybe_output_scripts' ), 15 ); add_action( 'admin_footer', array( &$this, 'maybe_output_scripts' ), 15 ); // For comments // Admin hooks add_action( 'admin_init', array( &$this, 'register_setting' ) ); add_action( 'admin_menu', array( &$this, 'register_settings_page' ) ); add_action( 'admin_head', array( &$this, 'output_shortcodes_for_tinymce' ) ); add_filter( 'mce_external_plugins', array( &$this, 'add_tinymce_plugin' ) ); add_filter( 'tiny_mce_version', array( &$this, 'break_tinymce_cache' ) ); add_filter( 'save_post', array( &$this, 'mark_as_encoded' ), 10, 2 ); add_filter( 'plugin_action_links', array( &$this, 'settings_link' ), 10, 2 ); // Register widget hooks // Requires change added in WordPress 2.9 if ( class_exists('WP_Embed') ) { add_filter( 'widget_text', array( &$this, 'widget_text_output' ), 7, 2 ); add_filter( 'widget_update_callback', array( &$this, 'widget_text_save' ), 1, 4 ); add_filter( 'widget_form_callback', array( &$this, 'widget_text_form' ), 1, 2 ); } // Create array of default settings (you can use the filter to modify these) $this->defaultsettings = (array) apply_filters( 'syntaxhighlighter_defaultsettings', array( 'theme' => 'default', 'loadallbrushes' => 0, 'shversion' => 3, 'title' => '', 'autolinks' => 1, 'classname' => '', 'collapse' => 0, 'firstline' => 1, 'gutter' => 1, 'htmlscript' => 0, 'light' => 0, 'padlinenumbers' => 'false', 'smarttabs' => 1, 'tabsize' => 4, 'toolbar' => 0, 'wraplines' => 1, // 2.x only ) ); // Create the settings array by merging the user's settings and the defaults $usersettings = (array) get_option('syntaxhighlighter_settings'); $this->settings = wp_parse_args( $usersettings, $this->defaultsettings ); // Dynamically set folder and version names for SynaxHighlighter if ( 2 == $this->settings['shversion'] ) { $this->shfolder = 'syntaxhighlighter2'; $this->agshver = '2.1.364'; } else { $this->shfolder = 'syntaxhighlighter3'; $this->agshver = '3.0.83c'; } // Register brush scripts wp_register_script( 'syntaxhighlighter-core', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shCore.js'), array(), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-as3', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushAS3.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-bash', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushBash.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-coldfusion', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushColdFusion.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-cpp', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushCpp.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-csharp', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushCSharp.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-css', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushCss.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-delphi', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushDelphi.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-diff', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushDiff.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-erlang', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushErlang.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-groovy', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushGroovy.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-java', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushJava.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-javafx', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushJavaFX.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-jscript', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushJScript.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-perl', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushPerl.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-php', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushPhp.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-plain', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushPlain.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-powershell', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushPowerShell.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-python', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushPython.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-ruby', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushRuby.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-scala', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushScala.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-sql', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushSql.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-vb', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushVb.js'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_script( 'syntaxhighlighter-brush-xml', plugins_url('syntaxhighlighter/' . $this->shfolder . '/scripts/shBrushXml.js'), array('syntaxhighlighter-core'), $this->agshver ); // Register some popular third-party brushes wp_register_script( 'syntaxhighlighter-brush-clojure', plugins_url('syntaxhighlighter/third-party-brushes/shBrushClojure.js'), array('syntaxhighlighter-core'), '20090602' ); wp_register_script( 'syntaxhighlighter-brush-fsharp', plugins_url('syntaxhighlighter/third-party-brushes/shBrushFSharp.js'), array('syntaxhighlighter-core'), '20091003' ); wp_register_script( 'syntaxhighlighter-brush-latex', plugins_url('syntaxhighlighter/third-party-brushes/shBrushLatex.js'), array('syntaxhighlighter-core'), '20090613' ); wp_register_script( 'syntaxhighlighter-brush-matlabkey', plugins_url('syntaxhighlighter/third-party-brushes/shBrushMatlabKey.js'), array('syntaxhighlighter-core'), '20091209' ); wp_register_script( 'syntaxhighlighter-brush-objc', plugins_url('syntaxhighlighter/third-party-brushes/shBrushObjC.js'), array('syntaxhighlighter-core'), '20091207' ); wp_register_script( 'syntaxhighlighter-brush-r', plugins_url('syntaxhighlighter/third-party-brushes/shBrushR.js'), array('syntaxhighlighter-core'), '20100919' ); // Register theme stylesheets wp_register_style( 'syntaxhighlighter-core', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shCore.css'), array(), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-default', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeDefault.css'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-django', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeDjango.css'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-eclipse', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeEclipse.css'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-emacs', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeEmacs.css'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-fadetogrey', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeFadeToGrey.css'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-midnight', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeMidnight.css'), array('syntaxhighlighter-core'), $this->agshver ); wp_register_style( 'syntaxhighlighter-theme-rdark', plugins_url('syntaxhighlighter/' . $this->shfolder . '/styles/shThemeRDark.css'), array('syntaxhighlighter-core'), $this->agshver ); // Create list of brush aliases and map them to their real brushes // The key is the language alias // The value is the script handle suffix: syntaxhighlighter-brush-ThisBitHere (your plugin needs to register the script itself) $this->brushes = (array) apply_filters( 'syntaxhighlighter_brushes', array( 'as3' => 'as3', 'actionscript3' => 'as3', 'bash' => 'bash', 'shell' => 'bash', 'coldfusion' => 'coldfusion', 'cf' => 'coldfusion', 'clojure' => 'clojure', 'clj' => 'clojure', 'cpp' => 'cpp', 'c' => 'cpp', 'c-sharp' => 'csharp', 'csharp' => 'csharp', 'css' => 'css', 'delphi' => 'delphi', 'pas' => 'delphi', 'pascal' => 'delphi', 'diff' => 'diff', 'patch' => 'diff', 'erl' => 'erlang', 'erlang' => 'erlang', 'fsharp' => 'fsharp', 'groovy' => 'groovy', 'java' => 'java', 'jfx' => 'javafx', 'javafx' => 'javafx', 'js' => 'jscript', 'jscript' => 'jscript', 'javascript' => 'jscript', 'latex' => 'latex', // Not used as a shortcode 'tex' => 'latex', 'matlab' => 'matlabkey', 'objc' => 'objc', 'obj-c' => 'objc', 'perl' => 'perl', 'pl' => 'perl', 'php' => 'php', 'plain' => 'plain', 'text' => 'plain', 'ps' => 'powershell', 'powershell' => 'powershell', 'py' => 'python', 'python' => 'python', 'r' => 'r', // Not used as a shortcode 'splus' => 'r', 'rails' => 'ruby', 'rb' => 'ruby', 'ror' => 'ruby', 'ruby' => 'ruby', 'scala' => 'scala', 'sql' => 'sql', 'vb' => 'vb', 'vbnet' => 'vb', 'xml' => 'xml', 'xhtml' => 'xml', 'xslt' => 'xml', 'html' => 'xml', 'xhtml' => 'xml', ) ); // Create a list of shortcodes to use. You can use the filter to add/remove ones. // If the language/lang parameter is left out, it's assumed the shortcode name is the language. // If that's invalid, then "plain" is used. $this->shortcodes = array( 'sourcecode', 'source', 'code' ); $this->shortcodes = array_merge( $this->shortcodes, array_keys( $this->brushes ) ); // Remove some shortcodes we don't want while still supporting them as language values unset( $this->shortcodes[array_search( 'latex', $this->shortcodes )] ); // Remove "latex" shortcode (it'll collide) unset( $this->shortcodes[array_search( 'r', $this->shortcodes )] ); // Remove "r" shortcode (too short) $this->shortcodes = (array) apply_filters( 'syntaxhighlighter_shortcodes', $this->shortcodes ); // Register each shortcode with a placeholder callback so that strip_shortcodes() will work // The proper callback and such is done in SyntaxHighlighter::shortcode_hack() foreach ( $this->shortcodes as $shortcode ) add_shortcode( $shortcode, '__return_true' ); // Create list of themes and their human readable names // Plugins can add to this list: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-theme/ $this->themes = (array) apply_filters( 'syntaxhighlighter_themes', array( 'default' => __( 'Default', 'syntaxhighlighter' ), 'django' => __( 'Django', 'syntaxhighlighter' ), 'eclipse' => __( 'Eclipse', 'syntaxhighlighter' ), 'emacs' => __( 'Emacs', 'syntaxhighlighter' ), 'fadetogrey' => __( 'Fade to Grey', 'syntaxhighlighter' ), 'midnight' => __( 'Midnight', 'syntaxhighlighter' ), 'rdark' => __( 'RDark', 'syntaxhighlighter' ), 'none' => __( '[None]', 'syntaxhighlighter' ), ) ); // Other special characters that need to be encoded before going into the database (namely to work around kses) $this->specialchars = (array) apply_filters( 'syntaxhighlighter_specialchars', array( '\0' => '&#92;&#48;', ) ); } // Register the settings page function register_settings_page() { add_options_page( __( 'SyntaxHighlighter Settings', 'syntaxhighlighter' ), __( 'SyntaxHighlighter', 'syntaxhighlighter' ), 'manage_options', 'syntaxhighlighter', array( &$this, 'settings_page' ) ); } // Register the plugin's setting function register_setting() { register_setting( 'syntaxhighlighter_settings', 'syntaxhighlighter_settings', array( &$this, 'validate_settings' ) ); } // Add the custom TinyMCE plugin which wraps plugin shortcodes in <pre> in TinyMCE function add_tinymce_plugin( $plugins ) { $plugins['syntaxhighlighter'] = plugins_url('syntaxhighlighter/syntaxhighlighter_mce.js'); return $plugins; } // Break the TinyMCE cache function break_tinymce_cache( $version ) { return $version . '-sh' . $this->pluginver; } // Add a "Settings" link to the plugins page function settings_link( $links, $file ) { static $this_plugin; if( empty($this_plugin) ) $this_plugin = plugin_basename(__FILE__); if ( $file == $this_plugin ) $links[] = '<a href="' . admin_url( 'options-general.php?page=syntaxhighlighter' ) . '">' . __( 'Settings', 'syntaxhighlighter' ) . '</a>'; return $links; } // Output list of shortcode tags for the TinyMCE plugin function output_shortcodes_for_tinymce() { $shortcodes = array(); foreach ( $this->shortcodes as $shortcode ) $shortcodes[] = preg_quote( $shortcode ); echo "<script type='text/javascript'>\n"; echo " var syntaxHLcodes = '" . implode( '|', $shortcodes ) . "';\n"; echo "</script>\n"; } // Additional CSS for the front end (to ensure themes don't screw too much with the code) function enforce_font_size() { echo ' <style type="text/css">.syntaxhighlighter { font-size: 12px !important; }</style>' . "\n"; } // A filter function that runs do_shortcode() but only with this plugin's shortcodes function shortcode_hack( $content, $callback ) { global $shortcode_tags; // Backup current registered shortcodes and clear them all out $orig_shortcode_tags = $shortcode_tags; remove_all_shortcodes(); // Register all of this plugin's shortcodes foreach ( $this->shortcodes as $shortcode ) add_shortcode( $shortcode, $callback ); // Do the shortcodes (only this plugins's are registered) $content = $this->do_shortcode_keep_escaped_tags( $content ); // Put the original shortcodes back $shortcode_tags = $orig_shortcode_tags; return $content; } // This is a clone of do_shortcode() that uses a different callback function // The new callback function will keep escaped tags escaped, i.e. [[foo]] // Up to date as of r18324 (3.2) function do_shortcode_keep_escaped_tags( $content ) { global $shortcode_tags; if (empty($shortcode_tags) || !is_array($shortcode_tags)) return $content; $pattern = get_shortcode_regex(); return preg_replace_callback('/'.$pattern.'/s', array( &$this, 'do_shortcode_tag_keep_escaped_tags' ), $content); } // Callback for above do_shortcode_keep_escaped_tags() function // It's a clone of core's do_shortcode_tag() function with a modification to the escaped shortcode return // Up to date as of r18324 (3.2) function do_shortcode_tag_keep_escaped_tags( $m ) { global $shortcode_tags; // allow [[foo]] syntax for escaping a tag if ( $m[1] == '[' && $m[6] == ']' ) { return $m[0]; // This line was modified for this plugin (no substr call) } $tag = $m[2]; $attr = shortcode_parse_atts( $m[3] ); if ( isset( $m[5] ) ) { // enclosing tag - extra parameter return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6]; } else { // self-closing tag return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL, $tag ) . $m[6]; } } // The main filter for the post contents. The regular shortcode filter can't be used as it's post-wpautop(). function parse_shortcodes( $content ) { return $this->shortcode_hack( $content, array( &$this, 'shortcode_callback' ) ); } // HTML entity encode the contents of shortcodes function encode_shortcode_contents( $content ) { return $this->shortcode_hack( $content, array( &$this, 'encode_shortcode_contents_callback' ) ); } // HTML entity encode the contents of shortcodes. Expects slashed content. function encode_shortcode_contents_slashed( $content ) { return addslashes( $this->encode_shortcode_contents( stripslashes( $content ) ) ); } // HTML entity encode the contents of shortcodes. Expects slashed content. Aborts if AJAX. function encode_shortcode_contents_slashed_noquickedit( $content ) { // In certain weird circumstances, the content gets run through "content_save_pre" twice // Keep track and don't allow this filter to be run twice // I couldn't easily figure out why this happens and didn't bother looking into it further as this works fine if ( true == $this->content_save_pre_ran ) return $content; $this->content_save_pre_ran = true; // Post quick edits aren't decoded for display, so we don't need to encode them (again) if ( !empty($_POST) && !empty($_POST['action']) && 'inline-save' == $_POST['action'] ) return $content; return $this->encode_shortcode_contents_slashed( $content ); } // HTML entity decode the contents of shortcodes function decode_shortcode_contents( $content ) { return $this->shortcode_hack( $content, array( &$this, 'decode_shortcode_contents_callback' ) ); } // The callback function for SyntaxHighlighter::encode_shortcode_contents() function encode_shortcode_contents_callback( $atts, $code = '', $tag = false ) { $this->encoded = true; $code = str_replace( array_keys($this->specialchars), array_values($this->specialchars), htmlspecialchars( $code ) ); return '[' . $tag . $this->atts2string( $atts ) . "]{$code}[/$tag]"; } // The callback function for SyntaxHighlighter::decode_shortcode_contents() // Shortcode attribute values need to not be quoted with TinyMCE disabled for some reason (weird bug) function decode_shortcode_contents_callback( $atts, $code = '', $tag = false ) { $quotes = ( user_can_richedit() ) ? true : false; $code = str_replace( array_values($this->specialchars), array_keys($this->specialchars), htmlspecialchars_decode( $code ) ); return '[' . $tag . $this->atts2string( $atts, $quotes ) . "]{$code}[/$tag]"; } // Dynamically format the post content for the edit form function the_editor_content( $content ) { global $post; // New code format (stored encoded in database) if ( 2 == $this->get_code_format( $post ) ) { // If TinyMCE is disabled or the HTML tab is set to be displayed first, we need to decode the HTML if ( !user_can_richedit() || 'html' == wp_default_editor() ) $content = $this->decode_shortcode_contents( $content ); } // Old code format (stored raw in database) else { // If TinyMCE is enabled and is set to be displayed first, we need to encode the HTML if ( user_can_richedit() && 'html' != wp_default_editor() ) $content = $this->encode_shortcode_contents( $content ); } return $content; } // Run SyntaxHighlighter::encode_shortcode_contents() on the contents of the text widget function widget_text_save( $instance, $new_instance, $old_instance, $widgetclass ) { if ( 'text' == $widgetclass->id_base ) { // Re-save the widget settings but this time with the shortcode contents encoded $new_instance['text'] = $this->encode_shortcode_contents( $new_instance['text'] ); $instance = $widgetclass->update( $new_instance, $old_instance ); // And flag it as encoded $instance['syntaxhighlighter_encoded'] = true; } return $instance; } // Run SyntaxHighlighter::decode_shortcode_contents_callback() on the contents of the text widget form function widget_text_form( $instance, $widgetclass ) { if ( 'text' == $widgetclass->id_base && !empty($instance['syntaxhighlighter_encoded']) ) { $instance['text'] = $this->shortcode_hack( $instance['text'], array( &$this, 'decode_shortcode_contents_callback' ) ); } return $instance; } // Run SyntaxHighlighter::parse_shortcodes() on the contents of a text widget function widget_text_output( $content, $instance = false ) { $this->codeformat = ( false === $instance || empty($instance['syntaxhighlighter_encoded']) ) ? 1 : 2; $content = $this->parse_shortcodes( $content ); $this->codeformat = false; return $content; } // Run SyntaxHighlighter::parse_shortcodes() on the contents of a comment function parse_shortcodes_comment( $content ) { $this->codeformat = 2; $content = $this->parse_shortcodes( $content ); $this->codeformat = false; return $content; } // This function determines what version of SyntaxHighlighter was used when the post was written // This is because the code was stored differently for different versions of SyntaxHighlighter function get_code_format( $post ) { if ( false !== $this->codeformat ) return $this->codeformat; if ( empty($post) ) $post = new stdClass(); if ( null !== $version = apply_filters( 'syntaxhighlighter_pre_getcodeformat', null, $post ) ) return $version; $version = ( empty($post->ID) || get_post_meta( $post->ID, '_syntaxhighlighter_encoded', true ) || get_post_meta( $post->ID, 'syntaxhighlighter_encoded', true ) ) ? 2 : 1; return apply_filters( 'syntaxhighlighter_getcodeformat', $version, $post ); } // Adds a post meta saying that HTML entities are encoded (for backwards compatibility) function mark_as_encoded( $post_ID, $post ) { if ( false == $this->encoded || 'revision' == $post->post_type ) return; delete_post_meta( $post_ID, 'syntaxhighlighter_encoded' ); // Previously used add_post_meta( $post_ID, '_syntaxhighlighter_encoded', true, true ); } // Transforms an attributes array into a 'key="value"' format (i.e. reverses the process) function atts2string( $atts, $quotes = true ) { if ( empty($atts) ) return ''; $atts = $this->attributefix( $atts ); // Re-map [code="php"] style tags if ( isset($atts[0]) ) { if ( empty($atts['language']) ) $atts['language'] = $atts[0]; unset($atts[0]); } $strings = array(); foreach ( $atts as $key => $value ) $strings[] = ( $quotes ) ? $key . '="' . esc_attr( $value ) . '"' : $key . '=' . esc_attr( $value ); return ' ' . implode( ' ', $strings ); } // Simple function for escaping just single quotes (the original js_escape() escapes more than we need) function js_escape_singlequotes( $string ) { return str_replace( "'", "\'", $string ); } // Output an anchor in the header for the Javascript to use // Might as well use it to output the version to help me debug people's sites function output_header_placeholder() { echo '<meta id="syntaxhighlighteranchor" name="syntaxhighlighter-version" content="' . esc_attr( $this->pluginver ) . '" />' . "\n"; } // Output any needed scripts. This is meant for the footer. function maybe_output_scripts() { global $wp_styles; if ( 1 == $this->settings['loadallbrushes'] ) $this->usedbrushes = array_flip( array_values( $this->brushes ) ); if ( empty($this->usedbrushes) ) return; $scripts = array(); foreach ( $this->usedbrushes as $brush => $unused ) $scripts[] = 'syntaxhighlighter-brush-' . strtolower( $brush ); wp_print_scripts( $scripts ); // Stylesheets can't be in the footer, so inject them via Javascript echo "<script type='text/javascript'>\n"; echo " (function(){\n"; echo " var corecss = document.createElement('link');\n"; echo " var themecss = document.createElement('link');\n"; if ( !is_a($wp_styles, 'WP_Styles') ) $wp_styles = new WP_Styles(); $needcore = false; if ( 'none' == $this->settings['theme'] ) { $needcore = true; } else { $theme = ( !empty($this->themes[$this->settings['theme']]) ) ? strtolower($this->settings['theme']) : $this->defaultsettings['theme']; $theme = 'syntaxhighlighter-theme-' . $theme; // See if the requested theme has been registered if ( !empty($wp_styles) && !empty($wp_styles->registered) && !empty($wp_styles->registered[$theme]) && !empty($wp_styles->registered[$theme]->src) ) { // Users can register their own stylesheet and may opt to not load the core stylesheet if they wish for some reason if ( is_array($wp_styles->registered[$theme]->deps) && in_array( 'syntaxhighlighter-core', $wp_styles->registered[$theme]->deps ) ) $needcore = true; } // Otherwise use the default theme else { $theme = 'syntaxhighlighter-theme-' . $this->defaultsettings['theme']; $needcore = true; } } if ( $needcore && !empty($wp_styles) && !empty($wp_styles->registered) && !empty($wp_styles->registered['syntaxhighlighter-core']) && !empty($wp_styles->registered['syntaxhighlighter-core']->src) ) : $corecssurl = add_query_arg( 'ver', $this->agshver, $wp_styles->registered['syntaxhighlighter-core']->src ); $corecssurl = apply_filters( 'syntaxhighlighter_csscoreurl', $corecssurl ); ?> var corecssurl = "<?php echo esc_js( $corecssurl ); ?>"; if ( corecss.setAttribute ) { corecss.setAttribute( "rel", "stylesheet" ); corecss.setAttribute( "type", "text/css" ); corecss.setAttribute( "href", corecssurl ); } else { corecss.rel = "stylesheet"; corecss.href = corecssurl; } document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") ); <?php endif; // Endif $needcore if ( 'none' != $this->settings['theme'] ) : ?> var themecssurl = "<?php echo esc_js( apply_filters( 'syntaxhighlighter_cssthemeurl', add_query_arg( 'ver', $this->agshver, $wp_styles->registered[$theme]->src ) ) ); ?>"; if ( themecss.setAttribute ) { themecss.setAttribute( "rel", "stylesheet" ); themecss.setAttribute( "type", "text/css" ); themecss.setAttribute( "href", themecssurl ); } else { themecss.rel = "stylesheet"; themecss.href = themecssurl; } //document.getElementById("syntaxhighlighteranchor").appendChild(themecss); document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") ); <?php endif; // Endif none != theme echo " })();\n"; switch ( $this->settings['shversion'] ) { case 2: echo " SyntaxHighlighter.config.clipboardSwf = '" . esc_js( apply_filters( 'syntaxhighlighter_clipboardurl', plugins_url('syntaxhighlighter/syntaxhighlighter2/scripts/clipboard.swf') ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.expandSource = '" . $this->js_escape_singlequotes( __( 'show source', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.viewSource = '" . $this->js_escape_singlequotes( __( 'view source', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.copyToClipboard = '" . $this->js_escape_singlequotes( __( 'copy to clipboard', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.copyToClipboardConfirmation = '" . $this->js_escape_singlequotes( __( 'The code is in your clipboard now', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.print = '" . $this->js_escape_singlequotes( __( 'print', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.help = '" . $this->js_escape_singlequotes( __( '?', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.alert = '" . $this->js_escape_singlequotes( __( 'SyntaxHighlighter\n\n', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.noBrush = '" . $this->js_escape_singlequotes( __( "Can't find brush for: ", 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.brushNotHtmlScript = '" . $this->js_escape_singlequotes( __( "Brush wasn't configured for html-script option: ", 'syntaxhighlighter' ) ) . "';\n"; break; case 3: echo " SyntaxHighlighter.config.strings.expandSource = '" . $this->js_escape_singlequotes( __( '+ expand source', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.help = '" . $this->js_escape_singlequotes( __( '?', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.alert = '" . $this->js_escape_singlequotes( __( 'SyntaxHighlighter\n\n', 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.noBrush = '" . $this->js_escape_singlequotes( __( "Can't find brush for: ", 'syntaxhighlighter' ) ) . "';\n"; echo " SyntaxHighlighter.config.strings.brushNotHtmlScript = '" . $this->js_escape_singlequotes( __( "Brush wasn't configured for html-script option: ", 'syntaxhighlighter' ) ) . "';\n"; break; } if ( 1 != $this->settings['autolinks'] ) echo " SyntaxHighlighter.defaults['auto-links'] = false;\n"; if ( !empty($this->settings['classname']) ) echo " SyntaxHighlighter.defaults['class-name'] = '" . $this->js_escape_singlequotes( $this->settings['classname'] ) . "';\n"; if ( 1 == $this->settings['collapse'] ) echo " SyntaxHighlighter.defaults['collapse'] = true;\n"; if ( 1 != $this->settings['firstline'] ) echo " SyntaxHighlighter.defaults['first-line'] = " . $this->settings['firstline'] . ";\n"; if ( 1 != $this->settings['gutter'] ) echo " SyntaxHighlighter.defaults['gutter'] = false;\n"; /* if ( 1 == $this->settings['htmlscript'] ) echo " SyntaxHighlighter.defaults['html-script'] = true;\n"; */ if ( 1 == $this->settings['light'] ) echo " SyntaxHighlighter.defaults['light'] = true;\n"; echo " SyntaxHighlighter.defaults['pad-line-numbers'] = "; switch ( $this->settings['padlinenumbers'] ) { case 'true': echo 'true'; break; case 'false'; echo 'false'; break; default; echo (int) $this->settings['padlinenumbers']; } echo ";\n"; if ( 1 != $this->settings['smarttabs'] ) echo " SyntaxHighlighter.defaults['smart-tabs'] = false;\n"; if ( 4 != $this->settings['tabsize'] ) echo " SyntaxHighlighter.defaults['tab-size'] = " . $this->settings['tabsize'] . ";\n"; if ( 1 != $this->settings['toolbar'] ) echo " SyntaxHighlighter.defaults['toolbar'] = false;\n"; // 2.x only for now if ( 1 != $this->settings['wraplines'] ) echo " SyntaxHighlighter.defaults['wrap-lines'] = false;\n"; ?> SyntaxHighlighter.all(); </script> <?php } // No-name attribute fixing function attributefix( $atts = array() ) { if ( empty($atts[0]) ) return $atts; // Quoted value if ( 0 !== preg_match( '#=("|\')(.*?)\1#', $atts[0], $match ) ) $atts[0] = $match[2]; // Unquoted value elseif ( '=' == substr( $atts[0], 0, 1 ) ) $atts[0] = substr( $atts[0], 1 ); return $atts; } // Shortcode handler for transforming the shortcodes to their final <pre>'s function shortcode_callback( $atts, $code = '', $tag = false ) { global $post; if ( false === $tag || empty($code) ) return $code; // Avoid PHP notices if ( !isset($post) ) $post = null; $code = apply_filters( 'syntaxhighlighter_precode', $code, $atts, $tag ); // Error fixing for [tag="language"] if ( isset($atts[0]) ) { $atts = $this->attributefix( $atts ); $atts['language'] = $atts[0]; unset($atts[0]); } // Default out all of the available parameters to "false" (easy way to check if they're set or not) // Note this isn't the same as if the user passes the string "false" to the shortcode $atts = (array) apply_filters( 'syntaxhighlighter_shortcodeatts', shortcode_atts( array( 'language' => false, 'lang' => false, 'type' => false, // language alias 'autolinks' => false, 'classname' => false, 'collapse' => false, 'firstline' => false, 'fontsize' => false, 'gutter' => false, 'highlight' => false, 'htmlscript' => false, 'light' => false, 'padlinenumbers' => false, 'smarttabs' => false, 'tabsize' => false, 'title' => $this->settings['title'], 'toolbar' => false, 'wraplines' => false, ), $atts ) ); // Check for language shortcode tag such as [php]code[/php] if ( isset($this->brushes[$tag]) ) { $lang = $tag; } // If a valid tag is not used, it must be sourcecode/source/code else { $atts = $this->attributefix( $atts ); // Check for the "language" attribute if ( false !== $atts['language'] ) $lang = $atts['language']; // Check for the "lang" attribute elseif ( false !== $atts['lang'] ) $lang = $atts['lang']; // Default to plain text else $lang = 'text'; // All language aliases are lowercase $lang = strtolower( $lang ); // Validate passed attribute if ( !isset($this->brushes[$lang]) ) return $code; } // Switch from the alias to the real brush name (so custom aliases can be used) $lang = $this->brushes[$lang]; // Register this brush as used so it's script will be outputted $this->usedbrushes[$lang] = true; $params = array(); $params[] = "brush: $lang;"; // Fix bug that prevents collapse from working if the toolbar is off or light mode is on if ( 'true' == $atts['collapse'] || '1' === $atts['collapse'] || 1 == $this->settings['collapse'] ) { $atts['toolbar'] = 'true'; $atts['light'] = 'false'; } // Parameter renaming (the shortcode API doesn't like parameter names with dashes) $rename_map = array( 'autolinks' => 'auto-links', 'classname' => 'class-name', 'firstline' => 'first-line', 'fontsize' => 'font-size', 'htmlscript' => 'html-script', 'padlinenumbers' => 'pad-line-numbers', 'smarttabs' => 'smart-tabs', 'tabsize' => 'tab-size', 'wraplines' => 'wrap-lines', ); // Allowed configuration parameters and their type // Use the proper names (see above) $allowed_atts = (array) apply_filters( 'syntaxhighlighter_allowedatts', array( 'auto-links' => 'boolean', 'class-name' => 'other', 'collapse' => 'boolean', 'first-line' => 'integer', 'font-size' => 'integer', 'gutter' => 'boolean', 'highlight' => 'other', 'html-script' => 'boolean', 'light' => 'boolean', 'pad-line-numbers' => 'other', 'smart-tabs' => 'boolean', 'tab-size' => 'integer', 'title' => 'other', 'toolbar' => 'boolean', 'wrap-lines' => 'boolean', ) ); $title = ''; // Sanitize configuration parameters and such foreach ( $atts as $key => $value ) { $key = strtolower( $key ); // Put back parameter names that have been renamed for shortcode use if ( !empty($rename_map[$key]) ) $key = $rename_map[$key]; // This this parameter if it's unknown, not set, or the language which was already handled if ( empty($allowed_atts[$key]) || false === $value || in_array( $key, array( 'language', 'lang' ) ) ) continue; // Sanitize values switch ( $allowed_atts[$key] ) { case 'boolean': $value = strtolower( $value ); if ( 'true' === $value || '1' === $value || 'on' == $value ) $value = 'true'; elseif ( 'false' === $value || '0' === $value || 'off' == $value ) $value = 'false'; else continue 2; // Invalid value, ditch parameter break; // integer case 'integer': $value = (int) $value; break; } // Sanitize the "classname" parameter if ( 'classname' == $key ) $value = trim( preg_replace( '/[^a-zA-Z0-9 _-]/i', '', $value ) ); // Special sanitization for "pad-line-numbers" if ( 'pad-line-numbers' == $key ) { $value = strtolower( $value ); if ( 'true' === $value || '1' === $value ) $value = 'true'; elseif ( 'false' === $value || '0' === $value ) $value = 'false'; else $value = (int) $value; } // Add % sign to "font-size" if ( 'font-size' == $key ) $value = $value . '%'; // If "html-script", then include the XML brush as it's needed if ( 'html-script' == $key && 'true' == $value ) $this->usedbrushes['xml'] = true; // Sanitize row highlights if ( 'highlight' == $key ) { if ( false === strpos( $value, ',' ) ) { $value = (int) $value; } else { $lines = explode( ',', $value ); $highlights = array(); foreach ( $lines as $line ) { // Line range if ( false !== strpos( $line, '-' ) ) { list( $range_start, $range_end ) = array_map( 'intval', explode( '-', $line ) ); if ( ! $range_start || ! $range_end || $range_end <= $range_start ) continue; for ( $i = $range_start; $i <= $range_end; $i++ ) $highlights[] = $i; } else { $highlights[] = (int) $line; } } natsort( $highlights ); $value = implode( ',', $highlights ); } if ( empty( $value ) ) continue; // Wrap highlight in [ ] $params[] = "$key: [$value];"; continue; } $params[] = "$key: $value;"; // Set the title variable if the title parameter is set (but not for feeds) if ( 'title' == $key && ! is_feed() ) $title = ' title="' . esc_attr( $value ) . '"'; } $code = ( false === strpos( $code, '<' ) && false === strpos( $code, '>' ) && 2 == $this->get_code_format($post) ) ? strip_tags( $code ) : htmlspecialchars( $code ); $params[] = 'notranslate'; // For Google, see http://otto42.com/9k $params = apply_filters( 'syntaxhighlighter_cssclasses', $params ); // Use this to add additional CSS classes / SH parameters return apply_filters( 'syntaxhighlighter_htmlresult', '<pre class="' . esc_attr( implode( ' ', $params ) ) . '"' . $title . '>' . $code . '</pre>' );; } // Settings page function settings_page() { ?> <script type="text/javascript"> // <![CDATA[ jQuery(document).ready(function($) { // Confirm pressing of the "Reset to Defaults" button $("#syntaxhighlighter-defaults").click(function(){ var areyousure = confirm("<?php echo esc_js( __( 'Are you sure you want to reset your settings to the defaults?', 'syntaxhighlighter' ) ); ?>"); if ( true != areyousure ) return false; }); <?php if ( !empty( $_GET['defaults'] ) ) : ?> $("#message p strong").text("<?php echo esc_js( __( 'Settings reset to defaults.', 'syntaxhighlighter' ) ); ?>"); <?php endif; ?> }); // ]]> </script> <div class="wrap"> <?php if ( function_exists('screen_icon') ) screen_icon(); ?> <h2><?php _e( 'SyntaxHighlighter Settings', 'syntaxhighlighter' ); ?></h2> <form method="post" action="options.php"> <?php settings_fields('syntaxhighlighter_settings'); ?> <table class="form-table"> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-shversion"><?php _e( 'Highlighter Version', 'syntaxhighlighter' ); ?></label></th> <td> <select name="syntaxhighlighter_settings[shversion]" id="syntaxhighlighter-shversion" class="postform"> <?php $versions = array( 3 => __( 'Version 3.x', 'syntaxhighlighter' ), 2 => __( 'Version 2.x', 'syntaxhighlighter' ), ); foreach ( $versions as $version => $name ) { echo ' <option value="' . esc_attr( $version ) . '"' . selected( $this->settings['shversion'], $version, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n"; } ?> </select><br /> <?php _e( 'Version 3 allows visitors to easily highlight portions of your code with their mouse (either by dragging or double-clicking) and copy it to their clipboard. No toolbar containing a Flash-based button is required.', 'syntaxhighlighter' ); ?><br /> <?php _e( 'Version 2 allows for line wrapping, something that version 3 does not do at this time.', 'syntaxhighlighter' ); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-theme"><?php _e( 'Color Theme', 'syntaxhighlighter' ); ?></label></th> <td> <select name="syntaxhighlighter_settings[theme]" id="syntaxhighlighter-theme" class="postform"> <?php foreach ( $this->themes as $theme => $name ) { echo ' <option value="' . esc_attr( $theme ) . '"' . selected( $this->settings['theme'], $theme, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n"; } ?> </select> </td> </tr> <tr valign="top"> <th scope="row"><?php _e( 'Load All Brushes', 'syntaxhighlighter' ); ?></th> <td> <fieldset> <legend class="hidden"><?php _e( 'Load All Brushes', 'syntaxhighlighter' ); ?></legend> <label for="syntaxhighlighter-loadallbrushes"><input name="syntaxhighlighter_settings[loadallbrushes]" type="checkbox" id="syntaxhighlighter-loadallbrushes" value="1" <?php checked( $this->settings['loadallbrushes'], 1 ); ?> /> <?php _e( 'Always load all language files (for directly using <code>&lt;pre&gt;</code> tags rather than shortcodes)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If left unchecked (default), then language files will only be loaded when needed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If unsure, leave this box unchecked', 'syntaxhighlighter' ); ?></label> </fieldset> </td> </tr> </table> <h3><?php _e( 'Defaults', 'syntaxhighlighter' ); ?></h3> <p><?php _e( 'All of the settings below can be configured on a per-code block basis, but you can control the defaults of all code blocks here.', 'syntaxhighlighter' ); ?></p> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e( 'Miscellaneous', 'syntaxhighlighter' ); ?></th> <td> <fieldset> <legend class="hidden"><?php _e( 'Miscellaneous', 'syntaxhighlighter' ); ?></legend> <label for="syntaxhighlighter-gutter"><input name="syntaxhighlighter_settings[gutter]" type="checkbox" id="syntaxhighlighter-gutter" value="1" <?php checked( $this->settings['gutter'], 1 ); ?> /> <?php _e( 'Display line numbers', 'syntaxhighlighter' ); ?></label><br /> <label for="syntaxhighlighter-toolbar"><input name="syntaxhighlighter_settings[toolbar]" type="checkbox" id="syntaxhighlighter-toolbar" value="1" <?php checked( $this->settings['toolbar'], 1 ); ?> /> <?php _e( 'Display the toolbar', 'syntaxhighlighter' ); ?></label><br /> <label for="syntaxhighlighter-autolinks"><input name="syntaxhighlighter_settings[autolinks]" type="checkbox" id="syntaxhighlighter-autolinks" value="1" <?php checked( $this->settings['autolinks'], 1 ); ?> /> <?php _e( 'Automatically make URLs clickable', 'syntaxhighlighter' ); ?></label><br /> <label for="syntaxhighlighter-collapse"><input name="syntaxhighlighter_settings[collapse]" type="checkbox" id="syntaxhighlighter-collapse" value="1" <?php checked( $this->settings['collapse'], 1 ); ?> /> <?php _e( 'Collapse code boxes', 'syntaxhighlighter' ); ?></label><br /> <label for="syntaxhighlighter-light"><input name="syntaxhighlighter_settings[light]" type="checkbox" id="syntaxhighlighter-light" value="1" <?php checked( $this->settings['light'], 1 ); ?> /> <?php _e( 'Use the light display mode, best for single lines of code', 'syntaxhighlighter' ); ?></label><br /> <label for="syntaxhighlighter-smarttabs"><input name="syntaxhighlighter_settings[smarttabs]" type="checkbox" id="syntaxhighlighter-smarttabs" value="1" <?php checked( $this->settings['smarttabs'], 1 ); ?> /> <?php _e( 'Use smart tabs allowing tabs being used for alignment', 'syntaxhighlighter' ); ?></label><br /> <label for="syntaxhighlighter-wraplines"><input name="syntaxhighlighter_settings[wraplines]" type="checkbox" id="syntaxhighlighter-wraplines" value="1" <?php checked( $this->settings['wraplines'], 1 ); ?> /> <?php _e( 'Wrap long lines (v2.x only, disabling this will make a scrollbar show instead)', 'syntaxhighlighter' ); ?></label><br /> <!--<label for="syntaxhighlighter-htmlscript"><input name="syntaxhighlighter_settings[htmlscript]" type="checkbox" id="syntaxhighlighter-htmlscript" value="1" <?php checked( $this->settings['htmlscript'], 1 ); ?> /> <?php _e( 'Enable &quot;HTML script&quot; mode by default (see the bottom of this page for details). Checking this box is not recommended as this mode only works with certain languages.', 'syntaxhighlighter' ); ?></label>--> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-classname"><?php _e( 'Additional CSS Class(es)', 'syntaxhighlighter' ); ?></label></th> <td><input name="syntaxhighlighter_settings[classname]" type="text" id="syntaxhighlighter-classname" value="<?php echo esc_attr( $this->settings['classname'] ); ?>" class="regular-text" /></td> </tr> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-firstline"><?php _e( 'Starting Line Number', 'syntaxhighlighter' ); ?></label></th> <td><input name="syntaxhighlighter_settings[firstline]" type="text" id="syntaxhighlighter-firstline" value="<?php echo esc_attr( $this->settings['firstline'] ); ?>" class="small-text" /></td> </tr> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-padlinenumbers"><?php _e( 'Line Number Padding', 'syntaxhighlighter' ); ?></label></th> <td> <select name="syntaxhighlighter_settings[padlinenumbers]" id="syntaxhighlighter-padlinenumbers" class="postform"> <?php $linepaddings = array( 'false' => __( 'Off', 'syntaxhighlighter' ), 'true' => __( 'Automatic', 'syntaxhighlighter' ), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, ); foreach ( $linepaddings as $value => $name ) { echo ' <option value="' . esc_attr( $value ) . '"' . selected( $this->settings['padlinenumbers'], $value, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n"; } ?> </select> </td> </tr> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-tabsize"><?php _e( 'Tab Size', 'syntaxhighlighter' ); ?></label></th> <td><input name="syntaxhighlighter_settings[tabsize]" type="text" id="syntaxhighlighter-tabsize" value="<?php echo esc_attr( $this->settings['tabsize'] ); ?>" class="small-text" /></td> </tr> <tr valign="top"> <th scope="row"><label for="syntaxhighlighter-title"><?php _e( 'Title', 'syntaxhighlighter' ); ?></label></th> <td> <input name="syntaxhighlighter_settings[title]" type="text" id="syntaxhighlighter-title" value="<?php echo esc_attr( $this->settings['title'] ); ?>" class="regular-text" /><br /> <?php _e( 'Some optional default text to display above each code block or as the clickable text for collapsed code blocks.', 'syntaxhighlighter' ); ?> </td> </tr> </table> <p class="submit"> <?php if ( function_exists( 'submit_button' ) ) { submit_button( null, 'primary', 'syntaxhighlighter-submit', false ); echo ' '; submit_button( __( 'Reset to Defaults', 'syntaxhighlighter' ), 'primary', 'syntaxhighlighter-defaults', false ); } else { echo '<input type="submit" name="syntaxhighlighter-submit" class="button-primary" value="' . __( 'Save Changes') . '" />' . "\n"; echo '<input type="submit" name="syntaxhighlighter-defaults" id="syntaxhighlighter-defaults" class="button-primary" value="' . __( 'Reset to Defaults', 'syntaxhighlighter' ) . '" />' . "\n"; } ?> </p> </form> <h3><?php _e( 'Preview', 'syntaxhighlighter' ); ?></h3> <p><?php _e( 'Click &quot;Save Changes&quot; to update this preview.', 'syntaxhighlighter' ); ?> <?php echo '<div'; if ( ! empty( $GLOBALS['content_width'] ) ) echo ' style="max-width:' . intval( $GLOBALS['content_width'] ) . 'px"'; echo '>'; $title = ( empty( $this->settings['title'] ) && 1 != $this->settings['collapse'] ) ? ' title="Code example: (this example was added using the title parameter)"' : ''; // Site owners may opt to disable the short tags, i.e. [php] $democode = apply_filters( 'syntaxhighlighter_democode', '[sourcecode language="php" htmlscript="true" highlight="12"' . $title . ']<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>PHP Code Example</title> </head> <body> <h1>' . __( 'PHP Code Example', 'syntaxhighlighter' ) . '</h1> <p><?php echo \'' . __( 'Hello World!', 'syntaxhighlighter' ) . '\'; ?></p> <p>' . __( 'This line is highlighted.', 'syntaxhighlighter' ) . '</p> <div class="foobar"> ' . __( ' This is an example of smart tabs.', 'syntaxhighlighter' ) . ' </div> <p><a href="http://wordpress.org/">' . __( 'WordPress' ) . '</a></p> </body> </html>[/sourcecode]' ); $this->codeformat = 1; echo $this->parse_shortcodes( $democode ); $this->codeformat = false; echo '</div>'; ?> <h3 style="margin-top:30px"><?php _e( 'Shortcode Parameters', 'syntaxhighlighter' ); ?></h3> <p><?php printf( __( 'These are the parameters you can pass to the shortcode and what they do. For the booleans (i.e. on/off), pass %1$s/%2$s or %3$s/%4$s.', 'syntaxhighlighter' ), '<code>true</code>', '<code>1</code>', '<code>false</code>', '<code>0</code>' ); ?></p> <ul class="ul-disc"> <li><?php printf( _x( '%1$s or %2$s &#8212; The language syntax to highlight with. You can alternately just use that as the tag, such as <code>[php]code[/php]</code>. <a href="%3$s">Click here</a> for a list of valid tags (under &quot;aliases&quot;).', 'language parameter', 'syntaxhighlighter' ), '<code>lang</code>', '<code>language</code>', 'http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes' ); ?></li> <li><?php printf( _x( '%s &#8212; Toggle automatic URL linking.', 'autolinks parameter', 'syntaxhighlighter' ), '<code>autolinks</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; Add an additional CSS class to the code box.', 'classname parameter', 'syntaxhighlighter' ), '<code>classname</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; Toggle collapsing the code box by default, requiring a click to expand it. Good for large code posts.', 'collapse parameter', 'syntaxhighlighter' ), '<code>collapse</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; An interger specifying what number the first line should be (for the line numbering).', 'firstline parameter', 'syntaxhighlighter' ), '<code>firstline</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; Toggle the left-side line numbering.', 'gutter parameter', 'syntaxhighlighter' ), '<code>gutter</code>' ); ?></li> <li><?php printf( _x( '%1$s &#8212; A comma-sperated list of line numbers to highlight. You can also specify a range. Example: %2$s', 'highlight parameter', 'syntaxhighlighter' ), '<code>highlight</code>', '<code>2,5-10,12</code>' ); ?></li> <li><?php printf( _x( "%s &#8212; Toggle highlighting any extra HTML/XML. Good for when you're mixing HTML/XML with another language, such as having PHP inside an HTML web page. The above preview has it enabled for example. This only works with certain languages.", 'htmlscript parameter', 'syntaxhighlighter' ), '<code>htmlscript</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; Toggle light mode which disables the gutter and toolbar all at once.', 'light parameter', 'syntaxhighlighter' ), '<code>light</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; Controls line number padding. Valid values are <code>false</code> (no padding), <code>true</code> (automatic padding), or an integer (forced padding).', 'padlinenumbers parameter', 'syntaxhighlighter' ), '<code>padlinenumbers</code>' ); ?></li> <li><?php printf( _x( '%1$s (v3 only) &#8212; Sets some text to show up before the code. Very useful when combined with the %2$s parameter.', 'title parameter', 'syntaxhighlighter' ), '<code>title</code>', '<code>collapse</code>' ); ?></li> <li><?php printf( _x( '%s &#8212; Toggle the toolbar (buttons in v2, the about question mark in v3)', 'toolbar parameter', 'syntaxhighlighter' ), '<code>toolbar</code>' ); ?></li> <li><?php printf( _x( '%s (v2 only) &#8212; Toggle line wrapping.', 'wraplines parameter', 'syntaxhighlighter'), '<code>wraplines</code>' ); ?></li> </ul> <p><?php _e( 'Some example shortcodes:', 'syntaxhighlighter' ); ?></p> <ul class="ul-disc"> <li><code>[php]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/php]</code></li> <li><code>[css autolinks=&quot;false&quot; classname=&quot;myclass&quot; collapse=&quot;false&quot; firstline=&quot;1&quot; gutter=&quot;true&quot; highlight=&quot;1-3,6,9&quot; htmlscript=&quot;false&quot; light=&quot;false&quot; padlinenumbers=&quot;false&quot; smarttabs=&quot;true&quot; tabsize=&quot;4&quot; toolbar=&quot;true&quot; title=&quot;<?php _e( 'example-filename.php', 'syntaxhighlighter' ); ?>&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/css]</code></li> <li><code>[code lang=&quot;js&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/code]</code></li> <li><code>[sourcecode language=&quot;plain&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/sourcecode]</code></li> </ul> <?php $this->maybe_output_scripts(); ?> </div> <?php } // Validate the settings sent from the settings page function validate_settings( $settings ) { if ( !empty($_POST['syntaxhighlighter-defaults']) ) { $settings = $this->defaultsettings; $_REQUEST['_wp_http_referer'] = add_query_arg( 'defaults', 'true', $_REQUEST['_wp_http_referer'] ); } else { $settings['shversion'] = ( ! empty($settings['shversion']) && 2 == $settings['shversion'] ) ? 2 : 3; $settings['theme'] = ( ! empty($settings['theme']) && isset($this->themes[$settings['theme']]) ) ? strtolower($settings['theme']) : $this->defaultsettings['theme']; $settings['loadallbrushes'] = ( ! empty($settings['loadallbrushes']) ) ? 1 : 0; $settings['autolinks'] = ( ! empty($settings['autolinks']) ) ? 1 : 0; $settings['collapse'] = ( ! empty($settings['collapse']) ) ? 1 : 0; $settings['gutter'] = ( ! empty($settings['gutter']) ) ? 1 : 0; $settings['light'] = ( ! empty($settings['light']) ) ? 1 : 0; $settings['smarttabs'] = ( ! empty($settings['smarttabs']) ) ? 1 : 0; $settings['toolbar'] = ( ! empty($settings['toolbar']) ) ? 1 : 0; // May be overridden below $settings['wraplines'] = ( ! empty($settings['wraplines']) ) ? 1 : 0; // 2.x only for now // If the version changed, then force change the toolbar version setting if ( $settings['shversion'] != $this->settings['shversion'] ) { $settings['toolbar'] = ( 2 == $settings['shversion'] ) ? 1 : 0; } if ( 'true' != $settings['padlinenumbers'] && 'false' != $settings['padlinenumbers'] ) $settings['padlinenumbers'] = (int) $settings['padlinenumbers']; $settings['classname'] = ( !empty($settings['classname']) ) ? preg_replace( '/[^ A-Za-z0-9_-]*/', '', $settings['classname'] ) : ''; $settings['firstline'] = (int) ( !empty($settings['firstline']) ) ? $settings['firstline'] : $this->defaultsettings['firstline']; $settings['tabsize'] = (int) ( !empty($settings['tabsize']) ) ? $settings['tabsize'] : $this->defaultsettings['tabsize']; } return $settings; } // PHP4 compatibility function SyntaxHighlighter() { $this->__construct(); } } // Start this plugin once all other plugins are fully loaded add_action( 'init', 'SyntaxHighlighter', 5 ); function SyntaxHighlighter() { global $SyntaxHighlighter; $SyntaxHighlighter = new SyntaxHighlighter(); } ?>
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter.php
PHP
oos
63,281
/* * SyntaxHighlighter shortcode plugin * by Andrew Ozz of Automattic */ // Avoid JS errors if ( typeof syntaxHLcodes == 'undefined' ) { var syntaxHLcodes = 'sourcecode'; } (function() { tinymce.create('tinymce.plugins.SyntaxHighlighterPlugin', { init : function(ed, url) { var t = this; ed.onBeforeSetContent.add(function(ed, o) { o.content = t._htmlToVisual(o.content); }); ed.onPostProcess.add(function(ed, o) { if ( o.save ) { o.content = t._visualToHtml(o.content); } }); }, getInfo : function() { return { longname : 'SyntaxHighlighter Assister', author : 'Automattic', authorurl : 'http://wordpress.com/', infourl : 'http://wordpress.org/extend/plugins/syntaxhighlighter/', version : tinymce.majorVersion + "." + tinymce.minorVersion }; }, // Private methods _visualToHtml : function(content) { content = tinymce.trim(content); // 2 <br> get converted to \n\n and are needed to preserve the next <p> content = content.replace(new RegExp('(<pre>\\s*)?(\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]*?\\[\\/\\3\\])(\\s*<\\/pre>)?', 'gi'), function(a) { a = a.replace( /<br \/>([\t ])/g, '<br \/><%%KEEPWHITESPACE%%>$1' ); return a + '<br /><br />'; }); content = content.replace(/<\/pre>(<br \/><br \/>)?<pre>/gi, '\n'); return content; }, _htmlToVisual : function(content) { content = tinymce.trim(content); content = content.replace(new RegExp('(<p>\\s*)?(<pre>\\s*)?(\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]*?\\[\\/\\4\\])(\\s*<\\/pre>)?(\\s*<\\/p>)?', 'gi'), '<pre>$3</pre>'); content = content.replace(/<\/pre><pre>/gi, '\n'); // Remove anonymous, empty paragraphs. content = content.replace(/<p>(\s|&nbsp;)*<\/p>/mg, ''); // Look for <p> <br> in the [tag]s, replace with <br /> content = content.replace(new RegExp('\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]+?\\[\\/\\1\\]', 'gi'), function(a) { return a.replace(/<br ?\/?>[\r\n]*/g, '<br />').replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<br />'); }); return content; } }); // Register plugin tinymce.PluginManager.add('syntaxhighlighter', tinymce.plugins.SyntaxHighlighterPlugin); })(); var syntaxHLlast = 0; function pre_wpautop2(content) { var d = new Date(), time = d.getTime(); if ( time - syntaxHLlast < 500 ) return content; syntaxHLlast = time; content = content.replace(new RegExp('<pre>\\s*\\[(' + syntaxHLcodes + ')', 'gi'), '[$1'); content = content.replace(new RegExp('\\[\\/(' + syntaxHLcodes + ')\\]\\s*<\\/pre>', 'gi'), '[/$1]'); content = this._pre_wpautop(content); content = content.replace(new RegExp('\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]+?\\[\\/\\1\\]', 'gi'), function(a) { return a.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&').replace(/<%%KEEPWHITESPACE%%>/g, ''); }); return content; } function wpautop2(content) { // js htmlspecialchars content = content.replace(new RegExp('\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]+?\\[\\/\\1\\]', 'gi'), function(a) { return a.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); }); return this._wpautop(content); } switchEditors._pre_wpautop = switchEditors.pre_wpautop; switchEditors._wpautop = switchEditors.wpautop; switchEditors.pre_wpautop = pre_wpautop2; switchEditors.wpautop = wpautop2;
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter_mce.js
JavaScript
oos
3,358
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /** * Eclipse IDE SyntaxHighlighter color theme * (C) Code-House * http://blog.code-house.org/2009/10/xml-i-adnotacje-kod-ogolnego-przeznaczenia-i-jpa/ */ .syntaxhighlighter { background-color: #fff !important; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { background-color: #c3defe !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #c3defe !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #787878 !important; background-color: #fff !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 1px solid #d4d0c8 !important; color: #000 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { background-color: #fff !important; } /* Second line */ .syntaxhighlighter .line.alt2 { background-color: #fff !important; } .syntaxhighlighter .toolbar { background-color: #F8F8F8 !important; border: #E7E5DC solid 1px !important; } .syntaxhighlighter .toolbar a { color: #a0a0a0 !important; } .syntaxhighlighter .toolbar a:hover { color: red !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #000 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #3f5fbf !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #2a00ff !important; } .syntaxhighlighter .keyword { color: #7f0055 !important; font-weight: bold !important; } .syntaxhighlighter .preprocessor { color: #646464 !important; } .syntaxhighlighter .variable { color: #a70 !important; } .syntaxhighlighter .value { color: #090 !important; } .syntaxhighlighter .functions { color: #ff1493 !important; } .syntaxhighlighter .constants { color: #0066CC !important; } .syntaxhighlighter .script { background-color: yellow !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #808080 !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #ff1493 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: red !important; } .xml .keyword { color: #3f7f7f !important; font-weight: normal !important; } .xml .color1, .xml .color1 a{ color: #7f007f !important; } .xml .string { font-style: italic !important; color: #2a00ff !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeEclipse.css
CSS
oos
3,692
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ .syntaxhighlighter, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody { margin: 0 !important; padding: 0 !important; border: 0 !important; outline: 0 !important; background: none !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.4em !important; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; /*min-height: inherit !important; *//* For IE8, FF & WebKit */ /*min-height: auto !important;*/ /* For IE7 */ direction: ltr !important; } .syntaxhighlighter { /* width: 99% !important; */ /* 99% fixes IE8 horizontal scrollbar */ margin: 0 5px 15px !important; padding: 1px !important; /* adds a little border on top and bottom */ position: relative !important; } .syntaxhighlighter code { display: inline !important; } .syntaxhighlighter .bold { font-weight: bold !important; } .syntaxhighlighter .italic { font-style: italic !important; } .syntaxhighlighter .line { } .syntaxhighlighter .no-wrap .line .content { white-space: pre !important; } .syntaxhighlighter .line table { border-collapse: collapse !important; } .syntaxhighlighter .line td { vertical-align: top !important; } .syntaxhighlighter .line .number { width: 3em !important; } .syntaxhighlighter .line .number code { width: 2.7em !important; padding-right: .3em !important; text-align: right !important; display: block !important; } .syntaxhighlighter .line .content { padding-left: .5em !important; } .syntaxhighlighter .line .spaces { } /* Disable border and margin on the lines when no gutter option is set */ .syntaxhighlighter.nogutter .line .content { border-left: none !important; } .syntaxhighlighter .bar { display: none !important; } .syntaxhighlighter .bar.show { display: block !important; } .syntaxhighlighter.collapsed .bar { display: block !important; } /* Adjust some properties when collapsed */ .syntaxhighlighter.collapsed .lines { display: none !important; } .syntaxhighlighter .lines.no-wrap { overflow: auto !important; overflow-y: hidden !important; } /* Styles for the toolbar */ .syntaxhighlighter .toolbar { position: absolute !important; right: 0px !important; top: 0px !important; font-size: 1px !important; padding: 8px 8px 8px 0 !important; /* in px because images don't scale with ems */ } .syntaxhighlighter.collapsed .toolbar { font-size: 80% !important; padding: .2em 0 .5em .5em !important; position: static !important; } .syntaxhighlighter .toolbar a.item, .syntaxhighlighter .toolbar .item { display: block !important; float: left !important; margin-left: 8px !important; background-repeat: no-repeat !important; overflow: hidden !important; text-indent: -5000px !important; } .syntaxhighlighter.collapsed .toolbar .item { display: none !important; } .syntaxhighlighter.collapsed .toolbar .item.expandSource { background-image: url(magnifier.png) !important; display: inline !important; text-indent: 0 !important; width: auto !important; float: none !important; height: 16px !important; padding-left: 20px !important; } .syntaxhighlighter .toolbar .item.viewSource { background-image: url(page_white_code.png) !important; } .syntaxhighlighter .toolbar .item.printSource { background-image: url(printer.png) !important; } .syntaxhighlighter .toolbar .item.copyToClipboard { text-indent: 0 !important; background: none !important; overflow: visible !important; } .syntaxhighlighter .toolbar .item.about { background-image: url(help.png) !important; } /** * Print view. * Colors are based on the default theme without background. */ .syntaxhighlighter.printing, .syntaxhighlighter.printing .line.alt1 .content, .syntaxhighlighter.printing .line.alt2 .content, .syntaxhighlighter.printing .line.highlighted .number, .syntaxhighlighter.printing .line.highlighted.alt1 .content, .syntaxhighlighter.printing .line.highlighted.alt2 .content, { background: none !important; } /* Gutter line numbers */ .syntaxhighlighter.printing .line .number { color: #bbb !important; } /* Add border to the lines */ .syntaxhighlighter.printing .line .content { color: #000 !important; } /* Toolbar when visible */ .syntaxhighlighter.printing .toolbar { display: none !important; } .syntaxhighlighter.printing a { text-decoration: none !important; } .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { color: #000 !important; } .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { color: #008200 !important; } .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { color: blue !important; } .syntaxhighlighter.printing .keyword { color: #069 !important; font-weight: bold !important; } .syntaxhighlighter.printing .preprocessor { color: gray !important; } .syntaxhighlighter.printing .variable { color: #a70 !important; } .syntaxhighlighter.printing .value { color: #090 !important; } .syntaxhighlighter.printing .functions { color: #ff1493 !important; } .syntaxhighlighter.printing .constants { color: #0066CC !important; } .syntaxhighlighter.printing .script { font-weight: bold !important; } .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { color: #808080 !important; } .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { color: #ff1493 !important; } .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { color: red !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shCore.css
CSS
oos
7,302
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /************************************ * Default Syntax Highlighter theme. * * Interface elements. ************************************/ .syntaxhighlighter { background-color: #E9E9E9 !important; /*border: 1px solid #E0E0E0 !important;*/ padding: 10px 0 !important; border-radius: 5px; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { color: black !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #e0e0e0 !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #afafaf !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 3px solid #6CE26C !important; color: #000 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { /*background-color: #fff !important;*/ } /* Second line */ .syntaxhighlighter .line.alt2 { /*background-color: #F8F8F8 !important;*/ } .syntaxhighlighter .toolbar { background-color: #F8F8F8 !important; border: #E7E5DC solid 1px !important; } .syntaxhighlighter .toolbar * { margin-bottom: 0; } .syntaxhighlighter .toolbar a { color: #a0a0a0 !important; } .syntaxhighlighter .toolbar a:hover { color: red !important; } .nogutter { border: none !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #000 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #008200 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: blue !important; } .syntaxhighlighter .keyword { color: #069 !important; font-weight: bold !important; } .syntaxhighlighter .preprocessor { color: gray !important; } .syntaxhighlighter .variable { color: #a70 !important; } .syntaxhighlighter .value { color: #090 !important; } .syntaxhighlighter .functions { color: #ff1493 !important; } .syntaxhighlighter .constants { color: #0066CC !important; } .syntaxhighlighter .script { background-color: yellow !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #808080 !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #ff1493 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: red !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeDefault.css
CSS
oos
3,735
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /** * Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager * http://www.ibrasten.com/ */ /************************************ * Interface elements. ************************************/ .syntaxhighlighter { background-color: #121212 !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #C3C3C3 !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 3px solid #3185B9 !important; color: #B9BDB6 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { } /* Second line */ .syntaxhighlighter .line.alt2 { background-color: #000000 !important; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { background-color: #3A3A00 !important; color: #fff !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #3A3A00 !important; } .syntaxhighlighter .toolbar { background-color: #000000 !important; border: #000000 solid 1px !important; } .syntaxhighlighter .toolbar a { color: #808080 !important; } .syntaxhighlighter .toolbar a:hover { color: #96DAFF !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #FFFFFF !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #696854 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #E3E658 !important; } .syntaxhighlighter .keyword { color: #D01D33 !important; } .syntaxhighlighter .preprocessor { color: #435A5F !important; } .syntaxhighlighter .variable { color: #898989 !important; } .syntaxhighlighter .value { color: #090 !important; } .syntaxhighlighter .functions { color: #AAAAAA !important; font-weight: bold !important; } .syntaxhighlighter .constants { color: #96DAFF !important; } .syntaxhighlighter .script { background-color: #C3C3C3 !important; color: #000 !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #FFC074 !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #4A8CDB !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #96DAFF !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeFadeToGrey.css
CSS
oos
3,508
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /** * RDark SyntaxHighlighter theme based on theme by Radu Dineiu * http://www.vim.org/scripts/script.php?script_id=1732 */ /************************************ * Interface elements. ************************************/ .syntaxhighlighter { background-color: #1B2426 !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #B9BDB6 !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 3px solid #435A5F !important; color: #B9BDB6 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { background-color: #1B2426 !important; } /* Second line */ .syntaxhighlighter .line.alt2 { background-color: #1B2426 !important; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { background-color: #435A5F !important; color: #fff !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #435A5F !important; } .syntaxhighlighter .toolbar { background-color: #1B2426 !important; } .syntaxhighlighter .toolbar a { color: #646763 !important; } .syntaxhighlighter .toolbar a:hover { color: #E0E8FF !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #B9BDB6 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #878A85 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #5CE638 !important; } .syntaxhighlighter .keyword { color: #5BA1CF !important; } .syntaxhighlighter .preprocessor { color: #435A5F !important; } .syntaxhighlighter .variable { color: #FFAA3E !important; } .syntaxhighlighter .value { color: #090 !important; } .syntaxhighlighter .functions { color: #FFAA3E !important; } .syntaxhighlighter .constants { color: #E0E8FF !important; } .syntaxhighlighter .script { background-color: #435A5F !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #E0E8FF !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #FFFFFF !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #FFAA3E !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeRDark.css
CSS
oos
3,472
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /** * Django SyntaxHighlighter theme */ /************************************ * Interface elements. ************************************/ .syntaxhighlighter { background-color: #0B2F20 !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #497958 !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 3px solid #41A83E !important; color: #B9BDB6 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { } /* Second line */ .syntaxhighlighter .line.alt2 { background-color: #0a2b1d !important; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { background-color: #336442 !important; color: #fff !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #336442 !important; } .syntaxhighlighter .toolbar { background-color: #245032 !important; border: #0B2F20 solid 1px !important; } .syntaxhighlighter .toolbar a { color: #C4B14A !important; } .syntaxhighlighter .toolbar a:hover { color: #FFE862 !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #F8F8F8 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #336442 !important; font-style: italic !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #9DF39F !important; } .syntaxhighlighter .keyword { color: #96DD3B !important; font-weight: bold !important; } .syntaxhighlighter .preprocessor { color: #91BB9E !important; } .syntaxhighlighter .variable { color: #FFAA3E !important; } .syntaxhighlighter .value { color: #F7E741 !important; } .syntaxhighlighter .functions { color: #FFAA3E !important; } .syntaxhighlighter .constants { color: #E0E8FF !important; } .syntaxhighlighter .script { background-color: #497958 !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #EB939A !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #91BB9E !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #EDEF7D !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeDjango.css
CSS
oos
3,452
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /** * Midnight SyntaxHighlighter theme based on theme by J.D. Myers * http://webdesign.lsnjd.com/ */ /************************************ * Interface elements. ************************************/ .syntaxhighlighter { background-color: #0F192A !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #38566F !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 3px solid #435A5F !important; color: #B9BDB6 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { background-color: #0F192A !important; } /* Second line */ .syntaxhighlighter .line.alt2 { background-color: #0F192A !important; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { background-color: #253E5A !important; color: #fff !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #253E5A !important; } .syntaxhighlighter .toolbar { background-color: #0F192A !important; } .syntaxhighlighter .toolbar a { color: #38566F !important; } .syntaxhighlighter .toolbar a:hover { color: #8AA6C1 !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #D1EDFF !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #428BDD !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #1DC116 !important; } .syntaxhighlighter .keyword { color: #B43D3D !important; } .syntaxhighlighter .preprocessor { color: #8AA6C1 !important; } .syntaxhighlighter .variable { color: #FFAA3E !important; } .syntaxhighlighter .value { color: #F7E741 !important; } .syntaxhighlighter .functions { color: #FFAA3E !important; } .syntaxhighlighter .constants { color: #E0E8FF !important; } .syntaxhighlighter .script { background-color: #404040 !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #F8BB00 !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #FFFFFF !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #FFAA3E !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeMidnight.css
CSS
oos
3,452
/** * SyntaxHighlighter * http://alexgorbatchev.com/ * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate * * @version * 2.1.364 (October 15 2009) * * @copyright * Copyright (C) 2004-2009 Alex Gorbatchev. * * @license * This file is part of SyntaxHighlighter. * * SyntaxHighlighter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SyntaxHighlighter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. */ /** * Emacs SyntaxHighlighter theme based on theme by Joshua Emmons * http://www.skia.net/ */ /************************************ * Interface elements. ************************************/ .syntaxhighlighter { background-color: #000000 !important; } /* Gutter line numbers */ .syntaxhighlighter .line .number { color: #D3D3D3 !important; } /* Add border to the lines */ .syntaxhighlighter .line .content { border-left: 3px solid #990000 !important; color: #B9BDB6 !important; } .syntaxhighlighter.printing .line .content { border: 0 !important; } /* First line */ .syntaxhighlighter .line.alt1 { } /* Second line */ .syntaxhighlighter .line.alt2 { background-color: #0f0f0f !important; } /* Highlighed line number */ .syntaxhighlighter .line.highlighted .number { background-color: #435A5F !important; color: #fff !important; } /* Highlighed line */ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #435A5F !important; } .syntaxhighlighter .toolbar { background-color: #000000 !important; border: #000000 solid 1px !important; } .syntaxhighlighter .toolbar a { color: #646763 !important; } .syntaxhighlighter .toolbar a:hover { color: #9CCFF4 !important; } /************************************ * Actual syntax highlighter colors. ************************************/ .syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #D3D3D3 !important; } .syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #FF7D27 !important; } .syntaxhighlighter .string, .syntaxhighlighter .string a { color: #FF9E7B !important; } .syntaxhighlighter .keyword { color: #00FFFF !important; } .syntaxhighlighter .preprocessor { color: #AEC4DE !important; } .syntaxhighlighter .variable { color: #FFAA3E !important; } .syntaxhighlighter .value { color: #090 !important; } .syntaxhighlighter .functions { color: #81CEF9 !important; } .syntaxhighlighter .constants { color: #FF9E7B !important; } .syntaxhighlighter .script { background-color: #990000 !important; } .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { color: #EBDB8D !important; } .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { color: #FF7D27 !important; } .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { color: #AEC4DE !important; }
01happy-blog
trunk/myblog/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeEmacs.css
CSS
oos
3,442
<?php // Silence is golden. ?>
01happy-blog
trunk/myblog/wp-content/plugins/index.php
PHP
oos
30
<?php /** Plugin Name: Simple Local Avatars Plugin URI: http://get10up.com/plugins/simple-local-avatars-wordpress/ Description: Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight. Version: 1.3.1 Author: Jake Goldman (10up LLC), Oomph Inc Author URI: http://get10up.com Plugin: Copyright 2011 Jake Goldman (email : jake@get10up.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA NOTE: Previous versions may have accidentally and incorrectly attributed the copyright to employers of Mr. Goldman. While credit is given to all contributors to the current version, including Mr. Goldman's employers, the copyright belongs - and has always belonged - to Mr. Goldman, personally. */ /** * add field to user profiles */ class Simple_Local_Avatars { private $user_id_being_edited; public function __construct() { add_filter( 'get_avatar', array( $this, 'get_avatar' ), 10, 5 ); add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'show_user_profile', array( $this, 'edit_user_profile' ) ); add_action( 'edit_user_profile', array( $this, 'edit_user_profile' ) ); add_action( 'personal_options_update', array( $this, 'edit_user_profile_update' ) ); add_action( 'edit_user_profile_update', array( $this, 'edit_user_profile_update' ) ); add_filter( 'avatar_defaults', array( $this, 'avatar_defaults' ) ); } public function get_avatar( $avatar = '', $id_or_email, $size = 96, $default = '', $alt = false ) { if ( is_numeric($id_or_email) ) $user_id = (int) $id_or_email; elseif ( is_string( $id_or_email ) && ( $user = get_user_by( 'email', $id_or_email ) ) ) $user_id = $user->ID; elseif ( is_object( $id_or_email ) && ! empty( $id_or_email->user_id ) ) $user_id = (int) $id_or_email->user_id; if ( empty( $user_id ) ) return $avatar; $local_avatars = get_user_meta( $user_id, 'simple_local_avatar', true ); if ( empty( $local_avatars ) || empty( $local_avatars['full'] ) ) return $avatar; $size = (int) $size; if ( empty( $alt ) ) $alt = get_the_author_meta( 'display_name', $user_id ); // generate a new size if ( empty( $local_avatars[$size] ) ) { $upload_path = wp_upload_dir(); $avatar_full_path = str_replace( $upload_path['baseurl'], $upload_path['basedir'], $local_avatars['full'] ); $image_sized = image_resize( $avatar_full_path, $size, $size, true ); // deal with original being >= to original image (or lack of sizing ability) $local_avatars[$size] = is_wp_error($image_sized) ? $local_avatars[$size] = $local_avatars['full'] : str_replace( $upload_path['basedir'], $upload_path['baseurl'], $image_sized ); // save updated avatar sizes update_user_meta( $user_id, 'simple_local_avatar', $local_avatars ); } elseif ( substr( $local_avatars[$size], 0, 4 ) != 'http' ) { $local_avatars[$size] = home_url( $local_avatars[$size] ); } $author_class = is_author( $user_id ) ? ' current-author' : '' ; $avatar = "<img alt='" . esc_attr( $alt ) . "' src='" . $local_avatars[$size] . "' class='avatar avatar-{$size}{$author_class} photo' height='{$size}' width='{$size}' />"; return apply_filters( 'simple_local_avatar', $avatar ); } public function admin_init() { load_plugin_textdomain( 'simple-local-avatars', false, dirname( plugin_basename( __FILE__ ) ) . '/localization/' ); register_setting( 'discussion', 'simple_local_avatars_caps', array( $this, 'sanitize_options' ) ); add_settings_field( 'simple-local-avatars-caps', __('Local Avatar Permissions','simple-local-avatars'), array( $this, 'avatar_settings_field' ), 'discussion', 'avatars' ); } public function sanitize_options( $input ) { $new_input['simple_local_avatars_caps'] = empty( $input['simple_local_avatars_caps'] ) ? 0 : 1; return $new_input; } public function avatar_settings_field( $args ) { $options = get_option('simple_local_avatars_caps'); echo ' <label for="simple_local_avatars_caps"> <input type="checkbox" name="simple_local_avatars_caps" id="simple_local_avatars_caps" value="1" ' . @checked( $options['simple_local_avatars_caps'], 1, false ) . ' /> ' . __('Only allow users with file upload capabilities to upload local avatars (Authors and above)','simple-local-avatars') . ' </label> '; } public function edit_user_profile( $profileuser ) { ?> <h3><?php _e( 'Avatar','simple-local-avatars' ); ?></h3> <table class="form-table"> <tr> <th><label for="simple-local-avatar"><?php _e('Upload Avatar','simple-local-avatars'); ?></label></th> <td style="width: 50px;" valign="top"> <?php echo get_avatar( $profileuser->ID ); ?> </td> <td> <?php $options = get_option('simple_local_avatars_caps'); if ( empty($options['simple_local_avatars_caps']) || current_user_can('upload_files') ) { do_action( 'simple_local_avatar_notices' ); wp_nonce_field( 'simple_local_avatar_nonce', '_simple_local_avatar_nonce', false ); ?> <input type="file" name="simple-local-avatar" id="simple-local-avatar" /><br /> <?php if ( empty( $profileuser->simple_local_avatar ) ) echo '<span class="description">' . __('No local avatar is set. Use the upload field to add a local avatar.','simple-local-avatars') . '</span>'; else echo ' <input type="checkbox" name="simple-local-avatar-erase" value="1" /> ' . __('Delete local avatar','simple-local-avatars') . '<br /> <span class="description">' . __('Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option.','simple-local-avatars') . '</span> '; } else { if ( empty( $profileuser->simple_local_avatar ) ) echo '<span class="description">' . __('No local avatar is set. Set up your avatar at Gravatar.com.','simple-local-avatars') . '</span>'; else echo '<span class="description">' . __('You do not have media management permissions. To change your local avatar, contact the blog administrator.','simple-local-avatars') . '</span>'; } ?> </td> </tr> </table> <script type="text/javascript">var form = document.getElementById('your-profile');form.encoding = 'multipart/form-data';form.setAttribute('enctype', 'multipart/form-data');</script> <?php } public function edit_user_profile_update( $user_id ) { if ( ! isset( $_POST['_simple_local_avatar_nonce'] ) || ! wp_verify_nonce( $_POST['_simple_local_avatar_nonce'], 'simple_local_avatar_nonce' ) ) //security return; if ( ! empty( $_FILES['simple-local-avatar']['name'] ) ) { $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff' ); // front end (theme my profile etc) support if ( ! function_exists( 'wp_handle_upload' ) ) require_once( ABSPATH . 'wp-admin/includes/file.php' ); $this->avatar_delete( $user_id ); // delete old images if successful // need to be more secure since low privelege users can upload if ( strstr( $_FILES['simple-local-avatar']['name'], '.php' ) ) wp_die('For security reasons, the extension ".php" cannot be in your file name.'); $this->user_id_being_edited = $user_id; // make user_id known to unique_filename_callback function $avatar = wp_handle_upload( $_FILES['simple-local-avatar'], array( 'mimes' => $mimes, 'test_form' => false, 'unique_filename_callback' => array( $this, 'unique_filename_callback' ) ) ); if ( empty($avatar['file']) ) { // handle failures switch ( $avatar['error'] ) { case 'File type does not meet security guidelines. Try another.' : add_action( 'user_profile_update_errors', create_function('$a','$a->add("avatar_error",__("Please upload a valid image file for the avatar.","simple-local-avatars"));') ); break; default : add_action( 'user_profile_update_errors', create_function('$a','$a->add("avatar_error","<strong>".__("There was an error uploading the avatar:","simple-local-avatars")."</strong> ' . esc_attr( $avatar['error'] ) . '");') ); } return; } update_user_meta( $user_id, 'simple_local_avatar', array( 'full' => $avatar['url'] ) ); // save user information (overwriting old) } elseif ( ! empty( $_POST['simple-local-avatar-erase'] ) ) { $this->avatar_delete( $user_id ); } } /** * remove the custom get_avatar hook for the default avatar list output on options-discussion.php */ public function avatar_defaults( $avatar_defaults ) { remove_action( 'get_avatar', array( $this, 'get_avatar' ) ); return $avatar_defaults; } /** * delete avatars based on user_id */ public function avatar_delete( $user_id ) { $old_avatars = get_user_meta( $user_id, 'simple_local_avatar', true ); $upload_path = wp_upload_dir(); if ( is_array($old_avatars) ) { foreach ($old_avatars as $old_avatar ) { $old_avatar_path = str_replace( $upload_path['baseurl'], $upload_path['basedir'], $old_avatar ); @unlink( $old_avatar_path ); } } delete_user_meta( $user_id, 'simple_local_avatar' ); } public function unique_filename_callback( $dir, $name, $ext ) { $user = get_user_by( 'id', (int) $this->user_id_being_edited ); $name = $base_name = sanitize_file_name( $user->display_name . '_avatar' ); $number = 1; while ( file_exists( $dir . "/$name$ext" ) ) { $name = $base_name . '_' . $number; $number++; } return $name . $ext; } } $simple_local_avatars = new Simple_Local_Avatars; /** * more efficient to call simple local avatar directly in theme and avoid gravatar setup * * @param int|string|object $id_or_email A user ID, email address, or comment object * @param int $size Size of the avatar image * @param string $default URL to a default image to use if no avatar is available * @param string $alt Alternate text to use in image tag. Defaults to blank * @return string <img> tag for the user's avatar */ function get_simple_local_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) { global $simple_local_avatars; $avatar = $simple_local_avatars->get_avatar( '', $id_or_email, $size, $default, $alt ); if ( empty ( $avatar ) ) $avatar = get_avatar( $id_or_email, $size, $default, $alt ); return $avatar; } /** * on uninstallation, remove the custom field from the users and delete the local avatars */ register_uninstall_hook( __FILE__, 'simple_local_avatars_uninstall' ); function simple_local_avatars_uninstall() { $simple_local_avatars = new Simple_Local_Avatars; $users = get_users_of_blog(); foreach ( $users as $user ) $simple_local_avatars->avatar_delete( $user->user_id ); delete_option('simple_local_avatars_caps'); }
01happy-blog
trunk/myblog/wp-content/plugins/simple-local-avatars/simple-local-avatars.php
PHP
oos
11,847
<?php /* Plugin Name: WordPress Database Backup Plugin URI: http://austinmatzko.com/wordpress-plugins/wp-db-backup/ Description: On-demand backup of your WordPress database. Navigate to <a href="edit.php?page=wp-db-backup">Tools &rarr; Backup</a> to get started. Author: Austin Matzko Author URI: http://austinmatzko.com/ Version: 2.2.3 Copyright 2010 Austin Matzko (email : austin at pressedcode.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA */ /** * Change WP_BACKUP_DIR if you want to * use a different backup location */ if ( ! defined('ABSPATH') ) { die('Please do not load this file directly.'); } $rand = substr( md5( md5( DB_PASSWORD ) ), -5 ); global $wpdbb_content_dir, $wpdbb_content_url, $wpdbb_plugin_dir; $wpdbb_content_dir = ( defined('WP_CONTENT_DIR') ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content'; $wpdbb_content_url = ( defined('WP_CONTENT_URL') ) ? WP_CONTENT_URL : get_option('siteurl') . '/wp-content'; $wpdbb_plugin_dir = ( defined('WP_PLUGIN_DIR') ) ? WP_PLUGIN_DIR : $wpdbb_content_dir . '/plugins'; if ( ! defined('WP_BACKUP_DIR') ) { define('WP_BACKUP_DIR', $wpdbb_content_dir . '/backup-' . $rand . '/'); } if ( ! defined('WP_BACKUP_URL') ) { define('WP_BACKUP_URL', $wpdbb_content_url . '/backup-' . $rand . '/'); } if ( ! defined('ROWS_PER_SEGMENT') ) { define('ROWS_PER_SEGMENT', 100); } /** * Set MOD_EVASIVE_OVERRIDE to true * and increase MOD_EVASIVE_DELAY * if the backup stops prematurely. */ // define('MOD_EVASIVE_OVERRIDE', false); if ( ! defined('MOD_EVASIVE_DELAY') ) { define('MOD_EVASIVE_DELAY', '500'); } class wpdbBackup { var $backup_complete = false; var $backup_file = ''; var $backup_filename; var $core_table_names = array(); var $errors = array(); var $basename; var $page_url; var $referer_check_key; var $version = '2.1.5-alpha'; function module_check() { $mod_evasive = false; if ( defined( 'MOD_EVASIVE_OVERRIDE' ) && true === MOD_EVASIVE_OVERRIDE ) return true; if ( ! defined( 'MOD_EVASIVE_OVERRIDE' ) || false === MOD_EVASIVE_OVERRIDE ) return false; if ( function_exists('apache_get_modules') ) foreach( (array) apache_get_modules() as $mod ) if ( false !== strpos($mod,'mod_evasive') || false !== strpos($mod,'mod_dosevasive') ) return true; return false; } function wpdbBackup() { global $table_prefix, $wpdb; add_action('wp_ajax_save_backup_time', array(&$this, 'save_backup_time')); add_action('init', array(&$this, 'init_textdomain')); add_action('init', array(&$this, 'set_page_url')); add_action('load-update-core.php', array(&$this, 'update_notice_action')); add_action('wp_db_backup_cron', array(&$this, 'cron_backup')); add_action('wp_cron_daily', array(&$this, 'wp_cron_daily')); add_filter('cron_schedules', array(&$this, 'add_sched_options')); add_filter('wp_db_b_schedule_choices', array(&$this, 'schedule_choices')); $table_prefix = ( isset( $table_prefix ) ) ? $table_prefix : $wpdb->prefix; $datum = date("Ymd_B"); $this->backup_filename = DB_NAME . "_$table_prefix$datum.sql"; $possible_names = array( 'categories', 'commentmeta', 'comments', 'link2cat', 'linkcategories', 'links', 'options', 'post2cat', 'postmeta', 'posts', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta', ); foreach( $possible_names as $name ) { if ( isset( $wpdb->{$name} ) ) { $this->core_table_names[] = $wpdb->{$name}; } } $this->backup_dir = trailingslashit(apply_filters('wp_db_b_backup_dir', WP_BACKUP_DIR)); $this->basename = 'wp-db-backup'; $this->referer_check_key = $this->basename . '-download_' . DB_NAME; if (isset($_POST['do_backup'])) { $this->wp_secure('fatal'); check_admin_referer($this->referer_check_key); $this->can_user_backup('main'); // save exclude prefs $exc_revisions = isset( $_POST['exclude-revisions'] ) ? (array) $_POST['exclude-revisions'] : array(); $exc_spam = isset( $_POST['exclude-spam'] ) ? (array) $_POST['exclude-spam'] : array(); update_option('wp_db_backup_excs', array('revisions' => $exc_revisions, 'spam' => $exc_spam)); switch($_POST['do_backup']) { case 'backup': add_action('init', array(&$this, 'perform_backup')); break; case 'fragments': add_action('admin_menu', array(&$this, 'fragment_menu')); break; } } elseif (isset($_GET['fragment'] )) { $this->can_user_backup('frame'); add_action('init', array(&$this, 'init')); } elseif (isset($_GET['backup'] )) { $this->can_user_backup(); add_action('init', array(&$this, 'init')); } else { add_action('admin_menu', array(&$this, 'admin_menu')); } } function init() { $this->can_user_backup(); if (isset($_GET['backup'])) { $via = isset($_GET['via']) ? $_GET['via'] : 'http'; $this->backup_file = $_GET['backup']; $this->validate_file($this->backup_file); switch($via) { case 'smtp': case 'email': $success = $this->deliver_backup($this->backup_file, 'smtp', $_GET['recipient'], 'frame'); $this->error_display( 'frame' ); if ( $success ) { echo ' <!-- ' . $via . ' --> <script type="text/javascript"><!--\\ '; echo ' alert("' . __('Backup Complete!','wp-db-backup') . '"); window.onbeforeunload = null; </script> '; } break; default: $this->deliver_backup($this->backup_file, $via); $this->error_display( 'frame' ); } die(); } if (isset($_GET['fragment'] )) { list($table, $segment, $filename) = explode(':', $_GET['fragment']); $this->validate_file($filename); $this->backup_fragment($table, $segment, $filename); } die(); } function init_textdomain() { load_plugin_textdomain('wp-db-backup', str_replace(ABSPATH, '', dirname(__FILE__)), dirname(plugin_basename(__FILE__))); } function set_page_url() { $query_args = array( 'page' => $this->basename ); if ( function_exists('wp_create_nonce') ) $query_args = array_merge( $query_args, array('_wpnonce' => wp_create_nonce($this->referer_check_key)) ); $base = ( function_exists('site_url') ) ? site_url('', 'admin') : get_option('siteurl'); $this->page_url = add_query_arg( $query_args, $base . '/wp-admin/edit.php'); } /* * Add a link to back up your database when doing a core upgrade */ function update_notice_action() { if ( 'upgrade-core' == $_REQUEST['action'] ) : ob_start(array(&$this, 'update_notice')); add_action('admin_footer', create_function('', 'ob_end_flush();')); endif; } function update_notice($text = '') { $pattern = '#(<a href\="' . __('http://codex.wordpress.org/WordPress_Backups') . '">.*?</p>)#'; $replace = '$1' . "\n<p>" . sprintf(__('Click <a href="%s" target="_blank">here</a> to back up your database using the WordPress Database Backup plugin. <strong>Note:</strong> WordPress Database Backup does <em>not</em> back up your files, just your database.', 'wp-db-backup'), 'tools.php?page=wp-db-backup') . "</p>\n"; $text = preg_replace($pattern, $replace, $text); return $text; } function build_backup_script() { global $table_prefix, $wpdb; echo "<div class='wrap'>"; echo '<fieldset class="options"><legend>' . __('Progress','wp-db-backup') . '</legend> <p><strong>' . __('DO NOT DO THE FOLLOWING AS IT WILL CAUSE YOUR BACKUP TO FAIL:','wp-db-backup'). '</strong></p> <ol> <li>'.__('Close this browser','wp-db-backup').'</li> <li>'.__('Reload this page','wp-db-backup').'</li> <li>'.__('Click the Stop or Back buttons in your browser','wp-db-backup').'</li> </ol> <p><strong>' . __('Progress:','wp-db-backup') . '</strong></p> <div id="meterbox" style="height:11px;width:80%;padding:3px;border:1px solid #659fff;"><div id="meter" style="color:#fff;height:11px;line-height:11px;background-color:#659fff;width:0%;text-align:center;font-size:6pt;">&nbsp;</div></div> <div id="progress_message"></div> <div id="errors"></div> </fieldset> <iframe id="backuploader" src="about:blank" style="visibility:hidden;border:none;height:1em;width:1px;"></iframe> <script type="text/javascript"> //<![CDATA[ window.onbeforeunload = function() { return "' . __('Navigating away from this page will cause your backup to fail.', 'wp-db-backup') . '"; } function setMeter(pct) { var meter = document.getElementById("meter"); meter.style.width = pct + "%"; meter.innerHTML = Math.floor(pct) + "%"; } function setProgress(str) { var progress = document.getElementById("progress_message"); progress.innerHTML = str; } function addError(str) { var errors = document.getElementById("errors"); errors.innerHTML = errors.innerHTML + str + "<br />"; } function backup(table, segment) { var fram = document.getElementById("backuploader"); fram.src = "' . $this->page_url . '&fragment=" + table + ":" + segment + ":' . $this->backup_filename . ':"; } var curStep = 0; function nextStep() { backupStep(curStep); curStep++; } function finishBackup() { var fram = document.getElementById("backuploader"); setMeter(100); '; $download_uri = add_query_arg('backup', $this->backup_filename, $this->page_url); switch($_POST['deliver']) { case 'http': echo ' setProgress("' . __('Backup Complete!','wp-db-backup') . '"); window.onbeforeunload = null; fram.src = "' . $download_uri . '"; '; break; case 'smtp': if ( get_option('wpdb_backup_recip') != $_POST['backup_recipient'] ) { update_option('wpdb_backup_recip', $_POST['backup_recipient'] ); } echo ' setProgress("' . sprintf(__('Your backup has been emailed to %s','wp-db-backup'), $_POST['backup_recipient']) . '"); window.onbeforeunload = null; fram.src = "' . $download_uri . '&via=email&recipient=' . $_POST['backup_recipient'] . '"; '; break; default: echo ' setProgress("' . __('Backup Complete!','wp-db-backup') . '"); window.onbeforeunload = null; '; } echo ' } function backupStep(step) { switch(step) { case 0: backup("", 0); break; '; $also_backup = array(); if (isset($_POST['other_tables'])) { $also_backup = $_POST['other_tables']; } else { $also_backup = array(); } $core_tables = $_POST['core_tables']; $tables = array_merge($core_tables, $also_backup); $step_count = 1; foreach ($tables as $table) { $rec_count = $wpdb->get_var("SELECT count(*) FROM {$table}"); $rec_segments = ceil($rec_count / ROWS_PER_SEGMENT); $table_count = 0; if ( $this->module_check() ) { $delay = "setTimeout('"; $delay_time = "', " . (int) MOD_EVASIVE_DELAY . ")"; } else { $delay = $delay_time = ''; } do { echo "case {$step_count}: {$delay}backup(\"{$table}\", {$table_count}){$delay_time}; break;\n"; $step_count++; $table_count++; } while($table_count < $rec_segments); echo "case {$step_count}: {$delay}backup(\"{$table}\", -1){$delay_time}; break;\n"; $step_count++; } echo "case {$step_count}: finishBackup(); break;"; echo ' } if(step != 0) setMeter(100 * step / ' . $step_count . '); } nextStep(); // ]]> </script> </div> '; $this->backup_menu(); } function backup_fragment($table, $segment, $filename) { global $table_prefix, $wpdb; echo "$table:$segment:$filename"; if($table == '') { $msg = __('Creating backup file...','wp-db-backup'); } else { if($segment == -1) { $msg = sprintf(__('Finished backing up table \\"%s\\".','wp-db-backup'), $table); } else { $msg = sprintf(__('Backing up table \\"%s\\"...','wp-db-backup'), $table); } } if (is_writable($this->backup_dir)) { $this->fp = $this->open($this->backup_dir . $filename, 'a'); if(!$this->fp) { $this->error(__('Could not open the backup file for writing!','wp-db-backup')); $this->error(array('loc' => 'frame', 'kind' => 'fatal', 'msg' => __('The backup file could not be saved. Please check the permissions for writing to your backup directory and try again.','wp-db-backup'))); } else { if($table == '') { //Begin new backup of MySql $this->stow("# " . __('WordPress MySQL database backup','wp-db-backup') . "\n"); $this->stow("#\n"); $this->stow("# " . sprintf(__('Generated: %s','wp-db-backup'),date("l j. F Y H:i T")) . "\n"); $this->stow("# " . sprintf(__('Hostname: %s','wp-db-backup'),DB_HOST) . "\n"); $this->stow("# " . sprintf(__('Database: %s','wp-db-backup'),$this->backquote(DB_NAME)) . "\n"); $this->stow("# --------------------------------------------------------\n"); } else { if($segment == 0) { // Increase script execution time-limit to 15 min for every table. if ( !ini_get('safe_mode')) @set_time_limit(15*60); // Create the SQL statements $this->stow("# --------------------------------------------------------\n"); $this->stow("# " . sprintf(__('Table: %s','wp-db-backup'),$this->backquote($table)) . "\n"); $this->stow("# --------------------------------------------------------\n"); } $this->backup_table($table, $segment); } } } else { $this->error(array('kind' => 'fatal', 'loc' => 'frame', 'msg' => __('The backup directory is not writeable! Please check the permissions for writing to your backup directory and try again.','wp-db-backup'))); } if($this->fp) $this->close($this->fp); $this->error_display('frame'); echo '<script type="text/javascript"><!--// var msg = "' . $msg . '"; window.parent.setProgress(msg); window.parent.nextStep(); //--></script> '; die(); } function perform_backup() { // are we backing up any other tables? $also_backup = array(); if (isset($_POST['other_tables'])) $also_backup = $_POST['other_tables']; $core_tables = $_POST['core_tables']; $this->backup_file = $this->db_backup($core_tables, $also_backup); if (false !== $this->backup_file) { if ('smtp' == $_POST['deliver']) { $this->deliver_backup($this->backup_file, $_POST['deliver'], $_POST['backup_recipient'], 'main'); if ( get_option('wpdb_backup_recip') != $_POST['backup_recipient'] ) { update_option('wpdb_backup_recip', $_POST['backup_recipient'] ); } wp_redirect($this->page_url); } elseif ('http' == $_POST['deliver']) { $download_uri = add_query_arg('backup',$this->backup_file,$this->page_url); wp_redirect($download_uri); exit; } // we do this to say we're done. $this->backup_complete = true; } } function admin_header() { ?> <script type="text/javascript"> //<![CDATA[ if ( 'undefined' != typeof addLoadEvent ) { addLoadEvent(function() { var t = {'extra-tables-list':{name: 'other_tables[]'}, 'include-tables-list':{name: 'wp_cron_backup_tables[]'}}; for ( var k in t ) { t[k].s = null; var d = document.getElementById(k); if ( ! d ) continue; var ul = d.getElementsByTagName('ul').item(0); if ( ul ) { var lis = ul.getElementsByTagName('li'); if ( 2 < lis.length ) { var text = document.createElement('p'); text.className = 'instructions'; text.innerHTML = '<?php _e('Click and hold down <code>[SHIFT]</code> to toggle multiple checkboxes', 'wp-db-backup'); ?>'; ul.parentNode.insertBefore(text, ul); } } t[k].p = d.getElementsByTagName("input"); for(var i=0; i < t[k].p.length; i++) { if(t[k].name == t[k].p[i].getAttribute('name')) { t[k].p[i].id = k + '-table-' + i; t[k].p[i].onkeyup = t[k].p[i].onclick = function(e) { e = e ? e : event; if ( 16 == e.keyCode ) return; var match = /([\w-]*)-table-(\d*)/.exec(this.id); var listname = match[1]; var that = match[2]; if ( null === t[listname].s ) t[listname].s = that; else if ( e.shiftKey ) { var start = Math.min(that, t[listname].s) + 1; var end = Math.max(that, t[listname].s); for( var j=start; j < end; j++) t[listname].p[j].checked = t[listname].p[j].checked ? false : true; t[listname].s = null; } } } } } <?php if ( function_exists('wp_schedule_event') ) : // needs to be at least WP 2.1 for ajax ?> if ( 'undefined' == typeof XMLHttpRequest ) var xml = new ActiveXObject( navigator.userAgent.indexOf('MSIE 5') >= 0 ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP' ); else var xml = new XMLHttpRequest(); var initTimeChange = function() { var timeWrap = document.getElementById('backup-time-wrap'); var backupTime = document.getElementById('next-backup-time'); if ( !! timeWrap && !! backupTime && ( 1 == <?php echo (int) ( 'en' == strtolower( substr( get_locale(), 0, 2 ) ) ); ?> ) ) { var span = document.createElement('span'); span.className = 'submit'; span.id = 'change-wrap'; span.innerHTML = '<input type="submit" id="change-backup-time" name="change-backup-time" value="<?php _e('Change','wp-db-backup'); ?>" />'; timeWrap.appendChild(span); backupTime.ondblclick = function(e) { span.parentNode.removeChild(span); clickTime(e, backupTime); }; span.onclick = function(e) { span.parentNode.removeChild(span); clickTime(e, backupTime); }; } } var clickTime = function(e, backupTime) { var tText = backupTime.innerHTML; backupTime.innerHTML = '<input type="text" value="' + tText + '" name="backup-time-text" id="backup-time-text" /> <span class="submit"><input type="submit" name="save-backup-time" id="save-backup-time" value="<?php _e('Save', 'wp-db-backup'); ?>" /></span>'; backupTime.ondblclick = null; var mainText = document.getElementById('backup-time-text'); mainText.focus(); var saveTButton = document.getElementById('save-backup-time'); if ( !! saveTButton ) saveTButton.onclick = function(e) { saveTime(backupTime, mainText); return false; }; if ( !! mainText ) mainText.onkeydown = function(e) { e = e || window.event; if ( 13 == e.keyCode ) { saveTime(backupTime, mainText); return false; } } } var saveTime = function(backupTime, mainText) { var tVal = mainText.value; xml.open('POST', 'admin-ajax.php', true); xml.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); if ( xml.overrideMimeType ) xml.setRequestHeader('Connection', 'close'); xml.send('action=save_backup_time&_wpnonce=<?php echo wp_create_nonce($this->referer_check_key); ?>&backup-time='+tVal); xml.onreadystatechange = function() { if ( 4 == xml.readyState && '0' != xml.responseText ) { backupTime.innerHTML = xml.responseText; initTimeChange(); } } } initTimeChange(); <?php endif; // wp_schedule_event exists ?> }); } //]]> </script> <style type="text/css"> .wp-db-backup-updated { margin-top: 1em; } fieldset.options { border: 1px solid; margin-top: 1em; padding: 1em; -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; -webkit-border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 8px; border-radius: 8px; } fieldset.options div.tables-list { float: left; padding: 1em; } fieldset.options input { } fieldset.options legend { font-size: larger; font-weight: bold; margin-bottom: .5em; padding: 1em; } fieldset.options .instructions { font-size: smaller; } fieldset.options ul { list-style-type: none; } fieldset.options li { text-align: left; } fieldset.options .submit { border-top: none; } </style> <?php } function admin_load() { add_action('admin_head', array(&$this, 'admin_header')); } function admin_menu() { $_page_hook = add_management_page(__('Backup','wp-db-backup'), __('Backup','wp-db-backup'), 'import', $this->basename, array(&$this, 'backup_menu')); add_action('load-' . $_page_hook, array(&$this, 'admin_load')); if ( function_exists('add_contextual_help') ) { $text = $this->help_menu(); add_contextual_help($_page_hook, $text); } } function fragment_menu() { $page_hook = add_management_page(__('Backup','wp-db-backup'), __('Backup','wp-db-backup'), 'import', $this->basename, array(&$this, 'build_backup_script')); add_action('load-' . $page_hook, array(&$this, 'admin_load')); } /** * Add WP-DB-Backup-specific help options to the 2.7 =< WP contextual help menu * return string The text of the help menu. */ function help_menu() { $text = "\n<a href=\"http://wordpress.org/extend/plugins/wp-db-backup/faq/\" target=\"_blank\">" . __('FAQ', 'wp-db-backup') . '</a>'; $text .= "\n<br />\n<a href=\"http://www.ilfilosofo.com/forum/forum/2\" target=\"_blank\">" . __('WP-DB-Backup Support Forum', 'wp-db-backup') . '</a>'; return $text; } function save_backup_time() { if ( $this->can_user_backup() ) { // try to get a time from the input string $time = strtotime(strval($_POST['backup-time'])); if ( ! empty( $time ) && time() < $time ) { wp_clear_scheduled_hook( 'wp_db_backup_cron' ); // unschedule previous $scheds = (array) wp_get_schedules(); $name = get_option('wp_cron_backup_schedule'); if ( 0 != $time ) { wp_schedule_event($time, $name, 'wp_db_backup_cron'); echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $time + (get_option('gmt_offset') * 3600)); exit; } } } else { die(0); } } /** * Better addslashes for SQL queries. * Taken from phpMyAdmin. */ function sql_addslashes($a_string = '', $is_like = false) { if ($is_like) $a_string = str_replace('\\', '\\\\\\\\', $a_string); else $a_string = str_replace('\\', '\\\\', $a_string); return str_replace('\'', '\\\'', $a_string); } /** * Add backquotes to tables and db-names in * SQL queries. Taken from phpMyAdmin. */ function backquote($a_name) { if (!empty($a_name) && $a_name != '*') { if (is_array($a_name)) { $result = array(); reset($a_name); while(list($key, $val) = each($a_name)) $result[$key] = '`' . $val . '`'; return $result; } else { return '`' . $a_name . '`'; } } else { return $a_name; } } function open($filename = '', $mode = 'w') { if ('' == $filename) return false; $fp = @fopen($filename, $mode); return $fp; } function close($fp) { fclose($fp); } /** * Write to the backup file * @param string $query_line the line to write * @return null */ function stow($query_line) { if(false === @fwrite($this->fp, $query_line)) $this->error(__('There was an error writing a line to the backup script:','wp-db-backup') . ' ' . $query_line . ' ' . $php_errormsg); } /** * Logs any error messages * @param array $args * @return bool */ function error($args = array()) { if ( is_string( $args ) ) $args = array('msg' => $args); $args = array_merge( array('loc' => 'main', 'kind' => 'warn', 'msg' => ''), $args); $this->errors[$args['kind']][] = $args['msg']; if ( 'fatal' == $args['kind'] || 'frame' == $args['loc']) $this->error_display($args['loc']); return true; } /** * Displays error messages * @param array $errs * @param string $loc * @return string */ function error_display($loc = 'main', $echo = true) { $errs = $this->errors; unset( $this->errors ); if ( ! count($errs) ) return; $msg = ''; $errs['fatal'] = isset( $errs['fatal'] ) ? (array) $errs['fatal'] : array(); $errs['warn'] = isset( $errs['warn'] ) ? (array) $errs['warn'] : array(); $err_list = array_slice( array_merge( $errs['fatal'], $errs['warn'] ), 0, 10); if ( 10 == count( $err_list ) ) $err_list[9] = __('Subsequent errors have been omitted from this log.','wp-db-backup'); $wrap = ( 'frame' == $loc ) ? "<script type=\"text/javascript\">\n var msgList = ''; \n %1\$s \n if ( msgList ) alert(msgList); \n </script>" : '%1$s'; $line = ( 'frame' == $loc ) ? "try{ window.parent.addError('%1\$s'); } catch(e) { msgList += ' %1\$s';}\n" : "%1\$s<br />\n"; foreach( (array) $err_list as $err ) $msg .= sprintf($line,str_replace(array("\n","\r"), '', addslashes($err))); $msg = sprintf($wrap,$msg); if ( count($errs['fatal'] ) ) { if ( function_exists('wp_die') && 'frame' != $loc ) wp_die(stripslashes($msg)); else die($msg); } else { if ( $echo ) echo $msg; else return $msg; } } /** * Taken partially from phpMyAdmin and partially from * Alain Wolf, Zurich - Switzerland * Website: http://restkultur.ch/personal/wolf/scripts/db_backup/ * Modified by Scott Merrill (http://www.skippy.net/) * to use the WordPress $wpdb object * @param string $table * @param string $segment * @return void */ function backup_table($table, $segment = 'none') { global $wpdb; $table_structure = $wpdb->get_results("DESCRIBE $table"); if (! $table_structure) { $this->error(__('Error getting table details','wp-db-backup') . ": $table"); return false; } if(($segment == 'none') || ($segment == 0)) { // Add SQL statement to drop existing table $this->stow("\n\n"); $this->stow("#\n"); $this->stow("# " . sprintf(__('Delete any existing table %s','wp-db-backup'),$this->backquote($table)) . "\n"); $this->stow("#\n"); $this->stow("\n"); $this->stow("DROP TABLE IF EXISTS " . $this->backquote($table) . ";\n"); // Table structure // Comment in SQL-file $this->stow("\n\n"); $this->stow("#\n"); $this->stow("# " . sprintf(__('Table structure of table %s','wp-db-backup'),$this->backquote($table)) . "\n"); $this->stow("#\n"); $this->stow("\n"); $create_table = $wpdb->get_results("SHOW CREATE TABLE $table", ARRAY_N); if (false === $create_table) { $err_msg = sprintf(__('Error with SHOW CREATE TABLE for %s.','wp-db-backup'), $table); $this->error($err_msg); $this->stow("#\n# $err_msg\n#\n"); } $this->stow($create_table[0][1] . ' ;'); if (false === $table_structure) { $err_msg = sprintf(__('Error getting table structure of %s','wp-db-backup'), $table); $this->error($err_msg); $this->stow("#\n# $err_msg\n#\n"); } // Comment in SQL-file $this->stow("\n\n"); $this->stow("#\n"); $this->stow('# ' . sprintf(__('Data contents of table %s','wp-db-backup'),$this->backquote($table)) . "\n"); $this->stow("#\n"); } if(($segment == 'none') || ($segment >= 0)) { $defs = array(); $ints = array(); foreach ($table_structure as $struct) { if ( (0 === strpos($struct->Type, 'tinyint')) || (0 === strpos(strtolower($struct->Type), 'smallint')) || (0 === strpos(strtolower($struct->Type), 'mediumint')) || (0 === strpos(strtolower($struct->Type), 'int')) || (0 === strpos(strtolower($struct->Type), 'bigint')) ) { $defs[strtolower($struct->Field)] = ( null === $struct->Default ) ? 'NULL' : $struct->Default; $ints[strtolower($struct->Field)] = "1"; } } // Batch by $row_inc if($segment == 'none') { $row_start = 0; $row_inc = ROWS_PER_SEGMENT; } else { $row_start = $segment * ROWS_PER_SEGMENT; $row_inc = ROWS_PER_SEGMENT; } do { // don't include extra stuff, if so requested $excs = (array) get_option('wp_db_backup_excs'); $where = ''; if ( is_array($excs['spam'] ) && in_array($table, $excs['spam']) ) { $where = ' WHERE comment_approved != "spam"'; } elseif ( is_array($excs['revisions'] ) && in_array($table, $excs['revisions']) ) { $where = ' WHERE post_type != "revision"'; } if ( !ini_get('safe_mode')) @set_time_limit(15*60); $table_data = $wpdb->get_results("SELECT * FROM $table $where LIMIT {$row_start}, {$row_inc}", ARRAY_A); $entries = 'INSERT INTO ' . $this->backquote($table) . ' VALUES ('; // \x08\\x09, not required $search = array("\x00", "\x0a", "\x0d", "\x1a"); $replace = array('\0', '\n', '\r', '\Z'); if($table_data) { foreach ($table_data as $row) { $values = array(); foreach ($row as $key => $value) { if ($ints[strtolower($key)]) { // make sure there are no blank spots in the insert syntax, // yet try to avoid quotation marks around integers $value = ( null === $value || '' === $value) ? $defs[strtolower($key)] : $value; $values[] = ( '' === $value ) ? "''" : $value; } else { $values[] = "'" . str_replace($search, $replace, $this->sql_addslashes($value)) . "'"; } } $this->stow(" \n" . $entries . implode(', ', $values) . ');'); } $row_start += $row_inc; } } while((count($table_data) > 0) and ($segment=='none')); } if(($segment == 'none') || ($segment < 0)) { // Create footer/closing comment in SQL-file $this->stow("\n"); $this->stow("#\n"); $this->stow("# " . sprintf(__('End of data contents of table %s','wp-db-backup'),$this->backquote($table)) . "\n"); $this->stow("# --------------------------------------------------------\n"); $this->stow("\n"); } } // end backup_table() function db_backup($core_tables, $other_tables) { global $table_prefix, $wpdb; if (is_writable($this->backup_dir)) { $this->fp = $this->open($this->backup_dir . $this->backup_filename); if(!$this->fp) { $this->error(__('Could not open the backup file for writing!','wp-db-backup')); return false; } } else { $this->error(__('The backup directory is not writeable!','wp-db-backup')); return false; } //Begin new backup of MySql $this->stow("# " . __('WordPress MySQL database backup','wp-db-backup') . "\n"); $this->stow("#\n"); $this->stow("# " . sprintf(__('Generated: %s','wp-db-backup'),date("l j. F Y H:i T")) . "\n"); $this->stow("# " . sprintf(__('Hostname: %s','wp-db-backup'),DB_HOST) . "\n"); $this->stow("# " . sprintf(__('Database: %s','wp-db-backup'),$this->backquote(DB_NAME)) . "\n"); $this->stow("# --------------------------------------------------------\n"); if ( (is_array($other_tables)) && (count($other_tables) > 0) ) $tables = array_merge($core_tables, $other_tables); else $tables = $core_tables; foreach ($tables as $table) { // Increase script execution time-limit to 15 min for every table. if ( !ini_get('safe_mode')) @set_time_limit(15*60); // Create the SQL statements $this->stow("# --------------------------------------------------------\n"); $this->stow("# " . sprintf(__('Table: %s','wp-db-backup'),$this->backquote($table)) . "\n"); $this->stow("# --------------------------------------------------------\n"); $this->backup_table($table); } $this->close($this->fp); if (count($this->errors)) { return false; } else { return $this->backup_filename; } } //wp_db_backup /** * Sends the backed-up file via email * @param string $to * @param string $subject * @param string $message * @return bool */ function send_mail( $to, $subject, $message, $diskfile) { global $phpmailer; $filename = basename($diskfile); extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message' ) ) ); if ( !is_object( $phpmailer ) || ( strtolower(get_class( $phpmailer )) != 'phpmailer' ) ) { if ( file_exists( ABSPATH . WPINC . '/class-phpmailer.php' ) ) require_once ABSPATH . WPINC . '/class-phpmailer.php'; if ( file_exists( ABSPATH . WPINC . '/class-smtp.php' ) ) require_once ABSPATH . WPINC . '/class-smtp.php'; if ( class_exists( 'PHPMailer') ) $phpmailer = new PHPMailer(); } // try to use phpmailer directly (WP 2.2+) if ( is_object( $phpmailer ) && ( strtolower(get_class( $phpmailer )) == 'phpmailer' ) ) { // Get the site domain and get rid of www. $sitename = strtolower( $_SERVER['SERVER_NAME'] ); if ( substr( $sitename, 0, 4 ) == 'www.' ) { $sitename = substr( $sitename, 4 ); } $from_email = 'wordpress@' . $sitename; $from_name = 'WordPress'; // Empty out the values that may be set $phpmailer->ClearAddresses(); $phpmailer->ClearAllRecipients(); $phpmailer->ClearAttachments(); $phpmailer->ClearBCCs(); $phpmailer->ClearCCs(); $phpmailer->ClearCustomHeaders(); $phpmailer->ClearReplyTos(); $phpmailer->AddAddress( $to ); $phpmailer->AddAttachment($diskfile, $filename); $phpmailer->Body = $message; $phpmailer->CharSet = apply_filters( 'wp_mail_charset', get_bloginfo('charset') ); $phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); $phpmailer->IsMail(); $phpmailer->Subject = $subject; do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); $result = @$phpmailer->Send(); // old-style: build the headers directly } else { $randomish = md5(time()); $boundary = "==WPBACKUP-$randomish"; $fp = fopen($diskfile,"rb"); $file = fread($fp,filesize($diskfile)); $this->close($fp); $data = chunk_split(base64_encode($file)); $headers .= "MIME-Version: 1.0\n"; $headers = 'From: wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\n"; // Add a multipart boundary above the plain message $message = "This is a multi-part message in MIME format.\n\n" . "--{$boundary}\n" . "Content-Type: text/plain; charset=\"" . get_bloginfo('charset') . "\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; // Add file attachment to the message $message .= "--{$boundary}\n" . "Content-Type: application/octet-stream;\n" . " name=\"{$filename}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$filename}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$boundary}--\n"; $result = @wp_mail($to, $subject, $message, $headers); } return $result; } function deliver_backup($filename = '', $delivery = 'http', $recipient = '', $location = 'main') { if ('' == $filename) { return false; } $diskfile = $this->backup_dir . $filename; /** * Try to compress to gzip, if available */ if ( function_exists('gzencode') ) { $gz_diskfile = "{$diskfile}.gz"; if ( function_exists('file_get_contents') ) { $text = file_get_contents($diskfile); } else { $text = implode("", file($diskfile)); } $gz_text = gzencode($text, 9); $fp = fopen($gz_diskfile, "w"); fwrite($fp, $gz_text); if ( fclose($fp) ) { unlink($diskfile); $diskfile = $gz_diskfile; $filename = "{$filename}.gz"; } } /* * */ if ('http' == $delivery) { if (! file_exists($diskfile)) $this->error(array('kind' => 'fatal', 'msg' => sprintf(__('File not found:%s','wp-db-backup'), "&nbsp;<strong>$filename</strong><br />") . '<br /><a href="' . $this->page_url . '">' . __('Return to Backup','wp-db-backup') . '</a>')); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Length: ' . filesize($diskfile)); header("Content-Disposition: attachment; filename=$filename"); $success = readfile($diskfile); unlink($diskfile); } elseif ('smtp' == $delivery) { if (! file_exists($diskfile)) { $msg = sprintf(__('File %s does not exist!','wp-db-backup'), $diskfile); $this->error($msg); return false; } if (! is_email($recipient)) { $recipient = get_option('admin_email'); } $message = sprintf(__("Attached to this email is\n %1s\n Size:%2s kilobytes\n",'wp-db-backup'), $filename, round(filesize($diskfile)/1024)); $success = $this->send_mail($recipient, get_bloginfo('name') . ' ' . __('Database Backup','wp-db-backup'), $message, $diskfile); if ( false === $success ) { $msg = __('The following errors were reported:','wp-db-backup') . "\n "; if ( function_exists('error_get_last') ) { $err = error_get_last(); $msg .= $err['message']; } else { $msg .= __('ERROR: The mail application has failed to deliver the backup.','wp-db-backup'); } $this->error(array('kind' => 'fatal', 'loc' => $location, 'msg' => $msg)); } else { unlink($diskfile); } } return $success; } function backup_menu() { global $table_prefix, $wpdb; $feedback = ''; $whoops = false; // did we just do a backup? If so, let's report the status if ( $this->backup_complete ) { $feedback = '<div class="updated wp-db-backup-updated"><p>' . __('Backup Successful','wp-db-backup') . '!'; $file = $this->backup_file; switch($_POST['deliver']) { case 'http': $feedback .= '<br />' . sprintf(__('Your backup file: <a href="%1s">%2s</a> should begin downloading shortly.','wp-db-backup'), WP_BACKUP_URL . "{$this->backup_file}", $this->backup_file); break; case 'smtp': if (! is_email($_POST['backup_recipient'])) { $feedback .= get_option('admin_email'); } else { $feedback .= $_POST['backup_recipient']; } $feedback = '<br />' . sprintf(__('Your backup has been emailed to %s','wp-db-backup'), $feedback); break; case 'none': $feedback .= '<br />' . __('Your backup file has been saved on the server. If you would like to download it now, right click and select "Save As"','wp-db-backup'); $feedback .= ':<br /> <a href="' . WP_BACKUP_URL . "$file\">$file</a> : " . sprintf(__('%s bytes','wp-db-backup'), filesize($this->backup_dir . $file)); } $feedback .= '</p></div>'; } // security check $this->wp_secure(); if (count($this->errors)) { $feedback .= '<div class="updated wp-db-backup-updated error"><p><strong>' . __('The following errors were reported:','wp-db-backup') . '</strong></p>'; $feedback .= '<p>' . $this->error_display( 'main', false ) . '</p>'; $feedback .= "</p></div>"; } // did we just save options for wp-cron? if ( (function_exists('wp_schedule_event') || function_exists('wp_cron_init')) && isset($_POST['wp_cron_backup_options']) ) : do_action('wp_db_b_update_cron_options'); if ( function_exists('wp_schedule_event') ) { wp_clear_scheduled_hook( 'wp_db_backup_cron' ); // unschedule previous $scheds = (array) wp_get_schedules(); $name = strval($_POST['wp_cron_schedule']); $interval = ( isset($scheds[$name]['interval']) ) ? (int) $scheds[$name]['interval'] : 0; update_option('wp_cron_backup_schedule', $name, false); if ( 0 !== $interval ) { wp_schedule_event(time() + $interval, $name, 'wp_db_backup_cron'); } } else { update_option('wp_cron_backup_schedule', intval($_POST['cron_schedule']), false); } update_option('wp_cron_backup_tables', isset( $_POST['wp_cron_backup_tables'] ) ? $_POST['wp_cron_backup_tables'] : array() ); if (is_email($_POST['cron_backup_recipient'])) { update_option('wp_cron_backup_recipient', $_POST['cron_backup_recipient'], false); } $feedback .= '<div class="updated wp-db-backup-updated"><p>' . __('Scheduled Backup Options Saved!','wp-db-backup') . '</p></div>'; endif; $other_tables = array(); $also_backup = array(); // Get complete db table list $all_tables = $wpdb->get_results("SHOW TABLES", ARRAY_N); $all_tables = array_map(create_function('$a', 'return $a[0];'), $all_tables); // Get list of WP tables that actually exist in this DB (for 1.6 compat!) $wp_backup_default_tables = array_intersect($all_tables, $this->core_table_names); // Get list of non-WP tables $other_tables = array_diff($all_tables, $wp_backup_default_tables); if ('' != $feedback) echo $feedback; if ( ! $this->wp_secure() ) return; // Give the new dirs the same perms as wp-content. // $stat = stat( ABSPATH . 'wp-content' ); // $dir_perms = $stat['mode'] & 0000777; // Get the permission bits. $dir_perms = '0777'; // the file doesn't exist and can't create it if ( ! file_exists($this->backup_dir) && ! @mkdir($this->backup_dir) ) { ?><div class="updated wp-db-backup-updated error"><p><?php _e('WARNING: Your backup directory does <strong>NOT</strong> exist, and we cannot create it.','wp-db-backup'); ?></p> <p><?php printf(__('Using your FTP client, try to create the backup directory yourself: %s', 'wp-db-backup'), '<code>' . $this->backup_dir . '</code>'); ?></p></div><?php $whoops = true; // not writable due to write permissions } elseif ( !is_writable($this->backup_dir) && ! @chmod($this->backup_dir, $dir_perms) ) { ?><div class="updated wp-db-backup-updated error"><p><?php _e('WARNING: Your backup directory is <strong>NOT</strong> writable! We cannot create the backup files.','wp-db-backup'); ?></p> <p><?php printf(__('Using your FTP client, try to set the backup directory&rsquo;s write permission to %1$s or %2$s: %3$s', 'wp-db-backup'), '<code>777</code>', '<code>a+w</code>', '<code>' . $this->backup_dir . '</code>'); ?> </p></div><?php $whoops = true; } else { $this->fp = $this->open($this->backup_dir . 'test' ); if( $this->fp ) { $this->close($this->fp); @unlink($this->backup_dir . 'test' ); // the directory is not writable probably due to safe mode } else { ?><div class="updated wp-db-backup-updated error"><p><?php _e('WARNING: Your backup directory is <strong>NOT</strong> writable! We cannot create the backup files.','wp-db-backup'); ?></p><?php if( ini_get('safe_mode') ){ ?><p><?php _e('This problem seems to be caused by your server&rsquo;s <code>safe_mode</code> file ownership restrictions, which limit what files web applications like WordPress can create.', 'wp-db-backup'); ?></p><?php } ?><?php printf(__('You can try to correct this problem by using your FTP client to delete and then re-create the backup directory: %s', 'wp-db-backup'), '<code>' . $this->backup_dir . '</code>'); ?></div><?php $whoops = true; } } if ( !file_exists($this->backup_dir . 'index.php') ) @ touch($this->backup_dir . 'index.php'); ?><div class='wrap'> <h2><?php _e('Backup','wp-db-backup') ?></h2> <form method="post" action=""> <?php if ( function_exists('wp_nonce_field') ) wp_nonce_field($this->referer_check_key); ?> <fieldset class="options"><legend><?php _e('Tables','wp-db-backup') ?></legend> <div class="tables-list core-tables alternate"> <h4><?php _e('These core WordPress tables will always be backed up:','wp-db-backup') ?></h4><ul><?php $excs = (array) get_option('wp_db_backup_excs'); foreach ($wp_backup_default_tables as $table) { if ( $table == $wpdb->comments ) { $checked = ( isset($excs['spam']) && is_array($excs['spam'] ) && in_array($table, $excs['spam']) ) ? ' checked=\'checked\'' : ''; echo "<li><input type='hidden' name='core_tables[]' value='$table' /><code>$table</code> <span class='instructions'> <input type='checkbox' name='exclude-spam[]' value='$table' $checked /> " . __('Exclude spam comments', 'wp-db-backup') . '</span></li>'; } elseif ( function_exists('wp_get_post_revisions') && $table == $wpdb->posts ) { $checked = ( isset($excs['revisions']) && is_array($excs['revisions'] ) && in_array($table, $excs['revisions']) ) ? ' checked=\'checked\'' : ''; echo "<li><input type='hidden' name='core_tables[]' value='$table' /><code>$table</code> <span class='instructions'> <input type='checkbox' name='exclude-revisions[]' value='$table' $checked /> " . __('Exclude post revisions', 'wp-db-backup') . '</span></li>'; } else { echo "<li><input type='hidden' name='core_tables[]' value='$table' /><code>$table</code></li>"; } } ?></ul> </div> <div class="tables-list extra-tables" id="extra-tables-list"> <?php if (count($other_tables) > 0) { ?> <h4><?php _e('You may choose to include any of the following tables:','wp-db-backup'); ?></h4> <ul> <?php foreach ($other_tables as $table) { ?> <li><label><input type="checkbox" name="other_tables[]" value="<?php echo $table; ?>" /> <code><?php echo $table; ?></code></label> <?php } ?></ul><?php } ?></div> </fieldset> <fieldset class="options"> <legend><?php _e('Backup Options','wp-db-backup'); ?></legend> <p><?php _e('What to do with the backup file:','wp-db-backup'); ?></p> <ul> <li><label for="do_save"> <input type="radio" id="do_save" name="deliver" value="none" style="border:none;" /> <?php _e('Save to server','wp-db-backup'); echo " (<code>" . $this->backup_dir . "</code>)"; ?> </label></li> <li><label for="do_download"> <input type="radio" checked="checked" id="do_download" name="deliver" value="http" style="border:none;" /> <?php _e('Download to your computer','wp-db-backup'); ?> </label></li> <li><label for="do_email"> <input type="radio" name="deliver" id="do_email" value="smtp" style="border:none;" /> <?php _e('Email backup to:','wp-db-backup'); ?> <input type="text" name="backup_recipient" size="20" value="<?php $backup_recip = get_option('wpdb_backup_recip'); if ( empty( $backup_recip ) ) { $backup_recip = get_option('admin_email'); } echo $backup_recip; ?>" /> </label></li> </ul> <?php if ( ! $whoops ) : ?> <input type="hidden" name="do_backup" id="do_backup" value="backup" /> <p class="submit"> <input type="submit" name="submit" onclick="document.getElementById('do_backup').value='fragments';" value="<?php _e('Backup now!','wp-db-backup'); ?>" /> </p> <?php else : ?> <div class="updated wp-db-backup-updated error"><p><?php _e('WARNING: Your backup directory is <strong>NOT</strong> writable!','wp-db-backup'); ?></p></div> <?php endif; // ! whoops ?> </fieldset> <?php do_action('wp_db_b_backup_opts'); ?> </form> <?php // this stuff only displays if some sort of wp-cron is available $cron = ( function_exists('wp_schedule_event') ) ? true : false; // wp-cron in WP 2.1+ $cron_old = ( function_exists('wp_cron_init') && ! $cron ) ? true : false; // wp-cron plugin by Skippy if ( $cron_old || $cron ) : echo '<fieldset class="options"><legend>' . __('Scheduled Backup','wp-db-backup') . '</legend>'; $datetime = get_option('date_format') . ' ' . get_option('time_format'); if ( $cron ) : $next_cron = wp_next_scheduled('wp_db_backup_cron'); if ( ! empty( $next_cron ) ) : ?> <p id="backup-time-wrap"> <?php printf(__('Next Backup: %s','wp-db-backup'), '<span id="next-backup-time">' . gmdate($datetime, $next_cron + (get_option('gmt_offset') * 3600)) . '</span>'); ?> </p> <?php endif; elseif ( $cron_old ) : ?><p><?php printf(__('Last WP-Cron Daily Execution: %s','wp-db-backup'), gmdate($datetime, get_option('wp_cron_daily_lastrun') + (get_option('gmt_offset') * 3600))); ?><br /><?php printf(__('Next WP-Cron Daily Execution: %s','wp-db-backup'), gmdate($datetime, (get_option('wp_cron_daily_lastrun') + (get_option('gmt_offset') * 3600) + 86400))); ?></p><?php endif; ?><form method="post" action=""> <?php if ( function_exists('wp_nonce_field') ) wp_nonce_field($this->referer_check_key); ?> <div class="tables-list"> <h4><?php _e('Schedule: ','wp-db-backup'); ?></h4> <?php if ( $cron_old ) : $wp_cron_backup_schedule = get_option('wp_cron_backup_schedule'); $schedule = array(0 => __('None','wp-db-backup'), 1 => __('Daily','wp-db-backup')); foreach ($schedule as $value => $name) { echo ' <input type="radio" style="border:none;" name="cron_schedule"'; if ($wp_cron_backup_schedule == $value) { echo ' checked="checked" '; } echo 'value="' . $value . '" /> ' . $name; } elseif ( $cron ) : echo apply_filters('wp_db_b_schedule_choices', wp_get_schedules() ); endif; $cron_recipient = get_option('wp_cron_backup_recipient'); if (! is_email($cron_recipient)) { $cron_recipient = get_option('admin_email'); } $cron_recipient_input = '<p><label for="cron_backup_recipient">' . __('Email backup to:','wp-db-backup') . ' <input type="text" name="cron_backup_recipient" id="cron_backup_recipient" size="20" value="' . $cron_recipient . '" /></label></p>'; echo apply_filters('wp_db_b_cron_recipient_input', $cron_recipient_input); echo '<p class="submit"><input type="submit" name="submit" value="' . __('Schedule backup','wp-db-backup') . '" /></p>'; echo '</div>'; $cron_tables = get_option('wp_cron_backup_tables'); if (! is_array($cron_tables)) { $cron_tables = array(); } if (count($other_tables) > 0) { echo '<div class="tables-list alternate" id="include-tables-list">'; echo '<h4>' . __('Tables to include in the scheduled backup:','wp-db-backup') . '</h4><ul>'; foreach ($other_tables as $table) { echo '<li><input type="checkbox" '; if (in_array($table, $cron_tables)) { echo 'checked="checked" '; } echo "name='wp_cron_backup_tables[]' value='{$table}' /> <code>{$table}</code></li>"; } echo '</ul></div>'; } echo '<input type="hidden" name="wp_cron_backup_options" value="SET" /></form>'; echo '</fieldset>'; endif; // end of wp_cron (legacy) section echo '</div><!-- .wrap -->'; } // end wp_backup_menu() function get_sched() { $options = array_keys( (array) wp_get_schedules() ); $freq = get_option('wp_cron_backup_schedule'); $freq = ( in_array( $freq , $options ) ) ? $freq : 'never'; return $freq; } function schedule_choices($schedule) { // create the cron menu based on the schedule $wp_cron_backup_schedule = $this->get_sched(); $next_cron = wp_next_scheduled('wp_db_backup_cron'); $wp_cron_backup_schedule = ( empty( $next_cron ) ) ? 'never' : $wp_cron_backup_schedule; $sort = array(); foreach ( (array) $schedule as $key => $value ) $sort[$key] = $value['interval']; asort( $sort ); $schedule_sorted = array(); foreach ( (array) $sort as $key => $value ) $schedule_sorted[$key] = $schedule[$key]; $menu = '<ul>'; $schedule = array_merge( array( 'never' => array( 'interval' => 0, 'display' => __('Never','wp-db-backup') ) ), (array) $schedule_sorted ); foreach ( $schedule as $name => $settings) { $interval = (int) $settings['interval']; if ( 0 == $interval && ! 'never' == $name ) continue; $display = ( ! '' == $settings['display'] ) ? $settings['display'] : sprintf(__('%s seconds','wp-db-backup'),$interval); $menu .= "<li><input type='radio' name='wp_cron_schedule' style='border:none;' "; if ($wp_cron_backup_schedule == $name) { $menu .= " checked='checked' "; } $menu .= "value='$name' /> $display</li>"; } $menu .= '</ul>'; return $menu; } // end schedule_choices() function wp_cron_daily() { // for legacy cron plugin $schedule = intval(get_option('wp_cron_backup_schedule')); // If scheduled backup is disabled if (0 == $schedule) return; else return $this->cron_backup(); } function cron_backup() { global $table_prefix, $wpdb; $all_tables = $wpdb->get_results("SHOW TABLES", ARRAY_N); $all_tables = array_map(create_function('$a', 'return $a[0];'), $all_tables); $core_tables = array_intersect($all_tables, $this->core_table_names); $other_tables = get_option('wp_cron_backup_tables'); $recipient = get_option('wp_cron_backup_recipient'); $backup_file = $this->db_backup($core_tables, $other_tables); if (false !== $backup_file) return $this->deliver_backup($backup_file, 'smtp', $recipient, 'main'); else return false; } function add_sched_options($sched) { $sched['weekly'] = array('interval' => 604800, 'display' => __('Once Weekly','wp-db-backup')); return $sched; } /** * Checks that WordPress has sufficient security measures * @param string $kind * @return bool */ function wp_secure($kind = 'warn', $loc = 'main') { global $wp_version; if ( function_exists('wp_verify_nonce') ) return true; else { $this->error(array('kind' => $kind, 'loc' => $loc, 'msg' => sprintf(__('Your WordPress version, %1s, lacks important security features without which it is unsafe to use the WP-DB-Backup plugin. Hence, this plugin is automatically disabled. Please consider <a href="%2s">upgrading WordPress</a> to a more recent version.','wp-db-backup'),$wp_version,'http://wordpress.org/download/'))); return false; } } /** * Checks that the user has sufficient permission to backup * @param string $loc * @return bool */ function can_user_backup($loc = 'main') { $can = false; // make sure WPMU users are site admins, not ordinary admins if ( function_exists('is_site_admin') && ! is_site_admin() ) return false; if ( ( $this->wp_secure('fatal', $loc) ) && current_user_can('import') ) $can = $this->verify_nonce($_REQUEST['_wpnonce'], $this->referer_check_key, $loc); if ( false == $can ) $this->error(array('loc' => $loc, 'kind' => 'fatal', 'msg' => __('You are not allowed to perform backups.','wp-db-backup'))); return $can; } /** * Verify that the nonce is legitimate * @param string $rec the nonce received * @param string $nonce what the nonce should be * @param string $loc the location of the check * @return bool */ function verify_nonce($rec = '', $nonce = 'X', $loc = 'main') { if ( wp_verify_nonce($rec, $nonce) ) return true; else $this->error(array('loc' => $loc, 'kind' => 'fatal', 'msg' => sprintf(__('There appears to be an unauthorized attempt from this site to access your database located at %1s. The attempt has been halted.','wp-db-backup'),get_option('home')))); } /** * Check whether a file to be downloaded is * surreptitiously trying to download a non-backup file * @param string $file * @return null */ function validate_file($file) { if ( (false !== strpos($file, '..')) || (false !== strpos($file, './')) || (':' == substr($file, 1, 1)) ) $this->error(array('kind' => 'fatal', 'loc' => 'frame', 'msg' => __("Cheatin' uh ?",'wp-db-backup'))); } } function wpdbBackup_init() { global $mywpdbbackup; $mywpdbbackup = new wpdbBackup(); } add_action('plugins_loaded', 'wpdbBackup_init'); ?>
01happy-blog
trunk/myblog/wp-content/plugins/wp-db-backup/wp-db-backup.php
PHP
oos
55,053
<?php /* Plugin Name: 云商店评论 Plugin URI: http://www.yuanshangdian.com/ Author: luofei614 Author URI: http://weibo.com/luofei614 Description: 云商店评论系统,评论时需要登陆微博后才能评论,从而防止垃圾信息。 Version: 1.5 */ if(!isset($_SESSION)) session_start(); //判断是否已经session_start, 如果没有进行session_start if(!empty($_GET['ysd_a'])){ header('Content-Type:text/html; charset=utf-8'); //检查referer if(!isset($_SERVER['HTTP_REFERER']) || !preg_match('/^http:\/\/sinaclouds.sinaapp.com/', $_SERVER['HTTP_REFERER'])){ exit('<script>alert("来源错误")</script>'); } if('callback'==$_GET['ysd_a'] && !empty($_GET['ticket']) && !empty($_GET['screen_name'])){ //登陆回调 $_SESSION['ysd_sso_ticket']=$_GET['ticket'];//ticket session echo '<script>window.top.login_success("'.$_GET['screen_name'].'")</script>'; }elseif('login_out'==$_GET['ysd_a'] && !empty($_GET['ticket'])){ //退出 if(isset($_SESSION['ysd_sso_ticket']) && $_SESSION['ysd_sso_ticket']==$_GET['ticket']){ unset($_SESSION['ysd_sso_ticket']); echo 'succ'; } } }else{ add_action('comment_form_before_fields','webo_login'); //add_action('comment_form_after_fields','weibo_choose'); add_action('comment_form_after','ysd_comment_form_alert'); add_action('pre_comment_on_post','ysd_comment_on_post'); add_action('comment_post','ysd_comment_post'); } function webo_login(){ if(is_user_logged_in()){ //管理员登录,无需微博登陆 return ; } //根路径 $root=dirname(rtrim($_SERVER['SCRIPT_NAME'],'/')); if('/'==$root || '\\'==$root) $root=''; $arr=explode('wp-content',__FILE__); $ssl=( ( isset($_SERVER['HTTP_APPMASK']) && $_SERVER['HTTP_APPMASK'] & 0x1 ) || ( isset($_SERVER['HTTP_X_PROTO']) && $_SERVER['HTTP_X_PROTO'] == 'SSL' ) )?true:false; $path=($ssl?'https://':'http://').$_SERVER['HTTP_HOST'].'/'.$root.'/wp-content'.str_replace('\\', '/', $arr[1]); $callback_url=$path.'?ysd_a=callback'; $login_out_url=$path.'?ysd_a=login_out'; $sso_url='http://sinaclouds.sinaapp.com/weibosso/?callback='.urlencode($callback_url).'&login_out='.urlencode($login_out_url); echo '<script>function login_success(name){ document.getElementById("author").value=name;document.getElementById("commentform").onsubmit=function(){return true;} }</script>'; echo '<iframe scrolling="no" frameborder="0" style="height:24px; width:100%;" allowtransparency="true" src="'.$sso_url.'"></iframe>'; } function weibo_choose(){ if(!is_user_logged_in()) echo '<input type="checkbox" name="send_to_weibo" /> 同时发布到微博'; } function ysd_comment_on_post($comment_post_ID){ if(!is_user_logged_in() && !isset($_SESSION['ysd_sso_ticket'])){ //var_dump($_SESSION); wp_die('<strong>错误</strong>: 请先用微博登陆后才能评论'); } } function ysd_comment_post(){ if(isset($_POST['send_to_weibo'])){ //同时更新到微博 $content=$_POST['comment']; if(mb_strlen($content,'utf-8')>120){ $content=mb_substr($content, 0,120).'...'; } $content.=$_SERVER['HTTP_REFERER']; $url='http://sinaclouds.sinaapp.com/weibosso/?a=send_msg&ticket='.$_SESSION['ysd_sso_ticket']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, array('content'=>$content)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); } } function ysd_comment_form_alert(){ if(!is_user_logged_in() && !isset($_SESSION['ysd_sso_ticket'])){ echo<<<JS <script> document.getElementById('commentform').onsubmit=function(){ alert('请先登录微博'); return false; } </script> JS; } } ?>
01happy-blog
trunk/myblog/wp-content/plugins/ysd-comment/ysd-comment.php
PHP
oos
3,720
<?php // Silence is golden. ?>
01happy-blog
trunk/myblog/wp-content/themes/index.php
PHP
oos
30
<?php /** * The template for displaying Comments. * * The area of the page that contains both current comments * and the comment form. The actual display of comments is * handled by a callback to twentyeleven_comment() which is * located in the functions.php file. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <div id="comments"> <?php if ( post_password_required() ) : ?> <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p> </div><!-- #comments --> <?php /* Stop the rest of comments.php from being processed, * but don't kill the script entirely -- we still have * to fully load the template. */ return; endif; ?> <?php // You can start editing here -- including this comment! ?> <?php if ( have_comments() ) : ?> <h2 id="comments-title"> <?php printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyeleven' ), number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); ?> </h2> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <nav id="comment-nav-above"> <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div> </nav> <?php endif; // check for comment navigation ?> <ol class="commentlist"> <?php /* Loop through and list the comments. Tell wp_list_comments() * to use twentyeleven_comment() to format the comments. * If you want to overload this in a child theme then you can * define twentyeleven_comment() and that will be used instead. * See twentyeleven_comment() in twentyeleven/functions.php for more. */ wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) ); ?> </ol> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <nav id="comment-nav-below"> <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div> </nav> <?php endif; // check for comment navigation ?> <?php /* If there are no comments and comments are closed, let's leave a little note, shall we? * But we don't want the note on pages or post types that do not support comments. */ elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?> <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p> <?php endif; ?> <?php comment_form(); ?> </div><!-- #comments -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/comments.php
PHP
oos
3,129
<?php /** * The template for displaying Search Results pages. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <section id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1> </header> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/search.php
PHP
oos
1,639
/* Theme Name: Twenty Eleven Theme URI: http://wordpress.org/extend/themes/twentyeleven Author: the WordPress team Author URI: http://wordpress.org/ Description: The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -- then go further with available theme options for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, support for featured images (as custom header images on posts and pages and as large images on featured "sticky" posts), and special styles for six different post formats. Version: 1.4 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-width, flexible-width, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready Text Domain: twentyeleven */ /* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html -------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { border: 0; font-family: inherit; font-size: 100%; font-style: inherit; font-weight: inherit; margin: 0; outline: 0; padding: 0; vertical-align: baseline; } :focus {/* remember to define focus styles! */ outline: 0; } body { background: #fff; line-height: 1; } ol, ul { list-style: none; } table {/* tables still need 'cellspacing="0"' in the markup */ border-collapse: separate; border-spacing: 0; } caption, th, td { font-weight: normal; text-align: left; } blockquote:before, blockquote:after, q:before, q:after { content: ""; } blockquote, q { quotes: "" ""; } a img { border: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } /* =Structure ----------------------------------------------- */ body { padding: 0 2em; } #page { margin: 2em auto; max-width: 1000px; } #branding hgroup { margin: 0 7.6%; } #access div { margin: 0 7.6%; } #primary { float: left; margin: 0 -26.4% 0 0; width: 100%; } #content { margin: 0 34% 0 7.6%; width: 58.4%; } #secondary { float: right; margin-right: 7.6%; width: 18.8%; } /* Singular */ .singular #primary { margin: 0; } .singular #content, .left-sidebar.singular #content { margin: 0 7.6%; position: relative; width: auto; } .singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title { margin: 0 auto; width: 68.9%; } /* Attachments */ .singular .image-attachment .entry-content { margin: 0 auto; width: auto; } .singular .image-attachment .entry-description { margin: 0 auto; width: 68.9%; } /* Showcase */ .page-template-showcase-php #primary, .left-sidebar.page-template-showcase-php #primary { margin: 0; } .page-template-showcase-php #content, .left-sidebar.page-template-showcase-php #content { margin: 0 7.6%; width: auto; } .page-template-showcase-php section.recent-posts { float: right; margin: 0 0 0 31%; width: 69%; } .page-template-showcase-php #main .widget-area { float: left; margin: 0 -22.15% 0 0; width: 22.15%; } /* error404 */ .error404 #primary { float: none; margin: 0; } .error404 #primary #content { margin: 0 7.6%; width: auto; } /* Alignment */ .alignleft { display: inline; float: left; margin-right: 1.625em; } .alignright { display: inline; float: right; margin-left: 1.625em; } .aligncenter { clear: both; display: block; margin-left: auto; margin-right: auto; } /* Right Content */ .left-sidebar #primary { float: right; margin: 0 0 0 -26.4%; width: 100%; } .left-sidebar #content { margin: 0 7.6% 0 34%; width: 58.4%; } .left-sidebar #secondary { float: left; margin-left: 7.6%; margin-right: 0; width: 18.8%; } /* One column */ .one-column #page { max-width: 690px; } .one-column #content { margin: 0 7.6%; width: auto; } .one-column #nav-below { border-bottom: 1px solid #ddd; margin-bottom: 1.625em; } .one-column #secondary { float: none; margin: 0 7.6%; width: auto; } /* Simplify the showcase template */ .one-column .page-template-showcase-php section.recent-posts { float: none; margin: 0; width: 100%; } .one-column .page-template-showcase-php #main .widget-area { float: none; margin: 0; width: auto; } .one-column .page-template-showcase-php .other-recent-posts { border-bottom: 1px solid #ddd; } /* Simplify the showcase template when small feature */ .one-column section.featured-post .attachment-small-feature { border: none; display: block; height: auto; max-width: 60%; position: static; } .one-column article.feature-image.small { margin: 0 0 1.625em; padding: 0; } .one-column article.feature-image.small .entry-title { font-size: 20px; line-height: 1.3em; } .one-column article.feature-image.small .entry-summary { height: 150px; overflow: hidden; padding: 0; text-overflow: ellipsis; } .one-column article.feature-image.small .entry-summary a { left: -9%; } /* Remove the margin on singular articles */ .one-column.singular .entry-header, .one-column.singular .entry-content, .one-column.singular footer.entry-meta, .one-column.singular #comments-title { width: 100%; } /* Simplify the pullquotes and pull styles */ .one-column.singular blockquote.pull { margin: 0 0 1.625em; } .one-column.singular .pull.alignleft { margin: 0 1.625em 0 0; } .one-column.singular .pull.alignright { margin: 0 0 0 1.625em; } .one-column.singular .entry-meta .edit-link a { position: absolute; left: 0; top: 40px; } .one-column.singular #author-info { margin: 2.2em -8.8% 0; padding: 20px 8.8%; } /* Make sure we have room for our comment avatars */ .one-column .commentlist > li.comment { margin-left: 102px; width: auto; } /* Make sure the logo and search form don't collide */ .one-column #branding #searchform { right: 40px; top: 4em; } /* Talking avatars take up too much room at this size */ .one-column .commentlist > li.comment { margin-left: 0; } .one-column .commentlist > li.comment .comment-meta, .one-column .commentlist > li.comment .comment-content { margin-right: 85px; } .one-column .commentlist .avatar { background: transparent; display: block; padding: 0; top: 1.625em; left: auto; right: 1.625em; } .one-column .commentlist .children .avatar { background: none; padding: 0; position: absolute; top: 2.2em; left: 2.2em; } .one-column #respond { width: auto; } /* =Global ----------------------------------------------- */ body, input, textarea { color: #373737; font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; line-height: 1.625; } body { background: #e2e2e2; } #page { background: #fff; } /* Headings */ h1,h2,h3,h4,h5,h6 { clear: both; } hr { background-color: #ccc; border: 0; height: 1px; margin-bottom: 1.625em; } /* Text elements */ p { margin-bottom: 1.625em; } ul, ol { margin: 0 0 1.625em 2.5em; } ul { list-style: square; } ol { list-style-type: decimal; } ol ol { list-style: upper-alpha; } ol ol ol { list-style: lower-roman; } ol ol ol ol { list-style: lower-alpha; } ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; } dl { margin: 0 1.625em; } dt { font-weight: bold; } dd { margin-bottom: 1.625em; } strong { font-weight: bold; } cite, em, i { font-style: italic; } blockquote { font-family: Georgia, "Bitstream Charter", serif; font-style: italic; font-weight: normal; margin: 0 3em; } blockquote em, blockquote i, blockquote cite { font-style: normal; } blockquote cite { color: #666; font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; letter-spacing: 0.05em; text-transform: uppercase; } pre { background: #f4f4f4; font: 13px "Courier 10 Pitch", Courier, monospace; line-height: 1.5; margin-bottom: 1.625em; overflow: auto; padding: 0.75em 1.625em; } code, kbd, samp, var { font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; } abbr, acronym, dfn { border-bottom: 1px dotted #666; cursor: help; } address { display: block; margin: 0 0 1.625em; } ins { background: #fff9c0; text-decoration: none; } sup, sub { font-size: 10px; height: 0; line-height: 1; position: relative; vertical-align: baseline; } sup { bottom: 1ex; } sub { top: .5ex; } /* Forms */ input[type=text], input[type=password], textarea { background: #fafafa; -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); border: 1px solid #ddd; color: #888; } input[type=text]:focus, textarea:focus { color: #373737; } textarea { padding-left: 3px; width: 98%; } input[type=text] { padding: 3px; } input#s { background: url(images/search.png) no-repeat 5px 6px; -moz-border-radius: 2px; border-radius: 2px; font-size: 14px; height: 22px; line-height: 1.2em; padding: 4px 10px 4px 28px; } input#searchsubmit { display: none; } /* Links */ a { color: #1982d1; text-decoration: none; } a:focus, a:active, a:hover { text-decoration: underline; } /* Assistive text */ .assistive-text { position: absolute !important; clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); } #access a.assistive-text:active, #access a.assistive-text:focus { background: #eee; border-bottom: 1px solid #ddd; color: #1982d1; clip: auto !important; font-size: 12px; position: absolute; text-decoration: underline; top: 0; left: 7.6%; } /* =Header ----------------------------------------------- */ #branding { border-top: 2px solid #bbb; padding-bottom: 10px; position: relative; z-index: 9999; } #site-title { margin-right: 270px; padding: 3.65625em 0 0; } #site-title a { color: #111; font-size: 30px; font-weight: bold; line-height: 36px; text-decoration: none; } #site-title a:hover, #site-title a:focus, #site-title a:active { color: #1982d1; } #site-description { color: #7a7a7a; font-size: 14px; margin: 0 270px 3.65625em 0; } #branding img { height: auto; margin-bottom: -7px; width: 100%; } /* =Menu -------------------------------------------------------------- */ #access { background: #222; /* Show a solid color for older browsers */ background: -moz-linear-gradient(#252525, #0a0a0a); background: -o-linear-gradient(#252525, #0a0a0a); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */ background: -webkit-linear-gradient(#252525, #0a0a0a); -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px; -moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px; box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px; clear: both; display: block; float: left; margin: 0 auto 6px; width: 100%; } #access ul { font-size: 13px; list-style: none; margin: 0 0 0 -0.8125em; padding-left: 0; } #access li { float: left; position: relative; } #access a { color: #eee; display: block; line-height: 3.333em; padding: 0 1.2125em; text-decoration: none; } #access ul ul { -moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2); -webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2); box-shadow: 0 3px 3px rgba(0,0,0,0.2); display: none; float: left; margin: 0; position: absolute; top: 3.333em; left: 0; width: 188px; z-index: 99999; } #access ul ul ul { left: 100%; top: 0; } #access ul ul a { background: #f9f9f9; border-bottom: 1px dotted #ddd; color: #444; font-size: 13px; font-weight: normal; height: auto; line-height: 1.4em; padding: 10px 10px; width: 168px; } #access li:hover > a, #access ul ul :hover > a, #access a:focus { background: #efefef; } #access li:hover > a, #access a:focus { background: #f9f9f9; /* Show a solid color for older browsers */ background: -moz-linear-gradient(#f9f9f9, #e5e5e5); background: -o-linear-gradient(#f9f9f9, #e5e5e5); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */ background: -webkit-linear-gradient(#f9f9f9, #e5e5e5); color: #373737; } #access ul li:hover > ul { display: block; } #access .current-menu-item > a, #access .current-menu-ancestor > a, #access .current_page_item > a, #access .current_page_ancestor > a { font-weight: bold; } /* Search Form */ #branding #searchform { position: absolute; top: 3.8em; right: 7.6%; text-align: right; } #branding #searchform div { margin: 0; } #branding #s { float: right; -webkit-transition-duration: 400ms; -webkit-transition-property: width, background; -webkit-transition-timing-function: ease; -moz-transition-duration: 400ms; -moz-transition-property: width, background; -moz-transition-timing-function: ease; -o-transition-duration: 400ms; -o-transition-property: width, background; -o-transition-timing-function: ease; width: 72px; } #branding #s:focus { background-color: #f9f9f9; width: 196px; } #branding #searchsubmit { display: none; } #branding .only-search #searchform { top: 5px; z-index: 1; } #branding .only-search #s { background-color: #666; border-color: #000; color: #222; } #branding .only-search #s, #branding .only-search #s:focus { width: 85%; } #branding .only-search #s:focus { background-color: #bbb; } #branding .with-image #searchform { top: auto; bottom: -27px; max-width: 195px; } #branding .only-search + #access div { padding-right: 205px; } /* =Content ----------------------------------------------- */ #main { clear: both; padding: 1.625em 0 0; } .page-title { color: #666; font-size: 10px; font-weight: 500; letter-spacing: 0.1em; line-height: 2.6em; margin: 0 0 2.6em; text-transform: uppercase; } .page-title a { font-size: 12px; font-weight: bold; letter-spacing: 0; text-transform: none; } .hentry, .no-results { border-bottom: 1px solid #ddd; margin: 0 0 1.625em; padding: 0 0 1.625em; position: relative; } .hentry:last-child, .no-results { border-bottom: none; } .blog .sticky .entry-header .entry-meta { clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); position: absolute !important; } .entry-title, .entry-header .entry-meta { padding-right: 76px; } .entry-title { clear: both; color: #222; font-size: 26px; font-weight: bold; line-height: 1.5em; padding-bottom: .3em; padding-top: 15px; } .entry-title, .entry-title a { color: #222; text-decoration: none; } .entry-title a:hover, .entry-title a:focus, .entry-title a:active { color: #1982d1; } .entry-meta { color: #666; clear: both; font-size: 12px; line-height: 18px; } .entry-meta a { font-weight: bold; } .single-author .entry-meta .by-author { display: none; } .entry-content, .entry-summary { padding: 1.625em 0 0; } .entry-content h1, .entry-content h2, .comment-content h1, .comment-content h2 { color: #000; font-weight: bold; margin: 0 0 .8125em; } .entry-content h3, .comment-content h3 { font-size: 10px; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } .entry-content table, .comment-content table { border-bottom: 1px solid #ddd; margin: 0 0 1.625em; width: 100%; } .entry-content th, .comment-content th { color: #666; font-size: 10px; font-weight: 500; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } .entry-content td, .comment-content td { border-top: 1px solid #ddd; padding: 6px 10px 6px 0; } .entry-content #s { width: 75%; } .comment-content ul, .comment-content ol { margin-bottom: 1.625em; } .comment-content ul ul, .comment-content ol ol, .comment-content ul ol, .comment-content ol ul { margin-bottom: 0; } dl.gallery-item { margin: 0; } .page-link { clear: both; display: block; margin: 0 0 1.625em; } .page-link a { background: #eee; color: #373737; margin: 0; padding: 2px 3px; text-decoration: none; } .page-link a:hover { background: #888; color: #fff; font-weight: bold; } .page-link span { margin-right: 6px; } .entry-meta .edit-link a, .commentlist .edit-link a { background: #eee; -moz-border-radius: 3px; border-radius: 3px; color: #666; float: right; font-size: 12px; line-height: 1.5em; font-weight: 300; text-decoration: none; padding: 0 8px; } .entry-meta .edit-link a:hover, .commentlist .edit-link a:hover { background: #888; color: #fff; } .entry-content .edit-link { clear: both; display: block; } /* Images */ .entry-content img, .comment-content img, .widget img { max-width: 97.5%; /* Fluid images for posts, comments, and widgets */ } img[class*="align"], img[class*="wp-image-"], img[class*="attachment-"] { height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */ } img.size-full, img.size-large { max-width: 97.5%; width: auto; /* Prevent stretching of full-size and large-size images with height and width attributes in IE8 */ height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */ } .entry-content img.wp-smiley { border: none; margin-bottom: 0; margin-top: 0; padding: 0; } img.alignleft, img.alignright, img.aligncenter { margin-bottom: 1.625em; } p img, .wp-caption { margin-top: 0.4em; } .wp-caption { background: #eee; margin-bottom: 1.625em; max-width: 96%; padding: 9px; } .wp-caption img { display: block; margin: 0 auto; max-width: 98%; } .wp-caption .wp-caption-text, .gallery-caption { color: #666; font-family: Georgia, serif; font-size: 12px; } .wp-caption .wp-caption-text { margin-bottom: 0.6em; padding: 10px 0 5px 40px; position: relative; } .wp-caption .wp-caption-text:before { color: #666; content: '\2014'; font-size: 14px; font-style: normal; font-weight: bold; margin-right: 5px; position: absolute; left: 10px; top: 7px; } #content .gallery { margin: 0 auto 1.625em; } #content .gallery a img { border: none; } img#wpstats { display: block; margin: 0 auto 1.625em; } #content .gallery-columns-4 .gallery-item { width: 23%; padding-right: 2%; } #content .gallery-columns-4 .gallery-item img { width: 100%; height: auto; } /* Image borders */ img[class*="align"], img[class*="wp-image-"], #content .gallery .gallery-icon img {/* Add fancy borders to all WordPress-added images but not things like badges and icons and the like */ border: 1px solid #ddd; padding: 6px; } .wp-caption img { border-color: #eee; } a:focus img[class*="align"], a:hover img[class*="align"], a:active img[class*="align"], a:focus img[class*="wp-image-"], a:hover img[class*="wp-image-"], a:active img[class*="wp-image-"], #content .gallery .gallery-icon a:focus img, #content .gallery .gallery-icon a:hover img, #content .gallery .gallery-icon a:active img {/* Add some useful style to those fancy borders for linked images ... */ background: #eee; border-color: #bbb; } .wp-caption a:focus img, .wp-caption a:active img, .wp-caption a:hover img {/* ... including captioned images! */ background: #fff; border-color: #ddd; } /* Make sure embeds and iframes fit their containers */ embed, iframe, object { max-width: 100%; } /* Password Protected Posts */ .post-password-required .entry-header .comments-link { margin: 1.625em 0 0; } .post-password-required input[type=password] { margin: 0.8125em 0; } .post-password-required input[type=password]:focus { background: #f7f7f7; } /* Author Info */ #author-info { font-size: 12px; overflow: hidden; } .singular #author-info { background: #f9f9f9; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 2.2em -35.6% 0 -35.4%; padding: 20px 35.4%; } .archive #author-info { border-bottom: 1px solid #ddd; margin: 0 0 2.2em; padding: 0 0 2.2em; } #author-avatar { float: left; margin-right: -78px; } #author-avatar img { background: #fff; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px #bbb; -moz-box-shadow: 0 1px 2px #bbb; box-shadow: 0 1px 2px #bbb; padding: 3px; } #author-description { float: left; margin-left: 108px; } #author-description h2 { color: #000; font-size: 15px; font-weight: bold; margin: 5px 0 10px; } /* Comments link */ .entry-header .comments-link a { background: #eee url(images/comment-bubble.png) no-repeat; color: #666; font-size: 13px; font-weight: normal; line-height: 35px; overflow: hidden; padding: 0 0 0; position: absolute; top: 1.5em; right: 0; text-align: center; text-decoration: none; width: 43px; height: 36px; } .entry-header .comments-link a:hover, .entry-header .comments-link a:focus, .entry-header .comments-link a:active { background-color: #1982d1; color: #fff; color: rgba(255,255,255,0.8); } .entry-header .comments-link .leave-reply { visibility: hidden; } /* Post Formats Headings To hide the headings, display: none the ".entry-header .entry-format" selector, and remove the padding rules below. */ .entry-header .entry-format { color: #666; font-size: 10px; font-weight: 500; letter-spacing: 0.1em; line-height: 2.6em; position: absolute; text-transform: uppercase; top: -5px; } .entry-header hgroup .entry-title { padding-top: 15px; } article.format-aside .entry-content, article.format-link .entry-content, article.format-status .entry-content { padding: 20px 0 0; } article.format-status .entry-content { min-height: 65px; } .recent-posts .entry-header .entry-format { display: none; } .recent-posts .entry-header hgroup .entry-title { padding-top: 0; } /* Singular content styles for Posts and Pages */ .singular .hentry { border-bottom: none; padding: 4.875em 0 0; position: relative; } .singular.page .hentry { padding: 3.5em 0 0; } .singular .entry-title { color: #000; font-size: 36px; font-weight: bold; line-height: 48px; } .singular .entry-title, .singular .entry-header .entry-meta { padding-right: 0; } .singular .entry-header .entry-meta { position: absolute; top: 0; left: 0; } blockquote.pull { font-size: 21px; font-weight: bold; line-height: 1.6125em; margin: 0 0 1.625em; text-align: center; } .singular blockquote.pull { margin: 0 -22.25% 1.625em; } .pull.alignleft { margin: 0 1.625em 0 0; text-align: right; } .singular .pull.alignleft { margin: 0 1.625em 0 -22.25%; } .pull.alignright { margin: 0 0 0 1.625em; text-align: left; } blockquote.pull.alignleft, blockquote.pull.alignright { width: 33%; } .singular .pull.alignright { margin: 0 -22.25% 0 1.625em; } .singular blockquote.pull.alignleft, .singular blockquote.pull.alignright { width: 33%; } .singular .entry-meta .edit-link a { bottom: auto; left: 50px; position: absolute; right: auto; top: 80px; } /* =Aside ----------------------------------------------- */ .format-aside .entry-title, .format-aside .entry-header .comments-link { display: none; } .singular .format-aside .entry-title { display: block; } .format-aside .entry-content { padding: 0; } .singular .format-aside .entry-content { padding: 1.625em 0 0; } /* =Link ----------------------------------------------- */ .format-link .entry-title, .format-link .entry-header .comments-link { display: none; } .singular .format-link .entry-title { display: block; } .format-link .entry-content { padding: 0; } .singular .format-link .entry-content { padding: 1.625em 0 0; } /* =Gallery ----------------------------------------------- */ .format-gallery .gallery-thumb { float: left; display: block; margin: .375em 1.625em 0 0; } /* =Status ----------------------------------------------- */ .format-status .entry-title, .format-status .entry-header .comments-link { display: none; } .singular .format-status .entry-title { display: block; } .format-status .entry-content { padding: 0; } .singular .format-status .entry-content { padding: 1.625em 0 0; } .format-status img.avatar { -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px #ccc; -moz-box-shadow: 0 1px 2px #ccc; box-shadow: 0 1px 2px #ccc; float: left; margin: 4px 10px 2px 0; padding: 0; } /* =Quote ----------------------------------------------- */ .format-quote blockquote { color: #555; font-size: 17px; margin: 0; } /* =Image ----------------------------------------------- */ .indexed.format-image .entry-header { min-height: 61px; /* Prevent the comment icon from colliding with the image when there is no title */ } .indexed.format-image .entry-content { padding-top: 0.5em; } .indexed.format-image .entry-content p { margin: 1em 0; } .indexed.format-image .entry-content p:first-child, .indexed.format-image .entry-content p:first-child a, .indexed.format-image .entry-content p:first-child img { display: block; margin: 0; } .indexed.format-image .entry-content .wp-caption .wp-caption-text { margin: 0; padding-bottom: 1em; } .indexed.format-image footer.entry-meta { background: #ddd; overflow: hidden; padding: 4%; max-width: 96%; } .indexed.format-image div.entry-meta { display: inline-block; float: left; width: 35%; } .indexed.format-image div.entry-meta + div.entry-meta { float: none; width: 65%; } .indexed.format-image .entry-meta span.cat-links, .indexed.format-image .entry-meta span.tag-links, .indexed.format-image .entry-meta span.comments-link { display: block; } .indexed.format-image footer.entry-meta a { color: #444; } .indexed.format-image footer.entry-meta a:hover { color: #fff; } #content .indexed.format-image img { border: none; max-width: 100%; padding: 0; } .indexed.format-image .wp-caption { background: #111; margin-bottom: 0; max-width: 96%; padding: 2% 2% 0; } .indexed.format-image .wp-caption .wp-caption-text { color: #ddd; } .indexed.format-image .wp-caption .wp-caption-text:before { color: #444; } .indexed.format-image a:hover img { opacity: 0.8; } /* =error404 ----------------------------------------------- */ .error404 #main #searchform { background: #f9f9f9; border: 1px solid #ddd; border-width: 1px 0; margin: 0 -8.9% 1.625em; overflow: hidden; padding: 1.625em 8.9%; } .error404 #main #s { width: 95%; } .error404 #main .widget { clear: none; float: left; margin-right: 3.7%; width: 30.85%; } .error404 #main .widget_archive { margin-right: 0; } .error404 #main .widget_tag_cloud { float: none; margin-right: 0; width: 100%; } .error404 .widgettitle { font-size: 10px; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } /* =Showcase ----------------------------------------------- */ h1.showcase-heading { color: #666; font-size: 10px; font-weight: 500; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } /* Intro */ article.intro { background: #f9f9f9; border-bottom: none; margin: -1.855em -8.9% 1.625em; padding: 0 8.9%; } article.intro .entry-title { display: none; } article.intro .entry-content { color: #111; font-size: 16px; padding: 1.625em 0 0.625em; } article.intro .edit-link a { background: #aaa; -moz-border-radius: 3px; border-radius: 3px; color: #fff; font-size: 12px; padding: 0 8px; position: absolute; top: 30px; right: 20px; text-decoration: none; } article.intro .edit-link a:hover, article.intro .edit-link a:focus, article.intro .edit-link a:active { background: #777; } /* Featured post */ section.featured-post { float: left; margin: -1.625em -8.9% 1.625em; padding: 1.625em 8.9% 0; position: relative; width: 100%; } section.featured-post .hentry { border: none; color: #666; margin: 0; } section.featured-post .entry-meta { clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); position: absolute !important; } /* Small featured post */ section.featured-post .attachment-small-feature { float: right; height: auto; margin: 0 -8.9% 1.625em 0; max-width: 59%; position: relative; right: -15px; } section.featured-post.small { padding-top: 0; } section.featured-post .attachment-small-feature:hover, section.featured-post .attachment-small-feature:focus, section.featured-post .attachment-small-feature:active { opacity: .8; } article.feature-image.small { float: left; margin: 0 0 1.625em; width: 45%; } article.feature-image.small .entry-title { line-height: 1.2em; } article.feature-image.small .entry-summary { color: #555; font-size: 13px; } article.feature-image.small .entry-summary p a { background: #222; color: #eee; display: block; left: -23.8%; padding: 9px 26px 9px 85px; position: relative; text-decoration: none; top: 20px; width: 180px; z-index: 1; } article.feature-image.small .entry-summary p a:hover { background: #1982d1; color: #eee; color: rgba(255,255,255,0.8); } /* Large featured post */ section.feature-image.large { border: none; max-height: 288px; padding: 0; width: 100%; } section.feature-image.large .showcase-heading { display: none; } section.feature-image.large .hentry { border-bottom: none; left: 9%; margin: 1.625em 9% 0 0; position: absolute; top: 0; } article.feature-image.large .entry-title a { background: #222; background: rgba(0,0,0,0.8); -moz-border-radius: 3px; border-radius: 3px; color: #fff; display: inline-block; font-weight: 300; padding: .2em 20px; } section.feature-image.large:hover .entry-title a, section.feature-image.large .entry-title:hover a { background: #eee; background: rgba(255,255,255,0.8); color: #222; } article.feature-image.large .entry-summary { display: none; } section.feature-image.large img { display: block; height: auto; max-width: 117.9%; padding: 0 0 6px; } /* Featured Slider */ .featured-posts { border-bottom: 1px solid #ddd; display: block; height: 328px; margin: 1.625em -8.9% 20px; max-width: 1000px; padding: 0; position: relative; overflow: hidden; } .featured-posts .showcase-heading { padding-left: 8.9%; } .featured-posts section.featured-post { background: #fff; height: 288px; left: 0; margin: 0; position: absolute; top: 30px; width: auto; } .featured-posts section.featured-post.large { max-width: 100%; overflow: hidden; } .featured-posts section.featured-post { -webkit-transition-duration: 200ms; -webkit-transition-property: opacity, visibility; -webkit-transition-timing-function: ease; -moz-transition-duration: 200ms; -moz-transition-property: opacity, visibility; -moz-transition-timing-function: ease; } .featured-posts section.featured-post { opacity: 0; visibility: hidden; } .featured-posts #featured-post-1 { opacity: 1; visibility: visible; } .featured-post .feature-text:after, .featured-post .feature-image.small:after { content: ' '; background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* W3C */ width: 100%; height: 45px; position: absolute; top: 230px; } .featured-post .feature-image.small:after { top: 253px; } #content .feature-slider { top: 5px; right: 8.9%; overflow: visible; position: absolute; } .feature-slider ul { list-style-type: none; margin: 0; } .feature-slider li { float: left; margin: 0 6px; } .feature-slider a { background: #3c3c3c; background: rgba(60,60,60,0.9); -moz-border-radius: 12px; border-radius: 12px; -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); display: block; width: 14px; height: 14px; } .feature-slider a.active { background: #1982d1; -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); cursor: default; opacity: 0.5; } /* Recent Posts */ section.recent-posts { padding: 0 0 1.625em; } section.recent-posts .hentry { border: none; margin: 0; } section.recent-posts .other-recent-posts { border-bottom: 1px solid #ddd; list-style: none; margin: 0; } section.recent-posts .other-recent-posts li { padding: 0.3125em 0; position: relative; } section.recent-posts .other-recent-posts .entry-title { border-top: 1px solid #ddd; font-size: 17px; } section.recent-posts .other-recent-posts a[rel="bookmark"] { color: #373737; float: left; max-width: 84%; } section.recent-posts .other-recent-posts a[rel="bookmark"]:after { content: '-'; color: transparent; font-size: 11px; } section.recent-posts .other-recent-posts a[rel="bookmark"]:hover { } section.recent-posts .other-recent-posts .comments-link a, section.recent-posts .other-recent-posts .comments-link > span { border-bottom: 2px solid #999; bottom: -2px; color: #444; display: block; font-size: 10px; font-weight: 500; line-height: 2.76333em; padding: 0.3125em 0 0.3125em 1em; position: absolute; right: 0; text-align: right; text-transform: uppercase; z-index: 1; } section.recent-posts .other-recent-posts .comments-link > span { border-color: #bbb; color: #888; } section.recent-posts .other-recent-posts .comments-link a:hover { color: #1982d1; border-color: #1982d1; } section.recent-posts .other-recent-posts li:after { clear: both; content: '.'; display: block; height: 0; visibility: hidden; } /* =Attachments ----------------------------------------------- */ .image-attachment div.attachment { background: #f9f9f9; border: 1px solid #ddd; border-width: 1px 0; margin: 0 -8.9% 1.625em; overflow: hidden; padding: 1.625em 1.625em 0; text-align: center; } .image-attachment div.attachment img { display: block; height: auto; margin: 0 auto 1.625em; max-width: 100%; } .image-attachment div.attachment a img { border-color: #f9f9f9; } .image-attachment div.attachment a:focus img, .image-attachment div.attachment a:hover img, .image-attachment div.attachment a:active img { border-color: #ddd; background: #fff; } .image-attachment .entry-caption p { font-size: 10px; letter-spacing: 0.1em; line-height: 2.6em; margin: 0 0 2.6em; text-transform: uppercase; } /* =Navigation -------------------------------------------------------------- */ #content nav { clear: both; overflow: hidden; padding: 0 0 1.625em; } #content nav a { font-size: 12px; font-weight: bold; line-height: 2.2em; } #nav-above { padding: 0 0 1.625em; } #nav-above { display: none; } .paged #nav-above { display: block; } .nav-previous { float: left; width: 50%; } .nav-next { float: right; text-align: right; width: 50%; } #content nav .meta-nav { font-weight: normal; } /* Singular navigation */ #nav-single { float: right; position: relative; top: -0.3em; text-align: right; z-index: 1; } #nav-single .nav-previous, #nav-single .nav-next { width: auto; } #nav-single .nav-next { padding-left: .5em; } #nav-single .nav-previous { padding-right: .5em; } /* =Widgets ----------------------------------------------- */ .widget-area { font-size: 12px; } .widget { clear: both; margin: 0 0 2.2em; } .widget-title { color: #666; font-size: 10px; font-weight: 500; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } .widget ul { font-size: 15px; margin: 0; } .widget ul ul { margin-left: 1.5em; } .widget ul li { color: #777; font-size: 13px; } .widget a { font-weight: bold; text-decoration: none; } .widget a:hover, .widget a:focus, .widget a:active { text-decoration: underline; } /* Search Widget */ .widget_search form { margin: 0 0 1.625em; } .widget_search #s { width: 77%; } .widget_search #searchsubmit { background: #ddd; border: 1px solid #ccc; -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); -moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); color: #888; font-size: 13px; line-height: 25px; position: relative; top: -2px; } .widget_search #searchsubmit:active { background: #1982d1; border-color: #0861a5; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); color: #bfddf3; } /* Ephemera Widget */ section.ephemera ol, .widget_twentyeleven_ephemera ol { list-style: square; margin: 5px 0 0; } .widget_twentyeleven_ephemera .widget-entry-title { font-size: 15px; font-weight: bold; padding: 0; } .widget_twentyeleven_ephemera .comments-link a, .widget_twentyeleven_ephemera .comments-link > span { color: #666; display: block; font-size: 10px; font-weight: 500; line-height: 2.76333em; text-transform: uppercase; } section.ephemera .entry-title .comments-link a:hover, .widget_twentyeleven_ephemera .entry-title .comments-link a:hover { } section.ephemera .entry-title a span { color: #29628d; } /* Twitter */ .widget_twitter li { list-style-type: none; margin-bottom: 14px; } .widget_twitter .timesince { display: block; font-size: 11px; margin-right: -10px; text-align: right; } /* Widget Image */ .widget_image img { border: 0; padding: 0; height: auto; max-width: 100%; } /* Calendar Widget */ .widget_calendar #wp-calendar { color: #555; width: 95%; text-align: center; } .widget_calendar #wp-calendar caption, .widget_calendar #wp-calendar td, .widget_calendar #wp-calendar th { text-align: center; } .widget_calendar #wp-calendar caption { font-size: 11px; font-weight: 500; padding: 5px 0 3px 0; text-transform: uppercase; } .widget_calendar #wp-calendar th { background: #f4f4f4; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; font-weight: bold; } .widget_calendar #wp-calendar tfoot td { background: #f4f4f4; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; } /* =Comments ----------------------------------------------- */ #comments-title { color: #666; font-size: 10px; font-weight: 500; line-height: 2.6em; padding: 0 0 2.6em; text-transform: uppercase; } .nopassword, .nocomments { color: #aaa; font-size: 24px; font-weight: 100; margin: 26px 0; text-align: center; } .commentlist { list-style: none; margin: 0 auto; width: 68.9%; } .content .commentlist, .page-template-sidebar-page-php .commentlist { width: 100%; /* reset the width for the one-column and sidebar page layout */ } .commentlist > li.comment { background: #f6f6f6; border: 1px solid #ddd; -moz-border-radius: 3px; border-radius: 3px; margin: 0 0 1.625em; padding: 1.625em; position: relative; } .commentlist .pingback { margin: 0 0 1.625em; padding: 0 1.625em; } .commentlist .children { list-style: none; margin: 0; } .commentlist .children li.comment { background: #fff; border-left: 1px solid #ddd; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; margin: 1.625em 0 0; padding: 1.625em; position: relative; } .commentlist .children li.comment .fn { display: block; } .comment-meta .fn { font-style: normal; } .comment-meta { color: #666; font-size: 12px; line-height: 2.2em; } .commentlist .children li.comment .comment-meta { line-height: 1.625em; margin-left: 50px; } .commentlist .children li.comment .comment-content { margin: 1.625em 0 0; } .comment-meta a { font-weight: bold; } .comment-meta a:focus, .comment-meta a:active, .comment-meta a:hover { } .commentlist .avatar { -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px #ccc; -moz-box-shadow: 0 1px 2px #ccc; box-shadow: 0 1px 2px #ccc; left: -102px; padding: 0; position: absolute; top: 0; } .commentlist > li:before { content: url(images/comment-arrow.png); left: -21px; position: absolute; } .commentlist > li.pingback:before { content: ''; } .commentlist .children .avatar { background: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; left: 2.2em; padding: 0; top: 2.2em; } a.comment-reply-link { background: #eee; -moz-border-radius: 3px; border-radius: 3px; color: #666; display: inline-block; font-size: 12px; padding: 0 8px; text-decoration: none; } a.comment-reply-link:hover, a.comment-reply-link:focus, a.comment-reply-link:active { background: #888; color: #fff; } a.comment-reply-link > span { display: inline-block; position: relative; top: -1px; } /* Post author highlighting */ .commentlist > li.bypostauthor { background: #ddd; border-color: #d3d3d3; } .commentlist > li.bypostauthor .comment-meta { color: #575757; } .commentlist > li.bypostauthor .comment-meta a:focus, .commentlist > li.bypostauthor .comment-meta a:active, .commentlist > li.bypostauthor .comment-meta a:hover { } .commentlist > li.bypostauthor:before { content: url(images/comment-arrow-bypostauthor.png); } /* Post Author threaded comments */ .commentlist .children > li.bypostauthor { background: #ddd; border-color: #d3d3d3; } /* sidebar-page.php comments */ /* Make sure we have room for our comment avatars */ .page-template-sidebar-page-php .commentlist > li.comment, .page-template-sidebar-page-php.commentlist .pingback { margin-left: 102px; width: auto; } /* And a full-width comment form */ .page-template-sidebar-page-php #respond { width: auto; } /* Comment Form */ #respond { background: #ddd; border: 1px solid #d3d3d3; -moz-border-radius: 3px; border-radius: 3px; margin: 0 auto 1.625em; padding: 1.625em; position: relative; width: 68.9%; } #respond input[type="text"], #respond textarea { background: #fff; border: 4px solid #eee; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: inset 0 1px 3px rgba(204,204,204,0.95); -moz-box-shadow: inset 0 1px 3px rgba(204,204,204,0.95); box-shadow: inset 0 1px 3px rgba(204,204,204,0.95); position: relative; padding: 10px; text-indent: 80px; } #respond .comment-form-author, #respond .comment-form-email, #respond .comment-form-url, #respond .comment-form-comment { position: relative; } #respond .comment-form-author label, #respond .comment-form-email label, #respond .comment-form-url label, #respond .comment-form-comment label { background: #eee; -webkit-box-shadow: 1px 2px 2px rgba(204,204,204,0.8); -moz-box-shadow: 1px 2px 2px rgba(204,204,204,0.8); box-shadow: 1px 2px 2px rgba(204,204,204,0.8); color: #555; display: inline-block; font-size: 13px; left: 4px; min-width: 60px; padding: 4px 10px; position: relative; top: 40px; z-index: 1; } #respond input[type="text"]:focus, #respond textarea:focus { text-indent: 0; z-index: 1; } #respond textarea { resize: vertical; width: 95%; } #respond .comment-form-author .required, #respond .comment-form-email .required { color: #bd3500; font-size: 22px; font-weight: bold; left: 75%; position: absolute; top: 45px; z-index: 1; } #respond .comment-notes, #respond .logged-in-as { font-size: 13px; } #respond p { margin: 10px 0; } #respond .form-submit { float: right; margin: -20px 0 10px; } #respond input#submit { background: #222; border: none; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); box-shadow: 0px 1px 2px rgba(0,0,0,0.3); color: #eee; cursor: pointer; font-size: 15px; margin: 20px 0; padding: 5px 42px 5px 22px; position: relative; left: 30px; text-shadow: 0 -1px 0 rgba(0,0,0,0.3); } #respond input#submit:active { background: #1982d1; color: #bfddf3; } #respond #cancel-comment-reply-link { color: #666; margin-left: 10px; text-decoration: none; } #respond .logged-in-as a:hover, #respond #cancel-comment-reply-link:hover { text-decoration: underline; } .commentlist #respond { margin: 1.625em 0 0; width: auto; } #reply-title { color: #373737; font-size: 24px; font-weight: bold; line-height: 30px; } #cancel-comment-reply-link { color: #888; display: block; font-size: 10px; font-weight: normal; line-height: 2.2em; letter-spacing: 0.05em; position: absolute; right: 1.625em; text-decoration: none; text-transform: uppercase; top: 1.1em; } #cancel-comment-reply-link:focus, #cancel-comment-reply-link:active, #cancel-comment-reply-link:hover { color: #ff4b33; } #respond label { line-height: 2.2em; } #respond input[type=text] { display: block; height: 24px; width: 75%; } #respond p { font-size: 12px; } p.comment-form-comment { margin: 0; } .form-allowed-tags { display: none; } /* =Footer ----------------------------------------------- */ #colophon { clear: both; } #supplementary { border-top: 1px solid #ddd; padding: 1.625em 7.6%; overflow: hidden; } /* Two Footer Widget Areas */ #supplementary.two .widget-area { float: left; margin-right: 3.7%; width: 48.1%; } #supplementary.two .widget-area + .widget-area { margin-right: 0; } /* Three Footer Widget Areas */ #supplementary.three .widget-area { float: left; margin-right: 3.7%; width: 30.85%; } #supplementary.three .widget-area + .widget-area + .widget-area { margin-right: 0; } /* Site Generator Line */ #site-generator { background: #f9f9f9; border-top: 1px solid #ddd; color: #666; font-size: 12px; line-height: 2.2em; padding: 2.2em 0.5em; text-align: center; } #site-generator a { color: #555; font-weight: bold; } /* =Responsive Structure ----------------------------------------------- */ @media (max-width: 800px) { /* Simplify the basic layout */ #main #content { margin: 0 7.6%; width: auto; } #nav-below { border-bottom: 1px solid #ddd; margin-bottom: 1.625em; } #main #secondary { float: none; margin: 0 7.6%; width: auto; } /* Simplify the showcase template */ .page-template-showcase-php .featured-posts { min-height: 280px; } .featured-posts section.featured-post { height: auto; } .page-template-showcase-php section.recent-posts { float: none; margin: 0; width: 100%; } .page-template-showcase-php #main .widget-area { float: none; margin: 0; width: auto; } .page-template-showcase-php .other-recent-posts { border-bottom: 1px solid #ddd; } /* Simplify the showcase template when small feature */ section.featured-post .attachment-small-feature, .one-column section.featured-post .attachment-small-feature { border: none; display: block; float: left; height: auto; margin: 0.625em auto 1.025em; max-width: 30%; position: static; } article.feature-image.small { float: right; margin: 0 0 1.625em; width: 64%; } .one-column article.feature-image.small .entry-summary { height: auto; } article.feature-image.small .entry-summary p a { left: 0; padding-left: 20px; padding-right: 20px; width: auto; } /* Remove the margin on singular articles */ .singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title { width: 100%; } /* Simplify the pullquotes and pull styles */ .singular blockquote.pull { margin: 0 0 1.625em; } .singular .pull.alignleft { margin: 0 1.625em 0 0; } .singular .pull.alignright { margin: 0 0 0 1.625em; } .singular .entry-meta .edit-link a { left: 0; position: absolute; top: 40px; } .singular #author-info { margin: 2.2em -8.8% 0; padding: 20px 8.8%; } /* Make sure we have room for our comment avatars */ .commentlist { width: 100%; } .commentlist > li.comment, .commentlist .pingback { margin-left: 102px; width: auto; } /* And a full-width comment form */ #respond { width: auto; } /* No need to float footer widgets at this size */ #colophon #supplementary .widget-area { float: none; margin-right: 0; width: auto; } /* No need to float 404 widgets at this size */ .error404 #main .widget { float: none; margin-right: 0; width: auto; } } @media (max-width: 650px) { /* @media (max-width: 650px) Reduce font-sizes for better readability on smaller devices */ body, input, textarea { font-size: 13px; } #site-title a { font-size: 24px; } #site-description { font-size: 12px; } #access ul { font-size: 12px; } article.intro .entry-content { font-size: 12px; } .entry-title { font-size: 21px; } .featured-post .entry-title { font-size: 14px; } .singular .entry-title { font-size: 28px; } .entry-meta { font-size: 12px; } blockquote { margin: 0; } blockquote.pull { font-size: 17px; } /* Reposition the site title and description slightly */ #site-title { padding: 5.30625em 0 0; } #site-title, #site-description { margin-right: 0; } /* Make sure the logo and search form don't collide */ #branding #searchform { top: 1.625em !important; } /* Floated content doesn't work well at this size */ .alignleft, .alignright { display: block; float: none; margin-left: 0; margin-right: 0; } /* Make sure the post-post navigation doesn't collide with anything */ #nav-single { display: block; position: static; } .singular .hentry { padding: 1.625em 0 0; } .singular.page .hentry { padding: 1.625em 0 0; } /* Talking avatars take up too much room at this size */ .commentlist > li.comment, .commentlist > li.pingback { margin-left: 0 !important; } .commentlist .avatar { background: transparent; display: block; padding: 0; position: static; } .commentlist .children .avatar { background: none; left: 2.2em; padding: 0; position: absolute; top: 2.2em; } /* Use the available space in the smaller comment form */ #respond input[type="text"] { width: 95%; } #respond .comment-form-author .required, #respond .comment-form-email .required { left: 95%; } #content .gallery-columns-3 .gallery-item { width: 31%; padding-right: 2%; } #content .gallery-columns-3 .gallery-item img { width: 100%; height: auto; } } @media (max-width: 450px) { #content .gallery-columns-2 .gallery-item { width: 45%; padding-right: 4%; } #content .gallery-columns-2 .gallery-item img { width: 100%; height: auto; } } @media only screen and (min-device-width: 320px) and (max-device-width: 480px) { body { padding: 0; } #page { margin-top: 0; } #branding { border-top: none; } } /* =Print ----------------------------------------------- */ @media print { body { background: none !important; font-size: 10pt; } footer.entry-meta a[rel=bookmark]:link:after, footer.entry-meta a[rel=bookmark]:visited:after { content: " [" attr(href) "] "; /* Show URLs */ } #page { clear: both !important; display: block !important; float: none !important; max-width: 100%; position: relative !important; } #branding { border-top: none !important; padding: 0; } #branding hgroup { margin: 0; } #site-title a { font-size: 21pt; } #site-description { font-size: 10pt; } #branding #searchform { display: none; } #branding img { display: none; } #access { display: none; } #main { border-top: none; box-shadow: none; } #primary { float: left; margin: 0; width: 100%; } #content { margin: 0; width: auto; } .singular #content { margin: 0; width: 100%; } .singular .entry-header .entry-meta { position: static; } .entry-meta .edit-link a { display: none; } #content nav { display: none; } .singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title { margin: 0; width: 100%; } .singular .hentry { padding: 0; } .entry-title, .singular .entry-title { font-size: 21pt; } .entry-meta { font-size: 10pt; } .entry-header .comments-link { display: none; } .page-link { display: none; } .singular #author-info { background: none; border-bottom: none; border-top: none; margin: 2.2em 0 0; padding: 0; } #respond { display: none; } .widget-area { display: none; } #colophon { display: none; } /* Comments */ .commentlist > li.comment { background: none; border: 1px solid #ddd; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 0 auto 1.625em; padding: 1.625em; position: relative; width: auto; } .commentlist .avatar { height: 39px; left: 2.2em; top: 2.2em; width: 39px; } .commentlist li.comment .comment-meta { line-height: 1.625em; margin-left: 50px; } .commentlist li.comment .fn { display: block; } .commentlist li.comment .comment-content { margin: 1.625em 0 0; } .commentlist .comment-edit-link { display: none; } .commentlist > li::before, .commentlist > li.bypostauthor::before { content: ''; } .commentlist .reply { display: none; } /* Post author highlighting */ .commentlist > li.bypostauthor { color: #444; } .commentlist > li.bypostauthor .comment-meta { color: #666; } .commentlist > li.bypostauthor:before { content: none; } /* Post Author threaded comments */ .commentlist .children > li.bypostauthor { background: #fff; border-color: #ddd; } .commentlist .children > li.bypostauthor > article, .commentlist .children > li.bypostauthor > article .comment-meta { color: #666; } } /* =IE7 ----------------------------------------------- */ #ie7 article.intro { margin-left: -7.6%; margin-right: -7.6%; padding-left: -7.6%; padding-right: -7.6%; max-width: 1000px; } #ie7 section.featured-post { margin-left: -7.6%; margin-right: -7.6%; max-width: 850px; } #ie7 section.recent-posts { margin-right: 7.6%; } /* =IE8 ----------------------------------------------- */ #ie8 section.feature-image.large img { width: 100%; }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/style.css
CSS
oos
54,401
<?php /** * Twenty Eleven functions and definitions * * Sets up the theme and provides some helper functions. Some helper functions * are used in the theme as custom template tags. Others are attached to action and * filter hooks in WordPress to change core functionality. * * The first function, twentyeleven_setup(), sets up the theme by registering support * for various features in WordPress, such as post thumbnails, navigation menus, and the like. * * When using a child theme (see http://codex.wordpress.org/Theme_Development and * http://codex.wordpress.org/Child_Themes), you can override certain functions * (those wrapped in a function_exists() call) by defining them first in your child theme's * functions.php file. The child theme's functions.php file is included before the parent * theme's file, so the child theme functions would be used. * * Functions that are not pluggable (not wrapped in function_exists()) are instead attached * to a filter or action hook. The hook can be removed by using remove_action() or * remove_filter() and you can attach your own function to the hook. * * We can remove the parent theme's hook only after it is attached, which means we need to * wait until setting up the child theme: * * <code> * add_action( 'after_setup_theme', 'my_child_theme_setup' ); * function my_child_theme_setup() { * // We are providing our own filter for excerpt_length (or using the unfiltered value) * remove_filter( 'excerpt_length', 'twentyeleven_excerpt_length' ); * ... * } * </code> * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ /** * Set the content width based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 584; /** * Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'twentyeleven_setup' ); if ( ! function_exists( 'twentyeleven_setup' ) ): /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers * and backgrounds, and post formats. * @uses register_nav_menus() To add support for navigation menus. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Eleven 1.0 */ function twentyeleven_setup() { /* Make Twenty Eleven available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Eleven, use a find and replace * to change 'twentyeleven' to the name of your theme in all the template files. */ load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Load up our theme options page and related code. require( get_template_directory() . '/inc/theme-options.php' ); // Grab Twenty Eleven's Ephemera widget. require( get_template_directory() . '/inc/widgets.php' ); // Add default posts and comments RSS feed links to <head>. add_theme_support( 'automatic-feed-links' ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) ); // Add support for a variety of post formats add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) ); $theme_options = twentyeleven_get_theme_options(); if ( 'dark' == $theme_options['color_scheme'] ) $default_background_color = '1d1d1d'; else $default_background_color = 'f1f1f1'; // Add support for custom backgrounds. add_theme_support( 'custom-background', array( // Let WordPress know what our default background color is. // This is dependent on our current color scheme. 'default-color' => $default_background_color, ) ); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images add_theme_support( 'post-thumbnails' ); // Add support for custom headers. $custom_header_support = array( // The default header text color. 'default-text-color' => '000', // The height and width of our custom header. 'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ), 'height' => apply_filters( 'twentyeleven_header_image_height', 288 ), // Support flexible heights. 'flex-height' => true, // Random image rotation by default. 'random-default' => true, // Callback for styling the header. 'wp-head-callback' => 'twentyeleven_header_style', // Callback for styling the header preview in the admin. 'admin-head-callback' => 'twentyeleven_admin_header_style', // Callback used to display the header preview in the admin. 'admin-preview-callback' => 'twentyeleven_admin_header_image', ); add_theme_support( 'custom-header', $custom_header_support ); if ( ! function_exists( 'get_custom_header' ) ) { // This is all for compatibility with versions of WordPress prior to 3.4. define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] ); define( 'HEADER_IMAGE', '' ); define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] ); add_custom_background(); } // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be the size of the header image that we just defined // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); // Add Twenty Eleven's custom image sizes. // Used for large feature (header) images. add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true ); // Used for featured posts if a large-feature doesn't exist. add_image_size( 'small-feature', 500, 300 ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'wheel' => array( 'url' => '%s/images/headers/wheel.jpg', 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Wheel', 'twentyeleven' ) ), 'shore' => array( 'url' => '%s/images/headers/shore.jpg', 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Shore', 'twentyeleven' ) ), 'trolley' => array( 'url' => '%s/images/headers/trolley.jpg', 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Trolley', 'twentyeleven' ) ), 'pine-cone' => array( 'url' => '%s/images/headers/pine-cone.jpg', 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Pine Cone', 'twentyeleven' ) ), 'chessboard' => array( 'url' => '%s/images/headers/chessboard.jpg', 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Chessboard', 'twentyeleven' ) ), 'lanterns' => array( 'url' => '%s/images/headers/lanterns.jpg', 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Lanterns', 'twentyeleven' ) ), 'willow' => array( 'url' => '%s/images/headers/willow.jpg', 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Willow', 'twentyeleven' ) ), 'hanoi' => array( 'url' => '%s/images/headers/hanoi.jpg', 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Hanoi Plant', 'twentyeleven' ) ) ) ); } endif; // twentyeleven_setup if ( ! function_exists( 'twentyeleven_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @since Twenty Eleven 1.0 */ function twentyeleven_header_style() { $text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. if ( $text_color == HEADER_TEXTCOLOR ) return; // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css"> <?php // Has the text been hidden? if ( 'blank' == $text_color ) : ?> #site-title, #site-description { position: absolute !important; clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that else : ?> #site-title a, #site-description { color: #<?php echo $text_color; ?> !important; } <?php endif; ?> </style> <?php } endif; // twentyeleven_header_style if ( ! function_exists( 'twentyeleven_admin_header_style' ) ) : /** * Styles the header image displayed on the Appearance > Header admin panel. * * Referenced via add_theme_support('custom-header') in twentyeleven_setup(). * * @since Twenty Eleven 1.0 */ function twentyeleven_admin_header_style() { ?> <style type="text/css"> .appearance_page_custom-header #headimg { border: none; } #headimg h1, #desc { font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; } #headimg h1 { margin: 0; } #headimg h1 a { font-size: 32px; line-height: 36px; text-decoration: none; } #desc { font-size: 14px; line-height: 23px; padding: 0 0 3em; } <?php // If the user has set a custom color for the text use that if ( get_header_textcolor() != HEADER_TEXTCOLOR ) : ?> #site-title a, #site-description { color: #<?php echo get_header_textcolor(); ?>; } <?php endif; ?> #headimg img { max-width: 1000px; height: auto; width: 100%; } </style> <?php } endif; // twentyeleven_admin_header_style if ( ! function_exists( 'twentyeleven_admin_header_image' ) ) : /** * Custom header image markup displayed on the Appearance > Header admin panel. * * Referenced via add_theme_support('custom-header') in twentyeleven_setup(). * * @since Twenty Eleven 1.0 */ function twentyeleven_admin_header_image() { ?> <div id="headimg"> <?php $color = get_header_textcolor(); $image = get_header_image(); if ( $color && $color != 'blank' ) $style = ' style="color:#' . $color . '"'; else $style = ' style="display:none"'; ?> <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1> <div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div> <?php if ( $image ) : ?> <img src="<?php echo esc_url( $image ); ?>" alt="" /> <?php endif; ?> </div> <?php } endif; // twentyeleven_admin_header_image /** * Sets the post excerpt length to 40 words. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. */ function twentyeleven_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts */ function twentyeleven_continue_reading_link() { return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>'; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function twentyeleven_auto_excerpt_more( $more ) { return ' &hellip;' . twentyeleven_continue_reading_link(); } add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function twentyeleven_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= twentyeleven_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' ); /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ function twentyeleven_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' ); /** * Register our sidebars and widgetized areas. Also register the default Epherma widget. * * @since Twenty Eleven 1.0 */ function twentyeleven_widgets_init() { register_widget( 'Twenty_Eleven_Ephemera_Widget' ); register_sidebar( array( 'name' => __( 'Main Sidebar', 'twentyeleven' ), 'id' => 'sidebar-1', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Showcase Sidebar', 'twentyeleven' ), 'id' => 'sidebar-2', 'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Footer Area One', 'twentyeleven' ), 'id' => 'sidebar-3', 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Footer Area Two', 'twentyeleven' ), 'id' => 'sidebar-4', 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Footer Area Three', 'twentyeleven' ), 'id' => 'sidebar-5', 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'twentyeleven_widgets_init' ); if ( ! function_exists( 'twentyeleven_content_nav' ) ) : /** * Display navigation to next/previous pages when applicable */ function twentyeleven_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> <nav id="<?php echo $nav_id; ?>"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyeleven' ) ); ?></div> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></div> </nav><!-- #nav-above --> <?php endif; } endif; // twentyeleven_content_nav /** * Return the URL for the first link found in the post content. * * @since Twenty Eleven 1.0 * @return string|bool URL or false when no link is present. */ function twentyeleven_url_grabber() { if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) return false; return esc_url_raw( $matches[1] ); } /** * Count the number of footer sidebars to enable dynamic classes for the footer */ function twentyeleven_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'sidebar-3' ) ) $count++; if ( is_active_sidebar( 'sidebar-4' ) ) $count++; if ( is_active_sidebar( 'sidebar-5' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; } if ( $class ) echo 'class="' . $class . '"'; } if ( ! function_exists( 'twentyeleven_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own twentyeleven_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * * @since Twenty Eleven 1.0 */ function twentyeleven_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?> <li class="post pingback"> <p><?php _e( 'Pingback:', 'twentyeleven' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?></p> <?php break; default : ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> <article id="comment-<?php comment_ID(); ?>" class="comment"> <footer class="comment-meta"> <div class="comment-author vcard"> <?php $avatar_size = 68; if ( '0' != $comment->comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size ); /* translators: 1: comment author, 2: date and time */ printf( __( '%1$s on %2$s <span class="says">said:</span>', 'twentyeleven' ), sprintf( '<span class="fn">%s</span>', get_comment_author_link() ), sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() ) ) ); ?> <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .comment-author .vcard --> <?php if ( $comment->comment_approved == '0' ) : ?> <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em> <br /> <?php endif; ?> </footer> <div class="comment-content"><?php comment_text(); ?></div> <div class="reply"> <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>&darr;</span>', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </div><!-- .reply --> </article><!-- #comment-## --> <?php break; endswitch; } endif; // ends check for twentyeleven_comment() if ( ! function_exists( 'twentyeleven_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * Create your own twentyeleven_posted_on to override in a child theme * * @since Twenty Eleven 1.0 */ function twentyeleven_posted_on() { printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), get_the_author() ); } endif; /** * Adds two classes to the array of body classes. * The first is if the site has only had one author with published posts. * The second is if a singular post being displayed * * @since Twenty Eleven 1.0 */ function twentyeleven_body_classes( $classes ) { if ( function_exists( 'is_multi_author' ) && ! is_multi_author() ) $classes[] = 'single-author'; if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) ) $classes[] = 'singular'; return $classes; } add_filter( 'body_class', 'twentyeleven_body_classes' );
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/functions.php
PHP
oos
21,186
<?php /** * The template for displaying posts in the Image Post Format on index and archive pages * * Learn more: http://codex.wordpress.org/Post_Formats * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class( 'indexed' ); ?>> <header class="entry-header"> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Image', 'twentyeleven' ); ?></h3> </hgroup> <?php if ( comments_open() && ! post_password_required() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( "Reply", 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> </div> <?php endif; ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <div class="entry-meta"> <?php printf( __( '<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span></span>', 'twentyeleven' ), esc_url( get_permalink() ), get_the_date( 'c' ), get_the_date(), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), get_the_author() ); ?> </div><!-- .entry-meta --> <div class="entry-meta"> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); if ( $categories_list ): ?> <span class="cat-links"> <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?> </span> <?php endif; // End if categories ?> <?php /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( $tags_list ): ?> <span class="tag-links"> <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> </span> <?php endif; // End if $tags_list ?> <?php if ( comments_open() ) : ?> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; // End if comments_open() ?> </div><!-- .entry-meta --> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-image.php
PHP
oos
3,453
(function($) { $(document).ready( function() { $('.feature-slider a').click(function(e) { $('.featured-posts section.featured-post').css({ opacity: 0, visibility: 'hidden' }); $(this.hash).css({ opacity: 1, visibility: 'visible' }); $('.feature-slider a').removeClass('active'); $(this).addClass('active'); e.preventDefault(); }); }); })(jQuery);
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/js/showcase.js
JavaScript
oos
473
<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <nav id="nav-single"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'twentyeleven' ) ); ?></span> <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></span> </nav><!-- #nav-single --> <?php get_template_part( 'content', 'single' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/single.php
PHP
oos
932
<?php /** * The default template for displaying content * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Quote', 'twentyeleven' ); ?></h3> </hgroup> <div class="entry-meta"> <?php twentyeleven_posted_on(); ?> </div><!-- .entry-meta --> <?php if ( comments_open() && ! post_password_required() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> </div> <?php endif; ?> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php $show_sep = false; ?> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); if ( $categories_list ): ?> <span class="cat-links"> <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); $show_sep = true; ?> </span> <?php endif; // End if categories ?> <?php /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( $tags_list ): if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="tag-links"> <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); $show_sep = true; ?> </span> <?php endif; // End if $tags_list ?> <?php if ( comments_open() ) : ?> <?php if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; // End if comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-quote.php
PHP
oos
3,181
<?php /** * The template for displaying posts in the Status Post Format on index and archive pages * * Learn more: http://codex.wordpress.org/Post_Formats * * @package WordPress * @subpackage Twenty_Eleven */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Status', 'twentyeleven' ); ?></h3> </hgroup> <?php if ( comments_open() && ! post_password_required() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> </div> <?php endif; ?> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php twentyeleven_posted_on(); ?> <?php if ( comments_open() ) : ?> <span class="sep"> | </span> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-status.php
PHP
oos
2,216
<?php /** * The template for displaying Archive pages. * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <section id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"> <?php if ( is_day() ) : ?> <?php printf( __( 'Daily Archives: %s', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' ); ?> <?php elseif ( is_month() ) : ?> <?php printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyeleven' ) ) . '</span>' ); ?> <?php elseif ( is_year() ) : ?> <?php printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentyeleven' ) ) . '</span>' ); ?> <?php else : ?> <?php _e( 'Blog Archives', 'twentyeleven' ); ?> <?php endif; ?> </h1> </header> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/archive.php
PHP
oos
2,426
/* Theme Name: Twenty Eleven Adding support for language written in a Right To Left (RTL) direction is easy - it's just a matter of overwriting all the horizontal positioning attributes of your CSS stylesheet in a separate stylesheet file named rtl.css. http://codex.wordpress.org/Right_to_Left_Language_Support */ /* =Reset reset ----------------------------------------------- */ caption, th, td { text-align: right; } /* =Structure ----------------------------------------------- */ body { direction:rtl; unicode-bidi:embed; } /* Showcase */ .page-template-showcase-php section.recent-posts { float: left; margin: 0 31% 0 0; } .page-template-showcase-php #main .widget-area { float: right; margin: 0 0 0 -22.15%; } /* One column */ .one-column article.feature-image.small .entry-summary a { left: auto; right: -9%; } /* Simplify the pullquotes and pull styles */ .one-column.singular .entry-meta .edit-link a { right: 0px; left: auto; } /* Make sure we have room for our comment avatars */ .one-column .commentlist > li.comment { margin-left: 0; margin-right: 102px; } /* Make sure the logo and search form don't collide */ .one-column #branding #searchform { right: auto; left: 40px; } /* Talking avatars take up too much room at this size */ .one-column .commentlist > li.comment { margin-right: 0; } .one-column .commentlist > li.comment .comment-meta, .one-column .commentlist > li.comment .comment-content { margin-right: 0; margin-left: 85px; } .one-column .commentlist .avatar { right: auto; left: 1.625em; } .one-column .commentlist .children .avatar { left: auto; right: 2.2em; } /* =Global ----------------------------------------------- */ /* Text elements */ p { margin-bottom: 1.625em; } ul, ol { margin: 0 2.5em 1.625em 0; } .ltr ul, .ltr ol { margin: 0 0 1.625em 2.5em; } blockquote { font-family: Arial, sans-serif; } blockquote em, blockquote i, blockquote cite { font-style: normal; } /* Forms */ textarea { padding-left: 0; padding-right: 3px; } input#s { background-position: 97% 6px; padding: 4px 28px 4px 10px; } /* Assistive text */ #access a.assistive-text:active, #access a.assistive-text:focus { left: auto; right: 7.6%; } /* =Header ----------------------------------------------- */ #site-title { margin-right: 0; margin-left: 270px; } #site-description { margin: 0 0 3.65625em 270px; } /* =Menu -------------------------------------------------------------- */ #access { float: right; } #access ul { margin: 0 -0.8125em 0 0; padding-right: 0; } #access li { float: right; } #access ul ul { float: right; left: auto; right: 0; } #access ul ul ul { left: auto; right: 100%; } /* Search Form */ #branding #searchform { right: auto; left: 7.6%; text-align: left; } #branding #s { float: left; } #branding .only-search + #access div { padding-right: 0; padding-left: 205px; } /* =Content ----------------------------------------------- */ .entry-title, .entry-header .entry-meta { padding-right: 0; padding-left: 76px; } .entry-content td, .comment-content td { padding: 6px 0 6px 10px; } .page-link span { margin-right: 0; margin-left: 6px; } .entry-meta .edit-link a { float: left; } /* Images */ .wp-caption .wp-caption-text, .gallery-caption { font-family: Arial, sans-serif; } .wp-caption .wp-caption-text { padding: 10px 40px 5px 0px; } .wp-caption .wp-caption-text:before { margin-right: 0; margin-left: 5px; left: auto; right: 10px; } #content .gallery-columns-4 .gallery-item { padding-right:0; padding-left:2%; } /* Author Info */ .singular #author-info { margin: 2.2em -35.4% 0 -35.6%; } #author-avatar { float: right; margin-right: 0; margin-left: -78px; } #author-description { float: right; margin-left: 0; margin-right: 108px; } /* Comments link */ .entry-header .comments-link a { background-image: url(images/comment-bubble-rtl.png); right: auto; left: 0; } /* Post Formats Headings */ .singular .entry-title, .singular .entry-header .entry-meta { padding-left: 0; } .singular .entry-header .entry-meta { left: auto; right: 0; } .singular .entry-meta .edit-link a { left: auto; right: 50px; } /* =Gallery ----------------------------------------------- */ .format-gallery .gallery-thumb { float: right; margin: .375em 0 0 1.625em; } /* =Status ----------------------------------------------- */ .format-status img.avatar { float: right; margin: 4px 0 2px 10px; } /* =Image ----------------------------------------------- */ .indexed.format-image div.entry-meta { float: right; } /* =error404 ---------------------- ------------------------- */ .error404 #main .widget { float: right; margin-right: auto; margin-left: 3.7%; } .error404 #main .widget_archive { margin-left: 0; } .error404 #main .widget_tag_cloud { margin-left: 0; } /* =Showcase ----------------------------------------------- */ article.intro .edit-link a { right: auto; left: 20px; } /* Featured post */ section.featured-post { float: right; } /* Small featured post */ section.featured-post .attachment-small-feature { float: left; margin: 0 0 1.625em -8.9%; right: auto; left: -15px; } article.feature-image.small { float: right; } article.feature-image.small .entry-summary p a { left:auto; right: -23.8%; padding: 9px 85px 9px 26px; } /* Large featured post */ section.feature-image.large .hentry { left:auto; right: 9%; margin: 1.625em 0 0 9%; } /* Featured Slider */ .featured-posts .showcase-heading { padding-left: 0; padding-right: 8.9%; } .featured-posts section.featured-post { left: auto; right: 0; } #content .feature-slider { right: auto; left: 8.9%; } .feature-slider li { float: right; } /* Recent Posts */ section.recent-posts .other-recent-posts a[rel="bookmark"] { float: right; } section.recent-posts .other-recent-posts .comments-link a, section.recent-posts .other-recent-posts .comments-link > span { padding: 0.3125em 1em 0.3125em 0; right: auto; left: 0; text-align: left; } /* =Attachments ----------------------------------------------- */ /* =Navigation -------------------------------------------------------------- */ .nav-previous { float: right; } .nav-next { float: left; text-align: left; } /* Singular navigation */ #nav-single { float: left; text-align: left; } #nav-single .nav-next { padding-left: 0; padding-right: .5em; } /* =Widgets ----------------------------------------------- */ .widget ul ul { margin-left: 0; margin-right: 1.5em; } /* Twitter */ .widget_twitter .timesince { margin-right: 0; margin-left: -10px; text-align: left; } /* =Comments ----------------------------------------------- */ .commentlist .children li.comment { border-left: none; border-right: 1px solid #ddd; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .commentlist .children li.comment .comment-meta { margin-left: 0; margin-right: 50px; } .commentlist .avatar { left: auto; right: -102px; } .commentlist > li:before { content: url(images/comment-arrow-rtl.png); left:auto; right: -21px; } .commentlist > li.pingback:before { content: ''; } .commentlist .children .avatar { left: auto; right: 2.2em; } /* Post author highlighting */ .commentlist > li.bypostauthor:before { content: url(images/comment-arrow-bypostauthor-rtl.png); } /* sidebar-page.php comments */ /* Make sure we have room for our comment avatars */ .page-template-sidebar-page-php .commentlist > li.comment, .page-template-sidebar-page-php.commentlist .pingback { margin-left: 0; margin-right: 102px; } /* Comment Form */ #respond .comment-form-author label, #respond .comment-form-email label, #respond .comment-form-url label, #respond .comment-form-comment label { left: auto; right: 4px; } #respond .comment-form-author label, #respond .comment-form-email label, #respond .comment-form-url label, #respond .comment-form-comment label { -webkit-box-shadow: -1px 2px 2px rgba(204,204,204,0.8); -moz-box-shadow: -1px 2px 2px rgba(204,204,204,0.8); box-shadow: -1px 2px 2px rgba(204,204,204,0.8); } #respond .comment-form-author .required, #respond .comment-form-email .required { left: auto; right: 75%; } #respond .form-submit { float: left; } #respond input#submit { left: auto; right: 30px; padding: 5px 22px 5px 42px; } #respond #cancel-comment-reply-link { margin-left: 0; margin-right: 10px; } #cancel-comment-reply-link { right: auto; left: 1.625em; } /* =Footer ----------------------------------------------- */ /* Two Footer Widget Areas */ #supplementary.two .widget-area { float: right; margin-right: 0; margin-left: 3.7%; } #supplementary.two .widget-area + .widget-area { margin-left: 0; } /* Three Footer Widget Areas */ #supplementary.three .widget-area { float: right; margin-right: 0; margin-left: 3.7%; } #supplementary.three .widget-area + .widget-area + .widget-area { margin-left: 0; } /* Site Generator Line */ #site-generator .sep { background-position: right center; } /* =Responsive Structure ----------------------------------------------- */ @media (max-width: 800px) { /* Simplify the showcase template when small feature */ section.featured-post .attachment-small-feature, .one-column section.featured-post .attachment-small-feature { float: right; } article.feature-image.small { float: left; } article.feature-image.small .entry-summary p a { right: 0; } .singular .entry-meta .edit-link a { left: auto; right: 0px; } /* Make sure we have room for our comment avatars */ .commentlist > li.comment, .commentlist .pingback { margin-left: 0; margin-right: 102px; } /* No need to float footer widgets at this size */ #colophon #supplementary .widget-area { margin-left: 0; } /* No need to float 404 widgets at this size */ .error404 #main .widget { margin-left: 0; } } @media (max-width: 650px) { /* @media (max-width: 650px) Reduce font-sizes for better readability on smaller devices */ #site-title, #site-description { margin-left: 0; } /* Talking avatars take up too much room at this size */ .commentlist > li.comment, .commentlist > li.pingback { margin-right: 0 !important; } .commentlist .children .avatar { left: auto; right: 2.2em; } /* Use the available space in the smaller comment form */ #respond .comment-form-author .required, #respond .comment-form-email .required { left: auto; right: 95%; } #content .gallery-columns-3 .gallery-item { padding-right: 0; padding-left:2%; } } @media (max-width: 450px) { #content .gallery-columns-2 .gallery-item { padding-right:0; padding-left:4%; } } /* =Print ----------------------------------------------- */ @media print { #primary { float: right; } /* Comments */ .commentlist .avatar { left: auto; right: 2.2em; } .commentlist li.comment .comment-meta { margin-left: 0; margin-right: 50px; } } /* =IE7 ----------------------------------------------- */ #ie7 section.recent-posts { margin-right: 0; margin-left: 7.6%; }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/rtl.css
CSS
oos
10,976
<?php /** * The template for displaying posts in the Link Post Format on index and archive pages * * Learn more: http://codex.wordpress.org/Post_Formats * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Link', 'twentyeleven' ); ?></h3> </hgroup> <?php if ( comments_open() && ! post_password_required() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> </div> <?php endif; ?> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php twentyeleven_posted_on(); ?> <?php if ( comments_open() ) : ?> <span class="sep"> | </span> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-link.php
PHP
oos
2,100
<?php /** * The template for displaying content in the single.php template * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> <?php if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php twentyeleven_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); /* translators: used between list items, there is a space after the comma */ $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( '' != $tag_list ) { $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); } elseif ( '' != $categories_list ) { $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); } else { $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); } printf( $utility_text, $categories_list, $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ), get_the_author(), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> <div id="author-info"> <div id="author-avatar"> <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?> </div><!-- #author-avatar --> <div id="author-description"> <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2> <?php the_author_meta( 'description' ); ?> <div id="author-link"> <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyeleven' ), get_the_author() ); ?> </a> </div><!-- #author-link --> </div><!-- #author-description --> </div><!-- #author-info --> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-single.php
PHP
oos
3,144
/* Theme Name: Twenty Eleven */ /* Used to style the TinyMCE editor. */ html .mceContentBody { direction: rtl; unicode-bidi: embed; float: right; width: 584px; } * { font-family: Arial, Tahoma, sans-serif; } ul, ol { margin: 0 2.5em 1.625em 0; } blockquote { font-style: normal; } table { text-align: right; }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/editor-style-rtl.css
CSS
oos
317
<?php /** * The template for displaying Author Archive pages. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <section id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <?php /* Queue the first post, that way we know * what author we're dealing with (if that is the case). * * We reset this later so we can run the loop * properly with a call to rewind_posts(). */ the_post(); ?> <header class="page-header"> <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1> </header> <?php /* Since we called the_post() above, we need to * rewind the loop back to the beginning that way * we can run the loop properly, in full. */ rewind_posts(); ?> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php // If a user has filled out their description, show a bio on their entries. if ( get_the_author_meta( 'description' ) ) : ?> <div id="author-info"> <div id="author-avatar"> <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?> </div><!-- #author-avatar --> <div id="author-description"> <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2> <?php the_author_meta( 'description' ); ?> </div><!-- #author-description --> </div><!-- #author-info --> <?php endif; ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/author.php
PHP
oos
2,920
<?php /** * The Footer widget areas. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <?php /* The footer widget area is triggered if any of the areas * have widgets. So let's check that first. * * If none of the sidebars have widgets, then let's bail early. */ if ( ! is_active_sidebar( 'sidebar-3' ) && ! is_active_sidebar( 'sidebar-4' ) && ! is_active_sidebar( 'sidebar-5' ) ) return; // If we get this far, we have widgets. Let do this. ?> <div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>> <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?> <div id="first" class="widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-3' ); ?> </div><!-- #first .widget-area --> <?php endif; ?> <?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?> <div id="second" class="widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-4' ); ?> </div><!-- #second .widget-area --> <?php endif; ?> <?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?> <div id="third" class="widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-5' ); ?> </div><!-- #third .widget-area --> <?php endif; ?> </div><!-- #supplementary -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/sidebar-footer.php
PHP
oos
1,233
<?php /** * The template for displaying content featured in the showcase.php page template * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ global $feature_class; ?> <article id="post-<?php the_ID(); ?>" <?php post_class( $feature_class ); ?>> <header class="entry-header"> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php twentyeleven_posted_on(); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-summary"> <?php the_excerpt(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php /* translators: used between list items, there is a space after the comma */ $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( '' != $tag_list ) { $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); } else { $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); } printf( $utility_text, /* translators: used between list items, there is a space after the comma */ get_the_category_list( __( ', ', 'twentyeleven' ) ), $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-featured.php
PHP
oos
1,896
<?php /** * The template used for displaying page content in page.php * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-page.php
PHP
oos
777
/* Theme Name: Twenty Eleven Description: Used to style the TinyMCE editor. */ html .mceContentBody { max-width: 584px; } * { color: inherit; font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: inherit; font-weight: inherit; line-height: 1.625; } body { color: #333; font: 15px "Helvetica Neue", Helvetica, Arial, "Nimbus Sans L", sans-serif; font-weight: 300; line-height: 1.625; } /* Headings */ h1,h2,h3,h4,h5,h6 { clear: both; } h1, h2 { color: #000; font-size: 15px; font-weight: bold; margin: 0 0 .8125em; } h3 { font-size: 10px; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } h4, h5, h6 { font-size: 14px; margin: 0; } hr { background-color: #ccc; border: 0; height: 1px; margin-bottom: 1.625em; } /* Text elements */ p, ul, ol, dl { font-weight: 300; } p { margin-bottom: 1.625em; } ul, ol { margin: 0 0 1.625em 2.5em; padding: 0; } ul { list-style: square; } ol { list-style-type: decimal; } ol ol { list-style: upper-alpha; } ol ol ol { list-style: lower-roman; } ol ol ol ol { list-style: lower-alpha; } ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; } dl { margin: 0 1.625em; } dt { font-size: 15px; font-weight: bold; } dd { margin: 0 0 1.625em; } strong { font-weight: bold; } cite, em, i { font-style: italic; } cite { border: none; } big { font-size: 131.25%; } .mceContentBody blockquote, .mceContentBody blockquote p { font-family: Georgia, "Bitstream Charter", serif !important; font-style: italic !important; font-weight: normal; margin: 0 3em; } .mceContentBody blockquote em, .mceContentBody blockquote i, .mceContentBody blockquote cite { font-style: normal; } .mceContentBody blockquote cite { color: #666; font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; letter-spacing: 0.05em; text-transform: uppercase; } pre { background: #f4f4f4; font: 13px "Courier 10 Pitch", Courier, monospace; line-height: 1.5; margin-bottom: 1.625em; padding: 0.75em 1.625em; } code, kbd, samp, var { font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; } abbr, acronym, dfn { border-bottom: 1px dotted #666; cursor: help; } address { display: block; margin: 0 0 1.625em; } del { color: #333; } ins { background: #fff9c0; border: none; color: #333; text-decoration: none; } sup, sub { font-size: 10px; height: 0; line-height: 1; position: relative; vertical-align: baseline; } sup { bottom: 1ex; } sub { top: .5ex; } input[type=text], textarea { background: #fafafa; -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); border: 1px solid #ddd; color: #888; } input[type=text]:focus, textarea:focus { color: #333; } textarea { padding-left: 3px; width: 98%; } input[type=text] { padding: 3px; } /* Links */ a, a em, a strong { color: #1b8be0; text-decoration: none; } a:focus, a:active, a:hover { text-decoration: underline; } /* Alignment */ .alignleft { display: inline; float: left; margin-right: 1.625em; } .alignright { display: inline; float: right; margin-left: 1.625em; } .aligncenter { clear: both; display: block; margin-left: auto; margin-right: auto; } /* Tables */ table { border: none !important; border-bottom: 1px solid #ddd !important; border-collapse: collapse; border-spacing: 0; text-align: left; margin: 0 0 1.625em; width: 100%; } tr th { border: none !important; color: #666; font-size: 10px; font-weight: 500; letter-spacing: 0.1em; line-height: 2.6em; text-transform: uppercase; } td { border: none !important; border-top: 1px solid #ddd !important; padding: 6px 10px 6px 0; } /* Images */ img[class*="wp-image-"] { height: auto; max-width: 97.5%; } img.size-full { width: auto; /* Prevent stretching of full-size images in IE8 */ } img.wp-smiley { border: none; margin-bottom: 0; margin-top: 0; padding: 0; } p img, .wp-caption { margin-top: 0.4em; } img { border: 1px solid #ddd; padding: 6px; } img.alignleft, img.alignright, img.aligncenter { margin-bottom: 1.625em; } .wp-caption { background: #eee; border: none; margin-bottom: 1.625em; max-width: 96%; padding: 9px; } .wp-caption img { display: block; margin: 5px auto 0 !important; max-width: 98%; border-color: #eee; } .wp-caption .wp-caption-text, .wp-caption-dd { color: #666; font-family: Georgia, serif !important; font-size: 12px; margin: 0 0 0.6em 0 !important; padding: 0 0 5px 40px; position: relative; text-align: left; } .wp-caption .wp-caption-text:before { color: #666; content: '\2014'; font-size: 14px; font-style: normal; font-weight: bold; margin-right: 5px; position: absolute; left: 10px; top: 7px; } a:focus img[class*="wp-image-"], a:hover img[class*="wp-image-"], a:active img[class*="wp-image-"] { background: #eee; border-color: #bbb; } .wp-caption a:focus img, .wp-caption a:active img, .wp-caption a:hover img { background: #fff; border-color: #ddd; }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/editor-style.css
CSS
oos
5,012
<?php /** * The main template file. * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Eleven */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/index.php
PHP
oos
1,491
<?php /** * The template for displaying 404 pages (Not Found). * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <article id="post-0" class="post error404 not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'This is somewhat embarrassing, isn&rsquo;t it?', 'twentyeleven' ); ?></h1> </header> <div class="entry-content"> <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching, or one of the links below, can help.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> <?php the_widget( 'WP_Widget_Recent_Posts', array( 'number' => 10 ), array( 'widget_id' => '404' ) ); ?> <div class="widget"> <h2 class="widgettitle"><?php _e( 'Most Used Categories', 'twentyeleven' ); ?></h2> <ul> <?php wp_list_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?> </ul> </div> <?php /* translators: %1$s: smilie */ $archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'twentyeleven' ), convert_smilies( ':)' ) ) . '</p>'; the_widget( 'WP_Widget_Archives', array('count' => 0 , 'dropdown' => 1 ), array( 'after_title' => '</h2>'.$archive_content ) ); ?> <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/404.php
PHP
oos
1,601
<?php /** * The template for displaying all pages. * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages * and that other 'pages' on your WordPress site will use a * different template. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/page.php
PHP
oos
692
<?php /** * The template for displaying posts in the Aside Post Format on index and archive pages * * Learn more: http://codex.wordpress.org/Post_Formats * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Aside', 'twentyeleven' ); ?></h3> </hgroup> <?php if ( comments_open() && ! post_password_required() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> </div> <?php endif; ?> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php twentyeleven_posted_on(); ?> <?php if ( comments_open() ) : ?> <span class="sep"> | </span> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-aside.php
PHP
oos
2,102
<?php /** * Template Name: Sidebar Template * Description: A Page Template that adds a sidebar to pages * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/sidebar-page.php
PHP
oos
563
<?php /** * Template Name: Showcase Template * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts * * The showcase template in Twenty Eleven consists of a featured posts section using sticky posts, * another recent posts area (with the latest post shown in full and the rest as a list) * and a left sidebar holding aside posts. * * We are creating two queries to fetch the proper posts and a custom widget for the sidebar. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ // Enqueue showcase script for the slider wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '2011-04-28' ); get_header(); ?> <div id="primary" class="showcase"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php /** * We are using a heading by rendering the_content * If we have content for this page, let's display it. */ if ( '' != get_the_content() ) get_template_part( 'content', 'intro' ); ?> <?php endwhile; ?> <?php /** * Begin the featured posts section. * * See if we have any sticky posts and use them to create our featured posts. * We limit the featured posts at ten. */ $sticky = get_option( 'sticky_posts' ); // Proceed only if sticky posts exist. if ( ! empty( $sticky ) ) : $featured_args = array( 'post__in' => $sticky, 'post_status' => 'publish', 'posts_per_page' => 10, 'no_found_rows' => true, ); // The Featured Posts query. $featured = new WP_Query( $featured_args ); // Proceed only if published posts exist if ( $featured->have_posts() ) : /** * We will need to count featured posts starting from zero * to create the slider navigation. */ $counter_slider = 0; // Compatibility with versions of WordPress prior to 3.4. if ( function_exists( 'get_custom_header' ) ) $header_image_width = get_theme_support( 'custom-header', 'width' ); else $header_image_width = HEADER_IMAGE_WIDTH; ?> <div class="featured-posts"> <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1> <?php // Let's roll. while ( $featured->have_posts() ) : $featured->the_post(); // Increase the counter. $counter_slider++; /** * We're going to add a class to our featured post for featured images * by default it'll have the feature-text class. */ $feature_class = 'feature-text'; if ( has_post_thumbnail() ) { // ... but if it has a featured image let's add some class $feature_class = 'feature-image small'; // Hang on. Let's check this here image out. $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ); // Is it bigger than or equal to our header? if ( $image[1] >= $header_image_width ) { // If bigger, let's add a BIGGER class. It's EXTRA classy now. $feature_class = 'feature-image large'; } } ?> <section class="featured-post <?php echo $feature_class; ?>" id="featured-post-<?php echo $counter_slider; ?>"> <?php /** * If the thumbnail is as big as the header image * make it a large featured post, otherwise render it small */ if ( has_post_thumbnail() ) { if ( $image[1] >= $header_image_width ) $thumbnail_size = 'large-feature'; else $thumbnail_size = 'small-feature'; ?> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a> <?php } ?> <?php get_template_part( 'content', 'featured' ); ?> </section> <?php endwhile; ?> <?php // Show slider only if we have more than one featured post. if ( $featured->post_count > 1 ) : ?> <nav class="feature-slider"> <ul> <?php // Reset the counter so that we end up with matching elements $counter_slider = 0; // Begin from zero rewind_posts(); // Let's roll again. while ( $featured->have_posts() ) : $featured->the_post(); $counter_slider++; if ( 1 == $counter_slider ) $class = 'class="active"'; else $class = ''; ?> <li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php printf( esc_attr__( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" <?php echo $class; ?>></a></li> <?php endwhile; ?> </ul> </nav> <?php endif; // End check for more than one sticky post. ?> </div><!-- .featured-posts --> <?php endif; // End check for published posts. ?> <?php endif; // End check for sticky posts. ?> <section class="recent-posts"> <h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1> <?php // Display our recent posts, showing full content for the very latest, ignoring Aside posts. $recent_args = array( 'order' => 'DESC', 'post__not_in' => get_option( 'sticky_posts' ), 'tax_query' => array( array( 'taxonomy' => 'post_format', 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ), 'field' => 'slug', 'operator' => 'NOT IN', ), ), 'no_found_rows' => true, ); // Our new query for the Recent Posts section. $recent = new WP_Query( $recent_args ); // The first Recent post is displayed normally if ( $recent->have_posts() ) : $recent->the_post(); // Set $more to 0 in order to only get the first part of the post. global $more; $more = 0; get_template_part( 'content', get_post_format() ); echo '<ol class="other-recent-posts">'; endif; // For all other recent posts, just display the title and comment status. while ( $recent->have_posts() ) : $recent->the_post(); ?> <li class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a> <span class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?> </span> </li> <?php endwhile; // If we had some posts, close the <ol> if ( $recent->post_count > 0 ) echo '</ol>'; ?> </section><!-- .recent-posts --> <div class="widget-area" role="complementary"> <?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?> <?php the_widget( 'Twenty_Eleven_Ephemera_Widget', '', array( 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) ); ?> <?php endif; // end sidebar widget area ?> </div><!-- .widget-area --> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/showcase.php
PHP
oos
7,381
<?php /** * The template for displaying the footer. * * Contains the closing of the id=main div and all content after * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> </div><!-- #main --> <footer id="colophon" role="contentinfo"> <?php /* A sidebar in the footer? Yep. You can can customize * your footer with three columns of widgets. */ if ( ! is_404() ) get_sidebar( 'footer' ); ?> <div id="site-generator"> <?php do_action( 'twentyeleven_credits' ); ?> <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyeleven' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyeleven' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'twentyeleven' ), 'WordPress' ); ?></a> </div> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/footer.php
PHP
oos
914
<?php /** * The Sidebar containing the main widget area. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ $options = twentyeleven_get_theme_options(); $current_layout = $options['theme_layout']; if ( 'content' != $current_layout ) : ?> <div id="secondary" class="widget-area" role="complementary"> <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?> <aside id="archives" class="widget"> <h3 class="widget-title"><?php _e( 'Archives', 'twentyeleven' ); ?></h3> <ul> <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> </ul> </aside> <aside id="meta" class="widget"> <h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <?php wp_meta(); ?> </ul> </aside> <?php endif; // end sidebar widget area ?> </div><!-- #secondary .widget-area --> <?php endif; ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/sidebar.php
PHP
oos
956
<?php /** * The template used to display Tag Archive pages * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <section id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"><?php printf( __( 'Tag Archives: %s', 'twentyeleven' ), '<span>' . single_tag_title( '', false ) . '</span>' ); ?></h1> <?php $tag_description = tag_description(); if ( ! empty( $tag_description ) ) echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' ); ?> </header> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/tag.php
PHP
oos
1,888
<?php /** * The Header for our theme. * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?><!DOCTYPE html> <!--[if IE 6]> <html id="ie6" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 7]> <html id="ie7" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html id="ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width" /> <title><?php /* * Print the <title> tag based on what is being viewed. */ global $page, $paged; wp_title( '|', true, 'right' ); // Add the blog name. bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) echo " | $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script> <![endif]--> <?php /* We add some JavaScript to pages with the comment form * to support sites with threaded comments (when in use). */ if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. */ wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page" class="hfeed"> <header id="branding" role="banner"> <hgroup> <h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1> <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2> </hgroup> <?php // Check to see if the header image has been removed $header_image = get_header_image(); if ( $header_image ) : // Compatibility with versions of WordPress prior to 3.4. if ( function_exists( 'get_custom_header' ) ) { // We need to figure out what the minimum width should be for our featured image. // This result would be the suggested width if the theme were to implement flexible widths. $header_image_width = get_theme_support( 'custom-header', 'width' ); } else { $header_image_width = HEADER_IMAGE_WIDTH; } ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <?php // The header image // Check if this is a post or page, if it has a thumbnail, and if it's a big one if ( is_singular() && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && $image[1] >= $header_image_width ) : // Houston, we have a new header image! echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); else : // Compatibility with versions of WordPress prior to 3.4. if ( function_exists( 'get_custom_header' ) ) { $header_image_width = get_custom_header()->width; $header_image_height = get_custom_header()->height; } else { $header_image_width = HEADER_IMAGE_WIDTH; $header_image_height = HEADER_IMAGE_HEIGHT; } ?> <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" /> <?php endif; // end check for featured image or standard header ?> </a> <?php endif; // end check for removed header image ?> <?php // Has the text been hidden? if ( 'blank' == get_header_textcolor() ) : ?> <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>"> <?php get_search_form(); ?> </div> <?php else : ?> <?php get_search_form(); ?> <?php endif; ?> <nav id="access" role="navigation"> <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3> <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?> <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div> <div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> </nav><!-- #access --> </header><!-- #branding --> <div id="main">
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/header.php
PHP
oos
5,589
<?php /** * The template for displaying image attachments. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary" class="image-attachment"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <nav id="nav-single"> <h3 class="assistive-text"><?php _e( 'Image navigation', 'twentyeleven' ); ?></h3> <span class="nav-previous"><?php previous_image_link( false, __( '&larr; Previous' , 'twentyeleven' ) ); ?></span> <span class="nav-next"><?php next_image_link( false, __( 'Next &rarr;' , 'twentyeleven' ) ); ?></span> </nav><!-- #nav-single --> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-meta"> <?php $metadata = wp_get_attachment_metadata(); printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>', 'twentyeleven' ), esc_attr( get_the_time() ), get_the_date(), esc_url( wp_get_attachment_url() ), $metadata['width'], $metadata['height'], esc_url( get_permalink( $post->post_parent ) ), esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ), get_the_title( $post->post_parent ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <div class="entry-attachment"> <div class="attachment"> <?php /** * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file */ $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); foreach ( $attachments as $k => $attachment ) { if ( $attachment->ID == $post->ID ) break; } $k++; // If there is more than 1 attachment in a gallery if ( count( $attachments ) > 1 ) { if ( isset( $attachments[ $k ] ) ) // get the URL of the next image attachment $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); else // or get the URL of the first image attachment $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); } else { // or, if there's only 1 image, get the URL of the image $next_attachment_url = wp_get_attachment_url(); } ?> <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 ); echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height. ?></a> <?php if ( ! empty( $post->post_excerpt ) ) : ?> <div class="entry-caption"> <?php the_excerpt(); ?> </div> <?php endif; ?> </div><!-- .attachment --> </div><!-- .entry-attachment --> <div class="entry-description"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-description --> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> --> <?php comments_template(); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/image.php
PHP
oos
4,143
<?php /** * The template for displaying posts in the Gallery Post Format on index and archive pages * * Learn more: http://codex.wordpress.org/Post_Formats * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Gallery', 'twentyeleven' ); ?></h3> </hgroup> <div class="entry-meta"> <?php twentyeleven_posted_on(); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for search pages ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php if ( post_password_required() ) : ?> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php else : ?> <?php $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); if ( $images ) : $total_images = count( $images ); $image = array_shift( $images ); $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); ?> <figure class="gallery-thumb"> <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a> </figure><!-- .gallery-thumb --> <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ), 'href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', number_format_i18n( $total_images ) ); ?></em></p> <?php endif; ?> <?php the_excerpt(); ?> <?php endif; ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php $show_sep = false; ?> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); if ( $categories_list ): ?> <span class="cat-links"> <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); $show_sep = true; ?> </span> <?php endif; // End if categories ?> <?php /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( $tags_list ): if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="tag-links"> <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); $show_sep = true; ?> </span> <?php endif; // End if $tags_list ?> <?php if ( comments_open() ) : ?> <?php if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; // End if comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-gallery.php
PHP
oos
3,977
<?php /** * The default template for displaying content * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_sticky() ) : ?> <hgroup> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3> </hgroup> <?php else : ?> <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1> <?php endif; ?> <?php if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php twentyeleven_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; ?> <?php if ( comments_open() && ! post_password_required() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> </div> <?php endif; ?> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php $show_sep = false; ?> <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); if ( $categories_list ): ?> <span class="cat-links"> <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); $show_sep = true; ?> </span> <?php endif; // End if categories ?> <?php /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( $tags_list ): if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="tag-links"> <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); $show_sep = true; ?> </span> <?php endif; // End if $tags_list ?> <?php endif; // End if 'post' == get_post_type() ?> <?php if ( comments_open() ) : ?> <?php if ( $show_sep ) : ?> <span class="sep"> | </span> <?php endif; // End if $show_sep ?> <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> <?php endif; // End if comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- #entry-meta --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content.php
PHP
oos
3,695
<?php /** * The template for displaying page content in the showcase.php page template * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class( 'intro' ); ?>> <header class="entry-header"> <h2 class="entry-title"><?php the_title(); ?></h2> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> -->
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/content-intro.php
PHP
oos
743
/* A dark color scheme for Twenty Eleven */ /* =Global ----------------------------------------------- */ body { background: #1d1d1d; color: #bbb; } #page { background: #0f0f0f; } /* Headings */ hr { background-color: #333; } /* Text elements */ blockquote cite { color: #999; } pre { background: #0b0b0b; } code, kbd { font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; } abbr, acronym, dfn { border-bottom: 1px dotted #999; } ins { background: #00063f; } input[type=text], .post-password-required input[type=password], textarea { border: 1px solid #222; } input[type=text]:focus, textarea:focus { } input#s { background-color: #ddd; } /* Links */ a { } /* =Header ----------------------------------------------- */ #branding { border-top: 2px solid #0a0a0a; } #site-title a { color: #eee; } #site-title a:hover, #site-title a:focus, #site-title a:active { } #site-description { color: #858585; } #branding #s { background-color: #ddd; } /* =Menu ----------------------------------------------- */ #access { background: #333; /* Show a solid color for older browsers */ background: -moz-linear-gradient(#383838, #272727); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#383838), to(#272727)); /* older webkit syntax */ background: -webkit-linear-gradient(#383838, #272727); border-bottom: 1px solid #222; } /* =Content ----------------------------------------------- */ .page-title { color: #ccc; } .hentry { border-color: #222; } .entry-title { color: #ddd; } .entry-title, .entry-title a { color: #ddd; } .entry-title a:hover, .entry-title a:focus, .entry-title a:active { } .entry-meta { color: #999; } .entry-content h1, .entry-content h2, .comment-content h1, .comment-content h2 { color: #fff; } .entry-content table, .comment-content table { border-color: #222; } .entry-content th, .comment-content th { color: #999; } .entry-content td, .comment-content td { border-color: #222; } .page-link { } .page-link a { background: #242424; color: #bbb; } .page-link a:hover { background: #999; color: #000; } .entry-meta .edit-link a { background: #242424; color: #bbb; } .entry-meta .edit-link a:hover, .entry-meta .edit-link a:focus, .entry-meta .edit-link a:active { background: #999; color: #000; } /* Images */ .wp-caption { background: #2c2c2c; } .wp-caption .wp-caption-text { color: #999; } .wp-caption .wp-caption-text:before { color: #999; } /* Image borders */ img[class*="wp-image-"], #content .gallery .gallery-icon img { border-color: #2c2c2c; } .wp-caption img { border-color: #2c2c2c; } a:focus img[class*="wp-image-"], a:hover img[class*="wp-image-"], a:active img[class*="wp-image-"] { background: #2c2c2c; border-color: #444; } .wp-caption a:focus img, .wp-caption a:active img, .wp-caption a:hover img { background: #0f0f0f; border-color: #2c2c2c; } /* Password Protected Posts */ .post-password-required input[type=password] { background: #ddd; } .post-password-required input[type=password]:focus { background: #fff; } /* Author Info */ .singular #author-info { background: #060606; border-color: #222; } .archive #author-info { border-color: #222; } #author-avatar img { background: #000; -webkit-box-shadow: 0 1px 2px #444; -moz-box-shadow: 0 1px 2px #444; box-shadow: 0 1px 2px #444; } #author-description h2 { color: #fff; } /* Comments link */ .entry-header .comments-link a { background: #282828 url(../images/comment-bubble-dark.png) no-repeat; border-color: #222; color: #888; } .rtl .entry-header .comments-link a { background-image: url(../images/comment-bubble-dark-rtl.png); } /* Singular content styles for Posts and Pages */ .singular .entry-title { color: #fff; } /* =Status ----------------------------------------------- */ .format-status img.avatar { -webkit-box-shadow: 0 1px 2px #333; -moz-box-shadow: 0 1px 2px #333; box-shadow: 0 1px 2px #333; } /* =Quote ----------------------------------------------- */ .format-quote blockquote { color: #aaa; } /* =Image ----------------------------------------------- */ .indexed.format-image .wp-caption { background: #242424; } .indexed.format-image .entry-meta .edit-link a { color: #ddd; } .indexed.format-image .entry-meta .edit-link a:hover { color: #fff; } /* =error404 ----------------------------------------------- */ .error404 #main #searchform { background: #060606; border-color: #222; } /* =Showcase ----------------------------------------------- */ h1.showcase-heading { color: #ccc; } /* Intro */ article.intro { background: #060606; } article.intro .entry-content { color: #eee; } article.intro .edit-link a { background: #555; color: #000; } article.intro .edit-link a:hover { background: #888; } /* Featured post */ section.featured-post .hentry { color: #999; } /* Small featured post */ section.featured-post .attachment-small-feature { border-color: #444; } section.featured-post .attachment-small-feature:hover { border-color: #777; } article.feature-image.small .entry-summary { color: #aaa; } article.feature-image.small .entry-summary p a { background: #ddd; color: #111; } article.feature-image.small .entry-summary p a:hover { color: #40220c; } /* Large featured post */ article.feature-image.large .entry-title a { background: #ddd; background: rgba(0,0,0,0.8); color: #fff; } section.feature-image.large:hover .entry-title a, section.feature-image.large .entry-title:hover a { background: #111; background: rgba(255,255,255,0.8); color: #000; } section.feature-image.large img { border-bottom: 1px solid #222; } /* Featured Slider */ .featured-posts { border-color: #222; } .featured-posts section.featured-post { background: #000; } .featured-post .feature-text:after, .featured-post .feature-image.small:after { background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */ } .feature-slider a { background: #c3c3c3; background: rgba(60,60,60,0.9); -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); } .feature-slider a.active { background: #000; background: rgba(255,255,255,0.8); -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); } /* Recent Posts */ section.recent-posts .other-recent-posts { border-color: #222; } section.recent-posts .other-recent-posts .entry-title { border-color: #222; } section.recent-posts .other-recent-posts a[rel="bookmark"] { color: #ccc; } section.recent-posts .other-recent-posts a[rel="bookmark"]:hover { } section.recent-posts .other-recent-posts .comments-link a, section.recent-posts .other-recent-posts .comments-link > span { border-color: #959595; color: #bbb; } section.recent-posts .other-recent-posts .comments-link > span { border-color: #444; color: #777; } section.recent-posts .other-recent-posts .comments-link a:hover { } /* =Attachments ----------------------------------------------- */ .image-attachment div.attachment { background: #060606; border-color: #222; } .image-attachment div.attachment a img { border-color: #060606; } .image-attachment div.attachment a:focus img, .image-attachment div.attachment a:hover img, .image-attachment div.attachment a:active img { border-color: #2c2c2c; background: #0f0f0f; } /* =Widgets ----------------------------------------------- */ .widget-title { color: #ccc; } .widget ul li { color: #888; } /* Search Widget */ .widget_search #searchsubmit { background: #222; border-color: #333; -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); -moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); color: #777; } .widget_search #searchsubmit:active { -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); color: #40220c; } /* Calendar Widget */ .widget_calendar #wp-calendar { color: #aaa; } .widget_calendar #wp-calendar th { background: #0b0b0b; border-color: #333; } .widget_calendar #wp-calendar tfoot td { background: #0b0b0b; border-color: #333; } /* =Comments ----------------------------------------------- */ #comments-title { color: #bbb; } .nocomments { color: #555; } .commentlist > li.comment { background: #090909; border-color: #222; } .commentlist .children li.comment { background: #000; border-color: #222; } .rtl .commentlist .children li.comment { border-color: #222; } .comment-meta { color: #999; } .commentlist .avatar { -webkit-box-shadow: 0 1px 2px #222; -moz-box-shadow: 0 1px 2px #222; box-shadow: 0 1px 2px #222; } a.comment-reply-link { background: #242424; color: #bbb; } li.bypostauthor a.comment-reply-link { background: #111; } a.comment-reply-link:hover, a.comment-reply-link:focus, a.comment-reply-link:active, li.bypostauthor a.comment-reply-link:hover, li.bypostauthor a.comment-reply-link:focus, li.bypostauthor a.comment-reply-link:active { background: #999; color: #000; } .commentlist > li:before { content: url(../images/comment-arrow-dark.png); } .rtl .commentlist > li:before { content: url(../images/comment-arrow-dark-rtl.png); } /* Post author highlighting */ .commentlist > li.bypostauthor { background: #222; border-color: #2c2c2c; } .commentlist > li.bypostauthor:before { content: url(../images/comment-arrow-bypostauthor-dark.png); } .rtl .commentlist > li.bypostauthor:before { content: url(../images/comment-arrow-bypostauthor-dark-rtl.png); } /* Post Author threaded comments */ .commentlist .children > li.bypostauthor { background: #222; border-color: #2c2c2c; } .commentlist > li.bypostauthor .comment-meta { color: #a8a8a8; } /* Comment Form */ #respond { background: #222; border-color: #2c2c2c; } #respond input[type="text"], #respond textarea { background: #000; border: 4px solid #111; -webkit-box-shadow: inset 0 1px 3px rgba(51,51,51,0.95); -moz-box-shadow: inset 0 1px 3px rgba(51,51,51,0.95); box-shadow: inset 0 1px 3px rgba(51,51,51,0.95); color: #bbb; } #respond .comment-form-author label, #respond .comment-form-email label, #respond .comment-form-url label, #respond .comment-form-comment label { background: #111; -webkit-box-shadow: 1px 2px 2px rgba(51,51,51,0.8); -moz-box-shadow: 1px 2px 2px rgba(51,51,51,0.8); box-shadow: 1px 1px 2px rgba(51,51,51,0.8); color: #aaa; } .rtl #respond .comment-form-author label, .rtl #respond .comment-form-email label, .rtl #respond .comment-form-url label, .rtl #respond .comment-form-comment label { -webkit-box-shadow: -1px 2px 2px rgba(51,51,51,0.8); -moz-box-shadow: -1px 2px 2px rgba(51,51,51,0.8); box-shadow: -1px 1px 2px rgba(51,51,51,0.8); } #respond .comment-form-author .required, #respond .comment-form-email .required { color: #42caff; } #respond input#submit { background: #ddd; -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); box-shadow: 0px 1px 2px rgba(0,0,0,0.3); color: #111; text-shadow: 0 -1px 0 rgba(0,0,0,0.3); } #respond input#submit:active { color: #40220c; } #respond #cancel-comment-reply-link { color: #999; } #reply-title { color: #ccc; } #cancel-comment-reply-link { color: #777; } #cancel-comment-reply-link:focus, #cancel-comment-reply-link:active, #cancel-comment-reply-link:hover { color: #00b4cc; } /* =Footer ----------------------------------------------- */ #supplementary { border-color: #222; } /* Site Generator Line */ #site-generator { background: #060606; border-color: #000; } /* =Print ----------------------------------------------- */ @media print { body { color: #333; background: none !important; } #page { background: none !important; } /* Comments */ .commentlist > li.comment { } /* Post author highlighting */ .commentlist > li.bypostauthor { color: #333; } .commentlist > li.bypostauthor .comment-meta { color: #959595; } .commentlist > li:before { content: none !important; } /* Post Author threaded comments */ .commentlist .children > li.bypostauthor { background: #fff; border-color: #ddd; } .commentlist .children > li.bypostauthor > article, .commentlist .children > li.bypostauthor > article .comment-meta { color: #959595; } }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/colors/dark.css
CSS
oos
13,259
<?php /** * The template for displaying Category Archive pages. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <section id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"><?php printf( __( 'Category Archives: %s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1> <?php $category_description = category_description(); if ( ! empty( $category_description ) ) echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' ); ?> </header> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/category.php
PHP
oos
1,928
<?php /** * Makes a custom Widget for displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven * * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { /** * Constructor * * @return void **/ function Twenty_Eleven_Ephemera_Widget() { $widget_ops = array( 'classname' => 'widget_twentyeleven_ephemera', 'description' => __( 'Use this widget to list your recent Aside, Status, Quote, and Link posts', 'twentyeleven' ) ); $this->WP_Widget( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), $widget_ops ); $this->alt_option_name = 'widget_twentyeleven_ephemera'; add_action( 'save_post', array(&$this, 'flush_widget_cache' ) ); add_action( 'deleted_post', array(&$this, 'flush_widget_cache' ) ); add_action( 'switch_theme', array(&$this, 'flush_widget_cache' ) ); } /** * Outputs the HTML for this widget. * * @param array An array of standard parameters for widgets in this theme * @param array An array of settings for this widget instance * @return void Echoes it's output **/ function widget( $args, $instance ) { $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); if ( !is_array( $cache ) ) $cache = array(); if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = null; if ( isset( $cache[$args['widget_id']] ) ) { echo $cache[$args['widget_id']]; return; } ob_start(); extract( $args, EXTR_SKIP ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base); if ( ! isset( $instance['number'] ) ) $instance['number'] = '10'; if ( ! $number = absint( $instance['number'] ) ) $number = 10; $ephemera_args = array( 'order' => 'DESC', 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'post__not_in' => get_option( 'sticky_posts' ), 'tax_query' => array( array( 'taxonomy' => 'post_format', 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-status', 'post-format-quote' ), 'field' => 'slug', 'operator' => 'IN', ), ), ); $ephemera = new WP_Query( $ephemera_args ); if ( $ephemera->have_posts() ) : echo $before_widget; echo $before_title; echo $title; // Can set this with a widget option, or omit altogether echo $after_title; ?> <ol> <?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?> <?php if ( 'link' != get_post_format() ) : ?> <li class="widget-entry-title"> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a> <span class="comments-link"> <?php comments_popup_link( __( '0 <span class="reply">comments &rarr;</span>', 'twentyeleven' ), __( '1 <span class="reply">comment &rarr;</span>', 'twentyeleven' ), __( '% <span class="reply">comments &rarr;</span>', 'twentyeleven' ) ); ?> </span> </li> <?php else : ?> <li class="widget-entry-title"> <?php // Grab first link from the post content. If none found, use the post permalink as fallback. $link_url = twentyeleven_url_grabber(); if ( empty( $link_url ) ) $link_url = get_permalink(); ?> <a href="<?php echo esc_url( $link_url ); ?>" title="<?php printf( esc_attr__( 'Link to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>&nbsp;<span>&rarr;</span></a> <span class="comments-link"> <?php comments_popup_link( __( '0 <span class="reply">comments &rarr;</span>', 'twentyeleven' ), __( '1 <span class="reply">comment &rarr;</span>', 'twentyeleven' ), __( '% <span class="reply">comments &rarr;</span>', 'twentyeleven' ) ); ?> </span> </li> <?php endif; ?> <?php endwhile; ?> </ol> <?php echo $after_widget; // Reset the post globals as this query will have stomped on it wp_reset_postdata(); // end check for ephemeral posts endif; $cache[$args['widget_id']] = ob_get_flush(); wp_cache_set( 'widget_twentyeleven_ephemera', $cache, 'widget' ); } /** * Deals with the settings when they are saved by the admin. Here is * where any validation should be dealt with. **/ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['number'] = (int) $new_instance['number']; $this->flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) ) delete_option( 'widget_twentyeleven_ephemera' ); return $instance; } function flush_widget_cache() { wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' ); } /** * Displays the form for this widget on the Widgets page of the WP Admin area. **/ function form( $instance ) { $title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : ''; $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10; ?> <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyeleven' ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p> <p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php _e( 'Number of posts to show:', 'twentyeleven' ); ?></label> <input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3" /></p> <?php } }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/inc/widgets.php
PHP
oos
6,049
<?php /** * Twenty Eleven Theme Options * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ /** * Properly enqueue styles and scripts for our theme options page. * * This function is attached to the admin_enqueue_scripts action hook. * * @since Twenty Eleven 1.0 * */ function twentyeleven_admin_enqueue_scripts( $hook_suffix ) { wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' ); wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' ); wp_enqueue_style( 'farbtastic' ); } add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_admin_enqueue_scripts' ); /** * Register the form setting for our twentyeleven_options array. * * This function is attached to the admin_init action hook. * * This call to register_setting() registers a validation callback, twentyeleven_theme_options_validate(), * which is used when the option is saved, to ensure that our option values are complete, properly * formatted, and safe. * * @since Twenty Eleven 1.0 */ function twentyeleven_theme_options_init() { register_setting( 'twentyeleven_options', // Options group, see settings_fields() call in twentyeleven_theme_options_render_page() 'twentyeleven_theme_options', // Database option, see twentyeleven_get_theme_options() 'twentyeleven_theme_options_validate' // The sanitization callback, see twentyeleven_theme_options_validate() ); // Register our settings field group add_settings_section( 'general', // Unique identifier for the settings section '', // Section title (we don't want one) '__return_false', // Section callback (we don't want anything) 'theme_options' // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() ); // Register our individual settings fields add_settings_field( 'color_scheme', // Unique identifier for the field for this section __( 'Color Scheme', 'twentyeleven' ), // Setting field label 'twentyeleven_settings_field_color_scheme', // Function that renders the settings field 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() 'general' // Settings section. Same as the first argument in the add_settings_section() above ); add_settings_field( 'link_color', __( 'Link Color', 'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' ); add_settings_field( 'layout', __( 'Default Layout', 'twentyeleven' ), 'twentyeleven_settings_field_layout', 'theme_options', 'general' ); } add_action( 'admin_init', 'twentyeleven_theme_options_init' ); /** * Change the capability required to save the 'twentyeleven_options' options group. * * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group. * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page. * * By default, the options groups for all registered settings require the manage_options capability. * This filter is required to change our theme options page to edit_theme_options instead. * By default, only administrators have either of these capabilities, but the desire here is * to allow for finer-grained control for roles and users. * * @param string $capability The capability used for the page, which is manage_options by default. * @return string The capability to actually use. */ function twentyeleven_option_page_capability( $capability ) { return 'edit_theme_options'; } add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' ); /** * Add our theme options page to the admin menu, including some help documentation. * * This function is attached to the admin_menu action hook. * * @since Twenty Eleven 1.0 */ function twentyeleven_theme_options_add_page() { $theme_page = add_theme_page( __( 'Theme Options', 'twentyeleven' ), // Name of page __( 'Theme Options', 'twentyeleven' ), // Label in menu 'edit_theme_options', // Capability required 'theme_options', // Menu slug, used to uniquely identify the page 'twentyeleven_theme_options_render_page' // Function that renders the options page ); if ( ! $theme_page ) return; add_action( "load-$theme_page", 'twentyeleven_theme_options_help' ); } add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' ); function twentyeleven_theme_options_help() { $help = '<p>' . __( 'Some themes provide customization options that are grouped together on a Theme Options screen. If you change themes, options may change or disappear, as they are theme-specific. Your current theme, Twenty Eleven, provides the following Theme Options:', 'twentyeleven' ) . '</p>' . '<ol>' . '<li>' . __( '<strong>Color Scheme</strong>: You can choose a color palette of "Light" (light background with dark text) or "Dark" (dark background with light text) for your site.', 'twentyeleven' ) . '</li>' . '<li>' . __( '<strong>Link Color</strong>: You can choose the color used for text links on your site. You can enter the HTML color or hex code, or you can choose visually by clicking the "Select a Color" button to pick from a color wheel.', 'twentyeleven' ) . '</li>' . '<li>' . __( '<strong>Default Layout</strong>: You can choose if you want your site&#8217;s default layout to have a sidebar on the left, the right, or not at all.', 'twentyeleven' ) . '</li>' . '</ol>' . '<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>'; $sidebar = '<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' . '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' . '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>'; $screen = get_current_screen(); if ( method_exists( $screen, 'add_help_tab' ) ) { // WordPress 3.3 $screen->add_help_tab( array( 'title' => __( 'Overview', 'twentyeleven' ), 'id' => 'theme-options-help', 'content' => $help, ) ); $screen->set_help_sidebar( $sidebar ); } else { // WordPress 3.2 add_contextual_help( $screen, $help . $sidebar ); } } /** * Returns an array of color schemes registered for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_color_schemes() { $color_scheme_options = array( 'light' => array( 'value' => 'light', 'label' => __( 'Light', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/light.png', 'default_link_color' => '#1b8be0', ), 'dark' => array( 'value' => 'dark', 'label' => __( 'Dark', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/dark.png', 'default_link_color' => '#e4741f', ), ); return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options ); } /** * Returns an array of layout options registered for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_layouts() { $layout_options = array( 'content-sidebar' => array( 'value' => 'content-sidebar', 'label' => __( 'Content on left', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/content-sidebar.png', ), 'sidebar-content' => array( 'value' => 'sidebar-content', 'label' => __( 'Content on right', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content.png', ), 'content' => array( 'value' => 'content', 'label' => __( 'One-column, no sidebar', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/content.png', ), ); return apply_filters( 'twentyeleven_layouts', $layout_options ); } /** * Returns the default options for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_get_default_theme_options() { $default_theme_options = array( 'color_scheme' => 'light', 'link_color' => twentyeleven_get_default_link_color( 'light' ), 'theme_layout' => 'content-sidebar', ); if ( is_rtl() ) $default_theme_options['theme_layout'] = 'sidebar-content'; return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options ); } /** * Returns the default link color for Twenty Eleven, based on color scheme. * * @since Twenty Eleven 1.0 * * @param $string $color_scheme Color scheme. Defaults to the active color scheme. * @return $string Color. */ function twentyeleven_get_default_link_color( $color_scheme = null ) { if ( null === $color_scheme ) { $options = twentyeleven_get_theme_options(); $color_scheme = $options['color_scheme']; } $color_schemes = twentyeleven_color_schemes(); if ( ! isset( $color_schemes[ $color_scheme ] ) ) return false; return $color_schemes[ $color_scheme ]['default_link_color']; } /** * Returns the options array for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_get_theme_options() { return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() ); } /** * Renders the Color Scheme setting field. * * @since Twenty Eleven 1.3 */ function twentyeleven_settings_field_color_scheme() { $options = twentyeleven_get_theme_options(); foreach ( twentyeleven_color_schemes() as $scheme ) { ?> <div class="layout image-radio-option color-scheme"> <label class="description"> <input type="radio" name="twentyeleven_theme_options[color_scheme]" value="<?php echo esc_attr( $scheme['value'] ); ?>" <?php checked( $options['color_scheme'], $scheme['value'] ); ?> /> <input type="hidden" id="default-color-<?php echo esc_attr( $scheme['value'] ); ?>" value="<?php echo esc_attr( $scheme['default_link_color'] ); ?>" /> <span> <img src="<?php echo esc_url( $scheme['thumbnail'] ); ?>" width="136" height="122" alt="" /> <?php echo $scheme['label']; ?> </span> </label> </div> <?php } } /** * Renders the Link Color setting field. * * @since Twenty Eleven 1.3 */ function twentyeleven_settings_field_link_color() { $options = twentyeleven_get_theme_options(); ?> <input type="text" name="twentyeleven_theme_options[link_color]" id="link-color" value="<?php echo esc_attr( $options['link_color'] ); ?>" /> <a href="#" class="pickcolor hide-if-no-js" id="link-color-example"></a> <input type="button" class="pickcolor button hide-if-no-js" value="<?php esc_attr_e( 'Select a Color', 'twentyeleven' ); ?>" /> <div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div> <br /> <span><?php printf( __( 'Default color: %s', 'twentyeleven' ), '<span id="default-color">' . twentyeleven_get_default_link_color( $options['color_scheme'] ) . '</span>' ); ?></span> <?php } /** * Renders the Layout setting field. * * @since Twenty Eleven 1.3 */ function twentyeleven_settings_field_layout() { $options = twentyeleven_get_theme_options(); foreach ( twentyeleven_layouts() as $layout ) { ?> <div class="layout image-radio-option theme-layout"> <label class="description"> <input type="radio" name="twentyeleven_theme_options[theme_layout]" value="<?php echo esc_attr( $layout['value'] ); ?>" <?php checked( $options['theme_layout'], $layout['value'] ); ?> /> <span> <img src="<?php echo esc_url( $layout['thumbnail'] ); ?>" width="136" height="122" alt="" /> <?php echo $layout['label']; ?> </span> </label> </div> <?php } } /** * Returns the options array for Twenty Eleven. * * @since Twenty Eleven 1.2 */ function twentyeleven_theme_options_render_page() { ?> <div class="wrap"> <?php screen_icon(); ?> <?php $theme_name = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_current_theme(); ?> <h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), $theme_name ); ?></h2> <?php settings_errors(); ?> <form method="post" action="options.php"> <?php settings_fields( 'twentyeleven_options' ); do_settings_sections( 'theme_options' ); submit_button(); ?> </form> </div> <?php } /** * Sanitize and validate form input. Accepts an array, return a sanitized array. * * @see twentyeleven_theme_options_init() * @todo set up Reset Options action * * @since Twenty Eleven 1.0 */ function twentyeleven_theme_options_validate( $input ) { $output = $defaults = twentyeleven_get_default_theme_options(); // Color scheme must be in our array of color scheme options if ( isset( $input['color_scheme'] ) && array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) ) $output['color_scheme'] = $input['color_scheme']; // Our defaults for the link color may have changed, based on the color scheme. $output['link_color'] = $defaults['link_color'] = twentyeleven_get_default_link_color( $output['color_scheme'] ); // Link color must be 3 or 6 hexadecimal characters if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) ) $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) ); // Theme layout must be in our array of theme layout options if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) $output['theme_layout'] = $input['theme_layout']; return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults ); } /** * Enqueue the styles for the current color scheme. * * @since Twenty Eleven 1.0 */ function twentyeleven_enqueue_color_scheme() { $options = twentyeleven_get_theme_options(); $color_scheme = $options['color_scheme']; if ( 'dark' == $color_scheme ) wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null ); do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme ); } add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' ); /** * Add a style block to the theme for the current link color. * * This function is attached to the wp_head action hook. * * @since Twenty Eleven 1.0 */ function twentyeleven_print_link_color_style() { $options = twentyeleven_get_theme_options(); $link_color = $options['link_color']; $default_options = twentyeleven_get_default_theme_options(); // Don't do anything if the current link color is the default. if ( $default_options['link_color'] == $link_color ) return; ?> <style> /* Link color */ a, #site-title a:focus, #site-title a:hover, #site-title a:active, .entry-title a:hover, .entry-title a:focus, .entry-title a:active, .widget_twentyeleven_ephemera .comments-link a:hover, section.recent-posts .other-recent-posts a[rel="bookmark"]:hover, section.recent-posts .other-recent-posts .comments-link a:hover, .format-image footer.entry-meta a:hover, #site-generator a:hover { color: <?php echo $link_color; ?>; } section.recent-posts .other-recent-posts .comments-link a:hover { border-color: <?php echo $link_color; ?>; } article.feature-image.small .entry-summary p a:hover, .entry-header .comments-link a:hover, .entry-header .comments-link a:focus, .entry-header .comments-link a:active, .feature-slider a.active { background-color: <?php echo $link_color; ?>; } </style> <?php } add_action( 'wp_head', 'twentyeleven_print_link_color_style' ); /** * Adds Twenty Eleven layout classes to the array of body classes. * * @since Twenty Eleven 1.0 */ function twentyeleven_layout_classes( $existing_classes ) { $options = twentyeleven_get_theme_options(); $current_layout = $options['theme_layout']; if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) ) $classes = array( 'two-column' ); else $classes = array( 'one-column' ); if ( 'content-sidebar' == $current_layout ) $classes[] = 'right-sidebar'; elseif ( 'sidebar-content' == $current_layout ) $classes[] = 'left-sidebar'; else $classes[] = $current_layout; $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout ); return array_merge( $existing_classes, $classes ); } add_filter( 'body_class', 'twentyeleven_layout_classes' ); /** * Implements Twenty Eleven theme options into Theme Customizer * * @param $wp_customize Theme Customizer object * @return void * * @since Twenty Eleven 1.3 */ function twentyeleven_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $options = twentyeleven_get_theme_options(); $defaults = twentyeleven_get_default_theme_options(); $wp_customize->add_setting( 'twentyeleven_theme_options[color_scheme]', array( 'default' => $defaults['color_scheme'], 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $schemes = twentyeleven_color_schemes(); $choices = array(); foreach ( $schemes as $scheme ) { $choices[ $scheme['value'] ] = $scheme['label']; } $wp_customize->add_control( 'twentyeleven_color_scheme', array( 'label' => __( 'Color Scheme', 'twentyeleven' ), 'section' => 'colors', 'settings' => 'twentyeleven_theme_options[color_scheme]', 'type' => 'radio', 'choices' => $choices, 'priority' => 5, ) ); // Link Color (added to Color Scheme section in Theme Customizer) $wp_customize->add_setting( 'twentyeleven_theme_options[link_color]', array( 'default' => twentyeleven_get_default_link_color( $options['color_scheme'] ), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( 'label' => __( 'Link Color', 'twentyeleven' ), 'section' => 'colors', 'settings' => 'twentyeleven_theme_options[link_color]', ) ) ); // Default Layout $wp_customize->add_section( 'twentyeleven_layout', array( 'title' => __( 'Layout', 'twentyeleven' ), 'priority' => 50, ) ); $wp_customize->add_setting( 'twentyeleven_theme_options[theme_layout]', array( 'type' => 'option', 'default' => $defaults['theme_layout'], 'sanitize_callback' => 'sanitize_key', ) ); $layouts = twentyeleven_layouts(); $choices = array(); foreach ( $layouts as $layout ) { $choices[$layout['value']] = $layout['label']; } $wp_customize->add_control( 'twentyeleven_theme_options[theme_layout]', array( 'section' => 'twentyeleven_layout', 'type' => 'radio', 'choices' => $choices, ) ); } add_action( 'customize_register', 'twentyeleven_customize_register' ); /** * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. * Used with blogname and blogdescription. * * @since Twenty Eleven 1.3 */ function twentyeleven_customize_preview_js() { wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20120523', true ); } add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' );
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/inc/theme-options.php
PHP
oos
19,398
( function( $ ){ wp.customize( 'blogname', function( value ) { value.bind( function( to ) { $( '#site-title a' ).html( to ); } ); } ); wp.customize( 'blogdescription', function( value ) { value.bind( function( to ) { $( '#site-description' ).html( to ); } ); } ); } )( jQuery );
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/inc/theme-customizer.js
JavaScript
oos
296
var farbtastic; (function($){ var pickColor = function(a) { farbtastic.setColor(a); $('#link-color').val(a); $('#link-color-example').css('background-color', a); }; $(document).ready( function() { $('#default-color').wrapInner('<a href="#" />'); farbtastic = $.farbtastic('#colorPickerDiv', pickColor); pickColor( $('#link-color').val() ); $('.pickcolor').click( function(e) { $('#colorPickerDiv').show(); e.preventDefault(); }); $('#link-color').keyup( function() { var a = $('#link-color').val(), b = a; a = a.replace(/[^a-fA-F0-9]/, ''); if ( '#' + a !== b ) $('#link-color').val(a); if ( a.length === 3 || a.length === 6 ) pickColor( '#' + a ); }); $(document).mousedown( function() { $('#colorPickerDiv').hide(); }); $('#default-color a').click( function(e) { pickColor( '#' + this.innerHTML.replace(/[^a-fA-F0-9]/, '') ); e.preventDefault(); }); $('.image-radio-option.color-scheme input:radio').change( function() { var currentDefault = $('#default-color a'), newDefault = $(this).next().val(); if ( $('#link-color').val() == currentDefault.text() ) pickColor( newDefault ); currentDefault.text( newDefault ); }); }); })(jQuery);
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/inc/theme-options.js
JavaScript
oos
1,240
#wpcontent select option { padding-right: 5px; } .image-radio-option td { padding-top: 15px; } .image-radio-option label { display: block; float: left; margin: 0 30px 20px 2px; position: relative; } .image-radio-option input { margin: 0 0 10px; } .image-radio-option span { display: block; width: 136px; } .image-radio-option img { margin: 0 0 0 -2px; } #link-color-example { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; border: 1px solid #dfdfdf; margin: 0 7px 0 3px; padding: 4px 14px; } body.rtl .image-radio-option label { float: right; margin: 0 2px 20px 30px; }
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/inc/theme-options.css
CSS
oos
615
<?php /** * The template for displaying search forms in Twenty Eleven * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <label for="s" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label> <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> </form>
01happy-blog
trunk/myblog/wp-content/themes/twentyeleven/searchform.php
PHP
oos
593
<?php /** * @package Themolio */ ?> <?php global $themolio_is_mobile; ?> <div id="comments"> <?php if(post_password_required()): ?> <p class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'themolio'); ?></p> </div> <?php return; endif; ?> <?php if(have_comments()): ?> <table class="comment-title-container tablayout"><tr> <td style="width:50%; text-align:left;"> <h2 class="comments-title"> <?php printf(_n('1条回复', '%1$s 条回复', get_comments_number(), 'themolio'), number_format_i18n(get_comments_number())); ?> </h2> </td> <?php if(comments_open() and !$themolio_is_mobile): ?> <td style="width:50%; text-align:right;"> <h4 class="comments-write-link"><a href="javascript:void(0)"><?php _e('回复显示切换','themolio'); ?></a></h4> </td> <?php endif; ?> </tr></table> <?php if(get_comment_pages_count() > 1 && get_option('page_comments')): ?> <div class="comment-navigation single-navigation"> <span class="nav-previous"><?php previous_comments_link(__('Older Comments', 'themolio')); ?></span> <span class="nav-next"><?php next_comments_link(__('Newer Comments', 'themolio')); ?></span> </div> <?php endif; ?> <ul class="commentlist"> <?php wp_list_comments(array('callback' => 'themolio_comment')); ?> </ul> <?php elseif(!comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')): ?> <p class="nocomments"><?php _e('Comments are closed.', 'themolio'); ?></p> <?php endif; ?> <?php comment_form(); ?> </div>
01happy-blog
trunk/myblog/wp-content/themes/themolio/comments.php
PHP
oos
1,791
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_is_mobile; ?> <?php get_header(); ?> <?php if($themolio_is_mobile) { $containerclass = ' fullcontainer'; } else { $containerclass = ''; } ?> <?php get_left_sidebar(); ?> <div class="container<?php echo $containerclass; ?>"> <?php themolio_breadcrumbs(); ?> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <?php get_template_part('content', get_post_format()); ?> <?php endwhile; ?> <?php themolio_get_pagination(); ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php if(!$themolio_is_mobile): ?> <?php get_sidebar(); ?> <?php endif; ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/search.php
PHP
oos
1,086
/* Theme Name: Themolio Theme URI: http://dezineappz.com/themolio Author: DezineAppz Author URI: http://dezineappz.com Description: Beautiful grid layout based theme. Traditional look also available. Completely responsive through a mobile friendly layout. Custom background, logo and favicon feature available. Elegant look and feel with customization options available. Multiple post format support. Support for post thumbnails. Valid XHTML and CSS 2/3. Compatible upto WordPress 3.4.1 Version: 1.2 License: GNU General Public License License URI: license.txt Tags: light, white, two-columns, right-sidebar, fixed-width, custom-background, custom-colors, custom-menu, editor-style, featured-images, full-width-template, post-formats, theme-options, translation-ready */ /* Reset */ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { border: 0; font-size: 100%; font: inherit; vertical-align: baseline; margin: 0; padding: 0; } article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section { display: block; } body { line-height: 1; text-shadow: none; } ol,ul { list-style: none; } blockquote,q { quotes: none; } blockquote: before,blockquote: after,q: before,q: after { content: none; } table { border-collapse: collapse; border-spacing: 0; } /* Default HTML Elements */ h1,h2,h3,h4,h5,h6 { clear: both; word-wrap: break-word; line-height: 165%; font-weight: 700; } p { word-wrap: break-word; line-height: 165%; } pre { overflow: auto; font-family: courier,Georgia,Serif; margin: 5px; padding: 5px; } pre { white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; _white-space: pre; } a { text-decoration: none; } abbr, .abbr, acronym { border-bottom: 1px dotted; cursor: help; } address { display: block; margin: 0 0 0 1.625em; } cite,em,i { font-style: italic; } blockquote em,blockquote i,blockquote cite { font-style: normal; } blockquote { padding-left: 15px; margin-left: 15px; border-left: 5px #ddd solid; font-family: Georgia, serif; font-style: italic; } sup,sub { height: 0; line-height: 1; vertical-align: baseline; position: relative; } sup { bottom: 1ex; } sub { top: .5ex; } dt,strong { font-weight: 700; } : focus { outline: 0; } del, strike, s { text-decoration: line-through; } ins { text-decoration: none; background-color: #feeeaf; } a img { border: 0; } .clearfix: after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } * html .clearfix { zoom: 1; } /* IE6 */ : first-child+html .clearfix { zoom: 1; } /* IE7 */ .clear { line-height: 1px; height: 0; margin: 0; padding: 0; clear: both; visibility: hidden; } input { font-family: Helvetica, Arial, sans-serif; } input[type="submit"], input[type="reset"], input[type="button"] { padding: 5px; border: 1px solid; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; font-weight: 700; cursor: pointer; } input[type="submit"]::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner { border:0; padding:0; } input[type="text"], input[type="password"], textarea { padding: 5px; border: 1px solid; } textarea { overflow: auto; font-family: inherit; font-size: 100%; } /* post code */ .entry-content pre {background: #E9E9E9; padding: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;} /* Body */ body { } .wrapper { width: 98%; min-width: 980px; margin: 0 auto; overflow: hidden; text-align: left; position: relative; } #content .wrapper { padding: 20px 0px; } .container { margin: 0 340px 0 140px;} .fullcontainer { width: 100%; } .widget-area { width: 320px; position: absolute; right: 0px; top: 20px; background-color: #EEF; } .widget-left-area { width: 120px; position: absolute; left: 0px; top: 20px; background-color: #EEF; } /* Layout helpers */ .tablayout { width: 100%; } .tablayout td { vertical-align: middle; } .tablayout td.left { text-align: left; } .tablayout td.right { text-align: right; } /* Header */ header[role="banner"], header[role="banner"] .wrapper, header[role="banner"] .tablayout { height: 100px; } header[role="banner"] { padding: 0 10px; } .site-title, .site-desc { line-height: 100%; } .site-title a { color: #B42111; } .site-title { font-family: "TrashHandRegular", Georgia, serif; font-size: 45px; font-weight: 300; } .site-desc { font-size: 14px; margin-top: 10px; color: #8a8a8a; } .custom-logo { max-height: 100px; max-width: 100px; } header[role="banner"] #s { width: 140px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; color: #777; } header[role="banner"] #searchsubmit { width: 100px; } /* Footer */ .social-link { margin-left: 5px; } .social-link img { vertical-align: middle; } /* Dropdown Menu */ nav { background: #2B6695; } .main-menu { overflow: hidden; background: #2B6695; } .main-menu ul, .main-menu ul ul { list-style: none; margin: 0 !important; } .main-menu ul li { float: left; } .main-menu ul li a { display: block; font-size: 13px; font-weight: 700; text-transform: capitalize; } .main-menu ul ul { visibility: hidden; width: 140px; position: absolute; z-index: 999; } .main-menu ul ul li { width: 140px; position: relative; } .main-menu ul ul ul { left: 139px; top: 0; position: absolute; } .main-menu ul li:hover > ul { visibility: visible; } /* styling */ .main-menu a { padding: 15px 10px; color: #fff; text-shadow: #000 1px 1px; } .main-menu li { } .main-menu a:hover, .main-menu .current-menu-item a, .main-menu .current-menu-item li a:hover, .main-menu .current_page_item a, .main-menu .current_page_item li a:hover { background: url(images/menu_hover_bg.png) repeat; } .main-menu .current-menu-item li a, .main-menu .current_page_item li a { background-image: none; } /* Posts */ article.post, article.page, article.type-attachment { margin-bottom: 10px; background-color: #fff; padding: 10px; border-bottom: 1px dashed #ddd; } .entry-title { font-family: Georgia, serif; color: #333; font-weight: 300; margin-bottom: 10px; font-size: 24px; } .entry-title a { color: #105CB6; } .container a:hover { color: #B42111; } .entry-meta { font-size: 12px; color: #888; line-height: 150%; padding-bottom: 10px; border-bottom: 1px #eee solid; margin-bottom: 15px; } .entry-meta a:hover { text-decoration: underline; } .entry-meta p { margin-top: 5px; } .entry-content { line-height: 165%; overflow: hidden; } .entry-content a:hover { text-decoration: underline; } .entry-content * { margin-bottom: 15px; line-height: 165%; } .entry-content img { margin-bottom: 0; } .entry-content *:last-child { margin-bottom: 0; } .entry-content .wp-smiley { margin-bottom: 0 !important; } .entry-content br { margin-bottom: 0 !important; } .entry-content h1 { font-size: 24px; } .entry-content h2 { font-size: 20px; } .entry-content h3 { font-size: 17px; } .entry-content h4 { font-size: 15px; } .entry-content h5 { font-size: 13px; } .entry-content h6 { font-size: 12px; } .entry-content li { margin-bottom: 10px; } .entry-content ul, .entry-content ul ul { list-style: disc; margin-left: 50px; } .entry-content ol { list-style: decimal; margin-left: 50px; } .entry-content ol ol { margin-left: 20px; } .entry-content ul ul, .entry-content ol ol { margin-top: 10px; } .entry-content ol ol { list-style: upper-alpha; } .entry-content ol ol ol { list-style: lower-roman; } .entry-content ol ol ol ol { list-style: lower-alpha; } .entry-content table { border: 1px #ccc solid; } .entry-content table td, .entry-content table th { border: 1px #ccc solid; padding: 5px; } .entry-content table th { background-color: #e5e5e5; font-weight: 700; text-shadow: #f5f5f5 1px 1px; } .entry-content table caption { border: 1px #ccc solid; padding: 5px; border-bottom: 0 none; } .more-link { font-family: Helvetica, Arial, sans-serif !important; clear: both; background: #f5f5f5 url(images/button_bg.png) repeat-x bottom left; position:relative; overflow:visible; display:inline-block; padding: 4px 5px; border: 1px #ccc solid; margin:0; text-decoration:none; text-shadow:1px 1px 0 #fff; font-size: 11px; white-space:nowrap; cursor:pointer; outline:none; zoom:1; *display:inline; color: #555 !important; font-weight: 700; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .more-link:hover { text-decoration: none !important; color: #fff !important; } .page-link { clear: both; } .page-link span { font-family: Helvetica, Arial, sans-serif !important; display:inline-block; position:relative; overflow:visible; padding: 6px !important; line-height: 100%; margin-bottom: 0 !important; font-weight: 700; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; border: 1px solid; } .page-link a:hover span, .page-link span { background: url(images/button_bg.png) repeat-x top left; color: #fff !important; } .page-link a span { background-color: #f5f5f5; border-color: #ccc; color: #555 !important; text-shadow: #fff 1px 1px !important; text-decoration: none !important; } .page-link .pages-title { background: none; border: 0 none; text-shadow: none !important; color: #555 !important; } .entry-thumb { margin-bottom: 10px; } .entry-thumb img { max-width: 100%; height: auto; width: auto; } #author-info { clear: both; overflow: hidden; padding-top: 10px; margin-top: 15px; border-top: 1px #eee solid; } #author-info a:hover { text-decoration: underline; } #author-avatar { float: left; width: 48px; } #author-avatar img { margin-top: 7px; } #author-description { float: left; width: 85%; margin-left: 15px; } #author-description h3 { font-size: 16px; font-family: Georgia, serif; font-weight: 300; } .entry-utility { clear: both; padding-top: 10px; margin-top: 15px; border-top: 1px #eee solid; line-height: 165%; } .entry-utility a:hover { text-decoration: underline; } .utility-title { font-weight: 700; } .sticky, .bypostauthor {} /* Posts: Grid */ .grid-col { float: left; margin: 0 1%; } .grid-col-2 { width: 48%; } .grid-col-3 { width: 31%; } .grid-col-4 { width: 23%; } .grid-horizontal-col-2 { width: 44%; } .grid-horizontal-col-3 { width: 27%; } .grid-horizontal-col-4 { width: 19%; } .grid-col article.post { padding: 10px !important; margin-bottom: 20px; } .grid-title { font-size: 18px; margin-bottom: 5px; } .grid-thumb img { max-width: 100%; height: auto; width: auto; } .grid-thumb { margin-bottom: 10px; } .grid-meta span { display: block; margin-top: 5px; } .grid-meta span:first-child { margin-top: 0; } .grid-meta .entry-comments { display: inline-block; margin-top: 5px; } .post-grid-horizontal { padding: 10px !important; margin: 0 1%; margin-bottom: 20px; min-height: 250px; display: -moz-inline-stack; display: inline-block; vertical-align: top; zoom: 1; *display: inline; _height: 250px; } /* Widget Area */ .widget { padding: 10px; margin-bottom: 20px; } .widget-title { font-size: 16px; color: #E47911; font-family: Georgia, serif; font-weight: 300; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px #ddd solid; } .widget a:hover { text-decoration: underline; color: #b42111; } .widget li { line-height: 165%; margin-top: 5px; } .widget ul ul { margin-left: 15px; list-style: square; list-style-position: inside; } #wp-calendar { width: 100%; } #wp-calendar td, #wp-calendar th, #wp-calendar caption { padding: 5px; text-align: center; } #wp-calendar td { background-color: #eee; } #wp-calendar th { background-color: #777; color: #fff; } #wp-calendar #prev { text-align: left; } #wp-calendar #next { text-align: right; } .widget #s { width: 55%; } .widget #searchsubmit { width: 35%; } .tagcloud a { margin-bottom: 5px; display: inline-block; font-size: 11px !important; background: #f5f5f5 url(images/button_bg.png) bottom left repeat-x; border: 1px #d5d5d5 solid; color: #666 !important; text-shadow: #fff 1px 1px; padding: 3px 8px; -moz-border-radius: 16px; -webkit-border-radius: 16px; border-radius: 16px; } .tagcloud a:hover { color: #fff !important; } /* Form elements */ input[type="text"], input[type="password"], textarea { border-color: #cecece; color: #777; } input[type="submit"], input[type="reset"], input[type="button"] { background: url(images/button_bg.png) bottom left repeat-x; color: #fff; } /* Navigation */ .navigation a, .single-navigation span a { font-family: Helvetica, Arial, sans-serif !important; background: #f5f5f5 url(images/button_bg.png) repeat-x top left; position:relative; overflow:visible; display:inline-block; padding: 7px; border: 1px #cecece solid; margin:0; text-decoration:none; text-shadow: 1px 1px 0 #fff; font-size: 11px; white-space:nowrap; cursor:pointer; outline:none; zoom:1; *display:inline; color: #555 !important; font-weight: 700; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; margin-right: 5px; } .navigation a:hover, .navigation .current, .single-navigation span a:hover { color: #fff !important; text-decoration: none !important; } #single-navigation { margin-bottom: 10px; background-color: #fff; padding: 10px 10px 20px; font-size: 84.8%; color: #666; border-bottom: 1px dashed #ddd; } #single-navigation a:hover { text-decoration: underline; color: #b42111; } /* Bread Crumbs */ #crumbs { margin-bottom: 10px; background-color: #fff; padding: 16px 10px; font-size: 13px; color: #888; font-weight: 700; border-bottom: 1px solid #ddd; } #crumbs a { color: #105CB6; } #crumbs a:hover { color: #b42111; } /* Images and alignment */ .alignnone { margin: 5px 20px 20px 0; } .aligncenter,div.aligncenter { display: block; margin: 5px auto; } .alignright { float: right; margin: 5px 0 20px 20px; } .alignleft { float: left; margin: 5px 20px 20px 0; } img.alignleft { margin: 10px 20px 5px 0 !important; display: inline; float: left; } img.alignright { margin: 10px 10px 5px 20px !important; display: inline; float: right; } img.aligncenter { margin: 10px auto !important; display: block; clear: both; } img.alignnone { /* not sure about this one */ } .entry-content img, .comment-content img, .widget img { max-width: 100%; } img[class*="align"], img[class*="wp-image-"], img[class*="attachment-"] { height: auto; } img.size-full, img.size-large { max-width: 100%; width: auto; height: auto; } .entry-content embed, .entry-content object, .entry-content iframe { max-width: 100%; } .gallery dl, .gallery dt { margin: 0; padding: 0; } .gallery-item { text-align: center; } .gallery-columns-1 .gallery-item { width: 100%; } .gallery-columns-2 .gallery-item { width: 46%; margin: 2%; } .gallery-columns-3 .gallery-item { width: 29%; margin: 2%; } .gallery-columns-4 .gallery-item { width: 21%; margin: 2%; } .gallery-columns-5 .gallery-item { width: 16%; margin: 2%; } .gallery-columns-6 .gallery-item { width: 12%; margin: 2%; } .gallery .gallery-item { float: left; } .entry-attachment { text-align: center; } .wp-caption { text-align: center; } .wp-caption, .entry-attachment { max-width: 100%; background: none !important; border: 0 none !important; padding: 0 !important; } .wp-caption img, .entry-attachment img, .gallery-thumb img, .gallery-item img { height: auto; background: #fff; border: 1px #ddd solid; padding: 4px; } .wp-caption .wp-caption-text, .entry-attachment .entry-caption p, .gallery .gallery-caption { font-size: 12px; margin-bottom: 10px; padding: 0 !important; word-wrap: break-word; line-height: 135%; margin-top: 5px; text-align: center; } /* Comments */ .comment-title-container { background-color: #fff; } .comment-title-container td { padding: 10px 20px; } .comments-title { font-family: Georgia, serif; font-size: 20px; font-weight: 300; color: #555; } .comments-write-link a { font-size: 13px; font-weight: 300; } .comments-write-link a:hover { text-decoration: underline; } .comment-navigation { margin-top: 30px; } .commentlist li { padding: 10px; background-color: #eef; margin-bottom: 20px;} .commentlist li li { background: none; border: 0 none; padding-bottom: 0; padding-right: 0; } .comment-meta a:hover { text-decoration: underline; } .comment-meta p { margin-top: 5px; } .comment-meta p:first-child { margin-top: 0; } .comment-reply, .edit-link, .comment-awaiting-moderation { font-size: 13px; } .comment-awaiting-moderation { font-family: Georgia, serif; font-style: italic; color: #333; font-size: 12px; font-weight: 700; } .comment-meta { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px #eee solid; } .comment-content, .pingback-content { line-height: 165%; overflow: hidden; } .comment-content a:hover, .pingback-content a:hover { text-decoration: underline; } .comment-content *, .pingback-content * { margin-bottom: 15px; line-height: 165%; } .comment-content *:last-child, .pingback-content *:last-child { margin-bottom: 0; } .comment-content .wp-smiley { margin-bottom: 0 !important; } .comment-content br { margin-bottom: 0 !important; } .comment-content h1 { font-size: 24px; } .comment-content h2 { font-size: 20px; } .comment-content h3 { font-size: 17px; } .comment-content h4 { font-size: 15px; } .comment-content h5 { font-size: 13px; } .comment-content h6 { font-size: 12px; } .comment-content li { margin-bottom: 10px; padding: 0; } .comment-content ul, .comment-content ul ul { list-style: disc; margin-left: 20px; } .comment-content ol { list-style: decimal; margin-left: 25px; } .comment-content ol ol { margin-left: 20px; } .comment-content ul ul, .comment-content ol ol { margin-top: 10px; } .comment-content ol ol { list-style: upper-alpha; } .comment-content ol ol ol { list-style: lower-roman; } .comment-content ol ol ol ol { list-style: lower-alpha; } .comment-content table { border: 1px #ccc solid; } .comment-content table td, .comment-content table th { border: 1px #ccc solid; padding: 5px; } .comment-content table th { background-color: #e5e5e5; font-weight: 700; text-shadow: #f5f5f5 1px 1px; } .comment-content table caption { border: 1px #ccc solid; padding: 5px; border-bottom: 0 none; } .nocomments, .nopassword { padding: 20px; background-color: #fff; border: 1px #cecece solid; margin-top: 30px; } /* Comment Form */ #respond { padding: 0 10px 20px; background-color: #fff; margin-top: 30px; } .form-allowed-tags { display: none; } #reply-title { font-family: Georgia, serif; font-size: 20px; font-weight: 300; margin-bottom: 0; line-height:100%; } #cancel-comment-reply-link { display: block; line-height: 100%; width: 100px; font-size: 12px; font-weight: 300; margin-top: 10px; display: block; } #commentform p { margin-top: 10px; } #commentform input, #commentform textarea { margin-top: 5px; display: block; } #commentform label { font-weight: 700; } .commentlist li #respond { border-color: #e5e5e5 !important; } /* Footer */ footer[role="contentinfo"] { background: #2B6695; font-size: 13px; color: #FFFFFF; text-shadow: #000 1px 1px; } footer[role="contentinfo"] .wrapper { padding: 20px 0; } /* ads */ #text-3 { text-align: center; padding: 10px 0; } #entry-ads { margin:0 0 5px -15px; width:728px; } /* p indent .entry-content-single p { text-indent: 2em; }*/
01happy-blog
trunk/myblog/wp-content/themes/themolio/style.css
CSS
oos
19,633
/* IE Specific Styling */ .entry-content .last, .comment-content .last, .pingback-content .last { margin-bottom: 0; }
01happy-blog
trunk/myblog/wp-content/themes/themolio/ie.css
CSS
oos
118
<?php /** * @package Themolio */ ?> <?php /** * Setting the content width based on theme's layout */ if(!isset($content_width)) $content_width = 740; /** * Calling the theme options template and retrieving the theme options */ require(get_template_directory().'/admin/theme-options.php'); $themolio_options = themolio_get_options(); $themolio_is_mobile = themolio_is_mobile(); /** * Telling wordpress to run themolio_setup whenever "after_setup_theme" hook is run */ add_action('after_setup_theme', 'themolio_setup'); if (!function_exists('themolio_setup')): function themolio_setup() { /* Make Themolio available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Themolio, use a find and replace * to change 'themolio' to the name of your theme in all the template files. */ load_theme_textdomain('themolio', get_template_directory().'/languages' ); add_editor_style(); add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); /** * This sets up the image size for the grid based top-down layouts (with no sidebar). * If you change the width/height of your content, * you will have to modify the width and height mentioned below as well */ add_image_size('themolio-two-col-grid-image-nosidebar',460,300,true); add_image_size('themolio-three-col-grid-image-nosidebar',290,200,true); add_image_size('themolio-four-col-grid-image-nosidebar',210,150,true); /** * This sets up the image size for the grid based top-down layouts (with sidebar). * If you change the width/height of your content, * you will have to modify the width and height mentioned below as well */ add_image_size('themolio-two-col-grid-image-sidebar',356,250,true); add_image_size('themolio-three-col-grid-image-sidebar',230,150,true); add_image_size('themolio-four-col-grid-image-sidebar',171,110,true); /** * This sets up the image size for the featured image. * If you change the width/height of your content, * you will have to modify the width and height mentioned below as well */ add_image_size('themolio-featured-image',800,300,true); register_nav_menu('primary', __('Primary Menu', 'themolio')); add_theme_support('post-formats', array('link', 'gallery', 'status', 'quote', 'image', 'video')); if(themolio_is_wp_version('3.4')) { add_theme_support('custom-background'); } else { add_custom_background(); } } endif; /** * Checks the version of WP */ function themolio_is_wp_version($is_ver) { $wp_ver = explode('.', get_bloginfo('version')); $is_ver = explode('.', $is_ver); for($i=0; $i<=count($is_ver); $i++) if(!isset($wp_ver[$i])) array_push($wp_ver, 0); foreach($is_ver as $i => $is_val) if($wp_ver[$i] < $is_val) return false; return true; } /** * This removes the default gallery styling applied by wordpress */ add_filter('use_default_gallery_style', '__return_false'); /** * Default menu to use if custom menu is not used */ function themolio_page_menu_args($args) { $args['show_home'] = false; $args['menu_class'] = 'main-menu clearfix'; return $args; } add_filter('wp_page_menu_args', 'themolio_page_menu_args'); /** * Enqueue javascript files required by theme */ function themolio_enqueue_head_scripts() { global $themolio_options; if(is_admin()) return; if(is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); wp_enqueue_script('jquery'); wp_register_script('themolio-theme-js', get_template_directory_uri().'/js/themolio.js','jquery'); wp_enqueue_script('themolio-dropdown-js'); wp_enqueue_script('themolio-browser-detect-js'); wp_enqueue_script('themolio-theme-js'); } add_action('wp_enqueue_scripts', 'themolio_enqueue_head_scripts'); /** * Add style statements to the head */ function themolio_enqueue_styles() { global $themolio_is_mobile; $style = ""; $style .= '<!--[if IE]> <link rel="stylesheet" type="text/css" media="all" href="'.get_template_directory_uri().'/ie.css" /> <![endif]-->'."\n"; $style .= '<link rel="stylesheet" type="text/css" media="all" href="'.get_template_directory_uri().'/fonts/stylesheet.css" />'."\n"; $style .= '<style type="text/css">'."\n"; $style .= themolio_typography(); $style .= themolio_background_color_styling(); $style .= '</style>'."\n"; if($themolio_is_mobile) $style .= '<link rel="stylesheet" type="text/css" media="all" href="'.get_template_directory_uri().'/mobile.css" />'."\n"; echo $style; } add_action('wp_head','themolio_enqueue_styles'); /** * Custom Typography Styling */ function themolio_typography() { global $themolio_options; $style = ""; $style .= "\t".'body, #cancel-comment-reply-link { font-family: '.$themolio_options['content_font'].'; }'."\n"; $style .= "\t".'.entry-content, .widget, #author-info, .entry-utility, .comment-meta, .comment-content, .pingback-content, #respond, .nocomments, .nopassword { color: #'.$themolio_options['font_color'].'; font-size: '.$themolio_options['font_size'].'%; }'."\n"; $style .= "\t".'.entry-meta a, .entry-content a, .widget a, #author-info a, .entry-utility a, .comments-write-link a, .comment-meta a, .comment-content a, .pingback-content a, #respond a, #single-navigation a { color: #'.$themolio_options['link_color'].'; }'."\n"; $style .= "\t".'.more-link:hover, .page-link a:hover span, .page-link span, .navigation a:hover, .navigation .current, .single-navigation span a:hover, .tagcloud a:hover { text-decoration: none; background-color: #'.$themolio_options['button_color'].'; text-shadow: #'.themolio_color_darken($themolio_options['button_color'],50).' 1px 1px !important; border-color: #'.themolio_color_darken($themolio_options['button_color'],50).'; }'."\n"; $style .= "\t".'input[type="submit"], input[type="reset"], input[type="button"] { background-color: #'.$themolio_options['button_color'].'; text-shadow: #'.themolio_color_darken($themolio_options['button_color'],50).' 1px 1px !important; border-color: #'.themolio_color_darken($themolio_options['button_color'],50).'; }'."\n"; $style .= "\t".'input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover { background-color: #'.themolio_color_darken($themolio_options['button_color'],30).'; text-shadow: #'.themolio_color_darken($themolio_options['button_color'],80).' 1px 1px !important; border-color: #'.themolio_color_darken($themolio_options['button_color'],80).'; }'."\n"; return $style; } /** * Border color adjustment based on background color */ function themolio_background_color_styling() { global $themolio_options; $bgcolor = get_theme_mod('background_color'); $bgimage = get_theme_mod('background_image'); $style = ''; if((trim($bgcolor) != '' and trim($bgimage) != '') or (trim($bgcolor) != '' and trim($bgimage) == '')) { $style .= "\t".'article.post, article.page, article.type-attachment, .widget, #crumbs, .navigation a, .single-navigation span a, .comment-title-container, .commentlist li, #respond, .nocomments, .nopassword { border-color: #'.themolio_color_darken($bgcolor,30).'; }'."\n"; } else if(trim($bgimage) != '' and trim($bgcolor) == '') { $style .= "\t".'article.post, article.page, article.type-attachment, .widget, #crumbs, .navigation a, .single-navigation span a, .comment-title-container, .commentlist li, #respond, .nocomments, .nopassword, #single-navigation { border-color: #fff; box-shadow: 2px 2px 1px 1px #444444; }'."\n"; $style .= "\t".'.commentlist .children li { box-shadow: none; }'."\n"; } return $style; } /** * Setting global variable to maintain the count of items in the grid * Do not modify this function */ $themolio_grid_item_count = 1; function themolio_grid_item_count_incr() { global $themolio_grid_item_count; $themolio_grid_item_count++; } function themolio_grid_col_class() { global $themolio_options; if($themolio_options['grid_columns'] == 2) echo ' grid-col-2'; elseif($themolio_options['grid_columns'] == 3) echo ' grid-col-3'; elseif($themolio_options['grid_columns'] == 4) echo ' grid-col-4'; } /** * Register sidebars and widgetized areas */ function themolio_widgets_init() { register_sidebar(array( 'name' => __('Main Sidebar', 'themolio'), 'id' => 'sidebar-1', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', )); } add_action('widgets_init', 'themolio_widgets_init'); /** * Prints HTML with meta information for the current post-date/time and author. * Create your own themolio_posted_on to override in a child theme */ if (!function_exists('themolio_posted_on')): function themolio_posted_on() { $tag_list = get_the_tag_list('', __(', ', 'themolio')); $string = '<span class="entry-date">发表时间:'.esc_html(get_the_date()).'</span> | <span class="entry-author">作者:'.get_the_author().'</span> | <span class="entry-category">所属分类:'.get_the_category_list(__(', ', 'themolio')).'</span>'; if($tag_list != "") $string .= ' | <span class="entry-category">标签:'.$tag_list.'</span>'; print __($string, 'themolio' ); } endif; /** * Sets the post excerpt length to 40 words. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. */ function themolio_excerpt_length($length) { return 40; } add_filter('excerpt_length', 'themolio_excerpt_length'); /** * Returns a "Continue Reading" link for excerpts */ function themolio_continue_reading_link() { return '<p><a class="more-link" href="'.esc_url(get_permalink()).'">'.__('阅读全文', 'themolio').'</a></p>'; } /** * Replaces "[...]" (appended to automatically generated excerpts) with a themolio_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function themolio_auto_excerpt_more($more) { return themolio_continue_reading_link(); } add_filter('excerpt_more', 'themolio_auto_excerpt_more'); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function themolio_custom_excerpt_more( $output ) { if(has_excerpt() && !is_attachment()) { $output .= themolio_continue_reading_link(); } return $output; } add_filter('get_the_excerpt', 'themolio_custom_excerpt_more'); function reset_excerpt_length($length) { //if (is_home()) //return $length; return 100; } add_filter('excerpt_length', 'reset_excerpt_length'); function get_left_sidebar(){ $output = '<div id="primary_left" class="widget-left-area" role="complementary"><aside id="themolio-archives" class="widget widget_archives"><h3 class="widget-title">分类目录</h3><ul id="recentcomments">'; $obj = new Walker_Category(); $categories = get_categories(); foreach ($categories as $category) { $obj->start_el($output, $category, 0, array('style'=>'list')); } $output .= '</ul></aside></div>'; echo $output; } /** * Create pagination link for posts */ function themolio_get_pagination($range = 4){ global $paged, $wp_query; $max_page = 0; if (!$max_page) { $max_page = $wp_query->max_num_pages; } if($max_page > 1){ echo '<div class="navigation clearfix">'."\n"; if(!$paged){ $paged = 1; } if($paged != 1){ echo "<a href=".get_pagenum_link(1).">".__('第一页','themolio')."</a>"; } previous_posts_link(' &laquo; '); if($max_page > $range){ if($paged < $range){ for($i = 1; $i <= ($range + 1); $i++){ echo "<a href='".get_pagenum_link($i) ."'"; if($i==$paged) echo " class='current'"; echo ">".number_format_i18n($i)."</a>"; } } elseif($paged >= ($max_page - ceil(($range/2)))){ for($i = $max_page - $range; $i <= $max_page; $i++){ echo "<a href='".get_pagenum_link($i) ."'"; if($i==$paged) echo " class='current'"; echo ">".number_format_i18n($i)."</a>"; } } elseif($paged >= $range && $paged < ($max_page - ceil(($range/2)))){ for($i = ($paged - ceil($range/2)); $i <= ($paged + ceil(($range/2))); $i++){ echo "<a href='".get_pagenum_link($i) ."'"; if($i==$paged) echo " class='current'"; echo ">".number_format_i18n($i)."</a>"; } } } else{ for($i = 1; $i <= $max_page; $i++){ echo "<a href='".get_pagenum_link($i) ."'"; if($i==$paged) echo " class='current'"; echo ">".number_format_i18n($i)."</a>"; } } next_posts_link(' &raquo; '); if($paged != $max_page){ echo " <a href=".get_pagenum_link($max_page).">".__('最后页','themolio')."</a>"; } echo '</div>'."\n"; } } /** * Displays breadcrumbs */ function themolio_breadcrumbs() { //$delimiter = '<span class="sep">&raquo;</span>'; $delimiter = '&gt;'; $home = __('首页','themolio'); // text for the 'Home' link $before = '<span class="current">'; // tag before the current crumb $after = '</span>'; // tag after the current crumb if (!is_home() && !is_front_page() || is_paged()) { echo '<div id="crumbs">'; global $post; $homeLink = home_url(); echo '<a href="'.$homeLink.'">'.$home.'</a> '.$delimiter.' '; if (is_category()) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent); if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' '.$delimiter.' ')); //echo $before.__('Archive by category','themolio').' "'.single_cat_title('', false).'"'.$after; if (get_query_var('paged')) { echo $before.single_cat_title('', false) . ' 第' . get_query_var('paged') . '页' . $after; } else { echo $before.single_cat_title('', false).$after; } } elseif (is_day()) { echo '<a href="'.get_year_link(get_the_time('Y')).'">'.get_the_time('Y').'</a> '.$delimiter.' '; echo '<a href="'.get_month_link(get_the_time('Y'),get_the_time('m')).'">'.get_the_time('F').'</a> '.$delimiter.' '; echo $before.get_the_time('d').$after; } elseif (is_month()) { echo '<a href="'.get_year_link(get_the_time('Y')).'">'.get_the_time('Y').'</a> '.$delimiter.' '; echo $before.get_the_time('F').$after; } elseif (is_year()) { echo $before.get_the_time('Y').$after; } elseif (is_single() && !is_attachment()) { if (get_post_type() != 'post') { $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; echo '<a href="'.$homeLink.'/'.$slug['slug'].'/">'.$post_type->labels->singular_name.'</a> '.$delimiter.' '; echo $before.get_the_title().$after; } else { $cat = get_the_category(); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' '.$delimiter.' '); echo $before.get_the_title().$after; } } elseif (is_attachment()) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' '.$delimiter.' '); echo '<a href="'.get_permalink($parent).'">'.$parent->post_title.'</a> '.$delimiter.' '; echo $before.get_the_title().$after; } elseif (is_page() && !$post->post_parent) { echo $before.get_the_title().$after; } elseif (is_page() && $post->post_parent) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '<a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>'; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach ($breadcrumbs as $crumb) echo $crumb.' '.$delimiter.' '; echo $before.get_the_title().$after; } elseif (is_search()) { echo $before.__('搜索"'.get_search_query().'"结果','themolio').$after; } elseif (is_tag()) { echo $before.' '.single_tag_title('', false).$after; } elseif (is_author()) { global $author; $userdata = get_userdata($author); echo $before.__('Articles posted by','themolio').' '.$userdata->display_name.$after; } elseif (is_404()) { echo $before.__('Error 404','themolio').' '. $after; } /* if (get_query_var('paged')) { if (is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ' ('; echo __('Page','themolio').' '.get_query_var('paged'); if (is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ')'; } */ echo "</div>\n"; } } /** * Displays Author's description on Single post templates */ function themolio_post_author_info() { global $themolio_options; // If a user has filled out their description and this is a multi-author blog, show a bio on their entries if(get_the_author_meta('description') && (!function_exists('is_multi_author') || is_multi_author())) { ?> <div id="author-info" class="clearfix"> <div id="author-avatar"> <?php echo get_avatar(get_the_author_meta('user_email'), apply_filters('themolio_author_bio_avatar_size', 48)); ?> </div> <div id="author-description"> <h3><?php printf(__('About %s', 'themolio'), get_the_author()); ?></h3> <p><?php the_author_meta('description'); ?></p> <p> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" rel="author"><?php printf(__('View all posts by %s <span class="meta-nav">&rarr;</span>', 'themolio'), get_the_author()); ?></a> </p> </div> </div> <?php } } /** * Prints HTML with post category and tags. */ function themolio_utility() { global $themolio_options; $utility_text = ""; $categories_list = get_the_category_list(__(', ', 'themolio')); $tag_list = get_the_tag_list('', __(', ', 'themolio')); if($categories_list != "") $utility_text .= '<p><span class="utility-title">'.__('所属分类: ','themolio').'</span>'.$categories_list.'</p>'; if($tag_list != "") $utility_text .= '<p><span class="utility-title">'.__('标签: ','themolio').'</span>'.$tag_list.'</p>'; if($utility_text != "" and $themolio_options['show_single_utility']) { echo '<div class="entry-utility">'; echo $utility_text; echo '</div>'; } } /** * Outputs pages in dropdown (used for mobile displays) */ function themolio_pages_dropdown() { ?> <select id="themolio_page_dropdown" name="themolio_page_dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php _e('Select page','themolio'); ?></option> <?php $pages = get_pages(); foreach ($pages as $page) { $option = '<option value="'.get_page_link($page->ID).'">'; $option .= $page->post_title; $option .= '</option>'; echo $option; } ?> </select> <?php } /** * Function to return darker color shade */ function themolio_color_darken($color, $dif=80){ $color = str_replace('#', '', $color); if (strlen($color) != 6){ return '000000'; } $rgb = ''; for ($x=0;$x<3;$x++){ $c = hexdec(substr($color,(2*$x),2)) - $dif; $c = ($c < 0) ? 0 : dechex($c); $rgb .= (strlen($c) < 2) ? '0'.$c : $c; } return $rgb; } if(!function_exists('themolio_comment')): /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own themolio_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. */ function themolio_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch($comment->comment_type): case 'pingback': case 'trackback': ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> <article id="comment-<?php comment_ID(); ?>" class="pingback"> <div class="pingback-content"> <?php _e('Pingback:', 'themolio'); ?> <?php comment_author_link(); ?><?php edit_comment_link(__('Edit', 'themolio'), '<p class="pingback-edit-link">', '</p>'); ?> </div> </article> <?php break; default: ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> <article id="comment-<?php comment_ID(); ?>" class="comment"> <div class="comment-meta"> <table class="tablayout"><tr> <td class="tdleft" style="width:55px;vertical-align:top;"><?php echo get_avatar($comment, '40'); ?></td> <td class="tdleft" style="vertical-align:top;"> <p class="comment-author"><?php printf(__('<strong>%1$s</strong> %2$s <span class="says">说:</span>', 'themolio'), sprintf('<span class="fn">%s</span>', get_comment_author_link()), sprintf('<a href="%1$s">%2$s</a>', esc_url(get_comment_link($comment->comment_ID)), sprintf(__('%1$s %2$s', 'themolio'), get_comment_date(), get_comment_time()))); ?></p> <?php comment_reply_link(array_merge($args, array('reply_text' => __('回复', 'themolio'), 'before' => '<p class="comment-reply">', 'after' => '</p>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> <?php edit_comment_link( __('编辑', 'themolio'), '<p class="edit-link">', '</p>'); ?> <?php if($comment->comment_approved == '0'): ?> <p class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'themolio'); ?></p> <?php endif; ?> </td> </tr></table> </div> <div class="comment-content"><?php comment_text(); ?></div> </article> <?php break; endswitch; } endif; function themolio_is_mobile() { $useragent = $_SERVER['HTTP_USER_AGENT']; if(preg_match('/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|meego.+mobile|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))) return true; else return false; } ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/functions.php
PHP
oos
26,081
/* Themolio JavaScript */ jQuery(document).ready(function() { jQuery('.entry-content *:last-child').addClass('last'); jQuery('.comment-content *:last-child').addClass('last'); jQuery('.pingback-content *:last-child').addClass('last'); jQuery('.comments-write-link a').click(function() { jQuery('.commentlist').toggle(); }); });
01happy-blog
trunk/myblog/wp-content/themes/themolio/js/themolio.js
JavaScript
oos
365
jQuery(document).ready(function() { jQuery('.main-menu ul li').has('ul').addClass('hasDownChild'); jQuery('.main-menu ul ul li').has('ul').addClass('hasRightChild'); jQuery('.main-menu ul li').hover(function() { jQuery(this).find('ul:first').css({visibility:"visible",display:"none"}).fadeIn(300); }, function() { jQuery(this).find('ul:first').hide(); }); });
01happy-blog
trunk/myblog/wp-content/themes/themolio/js/dropdown.js
JavaScript
oos
412
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_is_mobile; ?> <?php get_header(); ?> <?php if($themolio_is_mobile) { $containerclass = ' fullcontainer'; } else { $containerclass = ''; } ?> <?php get_left_sidebar(); ?> <div class="container<?php echo $containerclass; ?>"> <?php themolio_breadcrumbs(); ?> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <?php get_template_part('content', 'single'); ?> <div id="single-navigation"> <span class="nav-previous">上一篇:<?php previous_post_link('%link', '%title'); ?></span><br /><br /> <span class="nav-next">下一篇:<?php next_post_link('%link', '%title'); ?></span> </div> <?php comments_template('', true); ?> <?php endwhile; ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php if(!$themolio_is_mobile): ?> <?php get_sidebar(); ?> <?php endif; ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/single.php
PHP
oos
1,371
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_is_mobile; ?> <?php get_header(); ?> <?php if($themolio_is_mobile) { $containerclass = ' fullcontainer'; } else { $containerclass = ''; } ?> <?php get_header(); ?> <?php get_left_sidebar(); ?> <div class="container<?php echo $containerclass; ?>"> <?php themolio_breadcrumbs(); ?> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <?php get_template_part('content', get_post_format()); ?> <?php endwhile; ?> <?php themolio_get_pagination(); ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php if(!$themolio_is_mobile): ?> <?php get_sidebar(); ?> <?php endif; ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/archive.php
PHP
oos
1,110
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><?php the_title(); ?></h2> <div class="entry-meta"> <?php themolio_posted_on(); ?> </div> <div class="entry-content entry-content-single"> <?php the_content(__('Continue reading', 'themolio')); ?> <?php wp_link_pages(array('before' => '<div class="page-link clearfix"><span class="pages-title">'.__('Pages:','themolio').'</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?> </div> <?php themolio_post_author_info(); ?> </article>
01happy-blog
trunk/myblog/wp-content/themes/themolio/content-single.php
PHP
oos
689
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><?php the_title(); ?></h2> <?php if($themolio_options['show_page_meta']): ?> <div class="entry-meta"> <?php themolio_posted_on(); ?> <p> <?php if(comments_open() && ! post_password_required()) : ?> <?php comments_popup_link(__('Reply', 'themolio'), _x('1 Comment', 'comments number', 'themolio'), _x('% Comments', 'comments number', 'themolio'), 'entry-comments'); ?> <?php endif; ?> </p> </div> <?php endif; ?> <div class="entry-content"> <?php the_content(__('Continue reading', 'themolio')); ?> <?php wp_link_pages(array('before' => '<div class="page-link clearfix"><span class="pages-title">'.__('Pages:','themolio').'</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?> </div> </article>
01happy-blog
trunk/myblog/wp-content/themes/themolio/content-page.php
PHP
oos
1,014
/* Stylesheet for Editor */ /*************************/ html .mceContentBody { max-width: 584px; } * { color: inherit; font-family: "Helvetica Nue", Arial, sans-serif; font-style: inherit; font-weight: inherit; } body { color: #666; font-family: "Helvetica Nue", Arial, sans-serif; } h1, h2, h3, h4, h5, h6 { clear: both; word-wrap: break-word; line-height: 165%; padding-bottom: 10px; font-weight: 700; color: #000; border-bottom: 1px solid #d6d6d6; margin: 2em 0 1em; } a:link, a:visited, a:active { color: #ff8000; text-decoration: underline; -moz-transition: all 0.2s ease-out; -webkit-transition: all 0.2s ease-out; transition: all 0.2s ease-out; } a:hover, a:focus { color: #0080ff; } h1 { font-size: 2.4em; border-bottom: 3px double #d6d6d6; margin: 0 0 .75em; } h2 { font-size: 2em; } h3 { font-size: 1.8em; } h4 { font-size: 1.6em; } h5 { font-size: 1.4em; } h6 { font-size: 1.3em; } p { margin-bottom: 1em; font-size: 1.3em; line-height: 1.5em; } ul, ol { margin: 0 0 1em 30px; } li ul, li ol { margin: 5px 0 .5em 30px; } li { margin-bottom: 5px; font-size: 1.3em; line-height: 1.5em; } li li, li p { font-size: 1em; } ul li { list-style-type: square; } ol li { list-style-type: decimal; } blockquote em,blockquote i,blockquote cite { font-style: normal; } blockquote { padding-left: 15px; margin-left: 15px; border-left: 5px #ddd solid; font-family: Georgia, serif; font-style: italic; } sup,sub { height: 0; line-height: 1; vertical-align: baseline; position: relative; } sup { bottom: 1ex; } sub { top: .5ex; } dt,strong, b { font-weight: 700; } em, i { font-style: italic; } abbr, .abbr, acronym { border-bottom: 1px dotted; cursor: help; } address { display: block; margin: 0 0 0 1.625em; } cite,em,i { font-style: italic; } del, strike, s { text-decoration: line-through; } ins { text-decoration: none; background-color: #feeeaf; } a img { border: 0; } .wp-caption { text-align: center; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; background: #fff; -moz-box-shadow: 0 1px 5px #999; -webkit-box-shadow: 0 1px 5px #999; box-shadow: 0 1px 5px #999; padding: 0.8064516%; } .wp-caption img { margin-bottom: 0.8064516%; background: transparent; border: none; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; padding: 0; } .wp-caption p { font-size: 1.2em; color: #666; margin: 0 0.8064516%; } img { max-width: 98.3870968%; height: auto; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; background: #fff; -moz-box-shadow: 0 1px 5px #999; -webkit-box-shadow: 0 1px 5px #999; box-shadow: 0 1px 5px #999; padding: 0.8064516%; } .aligncenter { margin: 0 auto 20px; } .alignnone { margin: 0 0 20px; } table { width: 100%; font-size: 1.3em; margin: 0 0 1.5em; } table th, table td { -moz-transition: all 0.2s ease-out; -webkit-transition: all 0.2s ease-out; transition: all 0.2s ease-out; padding: 10px; } table th { font-weight: 700; border-bottom: 3px double #d6d6d6; } table td { border-bottom: 1px solid #d6d6d6; } table tr:nth-child(odd) td { background: #f6f6f6; } table th:nth-child(2), table td:nth-child(2) { text-align: center; } table th:nth-child(3), table td:nth-child(3) { text-align: right; } table tr:hover td { background: #e6e6e6; } .alignleft, img[align $='left'] { float: left; display: inline; margin: 5px 15px 15px 0; } .alignright, img[align $='right'] { float: right; display: inline; margin: 5px 0 15px 15px; }
01happy-blog
trunk/myblog/wp-content/themes/themolio/editor-style.css
CSS
oos
3,525
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_is_mobile; ?> <?php get_header(); ?> <?php if(($themolio_options['blog_style'] == 'grid' and !$themolio_options['show_sidebar_grid']) or $themolio_is_mobile) { $containerclass = ' fullcontainer'; } else { $containerclass = ''; } ?> <?php get_left_sidebar(); ?> <div class="container<?php echo $containerclass; ?>"> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <?php if($themolio_options['blog_style'] == 'grid' and !$themolio_is_mobile): ?> <?php if($themolio_options['grid_layout'] == 'top-bottom'): ?> <?php get_template_part('content', 'grid-top-bottom'); ?> <?php elseif($themolio_options['grid_layout'] == 'left-right'): ?> <?php get_template_part('content', 'grid-left-right'); ?> <?php endif; ?> <?php else: ?> <?php get_template_part('content', get_post_format()); ?> <?php endif; ?> <?php endwhile; ?> <?php if($themolio_options['blog_style'] == 'grid' and $themolio_options['grid_layout'] == 'top-bottom'): ?> </div><div class="clear"></div> <?php endif; ?> <?php themolio_get_pagination(8); ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php if((($themolio_options['blog_style'] == 'grid' and $themolio_options['show_sidebar_grid']) or $themolio_options['blog_style'] != 'grid') and !$themolio_is_mobile): ?> <?php get_sidebar(); ?> <?php endif; ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/index.php
PHP
oos
1,977
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> <?php get_header(); ?> <div class="fullcontainer"> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Error! Page not found','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <script type='text/javascript' src='http://www.01happy.com/gongyi/js/main.js'></script> </div> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/404.php
PHP
oos
609
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_grid_item_count; ?> <?php if($themolio_grid_item_count == 1): ?><div class="grid-col<?php themolio_grid_col_class(); ?>"><?php endif; ?> <article id="post-<?php the_ID(); ?>" <?php post_class('post-grid'); ?>> <?php if(trim(get_the_post_thumbnail($post->ID)) != '' and $themolio_options['show_featured']): ?> <div class="grid-thumb"> <a href="<?php the_permalink(); ?>"> <?php if($themolio_options['grid_columns'] == 2 and !$themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-two-col-grid-image-nosidebar'); elseif($themolio_options['grid_columns'] == 3 and !$themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-three-col-grid-image-nosidebar'); elseif($themolio_options['grid_columns'] == 4 and !$themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-four-col-grid-image-nosidebar'); elseif($themolio_options['grid_columns'] == 2 and $themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-two-col-grid-image-sidebar'); elseif($themolio_options['grid_columns'] == 3 and $themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-three-col-grid-image-sidebar'); elseif($themolio_options['grid_columns'] == 4 and $themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-four-col-grid-image-sidebar'); ?> </a> </div> <?php endif; ?> <h2 class="entry-title grid-title"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'themolio'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta grid-meta"> <?php themolio_posted_on(); ?> </div> <div class="entry-content"> <?php the_excerpt(); ?> </div> </article> <?php if(($themolio_grid_item_count % ceil(get_option('posts_per_page')/$themolio_options['grid_columns'])) == 0): ?> </div><div class="grid-col<?php themolio_grid_col_class(); ?>"> <?php endif; ?> <?php themolio_grid_item_count_incr(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/content-grid-top-bottom.php
PHP
oos
2,229
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_is_mobile; ?> <?php get_header(); ?> <?php if($themolio_is_mobile) { $containerclass = ' fullcontainer'; } else { $containerclass = ''; } ?> <?php get_left_sidebar(); ?> <div class="container<?php echo $containerclass; ?>"> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <?php get_template_part('content', 'page'); ?> <?php comments_template('', true); ?> <?php endwhile; ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php if(!$themolio_is_mobile): ?> <?php get_sidebar(); ?> <?php endif; ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/page.php
PHP
oos
1,043
<?php /** * @package Themolio */ ?> <?php /* THEME SETTINGS PAGE */ /***********************/ //Initialize theme options on load function themolio_init_options() { if(false === themolio_get_options()) add_option('themolio_options', themolio_get_default_options()); register_setting('themolio_options', 'themolio_options', 'themolio_validate_options'); } add_action('admin_init', 'themolio_init_options'); //Retrieve theme options function themolio_get_options() { return get_option('themolio_options', themolio_get_default_options()); } //Return capability function themolio_page_capability($capability) { return 'edit_theme_options'; } add_filter('option_page_capability_themolio_options', 'themolio_page_capability'); //Enqueue stylesheets and dependent javascripts function themolio_enqueue_scripts($hook_suffix) { wp_enqueue_script('jquery'); wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); wp_enqueue_script('themolio_color_picker', get_template_directory_uri().'/admin/jquery-colorpicker/jscolor.js', false, false); wp_enqueue_script('themolio_admin_js', get_template_directory_uri().'/admin/theme-options.js', array('jquery'), false); wp_enqueue_style('themolio_admin_css', get_template_directory_uri().'/admin/theme-options.css', false, false, 'all'); } //Add theme option page to the admin menu function themolio_activate_options() { $themolio_theme_page = add_theme_page(__('Themolio Settings','themolio'), __('Themolio Settings','themolio'), 'edit_theme_options', 'themolio_options', 'themolio_options_page'); if(!$themolio_theme_page) return; add_action('admin_print_styles-' . $themolio_theme_page, 'themolio_enqueue_scripts'); } add_action('admin_menu', 'themolio_activate_options'); //Default dropdowns function themolio_tab_list() { $tabs = array( 'typography' => array('value' => 'typography', 'label' => __('Fonts & Colors','themolio')), 'logo' => array('value' => 'logo', 'label' => __('Logo & Favicon','themolio')), 'layout' => array('value' => 'layout', 'label' => __('Layout','themolio')), 'blog' => array('value' => 'blog', 'label' => __('Blog','themolio')), 'social' => array('value' => 'social', 'label' => __('Social','themolio')), ); return apply_filters('themolio_tab_list', $tabs); } function themolio_content_fonts() { $fonts = array( 'Helvetica, Arial, sans-serif' => array('value' => 'Helvetica, Arial, sans-serif', 'label' => __('Helvetica, Arial','themolio')), 'Georgia, serif' => array('value' => 'Georgia, serif', 'label' => __('Georgia','themolio')), 'Verdana' => array('value' => 'Verdana', 'label' => __('Verdana','themolio')), ); return apply_filters('themolio_content_fonts', $fonts); } function themolio_grid_columns() { $number_of_columns = array( '2' => array('value' => '2', 'label' => __('Two','themolio')), '3' => array('value' => '3', 'label' => __('Three','themolio')), '4' => array('value' => '4', 'label' => __('Four','themolio')) ); return apply_filters('themolio_grid_columns', $number_of_columns); } function themolio_grid_layout() { $grid_layout = array( 'top-bottom' => array('value' => 'top-bottom', 'label' => __('Top to Bottom','themolio')), 'left-right' => array('value' => 'left-right', 'label' => __('Left to Right','themolio')) ); return apply_filters('themolio_grid_layout', $grid_layout); } function themolio_blog_style() { $blog_styles = array( 'standard' => array('value' => 'standard', 'label' => __('Standard','themolio')), 'grid' => array('value' => 'grid', 'label' => __('Grid','themolio')) ); return apply_filters('themolio_blog_style', $blog_styles); } //Retrieve Default theme settings function themolio_get_default_options() { $themolio_default_options = array( 'content_font' => 'Helvetica, Arial, sans-serif', 'font_size' => 83.3, 'font_color' => '666666', 'link_color' => 'E3940B', 'button_color' => 'E65343', 'custom_favicon' => '', 'custom_logo' => '', 'blog_style' => 'grid', 'show_sidebar_grid' => false, 'show_search' => true, 'show_excerpt' => false, 'show_featured' => false, 'show_single_utility' => true, 'show_page_meta' => false, 'grid_columns' => 3, 'grid_layout' => 'top-bottom', 'facebook_user' => '', 'twitter_user' => '', 'enable_rss' => true ); return apply_filters('themolio_get_default_options', $themolio_default_options); } function themolio_options_page() { if(isset($_POST['settings-reset'])) { delete_option('themolio_options'); add_settings_error('themolio_options','settings-reset-update',__('Default settings restored','themolio'),'updated'); } ?> <div class="wrap"> <!-- Start of wrap --> <?php screen_icon(); ?> <?php $theme_name = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme(); ?> <h2><?php printf(__('%s Theme Options', 'themolio'), $theme_name); ?></h2> <?php settings_errors(); ?> <!-- Tabs --> <?php $count = 1; ?> <h2 class="nav-tab-wrapper"> <?php foreach (themolio_tab_list() as $tab) { if($count == 1) $class = " nav-tab-active"; else $class = ""; ?> <a href="javascript:void(0)" id="nav-tab-<?php echo $tab['value']; ?>" class="nav-tab<?php echo $class; ?>"> <?php echo $tab['label']; ?> </a> <?php $count++; } ?> </h2> <div class="clear"></div> <form class="settings-form" method="post" id="settings-form" action="options.php"> <?php settings_fields('themolio_options'); $themolio_options = themolio_get_options(); $themolio_default_options = themolio_get_default_options(); ?> <div class="settings-section current-section" id="settings-typography"> <p> <label><?php _e('Content Font','themolio'); ?>:</label> <select name="themolio_options[content_font]"> <?php foreach (themolio_content_fonts() as $content_font) { ?> <option value="<?php echo $content_font['value']; ?>" <?php selected($themolio_options['content_font'], $content_font['value']); ?>><?php echo $content_font['label']; ?></option> <?php } ?> </select> </p> <p> <label><?php _e('Content Font Size','themolio'); ?>:</label> <input style="font-weight: 700;font-size:15px;" type="button" value=" - " id="font_size_decr_btn"/> <input type="text" readonly="readonly" name="themolio_options[font_size]" id="font_size" value="<?php echo esc_attr($themolio_options['font_size']); ?>"/> % <input style="font-weight: 700;font-size:15px;" type="button" value=" + " id="font_size_incr_btn"/> </p> <p> <label><?php _e('Font color','themolio'); ?>:</label> <input type="text" name="themolio_options[font_color]" class="color" value="<?php echo esc_attr($themolio_options['font_color']); ?>"/> </p> <p> <label><?php _e('Link color','themolio'); ?>:</label> <input type="text" name="themolio_options[link_color]" class="color" value="<?php echo esc_attr($themolio_options['link_color']); ?>"/> </p> <p> <label><?php _e('Button color','themolio'); ?>:</label> <input type="text" name="themolio_options[button_color]" class="color" value="<?php echo esc_attr($themolio_options['button_color']); ?>"/> </p> </div> <div class="settings-section" id="settings-logo"> <p> <label><?php _e('Custom Logo','themolio'); ?></label> <input type="text" name="themolio_options[custom_logo]" id="custom_logo" size="36" value="<?php echo esc_attr($themolio_options['custom_logo']); ?>"/> <input id="custom_logo_upload" type="button" class="image_upload button-secondary" value="<?php _e('Upload Logo','themolio'); ?>" /> </p> <p> <label><?php _e('Custom Favicon','themolio'); ?></label> <input type="text" name="themolio_options[custom_favicon]" id="custom_favicon" size="36" value="<?php echo esc_attr($themolio_options['custom_favicon']); ?>"/> <input id="custom_favicon_upload" type="button" class="image_upload button-secondary" value="<?php _e('Upload Favicon Image','themolio'); ?>" /> </p> </div> <div class="settings-section" id="settings-layout"> <p> <label><?php _e('Layout Style','themolio'); ?>:</label> <select name="themolio_options[blog_style]"> <?php foreach (themolio_blog_style() as $blog_style) { ?> <option value="<?php echo $blog_style['value']; ?>" <?php selected($themolio_options['blog_style'], $blog_style['value']); ?>><?php echo $blog_style['label']; ?></option> <?php } ?> </select> </p> <p> <label><?php _e('Number of columns for Grid','themolio'); ?>:</label> <select name="themolio_options[grid_columns]"> <?php foreach (themolio_grid_columns() as $grid_columns) { ?> <option value="<?php echo $grid_columns['value']; ?>" <?php selected($themolio_options['grid_columns'], $grid_columns['value']); ?>><?php echo $grid_columns['label']; ?></option> <?php } ?> </select> </p> <p> <label><?php _e('Layout for grid','themolio'); ?>:</label> <select name="themolio_options[grid_layout]"> <?php foreach (themolio_grid_layout() as $grid_layout) { ?> <option value="<?php echo $grid_layout['value']; ?>" <?php selected($themolio_options['grid_layout'], $grid_layout['value']); ?>><?php echo $grid_layout['label']; ?></option> <?php } ?> </select> <span class="field-meta"><?php _e('<strong>Top to bottom</strong>: Posts in the grid will be arranged starting from top moving downwards. <strong>Left to right</strong>: Posts in the grid will be arranged from left to right','themolio'); ?></span> </p> <p> <label><?php _e('Sidebar for Grid page','themolio'); ?></label> <input type="checkbox" name="themolio_options[show_sidebar_grid]" value="true" <?php checked(true,$themolio_options['show_sidebar_grid']); ?> /> <span class="field-meta"><?php _e('Show sidebar on the grid page ?','themolio'); ?></span> </p> </div> <div class="settings-section" id="settings-blog"> <p> <label><?php _e('Front page excerpts','themolio'); ?></label> <input type="checkbox" name="themolio_options[show_excerpt]" value="true" <?php checked(true,$themolio_options['show_excerpt']); ?> /> <span class="field-meta"><?php _e('Display excerpts on front page for standard layout blog ?','themolio'); ?></span> </p> <p> <label><?php _e('Featured Image','themolio'); ?></label> <input type="checkbox" name="themolio_options[show_featured]" value="true" <?php checked(true,$themolio_options['show_featured']); ?> /> <span class="field-meta"><?php _e('Display featured images on front page (for both grid and standard layout) ?','themolio'); ?></span> </p> <p> <label><?php _e('Default Search Box','themolio'); ?></label> <input type="checkbox" name="themolio_options[show_search]" value="true" <?php checked(true,$themolio_options['show_search']); ?> /> <span class="field-meta"><?php _e('Display default search box in header','themolio'); ?></span> </p> <p> <label><?php _e('Categories and Tags','themolio'); ?>:</label> <input type="checkbox" name="themolio_options[show_single_utility]" value="true" <?php checked(true,$themolio_options['show_single_utility']); ?> /> <span class="field-meta"><?php _e('Show tags and categories for single entries','themolio'); ?></span> </p> <p> <label><?php _e('Page Meta','themolio'); ?>:</label> <input type="checkbox" name="themolio_options[show_page_meta]" value="true" <?php checked(true,$themolio_options['show_page_meta']); ?> /> <span class="field-meta"><?php _e('Show meta information for pages','themolio'); ?></span> </p> </div> <div class="settings-section" id="settings-social"> <p> <label><?php _e('Facebook','themolio'); ?>:</label> <input type="text" class="social-field" id="facebook-user" name="themolio_options[facebook_user]" value="<?php echo esc_attr($themolio_options['facebook_user']); ?>"/> <span class="field-meta"><?php _e('Enter your facebook user id','themolio'); ?></span> </p> <p> <label><?php _e('Twitter','themolio'); ?>:</label> <input type="text" class="social-field" id="twitter-user" name="themolio_options[twitter_user]" value="<?php echo esc_attr($themolio_options['twitter_user']); ?>"/> <span class="field-meta"><?php _e('Enter your twitter user id','themolio'); ?></span> </p> <p> <label><?php _e('RSS','themolio'); ?>:</label> <input type="checkbox" name="themolio_options[enable_rss]" value="true" <?php checked(true,$themolio_options['enable_rss']); ?> /> <span class="field-meta"><?php _e('Show RSS icon','themolio'); ?></span> </p> </div> <?php submit_button('Save Settings','primary','settings-submit',false); ?> </form> <form class="form" method="post" id="reset-form" style="text-align: right; margin-top: 10px;" onsubmit="return confirmAction()"> <input type="submit" class="button-secondary" name="settings-reset" id="settings-reset" value="<?php _e('Reset Settings','themolio'); ?>" /> </form> <p style="text-align: right; margin-top: 10px; padding-top: 10px; border-top: 1px #ccc solid;"> <?php _e('Theme designed and developed by <a href="http://www.dezineappz.com">DezineAppz</a>','themolio'); ?> </p> </div> <!-- End of settings wrap --> <?php } function themolio_validate_options($input) { $output = $defaults = themolio_get_default_options(); //Validating dropdowns and radio options if (isset($input['blog_style']) && array_key_exists($input['blog_style'], themolio_blog_style())) $output['blog_style'] = $input['blog_style']; if (isset($input['grid_columns']) && array_key_exists($input['grid_columns'], themolio_grid_columns())) $output['grid_columns'] = $input['grid_columns']; if (isset($input['content_font']) && array_key_exists($input['content_font'], themolio_content_fonts())) $output['content_font'] = $input['content_font']; if (isset($input['grid_layout']) && array_key_exists($input['grid_layout'], themolio_grid_layout())) $output['grid_layout'] = $input['grid_layout']; //Validating Color Boxes if(themolio_validate_color($input['font_color'])) $output['font_color'] = $input['font_color']; if(themolio_validate_color($input['link_color'])) $output['link_color'] = $input['link_color']; if(themolio_validate_color($input['button_color'])) $output['button_color'] = $input['button_color']; //Validating Image fields if(trim($input['custom_logo']) == "") { $output['custom_logo'] = $input['custom_logo']; } else { if(themolio_validate_image_url($input['custom_logo'])) $output['custom_logo'] = $input['custom_logo']; else add_settings_error('themolio_options', 'invalid-logo-image', __('Invalid logo image URL','themolio'), 'error'); } if(trim($input['custom_favicon']) == "") { $output['custom_favicon'] = $input['custom_favicon']; } else { if(themolio_validate_image_url($input['custom_favicon'])) { if(themolio_validate_image_size($input['custom_favicon'],16,16)) $output['custom_favicon'] = $input['custom_favicon']; else add_settings_error('themolio_options', 'invalid-favicon-size', __('Favicon size cannot exceed 16 x 16 pixels','themolio'), 'error'); } else add_settings_error('themolio_options', 'invalid-favicon-image', __('Invalid favicon image URL','themolio'), 'error'); } //Validating number fields if(themolio_validate_decimal($input['font_size'])) { $output['font_size'] = $input['font_size']; } else { add_settings_error('themolio_options', 'invalid-font-size', __('Invalid font size. Font size should be in decimal format','themolio'), 'error'); } //Validating Social site usernames if(themolio_validate_social_user($input['facebook_user']) or trim($input['facebook_user']) == "") $output['facebook_user'] = $input['facebook_user']; else add_settings_error('themolio_options', 'invalid-facebook-user', 'Invalid facebook username', 'error'); if(themolio_validate_social_user($input['twitter_user']) or trim($input['twitter_user']) == "") $output['twitter_user'] = $input['twitter_user']; else add_settings_error('themolio_options', 'invalid-twitter-user', 'Invalid twitter username', 'error'); //Validating all the checkboxes $chkboxinputs = array('show_search','show_single_utility','show_page_meta','show_excerpt','show_featured','enable_rss','show_sidebar_grid'); foreach($chkboxinputs as $chkbox) { if (!isset($input[$chkbox])) $input[$chkbox] = null; $output[$chkbox] = ($input[$chkbox] == true ? true : false); } return apply_filters('themolio_validate_options', $output, $input, $defaults); } /* Supporting validation functions */ function themolio_validate_color($color) { $exp = "/([A-Za-z0-9])/"; if(!preg_match($exp,$color)) return false; else return true; } function themolio_validate_image_url($url) { $exp = "/^https?:\/\/(.)*\.(jpg|png|gif|ico)$/i"; if(!preg_match($exp,$url)) return false; else return true; } function themolio_validate_image_size($url,$width,$height) { $size = getimagesize($url); if($size[0] > $width or $size[1] > $height) return false; else return true; } function themolio_validate_number($value,$min,$max) { if(is_numeric($value)) { $value = intval($value); if($value < $min or $value > $max) return false; else return true; } else return false; } function themolio_validate_decimal($value) { if(is_numeric($value)) return true; else return false; } function themolio_validate_social_user($user) { $exp = "/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*$/"; if(!preg_match($exp,$user)) return false; else return true; } ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/admin/theme-options.php
PHP
oos
20,556
jQuery(document).ready(function() { //Loading current tab using cookie if(getCookie("currtab") != "" && getCookie("currtab") != null) { jQuery('.nav-tab').removeClass('nav-tab-active'); var currtab = getCookie("currtab"); jQuery('#' + currtab).addClass('nav-tab-active'); var currsection = currtab.replace('nav-tab-','settings-'); jQuery('.settings-section').hide(); jQuery('#' + currsection).show(); } //Animating tab jQuery('.nav-tab').click(function() { var clickedId = jQuery(this).attr("id"); var currentId = jQuery('.nav-tab-active').attr("id"); if(clickedId != currentId) { var clickedSectionId = clickedId.replace('nav-tab-','settings-'); var currentSectionId = jQuery('.current-section').attr("id"); jQuery('.settings-section').hide(); jQuery('#' + currentSectionId).removeClass('current-section'); jQuery('#' + clickedSectionId).slideDown(500); jQuery('#' + clickedSectionId).addClass('current-section'); jQuery('#' + currentId).removeClass('nav-tab-active'); jQuery('#' + clickedId).addClass('nav-tab-active'); } }); //Upload image script var formfieldID; jQuery('.image_upload').click(function() { var btnId = jQuery(this).attr("id"); formfieldID = btnId.replace("_upload",""); tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true'); return false; }); window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#' + formfieldID).val(imgurl); tb_remove(); } //Font size increment/decrement jQuery('#font_size_incr_btn').click(function() { var fontsize = parseFloat(jQuery('#font_size').val()); fontsize = fontsize + 1.5; jQuery('#font_size').val(fontsize); }); jQuery('#font_size_decr_btn').click(function() { var fontsize = parseFloat(jQuery('#font_size').val()); fontsize = fontsize - 1.5; if(fontsize < 0) fontsize = 83.3; jQuery('#font_size').val(fontsize); }); //Setting cookie to remember last tab jQuery('#settings-submit').click(function() { var currentTabId = jQuery('.nav-tab-active').attr("id"); setCookie("currtab",currentTabId,3); }); }); function confirmAction() { var confirmation = confirm("Do you want to delete your settings and restore to default settings ?"); return confirmation; } function setCookie(name,value,secs) { if (secs) { var date = new Date(); date.setTime(date.getTime()+(secs*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; }
01happy-blog
trunk/myblog/wp-content/themes/themolio/admin/theme-options.js
JavaScript
oos
3,131
.clear { clear: both; height: 0; line-height: 1; visibility: hidden; margin: 0; padding: 0; } .nav-tab-wrapper { margin-top: 20px !important; } .settings-section { display: none; padding: 30px; } .current-section { display: block; } .settings-error { margin-top: 20px !important; margin-bottom: 0 !important; padding-left: 10px !important; } .settings-form label { font-family: Georgia, serif; font-style: italic; font-size: 16px; padding-bottom: 10px; margin-bottom: 20px; display: block; border-bottom: 1px #ccc solid; } .settings-section p { margin-top: 20px; } .settings-section p:first-child { margin-top: 0; } .field-meta { margin-left: 15px; } .settings-radio-img { vertical-align: middle; margin-left: 15px; margin-right: 15px; }
01happy-blog
trunk/myblog/wp-content/themes/themolio/admin/theme-options.css
CSS
oos
746
/* Stylesheet for Mobile Devices */ nav .wrapper { text-align: center; padding: 10px 0; } #themolio_page_dropdown { background: #222; padding: 10px 0; border: 0 none; width: 100%; color: #fff; }
01happy-blog
trunk/myblog/wp-content/themes/themolio/mobile.css
CSS
oos
198
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> </div> <!-- End of content wrapper --> </div> <!-- End of content --> <footer id="footer" role="contentinfo"> <div class="wrapper"> <table class="tablayout"><tr> <td class="left"> <?php if(trim($themolio_options['facebook_user']) != ''): ?> <a class="social-link" href="http://www.facebook.com/<?php echo $themolio_options['facebook_user']; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/social_facebook_icon.png"/></a> <?php endif; ?> <?php if(trim($themolio_options['twitter_user']) != ''): ?> <a class="social-link" href="http://www.twitter.com/<?php echo $themolio_options['twitter_user']; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/social_twitter_icon.png"/></a> <?php endif; ?> <?php if($themolio_options['enable_rss']): ?> <a class="social-link" href="<?php bloginfo('rss2_url'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/social_rss_icon.png"/></a> <?php endif; ?> </td> <td class="right"> <?php _e('Copyright &copy;','themolio'); ?> <?php bloginfo('name'); ?> </td> </tr></table> </div> </footer> <?php wp_footer(); ?> <script src="http://s84.cnzz.com/stat.php?id=4606819&web_id=4606819&show=pic1" language="JavaScript"></script> </body> </html>
01happy-blog
trunk/myblog/wp-content/themes/themolio/footer.php
PHP
oos
1,500
<?php /** * @package Themolio */ ?> <div id="primary" class="widget-area" role="complementary"> <?php if(!dynamic_sidebar('sidebar-1')): ?> <aside id="themolio-archives" class="widget widget_archives"> <h3 class="widget-title"><?php _e('Archives','themolio'); ?></h3> <ul id="recentcomments"> <?php wp_get_archives(); ?> </ul> </aside> <?php endif; ?> </div>
01happy-blog
trunk/myblog/wp-content/themes/themolio/sidebar.php
PHP
oos
426
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> <?php if($themolio_options['grid_columns'] == 2) $gridclass = "grid-horizontal-col-2"; elseif($themolio_options['grid_columns'] == 3) $gridclass = "grid-horizontal-col-3"; elseif($themolio_options['grid_columns'] == 4) $gridclass = "grid-horizontal-col-4"; ?> <article id="post-<?php the_ID(); ?>" <?php post_class('post-grid-horizontal '.$gridclass); ?>> <?php if(trim(get_the_post_thumbnail($post->ID)) != '' and $themolio_options['show_featured']): ?> <div class="grid-thumb"> <a href="<?php the_permalink(); ?>"> <?php if($themolio_options['grid_columns'] == 2 and !$themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-two-col-grid-image-nosidebar'); elseif($themolio_options['grid_columns'] == 3 and !$themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-three-col-grid-image-nosidebar'); elseif($themolio_options['grid_columns'] == 4 and !$themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-four-col-grid-image-nosidebar'); elseif($themolio_options['grid_columns'] == 2 and $themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-two-col-grid-image-sidebar'); elseif($themolio_options['grid_columns'] == 3 and $themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-three-col-grid-image-sidebar'); elseif($themolio_options['grid_columns'] == 4 and $themolio_options['show_sidebar_grid']) the_post_thumbnail('themolio-four-col-grid-image-sidebar'); ?> </a> </div> <?php endif; ?> <h2 class="entry-title grid-title"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'themolio'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta grid-meta"> <?php themolio_posted_on(); ?> <?php if(comments_open() && ! post_password_required()) : ?> <?php comments_popup_link(__('Reply', 'themolio'), _x('1 Comment', 'comments number', 'themolio'), _x('% Comments', 'comments number', 'themolio'), 'entry-comments'); ?> <?php endif; ?> </div> <div class="entry-content"> <?php the_excerpt(); ?> </div> </article>
01happy-blog
trunk/myblog/wp-content/themes/themolio/content-grid-left-right.php
PHP
oos
2,437
<?php /** * @package Themolio */ ?> <!DOCTYPE html> <!--[if IE 6]> <html id="ie6" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 7]> <html id="ie7" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html id="ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta charset="<?php bloginfo('charset'); ?>" /> <?php if (is_home()){ $description = get_bloginfo('description', 'display'); } elseif (is_category()){ //$description = category_description(); } elseif (is_tag()){ //$description = tag_description(); } elseif (is_single()){ if ($post->post_excerpt) { $description = $post->post_excerpt; } else { //$description = mb_substr(strip_tags($post->post_content),0,220); } } ?> <?php if(isset($description)):?> <meta name="description" content="<?php echo $description; ?>" /> <?php endif;?> <title><?php global $page, $paged, $themolio_options, $themolio_is_mobile; if (is_search()){ $title = $s . '的搜索结果'; } else { $title = trim(wp_title('', false, 'right')); } $titlePage = ''; if ($paged >= 2 || $page >= 2) $titlePage = sprintf(__('第%s页', 'themolio'), max($paged, $page)); if (trim($title)) { echo trim($title); if (is_category() && $titlePage) { echo ' ' . $titlePage; } echo ' - '; bloginfo('name'); } else { bloginfo('name'); } $site_description = get_bloginfo('description', 'display'); if ($site_description && (is_home() || is_front_page())) { echo " | $site_description"; if ($titlePage) { echo ' ' . $titlePage; } } ?></title> <?php if($themolio_is_mobile): ?><meta name="viewport" content="width=device-width, initial-scale=0.8" /> <?php else: ?><meta name="viewport" content="width=device-width" /> <?php endif; ?><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <header role="banner"> <div class="wrapper"> <table class="tablayout"><tr> <?php if(trim($themolio_options['custom_logo']) != ''): ?> <td class="tdleft" style="max-width:100px;max-height:130px;width:auto;padding-right:15px;"> <a href="<?php echo home_url(); ?>"><img class="custom-logo" src="<?php echo $themolio_options['custom_logo']; ?>"/></a> </td> <?php endif; ?> <td class="tdleft" style="width:60%;"> <h1 class="site-title"><a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1> <?php if(trim(get_bloginfo('description')) != ''): ?> <p class="site-desc"><?php bloginfo('description'); ?></p> <?php endif; ?> </td> <?php if($themolio_options['show_search'] and !$themolio_is_mobile): ?> <td class="tdright" style="text-align:right;min-width:240px;"> <?php get_search_form(); ?> </td> <?php endif; ?> </tr></table> </div> </header> <!-- End of banner --> <nav> <div class="wrapper"> <?php if($themolio_is_mobile): ?> <?php themolio_pages_dropdown(); ?> <?php else: ?> <?php wp_nav_menu(array('theme_location' => 'primary', 'container_class' => 'main-menu clearfix')); ?> <?php endif; ?> </div> </nav> <!-- End of dropdown menu --> <div id="content"> <!-- Start of content --> <div class="wrapper"> <!-- Start of content wrapper -->
01happy-blog
trunk/myblog/wp-content/themes/themolio/header.php
PHP
oos
4,233
<?php /** * @package Themolio */ ?> <?php global $themolio_options, $themolio_is_mobile; ?> <?php get_header(); ?> <?php if($themolio_is_mobile) { $containerclass = ' fullcontainer'; } else { $containerclass = ''; } ?> <?php get_left_sidebar(); ?> <div class="container<?php echo $containerclass; ?>"> <?php themolio_breadcrumbs(); ?> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><?php the_title(); ?></h2> <div class="entry-meta"> <?php themolio_posted_on(); ?> <p> <?php if(comments_open() && ! post_password_required()) : ?> <?php comments_popup_link(__('Reply', 'themolio'), _x('1 Comment', 'comments number', 'themolio'), _x('% Comments', 'comments number', 'themolio'), 'entry-comments'); ?> <?php endif; ?> </p> </div> <div class="entry-content"> <div class="entry-attachment"> <?php $attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'))); foreach($attachments as $k => $attachment) { if($attachment->ID == $post->ID) break; } $k++; if(count($attachments) > 1) { if(isset($attachments[$k ])) $next_attachment_url = get_attachment_link($attachments[$k]->ID); else $next_attachment_url = get_attachment_link($attachments[0]->ID); } else { $next_attachment_url = wp_get_attachment_url(); } ?> <a href="<?php echo esc_url($next_attachment_url); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php $attachment_size = apply_filters('themolio_attachment_size', 740); echo wp_get_attachment_image($post->ID, array($attachment_size, 1024)); ?></a> <?php if(!empty($post->post_excerpt)) : ?> <div class="entry-caption"> <?php the_excerpt(); ?> </div> <?php endif; ?> <div class="entry-description"> <?php the_content(); ?> <?php wp_link_pages(array('before' => '<div class="page-link clearfix"><span class="pages-title">'.__('Pages:','themolio').'</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?> </div> </div> </div> </article> <div class="single-navigation"> <span class="nav-previous"><?php previous_image_link(false, __('Previous' ,'themolio')); ?></span> <span class="nav-next"><?php next_image_link(false, __('Next' ,'themolio')); ?></span> </div> <?php comments_template('', true); ?> <?php endwhile; ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php if(!$themolio_is_mobile): ?> <?php get_sidebar(); ?> <?php endif; ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/image.php
PHP
oos
4,070
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'themolio'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php themolio_posted_on(); ?> <p> <?php if(comments_open() && ! post_password_required()) : ?> <?php comments_popup_link(__('Reply', 'themolio'), _x('1 Comment', 'comments number', 'themolio'), _x('% Comments', 'comments number', 'themolio'), 'entry-comments'); ?> <?php endif; ?> </p> </div> <?php if(is_search()): ?> <div class="entry-content"> <?php the_excerpt(); ?> </div> <?php else: ?> <div class="entry-content"> <?php if(post_password_required()): ?> <?php the_content(__('Continue reading', 'themolio')); ?> <?php else: ?> <?php $images = get_children(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999)); if($images): $total_images = count($images); $image = array_shift($images); $image_img_tag = wp_get_attachment_image($image->ID, 'thumbnail'); ?> <figure class="gallery-thumb"> <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a> </figure><!-- .gallery-thumb --> <p><?php printf(_n('This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'themolio'), 'href="'.esc_url(get_permalink()).'" title="'.sprintf(esc_attr__('Permalink to %s', 'themolio'), the_title_attribute('echo=0')).'" rel="bookmark"', number_format_i18n($total_images)); ?></p> <?php endif; ?> <?php the_excerpt(); ?> <?php endif; ?> <?php wp_link_pages(array('before' => '<div class="page-link clearfix"><span class="pages-title">'.__('Pages:','themolio').'</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?> </div> <?php endif; ?> </article>
01happy-blog
trunk/myblog/wp-content/themes/themolio/content-gallery.php
PHP
oos
2,487
<?php /** * @package Themolio */ ?> <?php global $themolio_options; ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'themolio'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php themolio_posted_on(); ?> </div> <?php if(trim(get_the_post_thumbnail($post->ID)) != '' and $themolio_options['show_featured']): ?> <div class="entry-thumb"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('themolio-featured-image');?> </a> </div> <?php endif; ?> <div class="entry-content"> <?php if($themolio_options['show_excerpt'] or is_search()): ?> <?php the_excerpt(); ?> <?php else: ?> <?php the_excerpt(); ?> <?php //the_content(__('Continue reading', 'themolio')); ?> <?php wp_link_pages(array('before' => '<div class="page-link clearfix"><span class="pages-title">'.__('Pages:','themolio').'</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?> <?php endif; ?> </div> </article>
01happy-blog
trunk/myblog/wp-content/themes/themolio/content.php
PHP
oos
1,296
<?php /** * Template Name: Full-width, no sidebar * @package Themolio */ ?> <?php global $themolio_options; ?> <?php get_header(); ?> <div class="fullcontainer"> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <?php get_template_part('content', 'page'); ?> <?php comments_template('', true); ?> <?php endwhile; ?> <?php else: ?> <article id="post-0" class="post"> <h2 class="entry-title missing-title"><?php _e('Missing!','themolio'); ?></h2> <div class="entry-content"> <p><?php _e('No posts were found. Try using the search form below','themolio'); ?></p> <p><?php get_search_form(); ?></p> </div> </article> <?php endif; ?> </div> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/themolio/fullwidth-template.php
PHP
oos
813
<?php /** * @package Themolio */ ?> <form role="search" method="get" id="searchform" action="<?php echo home_url('/'); ?>"> <input type="text" value="" name="s" id="s" /> <input type="submit" id="searchsubmit" value="<?php _e('Search','themolio'); ?>" /> </form>
01happy-blog
trunk/myblog/wp-content/themes/themolio/searchform.php
PHP
oos
280
<?php /** * The template for displaying Comments. * * The area of the page that contains both current comments * and the comment form. The actual display of comments is * handled by a callback to twentyten_comment which is * located in the functions.php file. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ ?> <div id="comments"> <?php if ( post_password_required() ) : ?> <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></p> </div><!-- #comments --> <?php /* Stop the rest of comments.php from being processed, * but don't kill the script entirely -- we still have * to fully load the template. */ return; endif; ?> <?php // You can start editing here -- including this comment! ?> <?php if ( have_comments() ) : ?> <h3 id="comments-title"><?php printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten' ), number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' ); ?></h3> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> <div class="navigation"> <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div> </div> <!-- .navigation --> <?php endif; // check for comment navigation ?> <ol class="commentlist"> <?php /* Loop through and list the comments. Tell wp_list_comments() * to use twentyten_comment() to format the comments. * If you want to overload this in a child theme then you can * define twentyten_comment() and that will be used instead. * See twentyten_comment() in twentyten/functions.php for more. */ wp_list_comments( array( 'callback' => 'twentyten_comment' ) ); ?> </ol> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> <div class="navigation"> <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div> </div><!-- .navigation --> <?php endif; // check for comment navigation ?> <?php else : // or, if we don't have comments: /* If there are no comments and comments are closed, * let's leave a little note, shall we? */ if ( ! comments_open() ) : ?> <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyten' ); ?></p> <?php endif; // end ! comments_open() ?> <?php endif; // end have_comments() ?> <?php comment_form(); ?> </div><!-- #comments -->
01happy-blog
trunk/myblog/wp-content/themes/twentyten/comments.php
PHP
oos
2,976
<?php /** * The template for displaying Search Results pages. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div id="container"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '<span>' . get_search_query() . '</span>' ); ?></h1> <?php /* Run the loop for the search to output the results. * If you want to overload this in a child theme then include a file * called loop-search.php and that will be used instead. */ get_template_part( 'loop', 'search' ); ?> <?php else : ?> <div id="post-0" class="post no-results not-found"> <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> <div class="entry-content"> <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </div><!-- #post-0 --> <?php endif; ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyten/search.php
PHP
oos
1,190
/* Theme Name: Twenty Ten Theme URI: http://wordpress.org/ Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar. Author: the WordPress team Version: 1.4 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu Text Domain: twentyten */ /* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html -------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { background: transparent; border: 0; margin: 0; padding: 0; vertical-align: baseline; } body { line-height: 1; } h1, h2, h3, h4, h5, h6 { clear: both; font-weight: normal; } ol, ul { list-style: none; } blockquote { quotes: none; } blockquote:before, blockquote:after { content: ''; content: none; } del { text-decoration: line-through; } /* tables still need 'cellspacing="0"' in the markup */ table { border-collapse: collapse; border-spacing: 0; } a img { border: none; } /* =Layout -------------------------------------------------------------- */ /* LAYOUT: Two columns DESCRIPTION: Two-column fixed layout with one sidebar right of content */ #container { float: left; margin: 0 -240px 0 0; width: 100%; } #content { margin: 0 280px 0 20px; } #primary, #secondary { float: right; overflow: hidden; width: 220px; } #secondary { clear: right; } #footer { clear: both; width: 100%; } /* LAYOUT: One column, no sidebar DESCRIPTION: One centered column with no sidebar */ .one-column #content { margin: 0 auto; width: 640px; } /* LAYOUT: Full width, no sidebar DESCRIPTION: Full width content with no sidebar; used for attachment pages */ .single-attachment #content { margin: 0 auto; width: 900px; } /* =Fonts -------------------------------------------------------------- */ body, input, textarea, .page-title span, .pingback a.url { font-family: Georgia, "Bitstream Charter", serif; } h3#comments-title, h3#reply-title, #access .menu, #access div.menu ul, #cancel-comment-reply-link, .form-allowed-tags, #site-info, #site-title, #wp-calendar, .comment-meta, .comment-body tr th, .comment-body thead th, .entry-content label, .entry-content tr th, .entry-content thead th, .entry-meta, .entry-title, .entry-utility, #respond label, .navigation, .page-title, .pingback p, .reply, .widget-title, .wp-caption-text { font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; } input[type=submit] { font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; } pre { font-family: "Courier 10 Pitch", Courier, monospace; } code { font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; } /* =Structure -------------------------------------------------------------- */ /* The main theme structure */ #access .menu-header, div.menu, #colophon, #branding, #main, #wrapper { margin: 0 auto; width: 940px; } #wrapper { background: #fff; margin-top: 20px; padding: 0 20px; } /* Structure the footer area */ #footer-widget-area { overflow: hidden; } #footer-widget-area .widget-area { float: left; margin-right: 20px; width: 220px; } #footer-widget-area #fourth { margin-right: 0; } #site-info { float: left; font-size: 14px; font-weight: bold; width: 700px; } #site-generator { float: right; width: 220px; } /* =Global Elements -------------------------------------------------------------- */ /* Main global 'theme' and typographic styles */ body { background: #f1f1f1; } body, input, textarea { color: #666; font-size: 12px; line-height: 18px; } hr { background-color: #e7e7e7; border: 0; clear: both; height: 1px; margin-bottom: 18px; } /* Text elements */ p { margin-bottom: 18px; } ul { list-style: square; margin: 0 0 18px 1.5em; } ol { list-style: decimal; margin: 0 0 18px 1.5em; } ol ol { list-style: upper-alpha; } ol ol ol { list-style: lower-roman; } ol ol ol ol { list-style: lower-alpha; } ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; } dl { margin: 0 0 24px 0; } dt { font-weight: bold; } dd { margin-bottom: 18px; } strong { font-weight: bold; } cite, em, i { font-style: italic; } big { font-size: 131.25%; } ins { background: #ffc; text-decoration: none; } blockquote { font-style: italic; padding: 0 3em; } blockquote cite, blockquote em, blockquote i { font-style: normal; } pre { background: #f7f7f7; color: #222; line-height: 18px; margin-bottom: 18px; overflow: auto; padding: 1.5em; } abbr, acronym { border-bottom: 1px dotted #666; cursor: help; } sup, sub { height: 0; line-height: 1; position: relative; vertical-align: baseline; } sup { bottom: 1ex; } sub { top: .5ex; } input[type="text"], textarea { background: #f9f9f9; border: 1px solid #ccc; box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); padding: 2px; } a:link { color: #0066cc; } a:visited { color: #743399; } a:active, a:hover { color: #ff4b33; } /* Text meant only for screen readers */ .screen-reader-text { position: absolute; left: -9000px; } /* =Header -------------------------------------------------------------- */ #header { padding: 30px 0 0 0; } #site-title { float: left; font-size: 30px; line-height: 36px; margin: 0 0 18px 0; width: 700px; } #site-title a { color: #000; font-weight: bold; text-decoration: none; } #site-description { clear: right; float: right; font-style: italic; margin: 15px 0 18px 0; width: 220px; } /* This is the custom header image */ #branding img { border-top: 4px solid #000; border-bottom: 1px solid #000; display: block; float: left; } /* =Menu -------------------------------------------------------------- */ #access { background: #000; display: block; float: left; margin: 0 auto; width: 940px; } #access .menu-header, div.menu { font-size: 13px; margin-left: 12px; width: 928px; } #access .menu-header ul, div.menu ul { list-style: none; margin: 0; } #access .menu-header li, div.menu li { float: left; position: relative; } #access a { color: #aaa; display: block; line-height: 38px; padding: 0 10px; text-decoration: none; } #access ul ul { box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); display: none; position: absolute; top: 38px; left: 0; float: left; width: 180px; z-index: 99999; } #access ul ul li { min-width: 180px; } #access ul ul ul { left: 100%; top: 0; } #access ul ul a { background: #333; line-height: 1em; padding: 10px; width: 160px; height: auto; } #access li:hover > a, #access ul ul :hover > a { background: #333; color: #fff; } #access ul li:hover > ul { display: block; } #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access ul li.current-menu-item > a, #access ul li.current-menu-parent > a { color: #fff; } * html #access ul li.current_page_item a, * html #access ul li.current-menu-ancestor a, * html #access ul li.current-menu-item a, * html #access ul li.current-menu-parent a, * html #access ul li a:hover { color: #fff; } /* =Content -------------------------------------------------------------- */ #main { clear: both; overflow: hidden; padding: 40px 0 0 0; } #content { margin-bottom: 36px; } #content, #content input, #content textarea { color: #333; font-size: 16px; line-height: 24px; } #content p, #content ul, #content ol, #content dd, #content pre, #content hr { margin-bottom: 24px; } #content ul ul, #content ol ol, #content ul ol, #content ol ul { margin-bottom: 0; } #content pre, #content kbd, #content tt, #content var { font-size: 15px; line-height: 21px; } #content code { font-size: 13px; } #content dt, #content th { color: #000; } #content h1, #content h2, #content h3, #content h4, #content h5, #content h6 { color: #000; line-height: 1.5em; margin: 0 0 20px 0; } #content table { border: 1px solid #e7e7e7; margin: 0 -1px 24px 0; text-align: left; width: 100%; } #content tr th, #content thead th { color: #888; font-size: 12px; font-weight: bold; line-height: 18px; padding: 9px 24px; } #content tr td { border-top: 1px solid #e7e7e7; padding: 6px 24px; } #content tr.odd td { background: #f2f7fc; } .hentry { margin: 0 0 48px 0; } .home .sticky { background: #f2f7fc; border-top: 4px solid #000; margin-left: -20px; margin-right: -20px; padding: 18px 20px; } .single .hentry { margin: 0 0 36px 0; } .page-title { color: #000; font-size: 14px; font-weight: bold; margin: 0 0 36px 0; } .page-title span { color: #333; font-size: 16px; font-style: italic; font-weight: normal; } .page-title a:link, .page-title a:visited { color: #888; text-decoration: none; } .page-title a:active, .page-title a:hover { color: #ff4b33; } #content .entry-title { color: #000; font-size: 21px; font-weight: bold; line-height: 1.3em; margin-bottom: 0; } .entry-title a:link, .entry-title a:visited { color: #000; text-decoration: none; } .entry-title a:active, .entry-title a:hover { color: #ff4b33; } .entry-meta { color: #888; font-size: 12px; } .entry-meta abbr, .entry-utility abbr { border: none; } .entry-meta abbr:hover, .entry-utility abbr:hover { border-bottom: 1px dotted #666; } .entry-content, .entry-summary { clear: both; padding: 12px 0 0 0; } #content .entry-summary p:last-child { margin-bottom: 12px; } .entry-content fieldset { border: 1px solid #e7e7e7; margin: 0 0 24px 0; padding: 24px; } .entry-content fieldset legend { background: #fff; color: #000; font-weight: bold; padding: 0 24px; } .entry-content input { margin: 0 0 24px 0; } .entry-content input.file, .entry-content input.button { margin-right: 24px; } .entry-content label { color: #888; font-size: 12px; } .entry-content select { margin: 0 0 24px 0; } .entry-content sup, .entry-content sub { font-size: 10px; } .entry-content blockquote.left { float: left; margin-left: 0; margin-right: 24px; text-align: right; width: 33%; } .entry-content blockquote.right { float: right; margin-left: 24px; margin-right: 0; text-align: left; width: 33%; } .page-link { clear: both; color: #000; font-weight: bold; margin: 0 0 22px 0; word-spacing: 0.5em; } .page-link a:link, .page-link a:visited { background: #f1f1f1; color: #333; font-weight: normal; padding: 0.5em 0.75em; text-decoration: none; } .home .sticky .page-link a { background: #d9e8f7; } .page-link a:active, .page-link a:hover { color: #ff4b33; } body.page .edit-link { clear: both; display: block; } #entry-author-info { background: #f2f7fc; border-top: 4px solid #000; clear: both; font-size: 14px; line-height: 20px; margin: 24px 0; overflow: hidden; padding: 18px 20px; } #entry-author-info #author-avatar { background: #fff; border: 1px solid #e7e7e7; float: left; height: 60px; margin: 0 -104px 0 0; padding: 11px; } #entry-author-info #author-description { float: left; margin: 0 0 0 104px; } #entry-author-info h2 { color: #000; font-size: 100%; font-weight: bold; margin-bottom: 0; } .entry-utility { clear: both; color: #888; font-size: 12px; line-height: 18px; } .entry-meta a, .entry-utility a { color: #888; } .entry-meta a:hover, .entry-utility a:hover { color: #ff4b33; } #content .video-player { padding: 0; } /* =Asides -------------------------------------------------------------- */ .home #content .format-aside p, .home #content .category-asides p { font-size: 14px; line-height: 20px; margin-bottom: 10px; margin-top: 0; } .home .hentry.format-aside, .home .hentry.category-asides { padding: 0; } .home #content .format-aside .entry-content, .home #content .category-asides .entry-content { padding-top: 0; } /* =Gallery listing -------------------------------------------------------------- */ .format-gallery .size-thumbnail img, .category-gallery .size-thumbnail img { border: 10px solid #f1f1f1; margin-bottom: 0; } .format-gallery .gallery-thumb, .category-gallery .gallery-thumb { float: left; margin-right: 20px; margin-top: -4px; } .home #content .format-gallery .entry-utility, .home #content .category-gallery .entry-utility { padding-top: 4px; } /* =Attachment pages -------------------------------------------------------------- */ .attachment .entry-content .entry-caption { font-size: 140%; margin-top: 24px; } .attachment .entry-content .nav-previous a:before { content: '\2190\00a0'; } .attachment .entry-content .nav-next a:after { content: '\00a0\2192'; } /* =Images -------------------------------------------------------------- */ /* Resize images to fit the main content area. - Applies only to images uploaded via WordPress by targeting size-* classes. - Other images will be left alone. Use "size-auto" class to apply to other images. */ img.size-auto, img.size-full, img.size-large, img.size-medium, .attachment img { max-width: 100%; /* When images are too wide for containing element, force them to fit. */ height: auto; /* Override height to match resized width for correct aspect ratio. */ } .alignleft, img.alignleft { display: inline; float: left; margin-right: 24px; margin-top: 4px; } .alignright, img.alignright { display: inline; float: right; margin-left: 24px; margin-top: 4px; } .aligncenter, img.aligncenter { clear: both; display: block; margin-left: auto; margin-right: auto; } img.alignleft, img.alignright, img.aligncenter { margin-bottom: 12px; } .wp-caption { background: #f1f1f1; line-height: 18px; margin-bottom: 20px; max-width: 632px !important; /* prevent too-wide images from breaking layout */ padding: 4px; text-align: center; } .wp-caption img { margin: 5px 5px 0; } .wp-caption p.wp-caption-text { color: #888; font-size: 12px; margin: 5px; } .wp-smiley { margin: 0; } .gallery { margin: 0 auto 18px; } .gallery .gallery-item { float: left; margin-top: 0; text-align: center; width: 33%; } .gallery-columns-2 .gallery-item { width: 50%; } .gallery-columns-4 .gallery-item { width: 25%; } .gallery img { border: 2px solid #cfcfcf; } .gallery-columns-2 .attachment-medium { max-width: 92%; height: auto; } .gallery-columns-4 .attachment-thumbnail { max-width: 84%; height: auto; } .gallery .gallery-caption { color: #888; font-size: 12px; margin: 0 0 12px; } .gallery dl { margin: 0; } .gallery img { border: 10px solid #f1f1f1; } .gallery br+br { display: none; } #content .attachment img {/* single attachment images should be centered */ display: block; margin: 0 auto; } /* =Navigation -------------------------------------------------------------- */ .navigation { color: #888; font-size: 12px; line-height: 18px; overflow: hidden; } .navigation a:link, .navigation a:visited { color: #888; text-decoration: none; } .navigation a:active, .navigation a:hover { color: #ff4b33; } .nav-previous { float: left; width: 50%; } .nav-next { float: right; text-align: right; width: 50%; } #nav-above { margin: 0 0 18px 0; } #nav-above { display: none; } .paged #nav-above, .single #nav-above { display: block; } #nav-below { margin: -18px 0 0 0; } /* =Comments -------------------------------------------------------------- */ #comments { clear: both; } #comments .navigation { padding: 0 0 18px 0; } h3#comments-title, h3#reply-title { color: #000; font-size: 20px; font-weight: bold; margin-bottom: 0; } h3#comments-title { padding: 24px 0; } .commentlist { list-style: none; margin: 0; } .commentlist li.comment { border-bottom: 1px solid #e7e7e7; line-height: 24px; margin: 0 0 24px 0; padding: 0 0 0 56px; position: relative; } .commentlist li:last-child { border-bottom: none; margin-bottom: 0; } #comments .comment-body ul, #comments .comment-body ol { margin-bottom: 18px; } #comments .comment-body p:last-child { margin-bottom: 6px; } #comments .comment-body blockquote p:last-child { margin-bottom: 24px; } .commentlist ol { list-style: decimal; } .commentlist .avatar { position: absolute; top: 4px; left: 0; } .comment-author { } .comment-author cite { color: #000; font-style: normal; font-weight: bold; } .comment-author .says { font-style: italic; } .comment-meta { font-size: 12px; margin: 0 0 18px 0; } .comment-meta a:link, .comment-meta a:visited { color: #888; text-decoration: none; } .comment-meta a:active, .comment-meta a:hover { color: #ff4b33; } .commentlist .even { } .commentlist .bypostauthor { } .reply { font-size: 12px; padding: 0 0 24px 0; } .reply a, a.comment-edit-link { color: #888; } .reply a:hover, a.comment-edit-link:hover { color: #ff4b33; } .commentlist .children { list-style: none; margin: 0; } .commentlist .children li { border: none; margin: 0; } .nopassword, .nocomments { display: none; } #comments .pingback { border-bottom: 1px solid #e7e7e7; margin-bottom: 18px; padding-bottom: 18px; } .commentlist li.comment+li.pingback { margin-top: -6px; } #comments .pingback p { color: #888; display: block; font-size: 12px; line-height: 18px; margin: 0; } #comments .pingback .url { font-size: 13px; font-style: italic; } /* Comments form */ input[type=submit] { color: #333; } #respond { border-top: 1px solid #e7e7e7; margin: 24px 0; overflow: hidden; position: relative; } #respond p { margin: 0; } #respond .comment-notes { margin-bottom: 1em; } .form-allowed-tags { line-height: 1em; } .children #respond { margin: 0 48px 0 0; } h3#reply-title { margin: 18px 0; } #comments-list #respond { margin: 0 0 18px 0; } #comments-list ul #respond { margin: 0; } #cancel-comment-reply-link { font-size: 12px; font-weight: normal; line-height: 18px; } #respond .required { color: #ff4b33; font-weight: bold; } #respond label { color: #888; font-size: 12px; } #respond input { margin: 0 0 9px; width: 98%; } #respond textarea { width: 98%; } #respond .form-allowed-tags { color: #888; font-size: 12px; line-height: 18px; } #respond .form-allowed-tags code { font-size: 11px; } #respond .form-submit { margin: 12px 0; } #respond .form-submit input { font-size: 14px; width: auto; } /* =Widget Areas -------------------------------------------------------------- */ .widget-area ul { list-style: none; margin-left: 0; } .widget-area ul ul { list-style: square; margin-left: 1.3em; } .widget-area select { max-width: 100%; } .widget_search #s {/* This keeps the search inputs in line */ width: 60%; } .widget_search label { display: none; } .widget-container { margin: 0 0 18px 0; } .widget-title { color: #222; font-weight: bold; } .widget-area a:link, .widget-area a:visited { text-decoration: none; } .widget-area a:active, .widget-area a:hover { text-decoration: underline; } .widget-area .entry-meta { font-size: 11px; } #wp_tag_cloud div { line-height: 1.6em; } #wp-calendar { width: 100%; } #wp-calendar caption { color: #222; font-size: 14px; font-weight: bold; padding-bottom: 4px; text-align: left; } #wp-calendar thead { font-size: 11px; } #wp-calendar thead th { } #wp-calendar tbody { color: #aaa; } #wp-calendar tbody td { background: #f5f5f5; border: 1px solid #fff; padding: 3px 0 2px; text-align: center; } #wp-calendar tbody .pad { background: none; } #wp-calendar tfoot #next { text-align: right; } .widget_rss a.rsswidget { color: #000; } .widget_rss a.rsswidget:hover { color: #ff4b33; } .widget_rss .widget-title img { width: 11px; height: 11px; } /* Main sidebars */ #main .widget-area ul { margin-left: 0; padding: 0 20px 0 0; } #main .widget-area ul ul { border: none; margin-left: 1.3em; padding: 0; } #primary { } #secondary { } /* Footer widget areas */ #footer-widget-area { } /* =Footer -------------------------------------------------------------- */ #footer { margin-bottom: 20px; } #colophon { border-top: 4px solid #000; margin-top: -4px; overflow: hidden; padding: 18px 0; } #site-info { font-weight: bold; } #site-info a { color: #000; text-decoration: none; } #site-generator { font-style: italic; position: relative; } #site-generator a { background: url(images/wordpress.png) center left no-repeat; color: #666; display: inline-block; line-height: 16px; padding-left: 20px; text-decoration: none; } #site-generator a:hover { text-decoration: underline; } img#wpstats { display: block; margin: 0 auto 10px; } /* =Mobile Safari ( iPad, iPhone and iPod Touch ) -------------------------------------------------------------- */ pre { -webkit-text-size-adjust: 140%; } code { -webkit-text-size-adjust: 160%; } #access, .entry-meta, .entry-utility, .navigation, .widget-area { -webkit-text-size-adjust: 120%; } #site-description { -webkit-text-size-adjust: none; } /* =Print Style -------------------------------------------------------------- */ @media print { body { background: none !important; } #wrapper { clear: both !important; display: block !important; float: none !important; position: relative !important; } #header { border-bottom: 2pt solid #000; padding-bottom: 18pt; } #colophon { border-top: 2pt solid #000; } #site-title, #site-description { float: none; line-height: 1.4em; margin: 0; padding: 0; } #site-title { font-size: 13pt; } .entry-content { font-size: 14pt; line-height: 1.6em; } .entry-title { font-size: 21pt; } #access, #branding img, #respond, .comment-edit-link, .edit-link, .navigation, .page-link, .widget-area { display: none !important; } #container, #header, #footer { margin: 0; width: 100%; } #content, .one-column #content { margin: 24pt 0 0; width: 100%; } .wp-caption p { font-size: 11pt; } #site-info, #site-generator { float: none; width: auto; } #colophon { width: auto; } img#wpstats { display: none; } #site-generator a { margin: 0; padding: 0; } #entry-author-info { border: 1px solid #e7e7e7; } #main { display: inline; } .home .sticky { border: none; } }
01happy-blog
trunk/myblog/wp-content/themes/twentyten/style.css
CSS
oos
22,898
<?php /** * TwentyTen functions and definitions * * Sets up the theme and provides some helper functions. Some helper functions * are used in the theme as custom template tags. Others are attached to action and * filter hooks in WordPress to change core functionality. * * The first function, twentyten_setup(), sets up the theme by registering support * for various features in WordPress, such as post thumbnails, navigation menus, and the like. * * When using a child theme (see http://codex.wordpress.org/Theme_Development and * http://codex.wordpress.org/Child_Themes), you can override certain functions * (those wrapped in a function_exists() call) by defining them first in your child theme's * functions.php file. The child theme's functions.php file is included before the parent * theme's file, so the child theme functions would be used. * * Functions that are not pluggable (not wrapped in function_exists()) are instead attached * to a filter or action hook. The hook can be removed by using remove_action() or * remove_filter() and you can attach your own function to the hook. * * We can remove the parent theme's hook only after it is attached, which means we need to * wait until setting up the child theme: * * <code> * add_action( 'after_setup_theme', 'my_child_theme_setup' ); * function my_child_theme_setup() { * // We are providing our own filter for excerpt_length (or using the unfiltered value) * remove_filter( 'excerpt_length', 'twentyten_excerpt_length' ); * ... * } * </code> * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ /** * Set the content width based on the theme's design and stylesheet. * * Used to set the width of images and content. Should be equal to the width the theme * is designed for, generally via the style.css stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 640; /** Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'twentyten_setup' ); if ( ! function_exists( 'twentyten_setup' ) ): /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override twentyten_setup() in a child theme, add your own twentyten_setup to your child theme's * functions.php file. * * @uses add_theme_support() To add support for post thumbnails, custom headers and backgrounds, and automatic feed links. * @uses register_nav_menus() To add support for navigation menus. * @uses add_editor_style() To style the visual editor. * @uses load_theme_textdomain() For translation/localization support. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Ten 1.0 */ function twentyten_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories. add_theme_support( 'post-formats', array( 'aside', 'gallery' ) ); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // Make theme available for translation // Translations can be filed in the /languages/ directory load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'twentyten' ), ) ); // This theme allows users to set a custom background. add_theme_support( 'custom-background', array( // Let WordPress know what our default background color is. 'default-color' => 'f1f1f1', ) ); // The custom header business starts here. $custom_header_support = array( // The default image to use. // The %s is a placeholder for the theme template directory URI. 'default-image' => '%s/images/headers/path.jpg', // The height and width of our custom header. 'width' => apply_filters( 'twentyten_header_image_width', 940 ), 'height' => apply_filters( 'twentyten_header_image_height', 198 ), // Support flexible heights. 'flex-height' => true, // Don't support text inside the header image. 'header-text' => false, // Callback for styling the header preview in the admin. 'admin-head-callback' => 'twentyten_admin_header_style', ); add_theme_support( 'custom-header', $custom_header_support ); if ( ! function_exists( 'get_custom_header' ) ) { // This is all for compatibility with versions of WordPress prior to 3.4. define( 'HEADER_TEXTCOLOR', '' ); define( 'NO_HEADER_TEXT', true ); define( 'HEADER_IMAGE', $custom_header_support['default-image'] ); define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); add_custom_image_header( '', $custom_header_support['admin-head-callback'] ); add_custom_background(); } // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); // ... and thus ends the custom header business. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'berries' => array( 'url' => '%s/images/headers/berries.jpg', 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Berries', 'twentyten' ) ), 'cherryblossom' => array( 'url' => '%s/images/headers/cherryblossoms.jpg', 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Cherry Blossoms', 'twentyten' ) ), 'concave' => array( 'url' => '%s/images/headers/concave.jpg', 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Concave', 'twentyten' ) ), 'fern' => array( 'url' => '%s/images/headers/fern.jpg', 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Fern', 'twentyten' ) ), 'forestfloor' => array( 'url' => '%s/images/headers/forestfloor.jpg', 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Forest Floor', 'twentyten' ) ), 'inkwell' => array( 'url' => '%s/images/headers/inkwell.jpg', 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Inkwell', 'twentyten' ) ), 'path' => array( 'url' => '%s/images/headers/path.jpg', 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Path', 'twentyten' ) ), 'sunset' => array( 'url' => '%s/images/headers/sunset.jpg', 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Sunset', 'twentyten' ) ) ) ); } endif; if ( ! function_exists( 'twentyten_admin_header_style' ) ) : /** * Styles the header image displayed on the Appearance > Header admin panel. * * Referenced via add_custom_image_header() in twentyten_setup(). * * @since Twenty Ten 1.0 */ function twentyten_admin_header_style() { ?> <style type="text/css"> /* Shows the same border as on front end */ #headimg { border-bottom: 1px solid #000; border-top: 4px solid #000; } /* If header-text was supported, you would style the text with these selectors: #headimg #name { } #headimg #desc { } */ </style> <?php } endif; /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. * * To override this in a child theme, remove the filter and optionally add * your own function tied to the wp_page_menu_args filter hook. * * @since Twenty Ten 1.0 */ function twentyten_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' ); /** * Sets the post excerpt length to 40 characters. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. * * @since Twenty Ten 1.0 * @return int */ function twentyten_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts * * @since Twenty Ten 1.0 * @return string "Continue Reading" link */ function twentyten_continue_reading_link() { return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>'; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. * * @since Twenty Ten 1.0 * @return string An ellipsis */ function twentyten_auto_excerpt_more( $more ) { return ' &hellip;' . twentyten_continue_reading_link(); } add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. * * @since Twenty Ten 1.0 * @return string Excerpt with a pretty "Continue Reading" link */ function twentyten_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= twentyten_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' ); /** * Remove inline styles printed when the gallery shortcode is used. * * Galleries are styled by the theme in Twenty Ten's style.css. This is just * a simple filter call that tells WordPress to not use the default styles. * * @since Twenty Ten 1.2 */ add_filter( 'use_default_gallery_style', '__return_false' ); /** * Deprecated way to remove inline styles printed when the gallery shortcode is used. * * This function is no longer needed or used. Use the use_default_gallery_style * filter instead, as seen above. * * @since Twenty Ten 1.0 * @deprecated Deprecated in Twenty Ten 1.2 for WordPress 3.1 * * @return string The gallery style filter, with the styles themselves removed. */ function twentyten_remove_gallery_css( $css ) { return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); } // Backwards compatibility with WordPress 3.0. if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); if ( ! function_exists( 'twentyten_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own twentyten_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * * @since Twenty Ten 1.0 */ function twentyten_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> <div id="comment-<?php comment_ID(); ?>"> <div class="comment-author vcard"> <?php echo get_avatar( $comment, 40 ); ?> <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?> </div><!-- .comment-author .vcard --> <?php if ( $comment->comment_approved == '0' ) : ?> <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em> <br /> <?php endif; ?> <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> <?php /* translators: 1: date, 2: time */ printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?> </div><!-- .comment-meta .commentmetadata --> <div class="comment-body"><?php comment_text(); ?></div> <div class="reply"> <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </div><!-- .reply --> </div><!-- #comment-## --> <?php break; case 'pingback' : case 'trackback' : ?> <li class="post pingback"> <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p> <?php break; endswitch; } endif; /** * Register widgetized areas, including two sidebars and four widget-ready columns in the footer. * * To override twentyten_widgets_init() in a child theme, remove the action hook and add your own * function tied to the init hook. * * @since Twenty Ten 1.0 * @uses register_sidebar */ function twentyten_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Primary Widget Area', 'twentyten' ), 'id' => 'primary-widget-area', 'description' => __( 'The primary widget area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. register_sidebar( array( 'name' => __( 'Secondary Widget Area', 'twentyten' ), 'id' => 'secondary-widget-area', 'description' => __( 'The secondary widget area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 3, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'First Footer Widget Area', 'twentyten' ), 'id' => 'first-footer-widget-area', 'description' => __( 'The first footer widget area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 4, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Second Footer Widget Area', 'twentyten' ), 'id' => 'second-footer-widget-area', 'description' => __( 'The second footer widget area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 5, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Third Footer Widget Area', 'twentyten' ), 'id' => 'third-footer-widget-area', 'description' => __( 'The third footer widget area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 6, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), 'id' => 'fourth-footer-widget-area', 'description' => __( 'The fourth footer widget area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'twentyten_widgets_init' ); /** * Removes the default styles that are packaged with the Recent Comments widget. * * To override this in a child theme, remove the filter and optionally add your own * function tied to the widgets_init action hook. * * This function uses a filter (show_recent_comments_widget_style) new in WordPress 3.1 * to remove the default style. Using Twenty Ten 1.2 in WordPress 3.0 will show the styles, * but they won't have any effect on the widget in default Twenty Ten styling. * * @since Twenty Ten 1.0 */ function twentyten_remove_recent_comments_style() { add_filter( 'show_recent_comments_widget_style', '__return_false' ); } add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); if ( ! function_exists( 'twentyten_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * * @since Twenty Ten 1.0 */ function twentyten_posted_on() { printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( get_the_author_meta( 'ID' ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), get_the_author() ) ); } endif; if ( ! function_exists( 'twentyten_posted_in' ) ) : /** * Prints HTML with meta information for the current post (category, tags and permalink). * * @since Twenty Ten 1.0 */ function twentyten_posted_in() { // Retrieves tag list of current post, separated by commas. $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list ) { $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); } else { $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) ); } endif;
01happy-blog
trunk/myblog/wp-content/themes/twentyten/functions.php
PHP
oos
19,136
<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div id="container"> <div id="content" role="main"> <?php /* Run the loop to output the post. * If you want to overload this in a child theme then include a file * called loop-single.php and that will be used instead. */ get_template_part( 'loop', 'single' ); ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyten/single.php
PHP
oos
555
<?php /** * The template for displaying Archive pages. * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div id="container"> <div id="content" role="main"> <?php /* Queue the first post, that way we know * what date we're dealing with (if that is the case). * * We reset this later so we can run the loop * properly with a call to rewind_posts(). */ if ( have_posts() ) the_post(); ?> <h1 class="page-title"> <?php if ( is_day() ) : ?> <?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?> <?php elseif ( is_month() ) : ?> <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) ); ?> <?php elseif ( is_year() ) : ?> <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) ); ?> <?php else : ?> <?php _e( 'Blog Archives', 'twentyten' ); ?> <?php endif; ?> </h1> <?php /* Since we called the_post() above, we need to * rewind the loop back to the beginning that way * we can run the loop properly, in full. */ rewind_posts(); /* Run the loop for the archives page to output the posts. * If you want to overload this in a child theme then include a file * called loop-archive.php and that will be used instead. */ get_template_part( 'loop', 'archive' ); ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01happy-blog
trunk/myblog/wp-content/themes/twentyten/archive.php
PHP
oos
1,799
/* Theme Name: Twenty Ten */ /* RTL Basics */ body { direction:rtl; unicode-bidi:embed; } /* LAYOUT: Two-Column (Right) DESCRIPTION: Two-column fixed layout with one sidebar right of content */ #container { float: right; margin: 0 0 0 -240px; } #content { margin: 0 20px 36px 280px; } #primary, #secondary { float: left; } #secondary { clear: left; } /* =Fonts -------------------------------------------------------------- */ body, input, textarea, .page-title span, .pingback a.url, h3#comments-title, h3#reply-title, #access .menu, #access div.menu ul, #cancel-comment-reply-link, .form-allowed-tags, #site-info, #site-title, #wp-calendar, .comment-meta, .comment-body tr th, .comment-body thead th, .entry-content label, .entry-content tr th, .entry-content thead th, .entry-meta, .entry-title, .entry-utility, #respond label, .navigation, .page-title, .pingback p, .reply, .widget-title, input[type=submit] { font-family: Arial, Tahoma, sans-serif; } /* =Structure -------------------------------------------------------------- */ /* The main theme structure */ #footer-widget-area .widget-area { float: right; margin-left: 20px; margin-right: 0; } #footer-widget-area #fourth { margin-left: 0; } #site-info { float: right; } #site-generator { float: left; } /* =Global Elements -------------------------------------------------------------- */ /* Text elements */ ul, ol { margin: 0 1.5em 18px 0; } blockquote { font-style: normal; } /* Text meant only for screen readers */ .screen-reader-text { left: auto; text-indent:-9000px; overflow:hidden; } /* =Header -------------------------------------------------------------- */ #site-title { float: right; } #site-description { clear: left; float: left; font-style: normal; } #branding img { float: right; } /* =Menu -------------------------------------------------------------- */ #access { float:right; } #access .menu-header, div.menu { margin-right: 12px; margin-left: 0; } #access .menu-header li, div.menu li{ float:right; } #access ul ul { left:auto; right:0; float:right; } #access ul ul ul { left:auto; right:100%; } /* =Content -------------------------------------------------------------- */ #content table { text-align: right; margin: 0 0 24px -1px; } .page-title span { font-style:normal; } .entry-title, .entry-meta { clear: right; float: right; margin-left: 68px; margin-right: 0; } .entry-content input.file, .entry-content input.button { margin-left: 24px; margin-right:0; } .entry-content blockquote.left { float: right; margin-right: 0; margin-left: 24px; text-align: left; } .entry-content blockquote.right { float: left; margin-right: 24px; margin-left: 0; text-align: right; } #entry-author-info #author-avatar { float: right; margin: 0 0 0 -104px; } #entry-author-info #author-description { float: right; margin: 0 104px 0 0; } /* Gallery listing -------------------------------------------------------------- */ .category-gallery .gallery-thumb { float: right; margin-left:20px; margin-right:0; } /* Images -------------------------------------------------------------- */ #content .gallery .gallery-caption { margin-right: 0; } #content .gallery .gallery-item { float: right; } /* =Navigation -------------------------------------------------------------- */ .nav-previous { float: right; } .nav-next { float: left; text-align:left; } /* =Comments -------------------------------------------------------------- */ .commentlist li.comment { padding: 0 56px 0 0; } .commentlist .avatar { right: 0; left: auto; } .comment-author .says, #comments .pingback .url { font-style: normal; } /* Comments form */ .children #respond { margin: 0 0 0 48px; } /* =Widget Areas -------------------------------------------------------------- */ .widget-area ul { margin-right: 0; } .widget-area ul ul { margin-right: 1.3em; margin-left: 0; } #wp-calendar caption { text-align: right; } #wp-calendar tfoot #next { text-align: left; } /* Main sidebars */ #main .widget-area ul { margin-right: 0; padding: 0 0 0 20px; } #main .widget-area ul ul { margin-right: 1.3em; margin-left: 0; } /* =Footer -------------------------------------------------------------- */ #site-generator { font-style:normal; } #site-generator a { background-position: right center; padding-right: 20px; padding-left: 0; }
01happy-blog
trunk/myblog/wp-content/themes/twentyten/rtl.css
CSS
oos
4,385
/* Theme Name: Twenty Ten */ /* Used to style the TinyMCE editor. */ html .mceContentBody{ direction: rtl; unicode-bidi: embed; float: right; width: 640px; } * { font-family: Arial, Tahoma, sans-serif; } /* Text elements */ ul, ol { margin: 0 -18px 18px 0; } dd { margin-right: 0; } blockquote { font-style: normal; } table { text-align: right; margin: 0 0 24px -1px; }
01happy-blog
trunk/myblog/wp-content/themes/twentyten/editor-style-rtl.css
CSS
oos
380