Hi again,
I have been trying to add two textfield. one plain text and one for url.
The name I used in the files where I have been adding thoose to is: os & dev
After editing and updating the module I can see the two new text field in admin. I add some text to them and press the button "Modify". The I choose edit and check if the text is still there but it's gone.
I have also tried to make a new link but with the same result.
This is my first time to do thi kind of editing, so I guess I have missed something or done something wrong.
Below is what I have done:
wflinks/sql/wflinks.sql
# Table structure for table 'wflinks_links'
`os` varchar(25) NOT NULL,
`dev` varchar(255) NOT NULL,
# Table structure for table 'wflinks_mod'
`os` varchar(25) NOT NULL default ",
`dev` varchar(255) NOT NULL,
wflinks/submit.php
$os = $wfmyts -> addslashes( ltrim( $_REQUEST["os"] ) );
$dev = $wfmyts -> addslashes( ltrim( $_REQUEST["dev"] ) );
$sql = "INSERT INTO " . $xoopsDB -> prefix( 'wflinks_links' ) . " (lid, cid, title, url, submitter, status, date, hits, rating, votes, comments, forumid, published, expired, offline, description, ipaddress, notifypub, country, keywords, item_tag, googlemap, yahoomap, multimap, street1, street2, town, state, zip, tel, fax, voip, mobile, email, vat, os, dev ) ";
$sql .= " VALUES ('', $cid, '$title', '$url', '$submitter', '$status', '$date', 0, 0, 0, 0, '$forumid', '$publishdate', 0, '$offline', '$descriptionb', '$ipaddress', '$notifypub', '$country', '$keywords', '$item_tag', '$googlemap', '$yahoomap', '$multimap', '$street1', '$street2', '$town', '$state', '$zip', '$tel', '$fax', '$voip', '$mobile', '$email', '$vat', '$os', '$dev' )";
$sql = "UPDATE " . $xoopsDB -> prefix( 'wflinks_links' ) . " SET cid=$cid, title='$title', url='$url', updated='$updated', offline='$offline', description='$descriptionb', ipaddress='$ipaddress', notifypub='$notifypub', country='$country', keywords='$keywords', item_tag='$item_tag', googlemap='$googlemap', yahoomap='$yahoomap', multimap='$multimap', street1='$street1', street2='$street2', town='$town', state='$state', zip='$zip', tel='$tel', fax='$fax', voip='$voip', mobile='$mobile', email='$email', vat='$vat', os='$os, dev='$dev WHERE lid=" . intval($lid);
$sql = "INSERT INTO " . $xoopsDB -> prefix( 'wflinks_mod' ) . " (requestid, lid, cid, title, url, forumid, description, modifysubmitter, requestdate, country, keywords, item_tag, googlemap, yahoomap, multimap, street1, street2, town, state, zip, tel, fax, voip, mobile, email, vat, os, dev)";
$sql .= " VALUES ('', $lid, $cid, '$title', '$url', '$forumid', '$descriptionb', '$modifysubmitter', '$requestdate', '$country', '$keywords', '$item_tag', '$googlemap', '$yahoomap', '$multimap', '$street1', '$street2', '$town', '$state', '$zip', '$tel', '$fax', '$voip', '$mobile', '$email', '$vat', '$os', '$dev')";
$os = $link_array['os'] ? $wfmyts -> htmlSpecialCharsStrip( $link_array['os'] ) : '';
$dev = $link_array['dev'] ? $wfmyts -> htmlSpecialCharsStrip( $link_array['dev'] ) : 'http://';
$sform -> addElement( new XoopsFormText( _MD_WFL_OS, 'os', 70, 25, $os ), true );
$sform -> addElement( new XoopsFormText( _MD_WFL_DEV, 'dev', 70, 255, $dev ) );
wflinks/include/update.php
//Make changes to table wflinks_links
$i++;
$ret[$i] = true;
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_links') . " ADD COLUMN os VARCHAR(25) NOT NULL default '' AFTER multimap");
$ret[$i] = $ret[$i] && $xoopsDB->query($query[$i]);
$i++;
$ret[$i] = true;
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_links') . " ADD COLUMN dev VARCHAR(255) NOT NULL default '' AFTER os");
$ret[$i] = $ret[$i] && $xoopsDB->query($query[$i]);
$i++;
$ret[$i] = true;
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_links') . " MODIFY os TEXT NOT NULL default ''");
$ret[$i] = $ret[$i] && $xoopsDB->query($query[$i]);
$i++;
$ret[$i] = true;
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_links') . " MODIFY dev TEXT NOT NULL default ''");
$ret[$i] = $ret[$i] && $xoopsDB->query($query[$i]);
//Make changes to table wflinks_mod
$i++;
$ret[$i] = true;
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_mod') . " ADD COLUMN os VARCHAR(25) NOT NULL default '' AFTER mobile");
$ret[$i] = $ret[$i] && $xoopsDB->query($query[$i]);
$i++;
$ret[$i] = true;
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_mod') . " ADD COLUMN dev VARCHAR(25) NOT NULL default '' AFTER os");
$ret[$i] = $ret[$i] && $xoopsDB->query($query[$i]);
wflinks/language/english/main.php
define( '_MD_WFL_OS', 'OS Version' );
define( '_MD_WFL_DEV', 'Dev. Homepage' );
wflinks/language/english/admin.php
define( "_AM_WFL_OS", "OS Version" );
define( "_AM_WFL_LINK_DEV", "Dev. URL: " );
wflinks/update/weblinks_update.php
//Delete some Fields
$result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_links' ) . " DROP os");
$result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix( 'wflinks_links' ) . " DROP dev");
What have I done wrong or missed?
Best Regards
Ahlis