inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 30, 2017 23:54:13 GMT -8
hub.thecreed.online/board/4/important-readsBasically anything in [ ] I need not display, so it just reads as plain text - ONLY on the thread listing. I am unsure if this is possible and was unsure where to post this
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 2, 2017 4:44:23 GMT -8
BUMP
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 2, 2017 6:39:39 GMT -8
This is not possible via templates. There is a class that will trigger the hover text but not how it's displayed. You'd need a script to strip out any UBBC, though I'm not 100% sure that is possible (though worth a shot).
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 2, 2017 6:59:30 GMT -8
This is not possible via templates. There is a class that will trigger the hover text but not how it's displayed. You'd need a script to strip out any UBBC, though I'm not 100% sure that is possible (though worth a shot).
Thanks Kami - I wasn't sure where to post it at all (given that I'd be using the script in a template I'd still vaguely count this as a template type mod?)
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 2, 2017 7:36:59 GMT -8
This is not possible via templates. There is a class that will trigger the hover text but not how it's displayed. You'd need a script to strip out any UBBC, though I'm not 100% sure that is possible (though worth a shot).
Thanks Kami - I wasn't sure where to post it at all (given that I'd be using the script in a template I'd still vaguely count this as a template type mod?) I wouldn't. Template mods are for the actual template variables imo i.e. modding the actual template. Scripts can be made into plugins (in fact most plugins are scripts just with a user friendly interface). i mean ymmv but i think it's confusing to consider scripts template mods since you're not actually modifying the template (since nothing in the template is determining this).
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 2, 2017 11:14:34 GMT -8
Given there's no other place for this though? Anyway surely this is derailing the whole thread? I mean a member of the staff team is quite welcome to move it if they consider it in the wrong place but I don't know where it'd be moved to (it'd not be a plugin as I don't need a ui for it)
|
|
Kami
Forum Cat
Posts: 40,200
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,200
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 2, 2017 12:19:31 GMT -8
Given there's no other place for this though? Anyway surely this is derailing the whole thread? I mean a member of the staff team is quite welcome to move it if they consider it in the wrong place but I don't know where it'd be moved to (it'd not be a plugin as I don't need a ui for it) You can put it in the coding help board! I had asked before where I could get help for stuff that wasn't plugins or templates and they made the coding help board for that (: i also don't see the harm in putting it in the main plugin board, either, there are plenty of plugins that are just "install and forget" without any UI beyond a description.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 2, 2017 23:46:42 GMT -8
I've asked for this thread to be moved. Because last I checked Proboards also doesn't like to have multiple threads for the same reason.
Again can a mod move this to a board they feel more appropriate
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 3, 2017 10:21:51 GMT -8
I want to be sure we're referring to the same thing here natzy24, the forum url you give shows the following thread descriptions which I'll assume you are getting from the $[thread.short_content] template variable which btw has an imposed text length limit so it simply a truncated portion of the first few characters within the first post. There's no way to "add" more content to replace what was removed once the train has left the station (i.e. left PB servers and has arrived at your browser) [attr="class","title is-5"]OOC Rules[attr="class","subtitle is-6"]These rules apply no matter where you are on the hub[div
[div style="width: 75%; background-color: #F9F9F9; border-left: 5px solid rgba(45,45,45,0.1); border-bottom: 1px solid rgba(45,45,45,0.2); border-right: 1px solid rgba(45,45,45,0.2);
[attr="class","subtitle is-5"]Grievances [div style="width:75%;background-color:#F9F9F9;border-left:5px solid rgba(45,45,45,0.1);border-bottom:1px solid rgba(45,45,45,0
[attr="class","title is-5"]General Classes[attr="class","subtitle is-6"]These Classes are present in all eras[div
[attr="class","title is-5"]A TITLE[attr="class","subtitle is-6"]A Subtitle (Optional)[div style="width: 75%; background-color: #F9F9F9; border-left: 5px
Not a single one of the five descriptions above have a "fully formed" and recognizable bbcode pattern ( otherwise PB would have removed it when populating the text into the variable) and by fully formed I mean you can tell with certainty when a bbcode starts and ends without having to guess what is missing. A good test is to paste it into the bbcode tab then switch to the preview tab and see if it converts, if there is not enough there to define what should be done you end up with unconverted bbcodes as you have them now. What i think you're asking though is not for some code to render the bbcode but instead completely remove them from the final text which isn't as easy as it sounds. On thread description 1 we see an [attr] which is not technically a bbcode but is instead a construct supported by the style plugin, a code could be easily taught to treat that as a bccode as well but the effect of what that tag does is dependent on the context so suppose it creates a block level element the effect of that would be to insert at least one line-break into the final text but that would mean mimicking the style plugin to see what it does and that would be way too involved for a simple code, the same holds true for all the other native bbcodes especially if they have inline styles. The other problem comes at the end of that example 1 description with the incomplete "[div". If using a generic regular expression to support anything within square brackets then that would still be missed since it contains no bookend bracket to let the code know where the potential bbcode starts and ends so you end up with These rules apply no matter where you are on the hub[div The remedy for that might be to look only for opening brackets followed by alphanumerics or better yet provide a list of bbcodes that should be recognized by the code (making the script a bit more complex since it now has to list all possible bbcodes) so it can then handle cases such as that and still allow for perfectly legit uses for square brakits [sic]. You of course could just as easily ended up with "[di" and still be left with an unhappy ending depending on how detailed you want to make that list of bbcodes and their possible permutations. Here's a dirty code using the "if it looks like a bbcode and walks like a bbcode..." mindset (but be warned it has the potential to be overly aggressive): $('.thread-description').each(function(i, e){
var r = /\[\/?\w+([\s=][^\]]+)?\]?/g; var empty = "No Preview Available" var t = e.nextSibling; while(t && t.nodeName !== "BR"){ t = t.nextSibling; }
if (t && (t=t.nextSibling).nodeType == 3 && r.test(t.data)){
$(e).html((t.nodeValue.replace(r, ' ').trim()||empty)); t.nodeValue=""; }
})
Drop it at the bottom of your board template and see if warms the cockles (add <script> tags around it)
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 3, 2017 10:41:07 GMT -8
Thanks Chris - and I don't mind about not being abe to replace content I'm just trying to tidy it up
Its working perfectly btw
|
|
#FF6600
Closet Spammer
31801
0
1
Nov 24, 2024 19:07:38 GMT -8
wildmaven
Fear the Flying Flocks of Fiery Fury!!
35,652
October 2004
wildmaven
Wildmaven's Mini-Profile
|
Post by wildmaven on Jul 3, 2017 19:44:09 GMT -8
Thanks Chris - and I don't mind about not being abe to replace content I'm just trying to tidy it up Its working perfectly btw Since it's working now, do you still want this thread moved?
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 3, 2017 22:12:31 GMT -8
Thanks Chris - and I don't mind about not being abe to replace content I'm just trying to tidy it up Its working perfectly btw Since it's working now, do you still want this thread moved? Not any more thank you
|
|