JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Dec 3, 2022 15:54:51 GMT -8
Hi there, simple question but not sure which route would work for it - code or plugin etc, so placing this here...
Is there a way of deactivating the auto-tagging system? I have an alternative tagging code which works better for my site's purposes but it's conflicting with the proboards tagging, so I'd like to disable the auto one in favour of my custom tagger.
Anyone know how to turn the tagging off?
Thanks,
|
|
Kami
Forum Cat
Posts: 40,198
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,198
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Dec 4, 2022 8:23:53 GMT -8
Hi there, simple question but not sure which route would work for it - code or plugin etc, so placing this here... Is there a way of deactivating the auto-tagging system? I have an alternative tagging code which works better for my site's purposes but it's conflicting with the proboards tagging, so I'd like to disable the auto one in favour of my custom tagger. Anyone know how to turn the tagging off? Thanks, From a technical perspective, you can't turn it off -- it's baked into software functionality. There might, be a way to "break" the @ tag code, but it would be entirely dependent on whether or not the replacement you have also uses the same @ symbol plus username format. What is the code you're using, and can we get a link to your forum so we can see the code in action? (Moving forward, if you're asking for assistance with customisation, it's always best to provide a forum URL)
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Dec 4, 2022 14:40:11 GMT -8
Hi there, simple question but not sure which route would work for it - code or plugin etc, so placing this here... Is there a way of deactivating the auto-tagging system? I have an alternative tagging code which works better for my site's purposes but it's conflicting with the proboards tagging, so I'd like to disable the auto one in favour of my custom tagger. Anyone know how to turn the tagging off? Thanks, From a technical perspective, you can't turn it off -- it's baked into software functionality. There might, be a way to "break" the @ tag code, but it would be entirely dependent on whether or not the replacement you have also uses the same @ symbol plus username format. What is the code you're using, and can we get a link to your forum so we can see the code in action? (Moving forward, if you're asking for assistance with customisation, it's always best to provide a forum URL) Oops apologies! I forgot I no longer have the link in my signature... Okay here's a page where the conflict is happening (as an example)... aeipathyrp.com/thread/3490In the last message, the custom code is conflicting with the normal one. Here's a link to the custom code in Docs (as it's hosted on an external server). docs.google.com/document/d/156785RZu7HW6GnueQwGsEG5MHvikVlVx1_25A8Z_89c/edit?usp=sharingI didn't design the custom code - someone else did for me, so my customisation skills on it are limited, but it definitely uses the same @username format. Our site has a lot of canon characters so the custom tag code pulls from a character list. If the character is listed as taken, it auto tags to a character's accepted account. If the character is marked as wanted, it auto links to the wanted page in question. That way, if characters are dropped and picked up etc, we ever have to alter the tags - they auto update to send you to whatever the relevant page is. You can see the code working fine in the left hand side bar which is part of the html code in the board headers, but when you get into the messages themselves, it breaks because it's conflicting with the auto tagging. Hope this makes it clearer? XD EDIT: Happy to make a separate thread for this but I just noticed a scrolling issue on the page in question. When I scroll part way with my scroller wheel, it then jumps a bit? Is there a crumb in my mouse wheel or can you see this too? XD Just thought I'd check before I waste everyone's time with a bogus problem thread looking for a ghost-jump caused by dust in my cogs XD
|
|
Kami
Forum Cat
Posts: 40,198
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,198
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Dec 4, 2022 15:43:36 GMT -8
Def create a separate thread for the scrolling issue. As a rule, it's one issue per thread. So unfortunately I can't personally think of a way to get around this since it uses the same tagging structure (my low-cost idea was to use censored words to break the tagging structure but that would only work if they used two different tagging systems). It is possible that someone with better knowledge of javascript than I could modify the code to change what triggers it (so instead of the @ username structure maybe it could use something like +username) but I don't have the requisite knowledge base to know for sure if that's possible or if you would even want that. Do you know who owns this code? If you could get permission to edit it, someone like Chris might be able to assist.
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Dec 4, 2022 15:54:14 GMT -8
Def create a separate thread for the scrolling issue. As a rule, it's one issue per thread. So unfortunately I can't personally think of a way to get around this since it uses the same tagging structure (my low-cost idea was to use censored words to break the tagging structure but that would only work if they used two different tagging systems). It is possible that someone with better knowledge of javascript than I could modify the code to change what triggers it (so instead of the @ username structure maybe it could use something like +username) but I don't have the requisite knowledge base to know for sure if that's possible or if you would even want that. Do you know who owns this code? If you could get permission to edit it, someone like Chris might be able to assist. Lol okay I will make a new one - just wanted to make sure I wasn't seeing things before I wasted people's time on a wild goose hunt. As for the tagging code, I might be able to make that edit myself (I'm limited in customising it but I think I can take a stab at something like that). I own the code, as it was made for my site... If I alter the format though, I'll have to go into all the other pages and change the @ to a + or whatever.... hmmm... I'll have a think on it... thanks for your help Kami!
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Dec 4, 2022 16:12:36 GMT -8
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 7, 2022 5:22:44 GMT -8
That backend code should be OK since it scrapes pages not hosted by Proboards. The issue appears to be the frontend code which is using the same format as Proboards' tagging system, thus causing a conflict. The agreed solution is to use + username instead of @ username and that should be a reasonably straightforward edit since it appears the delimiter is stripped. The naked username is what is being passed between backend and frontend anyway. What I am seeing on the forum is <script> async function FillTracker(uid, username) { const href = `https://aeipathyrp.glitch.me/threads/${uid}/${username}`; const data = await $.get(href); const doc = new DOMParser().parseFromString(data, 'text/html'); $('#trackerwrap').append($('#openthreads', doc)); $('#trackerwrapother').append($('#openthreadsotherauthors', doc)); $('#lockedwrap').append($('#closedthreads', doc)); $('#otherauthorwrap').append($('#closedthreadsotherauthors', doc)); } function replaceAtNames(identifier) { $(identifier).each(function() { $(this).html($(this).html().replace(/@\w+/gm, function() { return `<span class="atlink">${arguments[0]}</span>`})); }); $(`${identifier} .atlink`).each(async function() { let username = this.innerText.substring(1).replace(/ /g, '%20'); this.innerHTML = await $.get( `https://aeipathyrp.glitch.me/tags/${username}`); }); } </script> Which would require a small edit to the regular expression being used inside the replaceAtNames function $(this).html($(this).html().replace(/\+\w+/gm, function() { note: /@\w+/gm is now /\+\w+/gmthere's also this code <script> $('.replyjump').click(function () { $('html, body').animate({scrollTop:$(document).height()}, 'slow'); return false; }); $("div[id=message]").each(async function() { let r = /@\w+/ig let tags = $(this).html().match(r); let dict = {}; for (let i in tags) { let username = tags[i].match(/\w+/)[0]; let lnk = await $.get(`https://aeipathyrp.glitch.me/tags.php?username=${username}`); if (lnk == '') lnk = tags[i]; dict[tags[i]] = lnk; } $(this).html($(this).html().replace(r, function(x) { return dict[x]; })) }); </script> which uses a variable r that may need to be modified let r = /\+\w+/ig Once those changes are in place, also make sure any tags within the forum content that are intended to use the alternate tagging system are modified to use the "+" instead of the "@," and barring any unforeseeable issues, that should do it.
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Jan 7, 2023 17:46:25 GMT -8
ChrisThis works fantastically! Thank you so much! I will now set about editing all my s to +s XD This issue can be marked as solved <3
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Feb 13, 2023 21:07:24 GMT -8
That backend code should be OK since it scrapes pages not hosted by Proboards. The issue appears to be the frontend code which is using the same format as Proboards' tagging system, thus causing a conflict. The agreed solution is to use + username instead of @ username and that should be a reasonably straightforward edit since it appears the delimiter is stripped. The naked username is what is being passed between backend and frontend anyway. What I am seeing on the forum is <script> async function FillTracker(uid, username) { const href = `https://aeipathyrp.glitch.me/threads/${uid}/${username}`; const data = await $.get(href); const doc = new DOMParser().parseFromString(data, 'text/html'); $('#trackerwrap').append($('#openthreads', doc)); $('#trackerwrapother').append($('#openthreadsotherauthors', doc)); $('#lockedwrap').append($('#closedthreads', doc)); $('#otherauthorwrap').append($('#closedthreadsotherauthors', doc)); } function replaceAtNames(identifier) { $(identifier).each(function() { $(this).html($(this).html().replace(/@\w+/gm, function() { return `<span class="atlink">${arguments[0]}</span>`})); }); $(`${identifier} .atlink`).each(async function() { let username = this.innerText.substring(1).replace(/ /g, '%20'); this.innerHTML = await $.get( `https://aeipathyrp.glitch.me/tags/${username}`); }); } </script> Which would require a small edit to the regular expression being used inside the replaceAtNames function $(this).html($(this).html().replace(/\+\w+/gm, function() { note: /@\w+/gm is now /\+\w+/gmthere's also this code <script> $('.replyjump').click(function () { $('html, body').animate({scrollTop:$(document).height()}, 'slow'); return false; }); $("div[id=message]").each(async function() { let r = /@\w+/ig let tags = $(this).html().match(r); let dict = {}; for (let i in tags) { let username = tags[i].match(/\w+/)[0]; let lnk = await $.get(`https://aeipathyrp.glitch.me/tags.php?username=${username}`); if (lnk == '') lnk = tags[i]; dict[tags[i]] = lnk; } $(this).html($(this).html().replace(r, function(x) { return dict[x]; })) }); </script> which uses a variable r that may need to be modified let r = /\+\w+/ig Once those changes are in place, also make sure any tags within the forum content that are intended to use the alternate tagging system are modified to use the "+" instead of the "@," and barring any unforeseeable issues, that should do it. Hi Chris, Apologies to bother you again for this issue but in reference to the above code... it seems to have stopped working? I'm not sure what I've done to "deactivate" it, so to speak? I've even tried to remove and reenter the code as you've shown above to make sure I didn't accidentally delete a part of it somehow >.< You can see on this page: aeipathyrp.com/thread/3490 - that the tag +leonidas, in the messages is triggering aesthetically (capitalised, bold, underlined etc) like a link should be... but it's not *actually* a link. It's not replacing the word with full name and appropriate url. Which I'm assuming has something to do with the communication between the code you gave me above and the code we have on our external server...? Do I need to change anything in the external server code (below)? I *think* I did all the code alterations you stated above correctly...? "use strict";
const debug = require("debug")("thread-tracker");
const chalk = require("chalk");
const scrape = require("./scraper.js");
module.exports = {
async linkTag(username) {
username = username.toLowerCase();
let colors = {
a_accepted: "#35417d", //athenia
b_accepted: "#d85a07", //bedoa
c_accepted: "#35417d", //colchis
e_accepted: "#d85a07", //egypt
j_accepted: "#703372", //judea
la_accepted: "#3f424e", //lands afar
t_accepted: "#35417d", //taengea
a_open: "#999999", //athenia unclaimed
b_open: "#999999", //beoda unclaimed
c_open: "#999999", //colchis unclaimed
k_open: "#999999", //egypt unclaimed
p_open: "#999999", //judea unclaimed
la_open: "#999999", //lands afar unclaimed
t_open: "#999999" //teangea unclaimed
};
// load file as a string
let {$} = await scrape("https://aeipathyrp.glitch.me/cca.html");
//cca line e.g. <a id="abir" href="/page/npcabir"><div class="..."><p>Achilleas<br>of Mikaelidas<b>Played by Asteria</b></p></div></a>
let e = $(`#${username}`)
if (e.length == 0) return `@${username}`;
e.find("i").remove();
let fullName = e.text();
let colorClass;
if (/\w+_(accepted|open)/.test(e.find('div').attr("class")))
colorClass = e.find('div').attr("class").match(/\w+_(accepted|open)/)[0];
return `<a href="${e.attr("href")}" title="+${username}" style="color: ${colors[colorClass]} !important;">${fullName}</a>`;
}
};
Additionally (if it helps diagnose the issue)... the +tags on this page: aeipathyrp.com/page/alehandros (left hand side bar) aren't working at all - no aesthetic changes, no links, no zip. So, I'm not really sure why some of them are half way there and some of them nothing at all... >.< Much obliged for any help you can give on this >.<
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Feb 15, 2023 0:19:58 GMT -8
You'll probably want to check the files you have hosted on glitch.me since they are giving a 404 error The initial error was the project was placed in suspended mode due to inactivity and they were attempting to "wake" the project but then it just started resolving to a file not found (404) error
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Feb 18, 2023 0:19:36 GMT -8
You'll probably want to check the files you have hosted on glitch.me since they are giving a 404 error The initial error was the project was placed in suspended mode due to inactivity and they were attempting to "wake" the project but then it just started resolving to a file not found (404) error Aaaah! I missed something obvious in the scraper code on the external server. Thank you so much! I have now sorted this.
|
|