Turning "ask question" on and off
Moderator: Thorsten
-
- Posts: 6
- Joined: Sat Jan 07, 2006 10:14 am
Turning "ask question" on and off
hi,
is there a way to turn the "ask question feature on and off?
regards,
sally.
is there a way to turn the "ask question feature on and off?
regards,
sally.
Hi Sally,
sure. Just remove the link in index.tpl.
bye
Thorsten
sure. Just remove the link in index.tpl.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
- Posts: 6
- Joined: Sat Jan 07, 2006 10:14 am
Hi,
no, there's no option for that in the admin panel. Sorry.
bye
Thorsten
no, there's no option for that in the admin panel. Sorry.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi,
this isn't as possible as it might be and there are no new features in 1.5.x.
bye
Thorsten
this isn't as possible as it might be and there are no new features in 1.5.x.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
remove the link
Just removing the link won't do! I have been spammed after doing so. The PHP page is still available! I don't know if robots can track it or some people just know it is there!
Is there a function/routine/module that can be deleted/renamed/commented_out to COMPLETELY disable it? Or change something to display "GO PLAY SOMEWHERE ELSE"
I don't mean to say it is a big problem! But removing LINKS is not a proper way. FUNCTIONALITIES should be removed.
Is there a function/routine/module that can be deleted/renamed/commented_out to COMPLETELY disable it? Or change something to display "GO PLAY SOMEWHERE ELSE"
I don't mean to say it is a big problem! But removing LINKS is not a proper way. FUNCTIONALITIES should be removed.
Hi,
okay, but this needs a big enhancement to our template engine to support blocks which ca be enabled or disabled.
bye
Thorsten
okay, but this needs a big enhancement to our template engine to support blocks which ca be enabled or disabled.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi,
delete the file savequestion.php.
bye
Thorsten
delete the file savequestion.php.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
I am a beginner too - and the spammers on ask question were driving me nuts
so with php book in hand i wrote a banned word function and did some tweaking
1. added to functions.php
function checkBannedWord($content)
{
require_once('inc/fileIterator.php'); //http://www.phpguru.org/
// Set the block counter
foreach (new FileIterator('inc/blockedWords.txt') as $line)
{
if (preg_match("/$content/i", $line)) {
return FALSE;
}
}
}
2 in savequestion.php i changed
A)
if (isset($_REQUEST["username"]) && $_REQUEST["username"] != '' && isset($_REQUEST["usermail"]) && checkEmail($_REQUEST["usermail"]) && isset($_REQUEST["content"]) && $_REQUEST["content"] != '' && IPCheck($_SERVER["REMOTE_ADDR"])) {
to
if (isset($_REQUEST["username"]) && $_REQUEST["username"] != '' && isset($_REQUEST["usermail"]) && checkEmail($_REQUEST["usermail"]) && isset($_REQUEST["content"]) && $_REQUEST["content"] != '' && checkBannedWord($_REQUEST["content"]) && IPCheck($_SERVER["REMOTE_ADDR"])) {
B) changed
if (checkEmail($usermail)) {
to
if (checkEmail($usermail)&& checkBannedWord($_REQUEST["content"])) {
C) changed
if (IPCheck($_SERVER["REMOTE_ADDR"]) == FALSE) {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_bannedIP"]
));
} else {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_SaveQuestion"]
));
}
to
if (IPCheck($_SERVER["REMOTE_ADDR"]) == FALSE) {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_bannedIP"]
));
} elseif (checkBannedWord($_REQUEST["content"]) == FALSE) {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_bannedWord"]
));
} else {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_SaveQuestion"]
));
}
3) and last added
$PMF_LANG["err_bannedWord"] = "Your content has been banned.";
to language_en.php
i got blocked words from the pmwiki cookbook blocklist2
so with php book in hand i wrote a banned word function and did some tweaking
1. added to functions.php
function checkBannedWord($content)
{
require_once('inc/fileIterator.php'); //http://www.phpguru.org/
// Set the block counter
foreach (new FileIterator('inc/blockedWords.txt') as $line)
{
if (preg_match("/$content/i", $line)) {
return FALSE;
}
}
}
2 in savequestion.php i changed
A)
if (isset($_REQUEST["username"]) && $_REQUEST["username"] != '' && isset($_REQUEST["usermail"]) && checkEmail($_REQUEST["usermail"]) && isset($_REQUEST["content"]) && $_REQUEST["content"] != '' && IPCheck($_SERVER["REMOTE_ADDR"])) {
to
if (isset($_REQUEST["username"]) && $_REQUEST["username"] != '' && isset($_REQUEST["usermail"]) && checkEmail($_REQUEST["usermail"]) && isset($_REQUEST["content"]) && $_REQUEST["content"] != '' && checkBannedWord($_REQUEST["content"]) && IPCheck($_SERVER["REMOTE_ADDR"])) {
B) changed
if (checkEmail($usermail)) {
to
if (checkEmail($usermail)&& checkBannedWord($_REQUEST["content"])) {
C) changed
if (IPCheck($_SERVER["REMOTE_ADDR"]) == FALSE) {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_bannedIP"]
));
} else {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_SaveQuestion"]
));
}
to
if (IPCheck($_SERVER["REMOTE_ADDR"]) == FALSE) {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_bannedIP"]
));
} elseif (checkBannedWord($_REQUEST["content"]) == FALSE) {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_bannedWord"]
));
} else {
$tpl->processTemplate ("writeContent", array(
"msgQuestion" => $PMF_LANG["msgQuestion"],
"Message" => $PMF_LANG["err_SaveQuestion"]
));
}
3) and last added
$PMF_LANG["err_bannedWord"] = "Your content has been banned.";
to language_en.php
i got blocked words from the pmwiki cookbook blocklist2
oops
typo in function - add last lines
function checkBannedWord($content)
{
require_once('inc/fileIterator.php');
// Set the block counter
foreach (new FileIterator('inc/blockedWords.txt') as $line)
{
// gets the content as part of a whole if (preg_match("/$content/i", $line)) {
if (preg_match("/\b$content\b/i", $line)) {
return FALSE;
} else {
return true;
}
}
}
typo in function - add last lines
function checkBannedWord($content)
{
require_once('inc/fileIterator.php');
// Set the block counter
foreach (new FileIterator('inc/blockedWords.txt') as $line)
{
// gets the content as part of a whole if (preg_match("/$content/i", $line)) {
if (preg_match("/\b$content\b/i", $line)) {
return FALSE;
} else {
return true;
}
}
}
Hi,
can I take your code under the terms of the MPL and add it into 1.6? If yes, please write me an e-mail and tell me your full name for your credits.
bye
Thorsten
can I take your code under the terms of the MPL and add it into 1.6? If yes, please write me an e-mail and tell me your full name for your credits.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist