Commit 59ad6e0a by Scott

Coding style (default plugins)

parent 9b5766d2
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_basic_adsense { class qa_basic_adsense
{
public function allow_template($template) public function allow_template($template)
{ {
return ($template!='admin'); return ($template!='admin');
...@@ -89,24 +89,16 @@ ...@@ -89,24 +89,16 @@
?> ?>
<div style="<?php echo $divstyle?>"> <div style="<?php echo $divstyle?>">
<script type="text/javascript"> <script type="text/javascript">
google_ad_client = <?php echo qa_js(qa_opt('adsense_publisher_id'))?>; google_ad_client = <?php echo qa_js(qa_opt('adsense_publisher_id'))?>;
google_ad_width = <?php echo qa_js($width)?>; google_ad_width = <?php echo qa_js($width)?>;
google_ad_height = <?php echo qa_js($height)?>; google_ad_height = <?php echo qa_js($height)?>;
google_ad_format = <?php echo qa_js($format)?>; google_ad_format = <?php echo qa_js($format)?>;
google_ad_type = "text_image"; google_ad_type = "text_image";
google_ad_channel = ""; google_ad_channel = "";
</script> </script>
<script type="text/javascript" <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div> </div>
<?php <?php
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,15 +34,10 @@ ...@@ -34,15 +34,10 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('widget', 'qa-basic-adsense.php', 'qa_basic_adsense', 'Basic AdSense'); qa_register_plugin_module('widget', 'qa-basic-adsense.php', 'qa_basic_adsense', 'Basic AdSense');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_event_logger { class qa_event_logger
{
public function init_queries($table_list) public function init_queries($table_list)
{ {
if (qa_opt('event_logger_to_database')) { if (qa_opt('event_logger_to_database')) {
...@@ -228,10 +228,4 @@ ...@@ -228,10 +228,4 @@
} }
} }
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,15 +34,10 @@ ...@@ -34,15 +34,10 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('event', 'qa-event-logger.php', 'qa_event_logger', 'Event Logger'); qa_register_plugin_module('event', 'qa-event-logger.php', 'qa_event_logger', 'Event Logger');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
return array( return array(
'page_title' => 'Example plugin page (US English)', 'page_title' => 'Example plugin page (US English)',
); );
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
return array( return array(
'page_title' => 'Example plugin page (UK English)', 'page_title' => 'Example plugin page (UK English)',
); );
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_example_page { class qa_example_page
{
private $directory; private $directory;
private $urltoroot; private $urltoroot;
...@@ -95,10 +95,4 @@ ...@@ -95,10 +95,4 @@
return $qa_content; return $qa_content;
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,16 +34,11 @@ ...@@ -34,16 +34,11 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('page', 'qa-example-page.php', 'qa_example_page', 'Example Page'); qa_register_plugin_module('page', 'qa-example-page.php', 'qa_example_page', 'Example Page');
qa_register_plugin_phrases('qa-example-lang-*.php', 'example_page'); qa_register_plugin_phrases('qa-example-lang-*.php', 'example_page');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,23 +20,18 @@ ...@@ -20,23 +20,18 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_html_theme_layer extends qa_html_theme_base { class qa_html_theme_layer extends qa_html_theme_base
{
public function head_css() public function head_css()
{ {
qa_html_theme_base::head_css(); qa_html_theme_base::head_css();
if (strlen(qa_opt('facebook_app_id')) && strlen(qa_opt('facebook_app_secret'))) if (strlen(qa_opt('facebook_app_id')) && strlen(qa_opt('facebook_app_secret'))) {
$this->output( $this->output(
'<style>', '<style>',
'.fb-login-button.fb_iframe_widget.fb_hide_iframes span {display:none;}', '.fb-login-button.fb_iframe_widget.fb_hide_iframes span {display:none;}',
'</style>' '</style>'
); );
} }
} }
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_facebook_login_page { class qa_facebook_login_page
{
private $directory; private $directory;
private $urltoroot; private $urltoroot;
...@@ -83,10 +84,4 @@ ...@@ -83,10 +84,4 @@
qa_redirect_raw($tourl); qa_redirect_raw($tourl);
} }
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_facebook_login { class qa_facebook_login
{
public function match_source($source) public function match_source($source)
{ {
return $source=='facebook'; return $source=='facebook';
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
</script> </script>
<div class="fb-login-button" style="display:inline; vertical-align:middle;" size="<?php echo $size?>" <?php echo $logout ? 'autologoutlink="true"' : 'scope="email,user_about_me,user_location,user_website"'?>> <div class="fb-login-button" style="display:inline; vertical-align:middle;" size="<?php echo $size?>" <?php echo $logout ? 'autologoutlink="true"' : 'scope="email,user_about_me,user_location,user_website"'?>>
</div> </div>
<?php <?php
} }
...@@ -126,10 +125,4 @@ ...@@ -126,10 +125,4 @@
), ),
); );
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -35,19 +35,15 @@ ...@@ -35,19 +35,15 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
if (!QA_FINAL_EXTERNAL_USERS) { // login modules don't work with external user integration // login modules don't work with external user integration
if (!QA_FINAL_EXTERNAL_USERS) {
qa_register_plugin_module('login', 'qa-facebook-login.php', 'qa_facebook_login', 'Facebook Login'); qa_register_plugin_module('login', 'qa-facebook-login.php', 'qa_facebook_login', 'Facebook Login');
qa_register_plugin_module('page', 'qa-facebook-login-page.php', 'qa_facebook_login_page', 'Facebook Login Page'); qa_register_plugin_module('page', 'qa-facebook-login-page.php', 'qa_facebook_login_page', 'Facebook Login Page');
qa_register_plugin_layer('qa-facebook-layer.php', 'Facebook Login Layer'); qa_register_plugin_layer('qa-facebook-layer.php', 'Facebook Login Layer');
} }
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_mouseover_admin_form { class qa_mouseover_admin_form
{
public function option_default($option) public function option_default($option)
{ {
if ($option === 'mouseover_content_max_len') if ($option === 'mouseover_content_max_len')
...@@ -71,10 +71,4 @@ ...@@ -71,10 +71,4 @@
), ),
); );
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_html_theme_layer extends qa_html_theme_base { class qa_html_theme_layer extends qa_html_theme_base
{
public function q_list($q_list) public function q_list($q_list)
{ {
if (!empty($q_list['qs']) && qa_opt('mouseover_content_on')) { // first check it is not an empty list and the feature is turned on if (!empty($q_list['qs']) && qa_opt('mouseover_content_on')) { // first check it is not an empty list and the feature is turned on
...@@ -63,10 +63,4 @@ ...@@ -63,10 +63,4 @@
qa_html_theme_base::q_list($q_list); // call back through to the default function qa_html_theme_base::q_list($q_list); // call back through to the default function
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,16 +34,11 @@ ...@@ -34,16 +34,11 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_layer('qa-mouseover-layer.php', 'Mouseover Layer'); qa_register_plugin_layer('qa-mouseover-layer.php', 'Mouseover Layer');
qa_register_plugin_module('module', 'qa-mouseover-admin-form.php', 'qa_mouseover_admin_form', 'Mouseover Layer'); qa_register_plugin_module('module', 'qa-mouseover-admin-form.php', 'qa_mouseover_admin_form', 'Mouseover Layer');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,18 +20,12 @@ ...@@ -20,18 +20,12 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_html_theme_layer extends qa_html_theme_base { class qa_html_theme_layer extends qa_html_theme_base
{
public function head_links() public function head_links()
{ {
qa_html_theme_base::head_links(); qa_html_theme_base::head_links();
$this->output('<link rel="search" type="application/opensearchdescription+xml" title="'.qa_html(qa_opt('site_title')).'" href="'.qa_path_html('opensearch.xml').'"/>'); $this->output('<link rel="search" type="application/opensearchdescription+xml" title="'.qa_html(qa_opt('site_title')).'" href="'.qa_path_html('opensearch.xml').'"/>');
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_opensearch_xml { class qa_opensearch_xml
{
public function match_request($request) public function match_request($request)
{ {
return ($request=='opensearch.xml'); return ($request=='opensearch.xml');
...@@ -48,10 +48,4 @@ ...@@ -48,10 +48,4 @@
return null; return null;
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,16 +34,11 @@ ...@@ -34,16 +34,11 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_layer('qa-opensearch-layer.php', 'OpenSearch Layer'); qa_register_plugin_layer('qa-opensearch-layer.php', 'OpenSearch Layer');
qa_register_plugin_module('page', 'qa-opensearch-page.php', 'qa_opensearch_xml', 'OpenSearch XML'); qa_register_plugin_module('page', 'qa-opensearch-page.php', 'qa_opensearch_xml', 'OpenSearch XML');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,15 +34,10 @@ ...@@ -34,15 +34,10 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('captcha', 'qa-recaptcha-captcha.php', 'qa_recaptcha_captcha', 'reCAPTCHA'); qa_register_plugin_module('captcha', 'qa-recaptcha-captcha.php', 'qa_recaptcha_captcha', 'reCAPTCHA');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,14 +20,8 @@ ...@@ -20,14 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser class qa_recaptcha_captcha
header('Location: ../'); {
exit;
}
class qa_recaptcha_captcha {
private $directory; private $directory;
public function load_module($directory, $urltoroot) public function load_module($directory, $urltoroot)
...@@ -139,10 +133,4 @@ ...@@ -139,10 +133,4 @@
return false; return false;
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,15 +34,10 @@ ...@@ -34,15 +34,10 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('widget', 'qa-tag-cloud.php', 'qa_tag_cloud', 'Tag Cloud'); qa_register_plugin_module('widget', 'qa-tag-cloud.php', 'qa_tag_cloud', 'Tag Cloud');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_tag_cloud { class qa_tag_cloud
{
public function option_default($option) public function option_default($option)
{ {
if ($option === 'tag_cloud_count_tags') if ($option === 'tag_cloud_count_tags')
...@@ -141,10 +141,4 @@ ...@@ -141,10 +141,4 @@
$themeobject->output('</div>'); $themeobject->output('</div>');
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,16 +34,11 @@ ...@@ -34,16 +34,11 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('editor', 'qa-wysiwyg-editor.php', 'qa_wysiwyg_editor', 'WYSIWYG Editor'); qa_register_plugin_module('editor', 'qa-wysiwyg-editor.php', 'qa_wysiwyg_editor', 'WYSIWYG Editor');
qa_register_plugin_module('page', 'qa-wysiwyg-upload.php', 'qa_wysiwyg_upload', 'WYSIWYG Upload'); qa_register_plugin_module('page', 'qa-wysiwyg-upload.php', 'qa_wysiwyg_upload', 'WYSIWYG Upload');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -245,8 +245,3 @@ class qa_wysiwyg_editor ...@@ -245,8 +245,3 @@ class qa_wysiwyg_editor
return qa_html(number_format($bytes/1048576, 1)); return qa_html(number_format($bytes/1048576, 1));
} }
} }
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -56,8 +56,3 @@ class qa_wysiwyg_upload ...@@ -56,8 +56,3 @@ class qa_wysiwyg_upload
return null; return null;
} }
} }
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -34,15 +34,10 @@ ...@@ -34,15 +34,10 @@
*/ */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../'); header('Location: ../../');
exit; exit;
} }
qa_register_plugin_module('page', 'qa-xml-sitemap.php', 'qa_xml_sitemap', 'XML Sitemap'); qa_register_plugin_module('page', 'qa-xml-sitemap.php', 'qa_xml_sitemap', 'XML Sitemap');
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
More about this license: http://www.question2answer.org/license.php More about this license: http://www.question2answer.org/license.php
*/ */
class qa_xml_sitemap { class qa_xml_sitemap
{
private $directory; private $directory;
private $urltoroot; private $urltoroot;
...@@ -288,10 +288,4 @@ ...@@ -288,10 +288,4 @@
"\t\t<priority>".max(0, min(1.0, $priority))."</priority>\n". "\t\t<priority>".max(0, min(1.0, $priority))."</priority>\n".
"\t</url>\n"; "\t</url>\n";
} }
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment