Thread Rating:
FAO Site Admin: Posting League Tables
#1
Looking at the site, I see there's no way of posting a formatted league table using BBCode. Would it be possible - or even viable - to add some new entries to the site's MyCode library to allow posting an HTML-type table?

For instance, using specific MyCode entries the following BBCode tags would produce a simple league table which would be displayed as below:

Code:
[table]
[tr]
  [th colspan=4 bgcolor=#f0f0f0]Scottish Championship 2015-16[/th]
[/tr]
 [tr]
    [th][b]Pos.[/b][/th][th][b]Team[/b][/th][th][b]P[/b][/th][th][b]Pts[/b][/th]
 [/tr]
 [tr]
    [td]1st[/td][td]Rangers[/td][td]22[/td][td]56[/td]
 [/tr]
 [tr]
   [td]2nd[/td][td]Hibernian[/td][td]21[/td][td]48[/td]
 [/tr]
 [tr]
   [td]3rd[/td][td]Falkirk[/td][td]23[/td][td]46[/td]
 [/tr]
[/table]

[Image: BBCode-table.jpg]


Of course, the BBCode text can be simply edited in any text editor to display different numbers of rows and columns in the exact same way as in basic HTML.

The four MyCode entries would be as follows:

Code:
1
Name: TABLE
Regular Expression:
\[table\](.*?)\[/table\]

Replacement:
<table class="{option}" BORDER=1>$1</table>

------------------------
2
Name: TR
Regular Expression:
\[tr\](.*?)\[/tr\]

Replacement:
<tr class="{option}">$1</tr>

-------------------------
3
Name: TH
Regular Expression:
\[th(( width=\d+| colspan=\d+| rowspan=\d+| bgcolor=\#[a-f0-9]{6})*)\](.*?)\[/th\]

Replacement:
<td align=center style="padding: 0 10px 0 10px;" class={option} $1>$3</td>

-------------------
4
Name: TD
Regular Expression:
\[td(( width=\d+| align=(left|center|right)| colspan=\d+| rowspan=\d+| bgcolor=\#[a-f0-9]{6})*)\](.*?)\[/td\]

Replacement:
<td align=center style="padding: 0 10px 0 10px;" class={option} $1>$4</td>

Perhaps, if this solution isn't suitable, the addition of a MyBB plugin to allow the posting of tables could be installed at root level?
Reply
#2
Copy this to here (from Rangers board).

(02-02-2016, 15:44)Larry-AV Wrote: I have read that thread, Trus, good luck !

Up to last season I could copy a league table from a website (e.g., BBC, SSN) into a notepad and having done that, reformat it to fit into a post.

From this season I have found that the copying does not work.
With some tables copying only picks up parts of the table, omitting some team names but showing their record, whilst simultaneously picking up the team name and record from other teams in the same table !!!
I do not know WTF is causing this partial data take, maybe it is a 'copyright' issue ???
With other sites the table copies in full but the data is splurged across and also down the page per team in my notepad.

As things stand the only way a table can be posted as found is from a screenshot, such as I posted as an attachment in the Falkirk match thread. That particular table is SPFL2 as displayed on the BBC website.
After the match at Raith tonight I will do another screenshot and post the table in the match thread.
As I use the same name for the table on my PC I will then check to see if the table in the Falkirk thread is as originally posted, or has updated to the same as after Raith.
I hope and expect that the table in Falkirk has its own identity on this site and will remain as originally posted.
However, if that is not the case and Falkirk equals Raith, then we will be totally screwed and there will be no point whatsoever in posting the table. This is because the reason for posting the table is to show how things stand at the time of posting.
AVFC RFC SAFC
Reply
#3
Not sure.
The BBcode settings are all switched on at a board level. You have an additional level of control on your user account (to view/hide BBcode formatting options).
What advantage does BBcode give you over posting the table's raw HTML?
Reply
#4
(02-02-2016, 16:53)M*rk Wrote: Not sure.
The BBcode settings are all switched on at a board level.  You have an additional level of control on your user account (to view/hide BBcode formatting options).

The MyCode entries have to be added in the Admin Control Panel, under -

Configuration - MyCode - Add New MyCode

- they're not part of the current settings.

(02-02-2016, 16:53)M*rk Wrote: What advantage does BBcode give you over posting the table's raw HTML?

Raw HTML doesn't display on a PHP bulletin board. They all use BBCode instead.

Example:

<table>
 <tr>
   <td>Test</td><td>Display</td>
 </tr>
</table>


My main request is to try to find a way for people to easily post league tables. The only way to do that currently is to post an image of the table from somewhere else.

Some of the MyBB plugins seem to be interesting, although I haven't tested them out myself. The MyCode examples I posted above have been tested by myself and work fine, with a little knowledge of HTML table structures.
Reply
#5
Copy this to here from Rangers board, for info.

(03-02-2016, 01:16)Larry-AV Wrote: You and I have thought (and hoped) correctly, Trus.

My 'ScotlandTable' uploads do have a unique identity per post on this site.
Falkirk is as originally posted and Raith shows the position today, 02/02/2016.
AVFC RFC SAFC
Reply
« Next Oldest | Next Newest »


Forum Jump:


Users browsing this thread: 1 Guest(s)