Webmastersite.net
Register Log In

Adding new table

Comments on Adding new table

kevinsan
Member

Usergroup: Customer
Joined: Nov 11, 2011

Total Topics: 17
Total Comments: 27
Adding new table
Posted Dec 03, 2011 - 9:53 PM:

Trying to create a new table as the example: scripts.webmastersite.net/w...g-database-tables-476.html.

Can see widgets in toplist generator.

aseantradezone.com/1/generi...ction=add&classname=widget always produces an empty query/output:

Debug Info:

Query 9: SELECT `id`,`to`,`subject`,`message`,`headers`,`replacement`,`mime` FROM wsndirectory_email WHERE timesent=0 AND inprogress=0 ORDER BY id ASC LIMIT 0,10

Load time so far: 0.074 seconds.

Number of rows is 0

Creating widget with blank as blank

Load time so far: 0.075 seconds.

Query 10: SELECT `id` FROM wsndirectory_attachments WHERE importurl != '' AND filename != 'failed' LIMIT 0,1

Load time so far: 0.078 seconds.

Number of rows is 0
Count is 0

Setting cookie with name 1_returnto, value aseantradezone.com/1/generi...ction=add&classname=widget and expiration time 0

Doing replacements for member #1

Load time so far: 0.081 seconds.

Here is the info:

Database:
CREATE TABLE IF NOT EXISTS `wsndirectory_widgets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lastedit` time NOT NULL DEFAULT '00:00:00',
`amount` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`ownerid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Custom Template Folder:
widget_add.php
<form action="generics.php?filled=1&action=add&classname=widget" method="post">
<p>Amount: <input type="text" name="amount" value="{WSNDIRECTORY_WIDGETAMOUNT}" size="{STANDARDSIZE}" /> </p>
<br />
<input type="submit" value="Add Widget" />
</form>

Class:
widget.php
<?php
class widget extends generic
{
function __construct($type, $input)
{ // constructor
global $language;
$this->objecttype = 'widget';
$this->objecttable = 'widgetstable';
$this->objectdateformat = $language->dateformat_comments;
parent::__construct($type, $input);
}
}
?>

We have tried many combinations. What are we doing incorrect?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Dec 04, 2011 - 8:57 AM:

kevinsan wrote:
Custom Template Folder:
widget_add.php


This is the problem, it's a template so the file extension needs to be .tpl not .php. When creating it through the admin panel it automatically gets a .tpl extension but I guess you uploaded the file via ftp.
kevinsan
Member

Usergroup: Customer
Joined: Nov 11, 2011

Total Topics: 17
Total Comments: 27
Posted Dec 04, 2011 - 3:03 PM:

Changed page extension to .tpl. All is good. Thanks!
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.