[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use a gambas web cgi in a phpBB forum


On Sat, 29 Nov 2025, 21:18 Lee, <t.lee.davidson@xxxxxxxxx> wrote:

> On 11/29/25 3:41 PM, Lee wrote:
> >
> And here is the code for the "gbcode" ("[gbcode]{TEXT}[/gbcode]") custom bbcode:
> > <script>document.addEventListener('DOMContentLoaded',function(){const
> xhr=new XMLHttpRequest();xhr.onload=()=>{if
> > (xhr.readyState==4 &&
> xhr.status==200){document.getElementById("gbcode").innerHTML=xhr.responseText;}};xhr.open("POST","http://
> >
> localhost/~user/Highlighter.gambas");xhr.setRequestHeader("Content-Type","text/plain;
>
> >
> charset=UTF-8");xhr.send(document.getElementById("gbcode").innerHTML);});</script><span id="gbcode">{TEXT}</span>
>
> Well, shoot!
>
> Upon further review, I've realized that script code will not work. If
> there is more than one post using the 'gbcode' bbcode, the
> SPAN id's will not be unique and only the first one found will be sent to
> the cgi app for highlighting.
>
>
> --
> Lee
>

Doh!
I hadn't thought of that either.
Good result though. Your js is way better than mine was.
Maybe something like a timestamp...

var id = "bbcode_" + Date.now()


Respects
BruceS

>

Follow-Ups:
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
References:
use a gambas web cgi in a phpBB forumBruce Steers <bsteers4@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumBruce Steers <bsteers4@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumBruce Steers <bsteers4@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>
Re: use a gambas web cgi in a phpBB forumLee <t.lee.davidson@xxxxxxxxx>