Hey all,
I've installed the table manager-module and created a custom table called "games"
date -> Date format
home_team -> Text
visiting_team -> Text
sets_home_team -> Numeric
sets_visiting_team -> Numeric
This table contains all games for next season (about 700 games).
Currently I'm displaying the full table content with this command print tablemanager_display(1, 15, true);
But I would like to have an easy way to filter out and display all games for a given week number. (eg Display current week games, previous & next weeks games, ...)
How would i do this ?
Can the table manager cope with this ?
Is there an another module that can help ?
Ps. I tried the events module, but this did not fulfill my needs.
Thanks,
T
Comments
Wow! I didn't actually imagine anyone used my module!!!
Tablemanager doesn't do that... But... I can create a custom function which will. You'll have to provide me with a link to your table and explain fully how you need it to work. I won't be able to do anything this weekend as I'm away, but I can promise you it'll be easy-ish and won't take too long once I'm back home.
Pobster
Table Manager is just great !! :-)
mmm ... my Drupal is currently only installed on my laptop.
I'll get Drupal with the table manager installed this evening on my public webspace.
And I'll write a functional spec with some feature requests.
Cheers.
I'm quite touched that two
I'm quite touched that two people have said nice things about my module in just one week! :o) VERY encouraging! :o)
Yes please, send in some feature request to my module page - I enjoy adding custom functions to my module!
Thanks
Pobster
Done!
Okay in the newest CVS version (http://cvs.drupal.org/viewcvs/drupal/contributions/modules/tablemanager/...) there is now a function to show restrictive dates, you call it like this:
print tablemanager_display_date(15, NULL, TRUE, 3, '1980/01/01', '2006/01/01');To break it down, its:
tablemanager_display_date(table_id, pagination, show_links, column_for_date_restriction, start, end, extra_attributes)
Seeing as when you call the function you're using php anyway, this allows you to insert the date using:
date('Y/m/d')So in effect you can call it like this to show all events one month into the future (from today):
print tablemanager_display_date(15, NULL, TRUE, 3, date('Y/m/d'), date('Y/m/d', mktime(0, 0, 0, date('m')+1, date('d'), date('Y'))));And perhaps to show everyone in a table who is under 25 years of age:
print tablemanager_display_date(15, NULL, TRUE, 3, date('Y/m/d', mktime(0, 0, 0, date('m'), date('d'), date('Y')-25)), date('Y/m/d'));Check out this link for more information:
http://uk.php.net/manual/en/function.date.php
I'm sure there's a cleaner way to do it rather than that messy mktime/ date thingy, but I've never really played around with date formatting before so maybe someone else could shed some light? Still it works that way ;o)
Pobster
I LIKE IT!!!
Well... Not that I've released it yet, but because I actually quite liked the idea of this custom function I've now incorporated it into the main function. To simplify it you can now call it like this:
print tablemanager_display(15, NULL, TRUE, array('column' => 3, 'start' => date('Y/m/d', mktime(0, 0, 0, date('m'), date('d'), date('Y')-25)), 'end' => date('Y/m/d')));If you don't wish to call it just pass NULL instead (as the extra attributes are still entered at the very end).
I'll release it later as I'm a bit busy at work at the moment.
Pobster
Using cell attributes question
I am using table manager on a drupal site under development and I would like to use colspan for a row in a table. Is this possible using cell attributes? I have successfully used [bgcolor=yellow] in a cell to change the background color but can't seem to get colspan to work.
Again, is colspan possible and if so how would I implement it?
Thanks.
Don't ask questions twice
Don't ask questions twice it's annoying for people if they have the same question and they're trying to search for an answer. Ask once... Better still, go to a modules issue page and post a support request. Annoyingly the answer would be better suited in this thread than the thread I answered you in... http://drupal.org/node/156567#comment-259393
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------