Additional Criteria when submitting question
Moderator: Thorsten
Additional Criteria when submitting question
How hard would it be to add additional fields when one needs to submit a questions for our FAQ?
We would like to have additional fields for the following along with the usual category, name, email..etc.
Make:
Model:
Year:
Engine Size:
We would like to have additional fields for the following along with the usual category, name, email..etc.
Make:
Model:
Year:
Engine Size:
Hi,
to do this you have two options:
- an easy hack that writes all the additional stuf into the main content table without any new columns in the database.
- a big hack with new columns in the database.
bye
Thorsten
to do this you have two options:
- an easy hack that writes all the additional stuf into the main content table without any new columns in the database.
- a big hack with new columns in the database.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
We'd perfer the easy route, as then, when an upgrade comes out, the DB hasn't been touched and just the files will need modded again. Much easier route.Thorsten wrote:Hi,
to do this you have two options:
- an easy hack that writes all the additional stuf into the main content table without any new columns in the database.
- a big hack with new columns in the database.
bye
Thorsten
This would be nice to have an admin feature, where one can add additional criteria fields on the form for that extra details.
Hi,
you can hack that into add.php.
bye
Thorsten
you can hack that into add.php.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Would that be in this area?
Code: Select all
$tpl->processTemplate ("writeContent", array(
"msgNewContentHeader" => $PMF_LANG["msgNewContentHeader"],
"msgNewContentAddon" => $PMF_LANG["msgNewContentAddon"],
"writeSendAdress" => $_SERVER["PHP_SELF"]."?".$sids."action=save",
"defaultContentMail" => getEmailAddress(),
"defaultContentName" => getFullUserName(),
"msgNewContentName" => $PMF_LANG["msgNewContentName"],
"msgNewContentMail" => $PMF_LANG["msgNewContentMail"],
"msgNewContentCategory" => $PMF_LANG["msgNewContentCategory"],
"printCategoryOptions" => $tree->printCategoryOptions($category),
"msgNewContentTheme" => $PMF_LANG["msgNewContentTheme"],
"readonly" => $readonly,
"printQuestion" => $question,
"msgNewContentArticle" => $PMF_LANG["msgNewContentArticle"],
"msgNewContentKeywords" => $PMF_LANG["msgNewContentKeywords"],
"msgNewContentLink" => $PMF_LANG["msgNewContentLink"],
"copyright_eintrag" => unhtmlentities($PMF_CONF["copyright_eintrag"]),
"msgNewContentSubmit" => $PMF_LANG["msgNewContentSubmit"],
));
$tpl->includeTemplate("writeContent", "index");
Hi,
sorry, it's in the file save.php. Sorry for that!
bye
Thorsten
sorry, it's in the file save.php. Sorry for that!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi Vanessa,
you have to change various lines of code...
bye
Thorsten
you have to change various lines of code...
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Sorry, I understand that this is a troublesome hack but any nudge in the right direction would be much appreciated (and I'll come back to post the solution so that other people can use it as well) -
If I want people to enter their country (for example) under name and email when asking a question, I understand that I would have to edit:
language_en.php
ask.php
ask.tpl
What should I edit if I want to this information to automatically appear into the content box whenever someone goes to the "Open Questions" page or the admin goes to "Edit Open Questions"? (Which I'm assuming is what Thorsten means is the "easy hack that writes stuff into the main content table".) It would be good if some extra HTML is added to say "This question was asked by <INSERT USERNAME> from <INSERT COUNTRY>" and the admin can choose whether they want to include it in the answer, when they answer the question.
I've been staring at save.php and savequestion.php for the past 8 hours - any help would be great!
If I want people to enter their country (for example) under name and email when asking a question, I understand that I would have to edit:
language_en.php
Code: Select all
// ask Question
...
$PMF_LANG["msgCountry"] = "Your country:";
Code: Select all
$tpl->processTemplate('writeContent', array(
...
'msgCountry' => $PMF_LANG['msgCountry'],
Code: Select all
<label for="country" class="left">{msgCountry}</label>
<input class="inputfield" type="text" name="division" id="country" size="50" /><br />
I've been staring at save.php and savequestion.php for the past 8 hours - any help would be great!
Hi,
which version do you use?
bye
Thorsten
which version do you use?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi,
okay.... and where should the country appear?
bye
Thorsten
okay.... and where should the country appear?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
If it's possible, I'd want it to appear as part of the answer - for example, to say "This question was asked by [AUTHOR] from [COUNTRY]" at the beginning of the answer to each question. Is this what you mean by the "easy hack that writes all the additional stuff into the main content table without any new columns in the database"?
Hi,
I would add this sentence in the user name column, if that's okay for you.
bye
Thorsten
I would add this sentence in the user name column, if that's okay for you.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist