skip nav

Forums

Scott's tips

Sun, Dec 1 2019 1:13 AM by ScottHope. 285 replies.
  • RoggRR Luxembourg
    425 Posts
    Tue, Jan 10 2017 3:50 AM

    very useful tips here .. i've tried to make this table (my 1st in html) for a tourney, 3 rounds (9-holers) per week

    ..... BLIZZARD week 6
    Royal St. G.
    POINTS week 6
    Tour
    PLAYER
    T
    R1
    Plc
    Pts
    R2
    Plc
    Pts
    R3
    Plc
    Pts
    Week Pts
    Tour Pts
    Pos
    LukeSkywa
    TL
    30
    1
    15
    29
    2
    14
    31
    3
    13
    42
    234
    1
    DarthVader
    CH
    31
    2
    14
    30
    4
    12
    29
    1
    15
    41
    222
    2
    Chewbacca
    L
    33
    4
    12
    32
    5
    11
    31
    3
    13
    36 215 5

























    how to make "Week Pts" to be automatically filled as SUM?
    also, for "Tour Pts"? (if u paste this table to the next week, clear all cells, except "Tour Pts".... so, when u putt in new scores, TourPts have to be old value TourPts + WeekPts(new1))

    thanks, to all for sharing

  • ScottHope United Kingdom
    6,220 Posts
    Tue, Jan 10 2017 4:57 AM

    I'm very impressed with that Rogg, well done!  Unfortunately, HTML on its own can't do sums. That can only be achieved with Javascript which can't be permanently put into forum posts.

    It might be better to make the table with a spreadsheet and post an image of that spreadsheet to the forum if the manipulation of the data is of greater importance than the table itself.  Good work though.  : )

  • RoggRR Luxembourg
    425 Posts
    Tue, Jan 10 2017 7:53 AM

    ScottHope:

    ... HTML on its own can't do sums. That can only be achieved with Javascript ...

    yeah, i've googled it already, and it was scary to see how it needs so complicated scripts for that simple thing (SUM=R1+R2+R3 ... display SUM), thought to find a simple tricky solution, lol

    thanks for advice, scott .... it looks like the best option, to post the screenshot/image of the spreadsheet

    anyway, this table can be used for a 15-20 players tourney, couldn't be so painfully, lol

  • ScottHope United Kingdom
    6,220 Posts
    Tue, Jan 10 2017 8:30 AM

    Cheers Rogg. Javascript is scary to look at for the first time, but it's all about dealing with the HTML elements on a webpage, and on this webpage currently, there are over 1,200 HTML elements.

    Javascript manipulates those elements, and in the case of your table, it has to be directed to the elements that contain the values you want added together, then obtain the values within those elements, add them together, find the element where you want to display the result, then put the result in that element. When you add in all the script that deals with error checking it can amount to a lot of code.  : )

  • RoggRR Luxembourg
    425 Posts
    Wed, Jan 11 2017 3:34 AM

    yes, i understand now ...
    ... HTML cant manage the 'variables', and thats the main problem ... we can control 4 options for individual cell, and cant control the cells content (no 'variables' ), cant make calculation "in-fly" or "by delay" (it has to be done "from outside", by using some scripts, to declare all variables and to make all calculations, then put the results into the desired cells) ... speaking bout errors, it might be real pain in the air, lol

    scott, thank you for the answers ... the topic is very useful, keep going

  • ScottHope United Kingdom
    6,220 Posts
    Wed, Jan 11 2017 4:05 AM

    Thanks Rogg, will keep going.  : )

  • ScottHope United Kingdom
    6,220 Posts
    Wed, Jan 11 2017 2:09 PM

    The blue javascript below will put each posters user ID number into the header of their forum post.

    If the poster has a default WGT avatar, then you will have to go to that posters profile page and apply the javascript there to view their user ID number.



    To use the code, copy and paste it into your browsers developer tools CONSOLE tab then hit enter. (Use F12 or the inspect element option via the right click menu, to access the dev tools. To save repeatedly typing the code in each time you change to a new webpage, use the up arrow keyboard key whilst the CONSOLE has a flashing cursor, to bring back the last code you pasted or typed in.

    // *** SHOW MEMBER ID NO. v27.08.2017.1 ***
    var showidscript = document.createElement("script");
    showidscript.setAttribute("src","https://pastebin.com/raw/PNnQMTd8");
    showidscript.setAttribute("type","text/javascript");
    document.body.appendChild(showidscript);
    //END

    // *** SHOW MEMBER ID NO. v10.03.2018.1 ***
    $("<script>").attr({src:"https://pastebin.com/raw/PNnQMTd8/",type:"text/javascript"}).appendTo("body");
    //END

    Here is another method.

  • ChromeSlayer United States
    156 Posts
    Mon, Jan 16 2017 5:14 PM

    ScottHope:

    Anyway, with BB code there is no need to delve into the HTML editor, it can all be implemented from within the message editor.

    To colour a bit of text you just have to do this...

    [‍color=red] I want this text red [/color]                 

    I want this text red

    I can get this to work when i am replying to a forum post or thread, but how come it wont work on my blog spot on my profile? was trying to change some text red there and it wouldn't work like i got it to work here in the forums like you have explain. Do you know if theirs any reason for this. Thanks!

  • ScottHope United Kingdom
    6,220 Posts
    Tue, Jan 17 2017 1:18 AM

    Hi ChromeSlayer, you're absolutely right about the BB code not working on our profile page blogs. For some peculiar reason WGT have configured them differently to the main forum, sorry about that.

    I've just done a quick test in a private message to see if it works there too, it doesn't.  : (

    To be honest ChromeSlayer, if you use the HTML editor to modify your font colour you'd be better off. It works here, in blogs & pm's.

    Colouring text video.

    If you want to make a link a different colour from the default green, you have to apply the font colour to the anchor tag, which are the <a></a> tags that surround the text that is used as the clickable link.

    A typical text link will look similar to this when viewed in the HTML editor...

    <a href="http://www.google.com">Take me to Google.</a>

    The href (hyperlink reference) is the web address the link will send you to, and the 'Take me to Google' is the text you click on.

    To make the text you click on a different colour, put this inside the anchor tag...

    style="color:blue"

    ...this will make the link text blue (you can use any valid HTML colour name, Hex colour value or RGB colour value), but there will be no colour change when you hover over the link like there is with the default green link. This requires a pseudo class selector which cannot be applied through inline CSS styling (which is what we are doing here and incidentally, is the only way we can style stuff and make it permanent using the forum message box).

    Applying the attribute (style), property (color) and value (blue) text to the anchor tag gives you this...

    <a href="http://www.google.com" style="color:blue">Take me to Google.</a>

    Well done if you got this far. : )

  • ChromeSlayer United States
    156 Posts
    Tue, Jan 17 2017 8:19 PM

    ScottHope:
    Hi ChromeSlayer, you're absolutely right about the BB code not working

    ya i wasn't trying to make the link aka my saved replays a different color, thanks for explaining i can change them blue if decide to one day. I just wanted some text above, acting like a header in bright red saying SAVED REPLAYS for example and then below would be all the green links to my saved shots. will these new steps u shared with still work for that?

    P.S. can u change the color of the subject/header on the blog spot on profile pages?

RSS