*===============================
MOD BEGIN FOR PHPMYFAQ
===============================*
phpMyFaq
Open index.php
replace:
if (isset($_REQUEST) && is_string($_REQUEST) && !preg_match("=/=", $_REQUEST) && isset($allowedVariables[$_REQUEST)) {
$action = trim($_REQUEST); }
} else {
$action = "main";
}
with:
if (isset($_REQUEST) && is_string($_REQUEST) && !preg_match("=/=", $_REQUEST) && isset($allowedVariables[$_REQUEST)) {
$action = trim($_REQUEST);
$template_action = trim($_REQUEST);
} else {
$action = "main";
}
replace:
if (isset($auth)) {
$login_tpl = 'template/loggedin.tpl';
with:
if (isset($_REQUEST)) { $template_action = $_REQUEST; }
if (isset($auth)) {
$login_tpl = 'template/loggedin.tpl';
replace:
$tpl = new PMF_Template (array(
'index' => 'template/index.tpl',
'loginBox' => $login_tpl,
'rightBox' => $right_tpl,
'writeContent' => $inc_tpl));
with:
if (isset($_REQUEST)) {
$tpl = new PMF_Template (array(
'index' => 'template/ost_index.tpl',
'loginBox' => $login_tpl,
'rightBox' => $right_tpl,
'writeContent' => $inc_tpl));
} else {
$tpl = new PMF_Template (array(
'index' => 'template/index.tpl',
'loginBox' => $login_tpl,
'rightBox' => $right_tpl,
'writeContent' => $inc_tpl));
}
create a template file templates/ost_index.tpl
paste the code below into the file:
<!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">>
<html xmlns="http://www.w3.org/1999/xhtml" xml="{metaLanguage}" lang="{metaLanguage}">
<head>
<title>{title}</title>
<base href="{baseHref}" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset={metaCharset}" />
<meta name="title" content="{metaTitle}" />
<meta name="description" content="{metaDescription}" />
<meta name="keywords" content="{metaKeywords}" />
<meta name="author" content="{metaPublisher}" />
<meta name="publisher" content="{metaPublisher}" />
<meta name="copyright" content="(c) 2001 - 2008 phpMyFAQ Team" />
<meta name="generator" content="phpMyFAQ {version}" />
<meta name="Content-Language" content="{metaCharset}" />
<meta name="robots" content="INDEX, FOLLOW" />
<meta name="revisit-after" content="7 days" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<style type="text/css" media="screen"> /*<!<!<C><s>```</s>[CDATA>*/ </style>
<style type="text/css" media="print"> /*<!<![CDATA<e>```</e></C>>*/ </style>
<script type="text/javascript" src="inc/js/functions.js"></script>
<link rel="shortcut icon" href="template/favicon.ico" type="image/x-icon" />
<link rel="icon" href="template/favicon.ico" type="image/x-icon" />
<link rel="alternate" title="News RSS Feed" type="application/rss+xml" href="feed/news/rss.php" />
<link rel="alternate" title="TopTen RSS Feed" type="application/rss+xml" href="feed/topten/rss.php" />
<link rel="alternate" title="Latest FAQ Records RSS Feed" type="application/rss+xml" href="feed/latest/rss.php" />
<link rel="alternate" title="Open Questions RSS Feed" type="application/rss+xml" href="feed/openquestions/rss.php" />
<link rel="microsummary" type="application/x.microsummary+xml" href="microsummary.php?action={action}" />
<link rel="search" type="application/opensearchdescription+xml" title="{metaTitle}" href="{opensearch}" />
</head>
<body dir="{dir}" onload="java_script();">
start main content
<div class="centercolumn">
<div class="centerpadding">
<div class="main-content" id="main">
{writeContent}
</div>
</div>
</div>
end main content
</body>
</html>
save a copy of of templates/artikel.tpl as ost_artikel.tpl
paste the code below into the file:
<h2>{writeThema}</h2>
Article
<div id="article_content">{writeContent}</div>
/Article
Voting Form
<div id="voting">
<form action="{saveVotingPATH}" method="post" target="_blank" style="display: inline;">
<fieldset>
<legend>{msgVoteUseability}</legend>
<input type="hidden" name="artikel" value="{saveVotingID}" />
<p align="center"><strong>{msgAverageVote}</strong> {printVotings}</p>
<p align="center">{msgVoteBad}
<input class="radio" type="radio" name="vote" value="1" /> 1
<input class="radio" type="radio" name="vote" value="2" /> 2
<input class="radio" type="radio" name="vote" value="3" /> 3
<input class="radio" type="radio" name="vote" value="4" /> 4
<input class="radio" type="radio" name="vote" value="5" /> 5
{msgVoteGood}<br />
<input class="submit" type="submit" name="submit" value="{msgVoteSubmit}" />
</p>
</fieldset>
</form>
</div>
/Voting Form
*NOTES: *
The articles shown on the new ticket page to the customer are shown
based on the tags / help topic names matching. For example if you have a help topic "ABC Returns" you would want to put the matching tag "ABC Returns" into each article in phpMyFaq realted to that help topic.
Secondly the query $suggested in open.inc.php uses my database references. You will need to change the FROM tables to match your own.
Finally the ajax call in the javascript in open.inc.php uses my phpMyFaq location. Your location may be different and /faq/ need to be changed to match yours.
http.open("GET", "/faq/index.php?ost_action=ost_artikel&action=artikel&artlang=en&id=" + kba, true);
If you have any problems with this mod let me know and I will be happy to help you where I can.