Gossamer Forum
Home : Products : DBMan : Customization :

Customise DB using timryan's templates

Quote Reply
Customise DB using timryan's templates
Hello, I have the demo running fine with templates and now I need to customise the DB.

I did changes in the default.cfg
Code:
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Nick => [1, 'alpha', 20, 50, 1, '', ''],
ICQ => [2, 'numer', 20, 20, 1, '', '\d{1}'],
Email => [3, 'alpha', 40, 50, 1, '', '.+@.+..+'],
URL => [4, 'alpha', 40, 75, 0, 'http://', '^http|news|mailto|ftp'],
Cidade => [5, 'alpha', 20, 30, 1, '', ''],
Date => [6, 'date', 15, 15, 1, &get_date, ''],
Status => [7, 'alpha', 20, 150, 1, '', ''],
Contribui => [8, 'alpha', 20, 150, 0, '', ''],
Micro => [9, 'alpha', 30, 50, 1, '', ''],
Conexao => [10, 'alpha', 20, 20, 1, '', ''],
Jogos => [11, 'alpha', 30, 50, 1, '', ''],
Fases => [12, 'alpha', 30, 50, 1, '', ''],
Armas => [13, 'alpha', 30, 50, 1, '', ''],
Descricao => [14, 'alpha', '40x3', 500, 1, '', ''],
'Contact Name' => [15, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [16, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [17, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [18, 'alpha', 10, 5, 0, 'No', ''],
isPopular => [19, 'alpha', 10, 5, 0, 'No', ''],
Rating => [20, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [21, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [22, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Userid => [23, 'alpha', -2, 15, 0, '', '']


);

AnthroRules told that this would be ok, but I found out that I need to change also some html templates, and then I added those new fields in the folloing templates:

add_form.html
modify_form_record.html
html_record.html
record_form.html

what I did was just replace some variables and add others like this
Code:
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Title:</font></td>
<td width="73%">
<input type="text" name="Title" size="40" maxlength="75" value="<%Title%>">

to this

Code:
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Nick:</font></td>
<td width="73%">
<input type="text" name="Title" size="20" maxlength="50" value="<%Nick%>">
</td>

Now I have some other problems:
When I'm going to add a new record some fields do not show up to be filled!:
Those ones:

Code:
# Select fields. Field name => 'comma seperated list of drop down options'.
%db_select_fields = (
Status => 'Player,Founder,Coordenador',
Contribui => 'Design,Moderador da Lista,WebMaster',
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No'

);

Only the ReceiveMail shows up! and I do not know why!

Other problem is that even this way I cannot add a record It says that
There were problems with the following fields:

Nick (Can not be left blank)
ICQ (Can not be left blank)
Email (Can not be left blank)
URL (Invalid format)
URL (Too long. Max length: 75)
Cidade (Can not be left blank)
Status (Can not be left blank)
Micro (Can not be left blank)
Conexao (Can not be left blank)
Jogos (Can not be left blank)
Fases (Can not be left blank)
Armas (Can not be left blank)
Descricao (Can not be left blank)
Contact Email (Invalid format)

What do I do??

Thanks


------------------
I'm not a programer, but I want to know more about computers to understand what is happening.

[This message has been edited by Oliver Prado (edited April 21, 2000).]
Quote Reply
Re: Customise DB using timryan's templates In reply to
If you do not want to require all those fields, then you need to change the 1 in the required column (refer to the db_def format in the default.cfg file) to 0.

Example:

You have:

Code:
ICQ => [2, 'numer', 20, 20, 1, '', '\d{1}'],

Change this to:

Code:
ICQ => [2, 'numer', 20, 20, 0, '', '\d{1}'],

The bolded 0 is what you change.

Regards,
Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
Yes, I know!
but even those that I filled in are now recognized by the script!

Do you want to try?

http://hempclan.hypermart.net/profiles/db.cgi


------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
Uh...you need to add the form that you have in your add.html file into add_error.html file.

I cannot see any syntax errors in your add.html template file at this time.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
I switch back to the default demo and that was fine.

the add_failure does not have any fields, only this:
Code:
<p><font face="Arial, Helvetica, sans-serif" size="2">There were problems with the following fields:<br>
<FONT COLOR="red"><B><%message%></B></FONT></font>
<P><font face="Arial, Helvetica, sans-serif" size="2">Please use the
back button, fix any errors, and submit the record again.</font><font face="Arial, Helvetica, sans-serif" size="2"> </font></p>

So I CHMOD the default.db to 777 but it did not help....

I'll try now to change all fields to 0 (not required to be filled)




------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
 
Quote:
So I CHMOD the default.db to 777 but it did not help....

Uh...the database file needs to be set to 666 (rw-rw-rw-).

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
Now that no fields are required to be filled
I get this error message!

There were problems with the following fields:

URL (Invalid format)
URL (Too long. Max length: 75)
Please use the back button, fix any errors, and submit the record again.

Even when the field is empty this happens....


------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
 
Code:
URL => [4, 'alpha', 40, 200, 0, '', ''],

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
I did it, and then I wass able to add a record in the DB.

But other problem come up....
All the data went in the URL field, I dont know why!
But this explains why before all the fields where showing the erros (required to be filled)

take a look now:
Code:
The following record was successfully added to the database:

(NOTE:This is the html_record Template)
ID: 6
Nick:
ICQ:
E-mail:
URL: craxy@erw.com|asdfsdf.com|its crazy|its crazy|its crazy|its crazy|its crazy|its crazy
Cidade:
Date: 22-Apr-2000
Status:
Contribui:
Micro:
Conexão:
Jogos:
Fases:
Armas:
Descrição
Contact Name: admin
Contact Email: its@crazy.com
Hits: 0
isNew: No
isPopular: No
Rating: 0
Votes: 0
ReceiveMail: Yes
UserID:


(NOTE:This is the html_footer Template)
See it?
Everithing even the | are there!

The problem is with the template add_form.html? or with the default.cfg?

Thanks for the help!!
I'm almost running out of time, because I'm doing this just to learn and in the week I'll have to get back to work...




------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
 
Quote:
add_form.html

That would be the problem...I think your .cfg file is set up properly.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
Oliver Prado:

I could be wrong here and I'm not familiar with the templates mod but in the first .cfg file you showed it had:

URL => [4,'alpha',40,75,0,'http://','^http|news|mailto|ftp'],

I'm not sure you can use the '|' separator code within valid expressions as it may be interpreted another field delimiter.

If you did indeed remove this valid expression, did you also take out any extra field delimiters that may have been added to the database?

Perhaps put your .db file in another directory as a backup and start with a new .db file and see what happens.

Hope this helps Smile
Quote Reply
Re: Customise DB using timryan's templates In reply to
Yes, Lois, you can use a | in the valid expressions field in the .cfg file. Within a regular expression, a | means "or."

I'd really like to help, Oliver, but I just don't have a clue about templates. (Nor why anyone would want to use them, but that's another thread. Smile )

One thing I can say. With all of those fields being added to one field, with the | between them, it appears that the input fields all have the same name. That's what happens when you input multiple items to the same field.

I don't know what this will tell you, but maybe it'll give you a place to start looking for answers.
------------------
JPD


[This message has been edited by JPDeni (edited April 22, 2000).]
Quote Reply
Re: Customise DB using timryan's templates In reply to
I want to thank you all for the hint's!
I think I'll change back to the template demo and then I'll make one change at a time.

Add one field at a time in the default.cfg and in the HTML templates

The problem is that I don't have a lot of time to do this.... (so it will take time)

I was doing this for my quake 2 clan, because when we change some information it takes to much to go change and upload the HTML of our profiles.
So the DBman would be great to us.


But now I'm thinking about an important issue:

Why there are so many MOD's and so many thing's to install and why they don't come together in the same instalation?

Would be easyer for everybody!

If you make a good MOD so it would be added in the next version of DBman!

Everyone would know the same tool!

This does not happens because copyright issues?

Thank's and See ya!

my ICQ if someonte want's to get in touch: 10033735

------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
I believe that JPDeni is on the right track...Make sure that your input fields are NAMED differently in your add.html file.

Also, did you take my suggestion to use the following codes in your default.cfg file?

Code:
URL => [4, 'alpha', 40, 200, 0, '', ''],

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
Wes, I did what you suggested and then all the data came to the same field.

I'll paste part of the add_form.html:

Code:
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">ID:</font></td>
<td width="73%"> <%ID%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="ID" value="<%ID%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Nick:</font></td>
<td width="73%">
<input type="text" name="Title" size="20" maxlength="50" value="<%Nick%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">ICQ:</font></td>
<td width="73%">
<input type="text" name="Title" size="20" maxlength="20" value="<%ICQ%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">E-mail:</font></td>
<td width="73%">
<input type="text" name="URL" size="40" maxlength="50" value="<%Email%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">URL:</font></td>
<td width="73%">
<input type="text" name="URL" size="40" maxlength="75" value="<%URL%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Cidade:</font></td>
<td width="73%">
<input type="text" name="URL" size="20" maxlength="30" value="<%Cidade%>">
</td>
</tr>
It's ok to me, but it does not work



------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
I have a quick question, which I did not pick up before...Are you using LINKS or DBMAN??? The Rating, Hits, Contact Name, Contact Email, ReceiveEmail, isNew, isPopular....lead me to believe that you are using LINKS.

And the problem with the codes you have provided is that you are mismatching "values" for input fields. Look at them again. Also, you only need these "values" in the add_error.html file.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.




[This message has been edited by AnthroRules (edited April 23, 2000).]
Quote Reply
Re: Customise DB using timryan's templates In reply to
There are several reasons all the mods aren't included in the distribution of DBMan. For one thing, all the mods that are currently on the resource center have been written since the last version of DBMan was issued. A new one should be coming out soon, but I don't know which of the mods, if any, will be included.

The other reason that there isn't one DBMan with all mods is that many of them are mutually exclusive. For one thing, if Alex releases the next version with templates, I'll have to go in and remove all the template information just like I did with Links for my own use. Not everyone uses -- or even wants -- all mods. That's the beauty of mods. You can take a basic script and change it to make it like you want it.

Eliot, in Tim's distribution of the DBMan template mod, he uses the templates from Links.


------------------
JPD






Quote Reply
Re: Customise DB using timryan's templates In reply to
 
Quote:
Eliot, in Tim's distribution of the DBMan template mod, he uses the templates from Links.

I am well aware of that...But the fact of the matter is that Oliver is not correctly formatting the template files...and since the Oliver has modified the %db_def hash to include his own fields, I am questioning why he is keeping the extraneous fields...and it looks like a LINKS set-up he is using.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Customise DB using timryan's templates In reply to
I understand what you meant now.
Smile


------------------
JPD






Quote Reply
Re: Customise DB using timryan's templates In reply to
Well, I'm using the TimRyan's DBMan Templats Mod (without links) 8/99. I think this does not have relations with Links templates (but I saw those fields that looks like fields in Links)

And I'm using DBman only.

I made changes in default.cfg and then in the HTML templates.
I just added new fields there.

That code I've pasted in the other message are the HTML code that I've changed.

The original add_form.html:
Code:
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">ID:</font></td>
<td width="73%"> <%ID%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="ID" value="<%ID%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Title:</font></td>
<td width="73%">
<input type="text" name="Title" size="40" maxlength="75" value="<%Title%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">URL:</font></td>
<td width="73%">
<input type="text" name="URL" size="40" maxlength="75" value="<%URL%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Date:</font></td>
<td width="73%"> <%Date%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="Date" value="<%Date%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Category:</font></td>
<td width="73%"><%Category%> <font face="Arial, Helvetica, sans-serif">
</font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Description:</font></td>
<td width="73%">
<textarea name="Description" cols="40" rows="3"><%Description%></textarea>
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Contact
Name:</font></td>
<td width="73%">
<input type="text" name="Contact Name" size="40" maxlength="75" value="<%Contact Name%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%" height="63"><font face="verdana,arial,helvetica" size="2">Contact
Email:</font></td>
<td width="73%" height="63">
<input type="text" name="Contact Email" size="40" maxlength="75" value="<%Contact Email%>">
</td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Hits:</font></td>
<td width="73%"> <%Hits%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="Hits" value="<%Hits%>">
</font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">isNew:</font></td>
<td width="73%"> <%isNew%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="isNew" value="<%isNew%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">isPopular:</font></td>
<td width="73%"> <%isPopular%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="isPopular" value="<%isPopular%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Rating:</font></td>
<td width="73%"> <%Rating%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="Rating" value="<%Rating%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Votes:</font></td>
<td width="73%"> <%Votes%> <font face="Arial, Helvetica, sans-serif">
<input type="Hidden" name="Votes" value="<%Votes%>">
</font><font face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">ReceiveMail:</font></td>
<td width="73%"><%ReceiveMail%> </td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><font face="verdana,arial,helvetica" size="2">Details:</font></td>
<td width="73%">
<h5>
<textarea name="Details" cols="40" rows="3"><%Details%></textarea>
</h5>
</td>
</tr>

The main diferences between this code and the other one that I've pasted upthere is that the other has more fields (that are the ones that I've added in the default.cfg)

What I did was just add new fields in default.cfg and in the html templates.

If I change back to default It works
IF I put my changes It does not work.


[]'s




------------------
I'm not a programer, but I want to know more about computers to understand what is happening.
Quote Reply
Re: Customise DB using timryan's templates In reply to
 
Quote:
The main diferences between this code and the other one that I've pasted upthere is that the other has more fields (that are the ones that I've added in the default.cfg)

No..The difference is that you are using the WRONG values for fields...which causing the mismatch delimiter characters in your URL field.

Look at the codes again....you HAVE the WRONG values in the codes you posted before.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.