If you mean that i've forgotten to create the /classes/widget.php file and template files. that been done already.
The files have been uploaded and sitting in the appropriate folders. I've been over the tutorial for a few hours and can't find which step I've missed.
The tutorial did say it was introduced in 5.0.0 Alpha 3, is the tutorial still valid?
Comments on Error adding new database table
Member
Usergroup: Customer
Joined: Feb 04, 2006
Total Topics: 8
Total Comments: 22
Hi Paul,
I've been playing around with the 5 series and was having some issues with the "Adding Database Tables" tutorial.
I've successfully create the table in mysql and can be seen from within the Toplist Generator feature in the Admin panel.
Though when i initate the page via the link "generics.php?action=add&classname=widgets" i get the following error message.
Fatal error: Class 'widgets' not found in /home/firstbyt/public_html/test_5/generics.php on line 69
Any idea where i might have gone wrong?
below is the database query.
regards
FBM
CREATE TABLE IF NOT EXISTS `wsnlinks_widgets` (
`id` int(11) NOT NULL auto_increment,
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
`lastedit` time NOT NULL default '00:00:00',
`amount` int(11) NOT NULL default '0',
`ownerid` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
It says you didn't add the class. If you do just the table without the class then you can only do toplists and not additions/edits/etc.
Member
Usergroup: Customer
Joined: Feb 04, 2006
Total Topics: 8
Total Comments: 22
Hi Paul.
thanks for the reply.
If you mean that i've forgotten to create the /classes/widget.php file and template files. that been done already.
The files have been uploaded and sitting in the appropriate folders. I've been over the tutorial for a few hours and can't find which step I've missed.
The tutorial did say it was introduced in 5.0.0 Alpha 3, is the tutorial still valid?
regards
FBM
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
What's the content of your classes/widget.php?
Member
Usergroup: Customer
Joined: Feb 04, 2006
Total Topics: 8
Total Comments: 22
HI Paul,
The only changes were thoses on the tutorial.
code below.
<?php
class search extends generic
{
function __construct($type, $input)
{ // constructor
global $language;
$this->objecttype = 'widgets';
$this->objecttable = 'widgetstable';
$this->objectdateformat = $language->dateformat_comments;
parent::__construct($type, $input);
}
function canview() { return true; }
}
?>
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
If you're doing a widgets table, it should be class widgets -- class search is for the search table.