metadata.json
{ "name": "My Layer", "description": "Custom layer", "version": "1.0", "date": "2017-04-19", "author": "PowerQA", "author_uri": "http://www.powerqa.org", "license": "GPLv2", "min_q2a": "1.5" }
qa-plugin.php
<?php /* Question2Answer by Gideon Greenspan and contributors http://www.question2answer.org/ File: qa-plugin/my-layer/qa-plugin.php Description: Initiates My Layer plugin 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. More about this license: http://www.question2answer.org/license.php */ /* Plugin Name: My Layer Plugin URI: Plugin Description: Custom layer Plugin Version: 1.0 Plugin Date: 2017-04-19 Plugin Author: PowerQA Plugin Author URI: http://www.powerqa.org/ Plugin License: GPLv2 Plugin Minimum Question2Answer Version: 1.5 Plugin Update Check URI: */ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser header('Location: ../../'); exit; } qa_register_plugin_layer('qa-my-layer.php', 'My Layer');
<?php /* Question2Answer by Gideon Greenspan and contributors http://www.question2answer.org/ File: qa-plugin/my-layer/qa-plugin.php Description: Initiates My Layer plugin
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. More about this license: http://www.question2answer.org/license.php */ /* Plugin Name: My Layer Plugin URI: Plugin Description: Custom layer Plugin Version: 1.0 Plugin Date: 2017-04-19 Plugin Author: PowerQA Plugin Author URI: http://www.powerqa.org/ Plugin License: GPLv2 Plugin Minimum Question2Answer Version: 1.5 Plugin Update Check URI: */
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser header('Location: ../../'); exit; } qa_register_plugin_layer('qa-my-layer.php', 'My Layer');
qa-my-layer.php
<?php /* Question2Answer by Gideon Greenspan and contributors http://www.question2answer.org/ File: qa-plugin/my-layer/qa-my-layer.php Description: Event module class for my layer plugin 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. More about this license: http://www.question2answer.org/license.php */ class qa_html_theme_layer extends qa_html_theme_base { public function c_list($c_list, $class) { if (!empty($c_list) && count($c_list['cs'])) { $title = qa_lang_html_sub(count($c_list['cs'])==1 ? 'main/1_comment' : 'main/x_comments', count($c_list['cs'])); $this->part_title(array('title' => $title, 'title_tags' => 'class="c_list_title"')); } qa_html_theme_base::c_list($c_list, $class); } }
<?php /* Question2Answer by Gideon Greenspan and contributors http://www.question2answer.org/
File: qa-plugin/my-layer/qa-my-layer.php Description: Event module class for my layer plugin
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.
More about this license: http://www.question2answer.org/license.php */ class qa_html_theme_layer extends qa_html_theme_base { public function c_list($c_list, $class) { if (!empty($c_list) && count($c_list['cs'])) { $title = qa_lang_html_sub(count($c_list['cs'])==1 ? 'main/1_comment' : 'main/x_comments', count($c_list['cs'])); $this->part_title(array('title' => $title, 'title_tags' => 'class="c_list_title"')); } qa_html_theme_base::c_list($c_list, $class); } }
<style> .c_list_title { padding: 5px 10px; margin-bottom: -15px; background: #ddd; color: #333; margin-top: 15px; font-size: 14px; } </style>
This is a solution for question page. It is not question list.
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.