Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Add a table to Links and Admin screen

Quote Reply
Add a table to Links and Admin screen
I'm in the process of making some new mods, and releasing code, so I'll be posting "How-to" notes as I do each of the things necessary. Some may be intuitive, but it will all go to the docs in the FAQ..... Some like this, have a few quirks to the process that can drive you batty!


To add a new table to the Links Admin, you need to do several things.

Edit the Admin_HTMLpm file, and after "Registered Users" enter a link
that looks just like that, with the name of your new table, for this
example, we'll say "My_New_Table"

<a href="editor.cgi?db=My_New_Table">My New Table</a><br>

This makes the link from the Admin to the editor.cgi program.

Next, you need to actually create that table! You can do that by issuing
the correct commands in the SQL Monitor, or by using a program such as
phpMyAdmin phpwizard.net/phpMyAdmin/

ID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
Title varchar(100) NOT NULL,
URL varchar(150) NOT NULL,
Add_Date date DEFAULT '0000-00-00' NOT NULL,
... etc ....

Now, reload the admin program, and if you click the "My New Table" link,
you'll get an error! <G>

You need to copy one of the .def files to a new file My_New_Table.def.
Don't worry about what is in it, it can be any table -- as long as you
do the next command next!

Edit the My_New_Table.def file, and change the two lines at the top of
the file to reflect the new table name.

package Links: BSQL::My_New_Table;

$db_table = 'My_New_Table';

After you've COPIED (don't rename, or you'll be missing a table!) the
file to the My_New_Table.def, and made the two changes to the file above,
click the link again, and you'll see the database definition for the table
you used as the template. Click RESYNC and you'll get the new table, new
values, and the table will be accessible in the Links Admin, without affecting
any of your existing tables or values.

POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/

[This message has been edited by pugdog (edited March 18, 2000).]