News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

FAQ (Frequently Asked Questions) mod

Started by All Colours Sam, June 20, 2011, 08:19:18 PM

Previous topic - Next topic

Chalky

I've just updated to the latest version.  Thanks Suki, I do like this mod  :)

DSystem

Ola. I'm trying to install this mod. Even in a clean install of SMF. More pops up the following error:

Database Error
Unknown column 'category_last_user' in 'field list'
File: /home/dsystem/public_html/smf/Packages/temp/database.php
Line: 190

I'll be very grateful if you have any solution

Thank you.

awolexpat

I am using the latest version of SMF and had a version of this mod previously installed in June of last year - sorry don't know the version number.

I am getting the same error as an earlier poster after uninstalling the old version and installing the new, as follows:
Unknown column 'c.category_log' in 'field list'
File: /home3/awolonl1/public_html/forum/Sources/Subs-Faq.php
Line: 279

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.4 while your database is at version 2.0.1. The above error might possibly go away if you execute the latest version of upgrade.php.


It installs without errors but this message appears when clicking on the FAQ link. I have not tried the database upgrade solution yet as I saw the previous poster who had the same issue; I also don't know where I can find the latest version of upgrade.php. Is this the complete forum package? I don't really understand why my database would not have been upgraded when i went to 2.0.4.

I also tried uninstalling and then installing from the Github repository (as argued at length on here) but whether with a zipped set or files uploaded to the Packages my SMF won't allow me to - with the zipped package it tells me there is nothing there and with the unzipped files it doesn't see the package at all to allow me to install. There are no installation instructions on Github either as far as I can tell.

With the previous poster you asked them to attach a file but there was nothing more since, so would it be possible to put what code changes are required on here? I have looked at the line the error is meant to have occurred on but of course the error is somewhere before that.

Kindred

don't worry about that message....   it's a generic and incorrect message that has nothing to do with your issue
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

awolexpat

OK, thanks Kindred I figured it might be. If anyone knows how to resolve the issue then I would be very grateful.

jsx

Quote from: DSystem on April 28, 2013, 07:01:25 PM
Ola. I'm trying to install this mod. Even in a clean install of SMF. More pops up the following error:

Database Error
Unknown column 'category_last_user' in 'field list'
File: /home/dsystem/public_html/smf/Packages/temp/database.php
Line: 190

I'll be very grateful if you have any solution

Thank you.

I get the same error. How to fix it?

Bobby

#386
Quote from: jsx on March 09, 2020, 02:55:53 PM
Quote from: DSystem on April 28, 2013, 07:01:25 PM
Ola. I'm trying to install this mod. Even in a clean install of SMF. More pops up the following error:

Database Error
Unknown column 'category_last_user' in 'field list'
File: /home/dsystem/public_html/smf/Packages/temp/database.php
Line: 190

I'll be very grateful if you have any solution

Thank you.

I get the same error. How to fix it?

This error might cause by the database. Go to your phpmyadmin and try to run these SQL statements:


--
-- Table structure for table `smf_faq`
--
DROP TABLE IF EXISTS `smf_faq`;
CREATE TABLE `smf_faq` (
  `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `cat_id` int(5) NOT NULL,
  `log` text NOT NULL,
  `title` varchar(255) NOT NULL DEFAULT '',
  `body` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `smf_faq`
--

INSERT INTO `smf_faq` (`id`, `cat_id`, `log`, `title`, `body`) VALUES
(1, 1, 'a:1:{i:0;a:2:{s:4:\"user\";i:1;s:4:\"time\";i:1584116938;}}', 'Your FAQ question 1', 'This is your answer 1  ;)'),
(2, 1, 'a:1:{i:0;a:2:{s:4:\"user\";i:1;s:4:\"time\";i:1584116972;}}', 'Your FAQ question 2', 'This is your answer 2  :)');

-- --------------------------------------------------------

--
-- Table structure for table `smf_faq_categories`
--
DROP TABLE IF EXISTS `smf_faq_categories`;
CREATE TABLE `smf_faq_categories` (
  `category_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `category_name` varchar(255) NOT NULL DEFAULT '',
  `category_last_user` int(11) DEFAULT NULL,
  `category_log` int(10) NOT NULL DEFAULT 0,
  PRIMARY KEY (`category_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `smf_faq_categories`
--

INSERT INTO `smf_faq_categories` (`category_id`, `category_name`, `category_last_user`, `category_log`) VALUES
(1, 'General', 1, '0');


--
-- Dumping data for table `smf_settings`
--
UPDATE `smf_settings` SET `value` = '1' WHERE `smf_settings`.`variable` = 'faqmod_settings_enable';
UPDATE `smf_settings` SET `value` = '5' WHERE `smf_settings`.`variable` = 'faqmod_num_faqs';
UPDATE `smf_settings` SET `value` = '1' WHERE `smf_settings`.`variable` = 'faqmod_show_catlist';
UPDATE `smf_settings` SET `value` = '3' WHERE `smf_settings`.`variable` = 'faqmod_show_latest';
UPDATE `smf_settings` SET `value` = 'id' WHERE `smf_settings`.`variable` = 'faqmod_sort_method';
UPDATE `smf_settings` SET `value` = 'home' WHERE `smf_settings`.`variable` = 'faqmod_menu_position';
UPDATE `smf_settings` SET `value` = '1' WHERE `smf_settings`.`variable` = 'faqmod_use_javascript';
UPDATE `smf_settings` SET `value` = '1' WHERE `smf_settings`.`variable` = 'faqmod_care';


Note: change all values "smf_" prefix with your own {database_prefix}

Kindred

Heya Suki,

Installing on 2.1 I get the following error

BLOB, TEXT, GEOMETRY or JSON column 'log' can't have a default value
File: .../Packages/temp/database.php
Line: 165
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

All Colours Sam

I commited a few fixes to the 2.0 branch: https://github.com/MissAllSunday/faq/tree/2.0

Can you test it out to see if there isn't any more errors before releasing a new version?

direct download: https://github.com/MissAllSunday/faq/archive/2.0.zip  Its double-foldered so unzip and re-zipjust the needed folders and files
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Speed King

Just installed FAQ mod version 2.0 on my SMF 2.1 RC3 test forum, running on PHP 8.0
It seems that mod is working properly, I have tested creating of new categories and new FAQs. New FAQs are saved successfully, editing of existing FAQs too.

I think that drop-down menu in admin panel for position of the FAQ mod button in the main forum menu next to... (Home, Help, Search, Login, Sign Up) needs to be edited, because in SMF 2.1 'Help' and 'Login' buttons do not exist.

All Colours Sam

Cool, good to know an almost 10 years old codebase still holds up.

Yeah the button position didn't aged well, will see what I can do to release a patch for it.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Kindred

@Suki

Still using this mod -- thank you for a really solid piece of work.

Lately, I've been seeing a bunch of these errors
.../index.php?action=faq;sa=categories;fid=1'123
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'123'
ORDER BY title ASC' at line 4
File: /.../Sources/Subs-Faq.php
Line: 238

some of them replace the '123 with %27

I saw the same errors happening in the Glossary mod --   I suspect it is some sort of injection attack that is getting interrupted by the error.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

All Colours Sam

Thanks for the report, perhaps now is the time to do a most needed update.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Diego Andrés

I suppose for Kindred
$lid = (int) $faqObject->clean($_GET['fid']);
could be a temporary patch. That should make the is_numeric check true

SMF Tricks - Free & Premium Responsive Themes for SMF.

All Colours Sam

Quote from: Suki on December 20, 2024, 08:32:23 AMThanks for the report, perhaps now is the time to do a most needed update.

And here it is, a Beta that adds support for 2.1, no new features were added besides simplifying permissions and adding a custom block on top of the page for those who might want to add a custom message or something.

If anyone wants to try it out and report any error back, that would be great.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Speed King

Just installed beta version on my SMF 2.1.4 forum.
The mod works fine, but I get an error message in the server error log file:

PHP Warning:  Undefined array key "faq_use_js" in /home/***/public_html/BNF/Themes/default/Faq.template.php on line 28
Forum details:

Forum version: SMF 2.1.4 (more detailed)
Current SMF version: SMF 2.1.4
GD version: bundled (2.1.0 compatible)
MySQL engine: MariaDB
MySQL version: 10.6.21-MariaDB-log
SMF file based caching: 2.1.4
Memcache:
Memcached:
SQLite3 database based caching: 3.26.0
PHP: 8.4.5 (more detailed)
Server version: Apache

All Colours Sam

Ah thank you for the report, it was an oversight on my part, I forgot that SMF new $modsettings fields doesn't really exists until you actually set them in the admin panel, I committed a fix for it:

On Themes/default/Faq.template.php
Find:
$useJavaScript = $modSettings[Faq::NAME .'_'. FaqAdmin::SETTINGS_USE_JS];


Replace with:
$useJavaScript = $utils->setting(FaqAdmin::SETTINGS_USE_JS);
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Advertisement: