-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathqa-faq-layer.php
46 lines (29 loc) · 1.01 KB
/
qa-faq-layer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
class qa_html_theme_layer extends qa_html_theme_base {
// theme replacement functions
function head_script() {
qa_html_theme_base::head_script();
}
function head_css()
{
qa_html_theme_base::head_css();
$this->output('<style>',qa_opt('faq_css'),'</style>');
}
function body_prefix()
{
if (!qa_get_logged_in_userid() && !@$_COOKIE['qa_faq_noshow'] && qa_opt('faq_notify_show')) {
setcookie('qa_faq_noshow','true',0, '/', QA_COOKIE_DOMAIN);
$this->faq_notify();
}
qa_html_theme_base::body_prefix();
}
// worker functions
// faq popup notification
function faq_notify() {
$notice = '<div class="notify-container">';
$text = str_replace('^faq','<a href="'.qa_path_html(qa_opt('faq_page_url')).'">'.qa_opt('faq_page_slug').'</a>',qa_opt('faq_notify_text'));
$notice .= '<div class="notify">'.$text.'<div class="notify-close" onclick="jQuery(this).parent().slideUp(\'fast\')">x</div></div>';
$notice .= '</div>';
$this->output($notice);
}
}