Post
Topic
Board Meta
Re: Little things that bug you/me about the forum
by
irfan_pak10
on 12/10/2024, 08:19:28 UTC
@PowerGlove do you think it would be possible to set up something like this to work on tables?

Code:
[table]
[tr][td style="background-color:#f0f0f0;"]Line 1[/td][/tr]
[tr][td style="background-color:#e0e0e0;"]Line 2[/td][/tr]
[tr][td style="background-color:#f0f0f0;"]Line 3[/td][/tr]
[/table]

It will help to make table formatting more easily.

Like this table format used by irfan_pak10, it is good visually but when you come to code block, it is complicated, so if your suggestion can make formatting with colors, background colors in tables more easily, I strongly support it.

[Translators] List of Bitcointalk Translators
Code:
[table]
[tr][td][b][size=16px][glow=black,2,300][color=transparent]..[/color][color=#fff]Username[/color][color=transparent]..[/color][/glow][/size][/b][/td][td][b][size=16px][glow=black,2,300][color=transparent]..[/color][color=#fff]Language[/color][color=transparent]..[/color][/glow][/size][/b][/td][td][b][size=16px][glow=black,2,300][color=transparent]..[/color][color=#fff]DT Status[/color][color=transparent]..[/color][/glow][/size][/b][/td][td][b][size=16px][glow=black,2,300][color=transparent]..[/color][color=#fff]Account Status[/color][color=transparent]..[/color][/glow][/size][/b][/td][td][b][size=16px][glow=black,2,300][color=transparent]..[/color][color=#fff]BPIP Profile[/color][color=transparent]..[/color][/glow][/size][/b][/td][td][b][size=16px][glow=black,2,300][color=transparent]..[/color][color=#fff]ANN/Portfolio[/color][color=transparent]..[/color][/glow][/size][/b][/td][/tr]

[tr][td][b][url=https://bitcointalk.org/index.php?action=profile;u=1081511]Tszunami98[/url][/b][/td][td]Romanian[/td][td][/td][td][size=12px][glow=green,2,300][color=transparent]..[/color][color=#fff]Active[/color][color=transparent]..[/color][/glow][/size][/td][td][url=https://bpip.org/profile.aspx?id=1081511]Tszunami98[/url][/td][td][url=https://docs.google.com/spreadsheets/d/12p79kj5j6IjV_UebaFWe_HH-CnKW7HYODhIURciFK_s/edit#gid=0]Link[/url][/td][/tr]

[/table]
Visually
Quote
..Username....Language....DT Status....Account Status....BPIP Profile....ANN/Portfolio..
Tszunami98Romanian..Active..Tszunami98Link

Still writing the code manually? I use GPT to write bbcodes from google spreadsheet. It generated within seconds.

like with this code I can generate any bbcode from my google spreadsheets

Code:
function generateBBCode() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  const data = sheet.getDataRange().getValues();
  let bbcode = `[table]\n`;

  // Add headers dynamically based on the first row of the sheet
  const headers = data[0];
  bbcode += `[tr]`;
  headers.forEach(header => {
    bbcode += `[td][b]${header}[/b][/td]`;
  });
  bbcode += `[/tr]\n`;

  // Iterate over the rows and generate BBCode for each
  for (let i = 1; i < data.length; i++) {
    const row = data[i];
    bbcode += `[tr]`;
   
    row.forEach((cell, index) => {
      let cellValue = cell || "N/A"; // Replace empty cells with "N/A"

      // Add link to usernames or URLs based on column index (e.g., link columns)
      if (headers[index].toLowerCase() === 'username' && row[index + 1]) {
        cellValue = `[url=${row[index + 1]}][b]${cell}[/b][/url]`; // Assuming next column contains the profile link
      } else if (cellValue.startsWith("http")) {
        cellValue = `[url=${cell}]Link[/url]`;
      }

      bbcode += `[td]${cellValue}[/td]`;
    });

    bbcode += `[/tr]\n`;
  }

  bbcode += `[/table]`;
  Logger.log(bbcode);
}