So I want create new page, but the documentacion is too hard.
I created "hello" folder in qa-plugin. I created qa-plugin.php file. The content:
<?php
/*
Plugin Name: Hello
Plugin URI:
Plugin Update Check URI:
Plugin Description: Text.......
Plugin Version: 0.1
Plugin Date: 2014-03-05
Plugin Author: atomjani
Plugin Author URI:
Plugin License: GPLv2
Plugin Minimum Question2Answer Version: 1.6
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
qa_register_plugin_module('page', 'hello.php', 'hello_page', 'Hello Page');
/*
Omit PHP closing tag to help avoid accidental output
*/
This is ok?
I created the hello.php file. The content:
<?php
class hello_page {
var $directory;
var $urltoroot;
function load_module($directory, $urltoroot)
{
$this->directory=$directory;
$this->urltoroot=$urltoroot;
}
function suggest_requests() // for display in admin interface
{
return array(
array(
'title' => 'Hello',
'request' => 'hello_page',
'nav' => 'M', // 'M'=main, 'F'=footer, 'B'=before main, 'O'=opposite main, null=none
),
);
}
function match_request($request)
{
if ($request=='hello_page')
return true;
return false;
}
function process_request($request)
{
$qa_content=qa_content_prepare();
$qa_content['title']='This is the browser tittle';
$qa_content['error']='An example error';
$qa_content['custom']='Some <b>custom html</b>';
$qa_content['custom_2']='<p><br>More <i>custom html</i></p>';
return $qa_content;
}
};
/*
Omit PHP closing tag to help avoid accidental output
*/
First I want to create this page and show it in menu. And if this work, I want to put some php code, sql querry. I didn't know that the cookie or session is working with this, because I want some function for registered user. First I have to understand the QA2 plugin using.