本文整理汇总了PHP中qa_html_theme_base::head_custom方法的典型用法代码示例。如果您正苦于以下问题:PHP qa_html_theme_base::head_custom方法的具体用法?PHP qa_html_theme_base::head_custom怎么用?PHP qa_html_theme_base::head_custom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qa_html_theme_base
的用法示例。
在下文中一共展示了qa_html_theme_base::head_custom方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (qa_opt('ccount')) {
$this->output(qa_opt('ccount_css'));
}
}
示例2: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (qa_opt('priv_active') && qa_opt('priv_check') && qa_get_logged_in_handle()) {
$userid = qa_get_logged_in_userid();
$notices = qa_db_read_one_value(qa_db_query_sub('SELECT meta_value FROM ^usermeta WHERE user_id=# AND meta_key=$ ', $userid, 'priv_notify'), true);
if ($notices) {
$all = explode('^', $notices);
if (!$all[1]) {
// no new
return;
}
$n = explode(',', $all[1]);
$this->notify = '<div class="notify-container">';
$text = count($n) > 1 ? str_replace('#', count($n), qa_opt('priv_notify_text_multi')) : str_replace('^privilege', qa_lang('profile/' . $n[0]), qa_opt('priv_notify_text'));
$text = str_replace('^profile', qa_path_html('user/' . qa_get_logged_in_handle(), array('tab' => 'privileges'), qa_opt('site_url')), $text);
$this->notify .= '<div class="priv-notify notify">' . $text . '<div class="notify-close" onclick="jQuery(this).parent().sildeUp(\'fast\')">x</div></div>';
$this->notify .= '</div>';
// remove notification flag
qa_db_query_sub('UPDATE ^usermeta SET meta_value=$ WHERE meta_key=$ AND user_id=#', ($all[0] ? $all[0] . ',' : '') . $all[1] . '^', 'priv_notify', $userid);
/*
$this->output("
<script>
jQuery('document').ready(function() { jQuery('.notify-container').delay(10000).fadeOut(); });
</script>");
*/
$this->output('
<style>', qa_opt('priv_css'), '</style>');
}
}
}
示例3: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (qa_opt('voting_on_cs')) {
$this->output('
<style>
.comment-votable-container {
width:100% !important;
}
.comment-vote-container {
padding-right: 4px;
text-align: center;
vertical-align:top;
width:12px;
}
.comment-vote-item {
color: silver;
}
.comment-vote-item:hover {
color:black;
cursor:pointer;
}
.comment-vote-item-selected {
color:orange;
cursor:pointer;
}
.comment-vote-item-disabled {
display:none;
}
</style>');
}
}
示例4: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (in_array($this->template, array('question', 'ask', 'not-found')) && qa_opt('confirm_close_plugin')) {
$this->output('<script type="text/javascript">
jQuery("document").ready(function() {
jQuery("form").submit(function(event) {
window.onbeforeunload = null;
});
window.onbeforeunload = function(event) {
var content = false
jQuery("textarea:visible").each( function() {
if(this.value) {
content = true;
return false;
}
});
if (content)
return "You have entered text; are you sure you wish to leave this page?";
}
});
</script>');
}
}
示例5: array
function head_custom()
{
parent::head_custom();
$tmpl = array('ask', 'question');
if (!in_array($this->template, $tmpl)) {
return;
}
$hidecss = qa_opt($this->cssopt) === '1';
$usehljs = qa_opt($this->hljsopt) === '1';
$wmd_buttons = QA_HTML_THEME_LAYER_URLTOROOT . 'pagedown/wmd-buttons.png';
$this->output_raw("<style>\n" . ".wmd-button > span { background-image: url('{$wmd_buttons}') }\n");
// display CSS for Markdown Editor
if (!$hidecss) {
$cssWMD = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/wmd.css');
$this->output_raw($cssWMD);
// display CSS for HighlightJS
if ($usehljs) {
$cssHJS = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/highlightjs.css');
$this->output_raw($cssHJS);
}
}
$this->output_raw("</style>\n\n");
// set up HighlightJS
if ($usehljs) {
$this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/highlight.min.js\"></script>\n" . "<script type=\"text/javascript\">\n" . "\$(function(){\n" . "\t\$('.wmd-input').keypress(function(){\n" . "\t\twindow.clearTimeout(hljs.Timeout);\n" . "\t\thljs.Timeout = window.setTimeout(function() {\n" . "\t\t\thljs.initHighlighting.called = false;\n" . "\t\t\thljs.initHighlighting();\n" . "\t\t}, 500);\n" . "\t});\n" . "\twindow.setTimeout(function() {\n" . "\t\thljs.initHighlighting.called = false;\n" . "\t\thljs.initHighlighting();\n" . "\t}, 500);\n" . "});\n" . "</script>\n\n");
}
//by hoangweb
//$cssHJS = file_get_contents( QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/hoangweb/dropzone.css' ); //print css
/*$this->output_raw("<style>\n");
$this->output_raw($cssHJS);
$this->output_raw("</style>\n\n");*/
$this->output_raw("<link rel=\"stylesheet\" type=\"text/css\" href=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/hoangweb/dropzone.css\"/>");
$this->output_raw("<link rel=\"stylesheet\" type=\"text/css\" href=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/hoangweb/style.css\"/>");
$this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/hoangweb/dropzone.js\"></script>");
}
示例6: head_custom
function head_custom()
{
if ($this->template == 'admin') {
$this->output("\n\t<script>\t\t\t\n\tfunction mergePluginGetPosts() {\n\t\tvar from=jQuery('#merge_from').val();\n\t\tvar to=jQuery('#merge_to').val();\n\n\t\tvar dataString = 'ajax_merge_get_from='+from+'&ajax_merge_get_to='+to; \n\t\tjQuery.ajax({ \n\t\t type: 'POST', \n\t\t url: '" . qa_self_html() . "', \n\t\t data: dataString, \n\t\t dataType: 'json', \n\t\t success: function(json) {\n\t\t\t\tjQuery('#merge_from_out').html('Merging from: <a href=\"'+json.from_url+'\">'+json.from+'</a>');\n\t\t\t\tjQuery('#merge_to_out').html('To: <a href=\"'+json.to_url+'\">'+json.to+'</a>');\n\t\t\t} \n\t\t});\n\t\treturn false;\n\t}\n\t</script>");
}
qa_html_theme_base::head_custom();
}
示例7: rgba
function head_custom()
{
parent::head_custom();
if ($this->template != 'plugin' || $this->request != 'chat') {
return;
}
$hidecss = qa_opt($this->optcss) === '1';
if (!$hidecss) {
$chat_css = '
<style>
#qa-chat-form { text-align: center; }
.qa-chat-post { width: 600px; }
#qa-chat-list, .qa-chat-item, #qa-chat-user-list, .qa-chat-user-item { display: block; list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.4; }
#qa-chat-list { width: 728px; margin: 1em auto; }
.qa-chat-item { overflow: hidden; padding: 4px 0; border-top: 1px solid #eee; }
.qa-chat-item:last-child { border-bottom: 1px solid #eee; }
.qa-chat-item-meta { float: left; width: 110px; padding-right: 20px; font-size: 11px; color: #999; text-align: right; }
.qa-chat-item-data { float: left; width: 598px; }
.qa-chat-user-item { padding: 2px 4px; }
.qa-chat-user-item:hover { background: rgba(255,255,255,0.4); }
.qa-chat-idle, .qa-chat-idle > a { color: #aaa; }
.qa-chat-kick { float: right; cursor: pointer; width: 10px; height: 10px; border-radius: 10px; background: #999; margin-top: 5px; }
.qa-chat-kick:hover { background: #f00; }
.qa-chat-service { background: #fffae4; }
</style>';
$this->output_raw($chat_css);
}
}
示例8: head_custom
function head_custom()
{
if (($this->template == 'user' || qa_opt('user_act_list_new')) && qa_opt('user_act_list_active')) {
$this->output('<style type="text/css">', str_replace('^', QA_HTML_THEME_LAYER_URLTOROOT, qa_opt('user_act_list_css')), '</style>');
}
qa_html_theme_base::head_custom();
}
示例9: head_custom
public function head_custom()
{
parent::head_custom();
$allowed_tmpl = qa_opt($this->allowed_templates_opt);
if (strlen($allowed_tmpl)) {
$tmpl = explode(',', $allowed_tmpl);
} else {
//fall back for the defaults if the option is not set from the admin panel
$tmpl = array('ask', 'question');
}
if (!in_array($this->template, $tmpl)) {
return;
}
$hidecss = qa_opt($this->cssopt) === '1';
$usehljs = qa_opt($this->hljsopt) === '1';
$wmd_buttons = QA_HTML_THEME_LAYER_URLTOROOT . 'pagedown/wmd-buttons.png';
$this->output_raw("<style>\n" . ".wmd-button > span { background-image: url('{$wmd_buttons}') }\n");
// display CSS for Markdown Editor
if (!$hidecss) {
$cssWMD = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/wmd.css');
$this->output_raw($cssWMD);
// display CSS for HighlightJS
if ($usehljs) {
$cssHJS = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/highlightjs.css');
$this->output_raw($cssHJS);
}
}
$this->output_raw("</style>\n\n");
// set up HighlightJS
if ($usehljs) {
$js = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/highlightjs-run.js');
$this->output_raw('<script src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'pagedown/highlight.min.js"></script>' . '<script>' . $js . '</script>');
}
}
示例10: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (qa_opt('admin_plus_dropdown')) {
$this->output("\n<style>\n.qa-nav-main-item{\n\tposition:relative;\n}\n.qa-nav-main-item ul{\n\tpadding-top:1px;\n\tz-index:1000;\n\tbackground:#fff; /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */\n\tbackground:rgba(255,255,255,0); /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */\n\tlist-style:none;\n\tposition:absolute;\n\tleft:-9999px; /* Hide off-screen when not needed (this is more accessible than display:none;) */\n}\n.qa-nav-main-item ul li{\n\tpadding-top:1px; /* Introducing a padding between the li and the a give the illusion spaced items */\n\tfloat:none;\n}\n.qa-nav-main-item ul a{\n\twhite-space:nowrap; /* Stop text wrapping and creating multi-line dropdown items */\n\tfont-size:75%;\n}\n.qa-nav-main-item:hover ul{ /* Display the dropdown on hover */\n\tleft:0; /* Bring back on-screen when needed */\n}\n</style>\n");
}
}
示例11: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (qa_opt('embed_enable_thickbox')) {
$this->output('<script type="text/javascript" src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'thickbox.js"></script>');
$this->output('<link rel="stylesheet" href="' . QA_HTML_THEME_LAYER_URLTOROOT . 'thickbox.css" type="text/css" media="screen" />');
}
}
示例12: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
$this->output('
<style>
' . qa_opt('share_plugin_css') . '
</style>');
}
示例13: head_custom
function head_custom()
{
if (qa_opt('embed_smileys') && qa_opt('embed_smileys_markdown_button')) {
$this->output('<style>', qa_opt('embed_smileys_css'), '</style>');
$this->output('<script>', "\n\t\t\t\tfunction toggleSmileyBox(idx) {\n\t\t\t\t\tjQuery('#smiley-box'+idx).toggle();\n\t\t\t\t}\n\t\t\t\tfunction insertSmiley(code,img,idx) {\n\t\t\t\t\tvar el = jQuery('textarea[index=\"'+idx+'\"]');\n\t\t\t\t\tel.val(el.val()+code);\n\t\t\t\t\ttoggleSmileyBox(idx);\n\t\t\t\t}\n\t\t\t\t", '</script>');
}
qa_html_theme_base::head_custom();
}
示例14: head_custom
function head_custom()
{
qa_html_theme_base::head_custom();
if (qa_opt('badge_active')) {
$this->output("\n\t\t\t\t<script>" . (qa_opt('badge_notify_time') != '0' ? "\n\t\t\t\t\tjQuery('document').ready(function() { jQuery('.notify-container').delay(" . (int) qa_opt('badge_notify_time') * 1000 . ").slideUp('fast'); });" : "") . "\n\t\t\t\t\tfunction badgeEdit(slug,end) {\n\t\t\t\t\t\tif(end) {\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').hide();\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').show();\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').html(jQuery('#badge_'+slug+'_edit').val());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').hide();\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').show();\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').focus();\n\t\t\t\t\t}\n\t\t\t\t</script>");
$this->output('
<style>', qa_opt('badges_css'), '</style>');
}
}
示例15:
function head_custom()
{
parent::head_custom();
if (qa_opt('qa_btt_enabled')) {
$script = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'js/qa-btt.js');
$script = str_replace('QA_PLUGINDIR', QA_HTML_THEME_LAYER_URLTOROOT, $script);
$this->output_raw('<script>' . $script . '</script>');
}
}