============================================================
One example (Notice at top for first time visitors)
============================================================
This is the method of using message to visitor.
Core Hack
qa-include/qa-page.php (L696 [case V1.5.4])
Before:
if (qa_opt('show_notice_visitor') && (!isset($topath)) && (!isset($_COOKIE['qa_noticed'])))
$qa_content['notices'][]=qa_notice_form('visitor', qa_opt('notice_visitor'));
After:
if (qa_opt('show_notice_visitor') && (!isset($topath)) && (!isset($_COOKIE['qa_noticed'])))
if($requestlower=='ask') // <- add this line
$qa_content['notices'][]=qa_notice_form('visitor', qa_opt('notice_visitor'));
Settings
-
admin -> users
-
Check "Notice at top for first time visitors - HTML allowed:"
-
Input "Be careful manners and ask."(example) in textbox
Test
Test after erasing COOKIE("qa_noticed") of your domain.
============================================================
Another example (Custom message on register form)
============================================================
This is the method of using message to users who registered.
Core Hack
qa-include/qa-page.php (L702 [case V1.5.4])
Before:
if (qa_opt('show_notice_welcome') && (qa_get_logged_in_flags() & QA_USER_FLAGS_WELCOME_NOTICE) )
if ( ($requestlower!='confirm') && ($requestlower!='account') ) // let people finish registering in peace
$qa_content['notices'][]=qa_notice_form('welcome', qa_opt('notice_welcome'));
After:
if (qa_opt('show_notice_welcome') && (qa_get_logged_in_flags() & QA_USER_FLAGS_WELCOME_NOTICE) )
if ( ($requestlower!='confirm') && ($requestlower!='account') ) // let people finish registering in peace
if ($requestlower=='ask') // <- add this line
$qa_content['notices'][]=qa_notice_form('welcome', qa_opt('notice_welcome'));
Settings
-
admin -> users
-
Check "Custom message on register form - HTML allowed:"
-
Input "Be careful manners and ask."(example) in textbox
Test
Register new user, and test by that new user. Since existing user's QA_USER_FLAGS_WELCOME_NOTICE is OFF, it is not fit for test.