News:

Wondering if this will always be free?  See why free is better.

Main Menu

Table From CSV

Started by Anguz, October 27, 2004, 06:34:53 AM

Previous topic - Next topic

Garry

Thanks for the come back agridoc

I recognize that Bloc just released it and that is why I worded my post the way I did

QuoteI am just curious as to whether  you would be interested in seeing if you could bet it to work in the articles as that would be a tremendous function if you could sort in and article.

It actully works in TP as a BBC function to create the Table

Its the Javascript portion that isnt working there which is totally understandable

The new TP has unleashed a temendous range of posibilities especilly with the abillity for the average user to use BBC and make a pretty page with out having to know any HTML

I am just playing at the moment and finding out which BBC mods work in the TP BBC area

so far the user_name function works  but it doesnt show the button for it  but if you use the bbc it works fine

and the csv to table works  but the sorting area doesnt


so once again  thanks for the come back

Ill keep playing to see what works and what doesnt

so far I have tried those two mods  and they are at least trying to work 





agridoc

I did a test install with SMF 1.1.4 and TinyPortal v1.0.5 beta .

I tried Table From CSV in TP BBC articles with simple amd complex tables. Both display and sorting work OK.

If you used the version that was given with the April fool (not checked with this subversion) announcement, uninstall it and use the latest.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

ianus

#182
Greetings!

I can confirm that. I have installed SMF1.1.4 and TP v1.0.5 beta 1 – just for testing.
This is not my live-site and the link will not stay forever. Also, what you see is absolute unperfect and some own scrips causes errors.

But the (brilliant!) table mod will work with the new TP Version and the tables are sortable inside an bbc-article.
Have a look at

example deleted - sorry for that, but it was a testing enviroment only





agridoc

Thank you ianus  ;)

I can't give a link but my test included a "copy paste" code from my working forum for a table with 9 columns (with either text or numbers) and 42 rows.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Butcher

Very nice mod Anguz thanks,

I have some prob with the table on how it looks like

what should i change so the fonts, bgcolor etc of the table don't have styles from: body, a:hover, but only from the .sortarrow, .csvtable td, .sortbg1 td, .sortbg2 td, .sortable th ?

ianus

Greetings!

It seems that you have found the correct entries in the style.css already.
So I don't understand your problem exactly.

Imho you can add all definitions which fit your needs.
A small example..

.sortbg1 td
{
color: green;
background-color: #FFF;
}


I you use a custom theme, you have to add the sortable definitions to the style.css of your theme.

Butcher

ok, let me put it this way. as u can u see i found what to change but it doesn't work.

background-color: some_color; don't work
background: url(some_image.gif); work

color: some_color; work but when the scripts loads the font colors are as the a:link, a:hover option.


ianus

Greetings!

Well, it seems that CSS could be black magic.


background: url(some_image.gif); work
The url definition is working, because there is no other url definiton for "background".
(Try to set an url background for the main table.
Find: /* By default (td, body..) use verdana in black.*/
Add:  background: url(images/ some_image.gif);
The image of the .sortable should behave like the background-color, it will be overwritten.

background-color: some_color; don't work
This isn't working, because there is (at least) one other definition.

Question:
Why the extra ".sorttable" is ignored and the other td definition shows up instead?

Answers (maybe, maybe not):
1.: If you have a second css file.
(I use to have a custom script running, which comes with it's own .css.
Both, the smf.css and the script.css are called in the index.template.php.
Originally the script.css use .script a{} but it was overwritten by the smf.css, even with the extra .script.)
- If you have a second css with td definitions, try to disable it temporary.

2.: First don't come first.
- Make sure the .sortable td is at the very last position in your style.css


This is the css part.
I'm very sure that it is possible to change the style of the sorttables.
I have just set up a new SMF with the tables mod and changed some colors.
This is only for testing and I will delete it again. But till then you can have a look at the colorful tables:
http://www.firopolis.de/smf/index.php?topic=3.0


The php/html part could cause this behavior also.
I this case, it is nearly impossible to give an answer.
Maybe there is a missing </td>, maybe there is a missing </div>, maybe ...


If you like, you can attach your style.css.
I'm not at home this weekend, but I can spend some time the next week.

Abadd0n

Original 1.3 isn't comportable with SMF 2.0 beta 4, and looks like author doesn't support this mod anymore, so this is modified version. Works with 2.0, probably with 1.x, but not tested.

Changes:
tag now is [ctable=] because tag [ table ] already exist
default separator is ; because it is more common for csv (just IMO)

http://custom.simplemachines.org/mods/index.php?mod=1583

TerryMullins

#189
Abadd0n,

I tried to download this using the link that you provided.
When I clicked on the link, I got a message that the file isn't ready for download.

I think that it could be helpful with the problem that I am working on...
http://www.simplemachines.org/community/index.php?topic=284090.msg1864951#msg1864951

Thank you,
Terry Mullins

Anguz

Quote from: Abadd0n on January 05, 2009, 08:39:15 AM
Original 1.3 isn't comportable with SMF 2.0 beta 4, and looks like author doesn't support this mod anymore, so this is modified version. Works with 2.0, probably with 1.x, but not tested.

Changes:
tag now is [ctable=] because tag [ table ] already exist
default separator is ; because it is more common for csv (just IMO)

http://custom.simplemachines.org/mods/index.php?mod=1583

You're quite bad mannered. I didn't give you permission to use my code, much less to claim it yours. If you want to write your own mod, then go ahead, don't use mine. Don't assume that I don't support it, I just haven't seen the need for support for this mod lately. When a problem arised, usually the same or other users found the solution before I had to do it. An update to the latest SMF version is planned when it reaches Final, not Betas, as was the case before. I would consider writing an update for an earlier release if I see many asking politely, but I didn't expect to have someone do what you did. Others have, with other mods, offered to update the code to a version of SMF they were using, but asked for permission first. Please remove your post from here and the Mod Site.
Cristián Lávaque http://cristianlavaque.com

ianus

Greetings!

Thanks a lot for your reply!
I have written nearly the same some hours ago, but I was sure that you will answer.
After my experience with the last big SMF update, I never lost the trust that you will be here at the right time.
So I decided to wait a little bit to let you take the lead and completely agree with your post.

In addition, this mod works perfect with the SMF2b4. My board depend on this beautiful mod in large parts and I tried to use it in a test environment. Only a small change is necessary to make the magic happen.

Sounds like I am a fan-boy? Well yes!

Anguz

Quote from: ianus on January 06, 2009, 04:56:05 PM
Greetings!

Thanks a lot for your reply!
I have written nearly the same some hours ago, but I was sure that you will answer.
After my experience with the last big SMF update, I never lost the trust that you will be here at the right time.
So I decided to wait a little bit to let you take the lead and completely agree with your post.

In addition, this mod works perfect with the SMF2b4. My board depend on this beautiful mod in large parts and I tried to use it in a test environment. Only a small change is necessary to make the magic happen.

Sounds like I am a fan-boy? Well yes!


Thanks a lot. I really appreciate the support. It's messages like this one that make me want to keep working on  these things. I'm really glad you find this mod so useful, that was my whole intention when I coded it. Hopefully SMF 2 Final will come soon. :)
Cristián Lávaque http://cristianlavaque.com

agridoc

As I had tested with early versions, I thought that  Table From CSV 1.30 worked with SMF 2.0.

After the last messages I did a test, as Ianus reported, it works somehow but needs a little work.

Speaking of mod upgrades, an upgrade should keep working with old posts depending on the mod.

I also waited for Anguz's response, he is just idling, he will open the throttle when needed  ;D
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

sheryltoo

I tried to install this mod on 1.1.7 yesterday but I don't think it's working. Do I need to make any changes to make it work in 1.1.7 or should I have not installed it?
Thanks for any help on this.
Sheryl

agridoc

sheryltoo version 1.30 installs and works properly in 1.1.7.

Try this in your forum.
[table=|]A|B|C
1|2|3
4|5|6[/table]


If you use another theme as default, some manual adding of code will be necessary for display and sorting. Main code will work.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

ianus

Greetings!

Welcome agridoc! Always a pleasure to read your posts.

@sheryltoo
As Agridoc stated, this mod will work in a SMF1.1.7 and you can use it without a doubt.
His code example is perfect to run a test.
But I you need further help, please explain your problems a little bit more detailed. I'm sure we will find a solution.

Quote
Speaking of mod upgrades, an upgrade should keep working with old posts depending on the mod.
I use an own tag to show the tables since the mod is compatible for 1.1.x. So I only change the original "table" to "csv" and I'm done. It seems to me, that the new parser won't accept the "table" anymore, but my knowledge of writing code is awfully bad.

sheryltoo

I copied that code into a message at my site and it displayed a table only how do I insert those tags using my forum's task bar?
The only table icon brings up the standard table with tr and td.
How do I get that straight line after table=
I don't see any way to use a table other then the standard way which is why I was thinking it's not working right.
Maybe I'm missing something.
Also, in reading over all the messages in this thread, am I to understand that you could put a background image using an url, inside a table in a message?
If so, how would you code that?
Sheryl

agridoc

sheryltoo I used | as separator.

CSV (Comma Separated Values) is a form for storing data. Ususally comma , is used as separator for American systems, semicolon ; for european.

The tag in Table from CSV is simple

[table=][table]

If no other separator is added after table= the separator defaults to comma. Example with a table

[table=]A,B,C
1,2,3
4,5,6[/table]


Table From CSV is of little use for small tables.

It's value shows with big tables (results, catalogs etc.)

In these cases data is exported to a CSV file and the contents are added between the tags.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

ianus

#199
agridoc is right. Credits for this useful clarification.

After using this mod for years now, I quit to build a own button for it. But at the very beginning, I like to have one and I have written a small how-to on the german support board.
Now, this is the quick translation - for SMF 1.1.x

First, you have to create an image for the button. Look at /themes/default/images/bbc for exampels to get the neccessary heigt and weight of the image. Your own image has to go there also.

Next:
(Backup first!)
In Themes/default/post.template.php
Search:
$context['bbc_tags'] = array();

Add: (where the button should appear)
'table' => array('code' => 'table', 'before' => '[table=]', 'after' => '[/table]', 'description' => $txt['table']),

Example:
array(),
'table' => array('code' => 'table', 'before' => '[table=]', 'after' => '[/table]', 'description' => $txt['table']),
'table' => array('code' => 'table', 'before' => '[table]', 'after' => '[/table]', 'description' => $txt[436]),
'tr' => array('code' => 'td', 'before' => '[tr]', 'after' => '[/tr]', 'description' => $txt[449]),
'td' => array('code' => 'td', 'before' => '[td]', 'after' => '[/td]', 'description' => $txt[437]),
array(),


You have to edit each custom theme which has its own post.template.php

If you want to have the hover text also.
Open modifications.english.php
and add
$txt['table'] = 'CSV Table';

You can change the hover text of course and If you used to have another language installed, you have to edit the coresponding language file also.

A button is attached. I made it years ago and you can use it if you like.

Notes:
The given code will not include an separator automatically. Can be done, but maybe your user want to use different separators.
You have to edit the SMF source.
Because of this, I recommend to follow agridoc's hint and use the existing table button and add a = and the separator while posting.

For the background images.
You can edit your style.css to add things like this. But I do not recommend to add an image.
It will slow down things if you include a big table and use an image for each field.
Use a color definition and you will be fine.
Of course you can insert an image as a table data, or include spoiler-code, list-code, whatever.
But it is recommended to fill out every table-field. If you have noting to show, use a . or – or something.

Example:
(bad code, Number 6 is missing and field is empty)
[table=|]A|B|C
1|2|3
4|5|
(good code, Number 6 is missing but – is used instead)
[table=|]A|B|C
1|2|3
4|5|-
Table in action:
(With images)
http://www.firopolis.de/forum/index.php/topic,2394.0.html
(With some lists)
http://www.firopolis.de/forum/index.php/topic,1372.0.html[/hr]

Advertisement: