phpBB issues

Discuss issues and requests related with the forum software
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: phpBB issues

30 Jul 2019, 03:19

I haven't looked into the phpBB source - does it offer the option to let posters evaluate a BBtag into some meta BBcode?
The result would be BB-Tags the forum could evaluate like normal other BB-Tags.
While quoting or editing the post the posts source should still only display the [/code] tags and not all the rest (really broke a lot in the old forums).
Recommends AHK Studio
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

30 Jul 2019, 12:20

Not sure about that, but I think I got the lag fixed.
after investigating this in depth, I found that the blocking/lag was caused mostly by the synchronous code I had written in prism.urls.js.
I've made it completely asynchronous, and it will only parse the ahk code for links when the mouse enters a code tag for the first time for that specific code tag.
Otherwise, prism.js was running pretty quickly already, I have also set it to defer to allow a smoother loading experience overall.
There might be still a bit of a lag because of how big the topic is, but it should still be a major improvement. :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
just me
Posts: 9406
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: phpBB issues

31 Jul 2019, 04:32

tank wrote:
09 Jul 2019, 07:11
so outside me being a smart ass we do have a problem with bots on this site. I have throttled the site if x number of hits in x seconds but am still actively working on the right number for both x's
Any progress on this?
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: phpBB issues

02 Aug 2019, 20:38

FYI I just found this. Might be worth considering once stable and they create an importer for phpBB.

https://flarum.org/
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: phpBB issues

04 Aug 2019, 19:51

- I went to my function list thread, and noticed it was working really fast.
- I've checked the speed for the 4 links that I mentioned.
- They're all working great apart from the really long base64 string thread.
- Perhaps that one could be given the 'Codebox=text' treatment.
- AFAICS the problem is solved, although maybe there's some other issue causing the base64 thread problem in IE. Thanks.

~1 second (IE)
list of every command/function/variable from across all versions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=74&t=27321

~who knows (IE) (I'm having real problems with this page, it's making the tab hang)
~instant (Firefox)
~2 seconds (Chrome)
Base64 decode and create file from clipboard - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=64341

~instant (IE)
[Class] eAutocomplete - Custom word completion for (Rich)Edit controls - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=48940&start=20

~3 seconds (IE)
[Editor] Gdip Bitmap Maker - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=62550
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

06 Aug 2019, 14:23

@kczx3 Very cool! :+1:
@jeeswg Good to hear :crazy:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: phpBB issues

06 Aug 2019, 18:59

joedf wrote:
06 Aug 2019, 14:23
@kczx3 Very cool! :+1:
@jeeswg Good to hear :crazy:
Um, since when could we actually mention someone in a post?
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

07 Aug 2019, 09:40

@kczx3
Since early April? I managed to find to the topic finally.
https://www.autohotkey.com/boards/viewtopic.php?p=100225#p100225

TLDR; jNizM had suggested a plugin, then Kobaltauge had managed to find a more up to date one. So I installed it, and the story goes from there :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: phpBB issues

08 Aug 2019, 23:43

joedf wrote:
30 Jul 2019, 12:20
Not sure about that, but I think I got the lag fixed.
after investigating this in depth, I found that the blocking/lag was caused mostly by the synchronous code I had written in prism.urls.js.
I've made it completely asynchronous, and it will only parse the ahk code for links when the mouse enters a code tag for the first time for that specific code tag.
Otherwise, prism.js was running pretty quickly already, I have also set it to defer to allow a smoother loading experience overall.
There might be still a bit of a lag because of how big the topic is, but it should still be a major improvement. :+1:
Unfortunately this change has caused AHK documentation lookup in code boxes to stop working on my iPad, which of course uses a touch screen.

Any chance of a fix?
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

09 Aug 2019, 08:37

Yeah I noticed that last night on my iPhone. I think I can fix this pretty easily. :+1:
EDIT: I added a 'ontouchstart' event, so tap a code box once to activate links. Also, I just thought of how I could this a lot more efficient. I'll post about it later. :think:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

09 Aug 2019, 09:42

New/Current version: https://www.autohotkey.com/boards/assets/prism/prism.urls.js
Now it simply puts one "click" event per code box (instead of an anchor tag for each token) and detects the token type and produces a link that opens in a new tab/window. CSS is used for "link" styling for the tokens.

Code: Select all

// NEW VERSION
// Using global events for target case-by-case detection

// linker to docs for prism.js update
// created 7/01/2019 - updated 09/08/2019
// script by joedf
var redirectQURL = '/docs/redirect.php?topic=';

// add CSS 'link' styling
codelinkstyle = document.createElement('style');
codelinkstyle .innerHTML = "code .selector:hover, code .constant:hover, code .keyword:hover, code .symbol:hover, \
							code .tag:hover, code .builtin:hover, code .x_function:hover, code .important:hover, \
							code .variable:hover { \
								text-decoration:underline !important; \
								cursor: pointer; \
							}";
document.head.appendChild(codelinkstyle);

// add events for each codebox
var cboxes = document.querySelectorAll('code.language-autohotkey');

for(var i=0;i<cboxes.length;i++) {
	cboxes[i].addEventListener('click', function(e){
		
		var citem = e.target;
		if (citem.className.indexOf('token') >= 0) {

			var type = citem.className.replace('token','').trim().toLowerCase();
			var cURL = null;

			// supported types: selector, constant, operator, and variable
			if (['selector','constant','keyword','symbol','tag'].indexOf(type)>=0) {
				cURL = redirectQURL+citem.innerText;
			} else if (['builtin','x_function'].indexOf(type)>-1) {
				cURL = redirectQURL+citem.innerText+'()';
			} else if (type.indexOf('variable')>-1) {
				// same as bove normal rediretor usage but remove the % symbols...
				cURL = redirectQURL+citem.innerText.replace(/%/gi,'');
			} else if (type.indexOf('important')>-1) {
				// same as bove normal rediretor usage but remove the # symbols...
				cURL = redirectQURL+citem.innerText.replace(/#/gi,'');
			} else {
				// do nothing? leave as is...
				return false;
			}

			var w = window.open(cURL, '_blank');
  			w.focus();
			return true;
		}

	});
}

console.log("prism.urls.js executed.");

Old version:

Code: Select all

// ORIGINAL
// with <a>nchor tags on each thing

// linker to docs for prism.js update
// created 7/01/2019 - updated 09/08/2019
// script by joedf
////////////////////////////////////

var redirectQURL = '/docs/redirect.php?topic=';

// get AHK codeboxes
var cboxes = document.querySelectorAll('code.language-autohotkey');

for(var i=0;i<cboxes.length;i++) {

	['mouseenter', 'touchstart'].forEach(function(e) {
		cboxes[i].addEventListener(e,function(){
			if (!this.hasAttribute('highlightedlinks')) {
				ctokens = this.querySelectorAll('.token:not(.punctuation):not(.comment)');
				this.setAttribute('highlightedlinks','true');
				for(var j=0;j<ctokens.length;j++) {
					(function(index) {
						setTimeout(function(){
							var citem = ctokens[index];
							var type = citem.className.replace('token','').trim().toLowerCase();
							// supported types: selector, constant, operator, and variable
							if (['selector','constant','keyword','symbol','tag'].indexOf(type)>-1) {
								citem.outerHTML = '<a href="'+redirectQURL+citem.innerHTML+'">'+citem.outerHTML+'</a>';
							} else if (['builtin','x_function'].indexOf(type)>-1) {
								citem.outerHTML = '<a href="'+redirectQURL+citem.innerHTML+'()">'+citem.outerHTML+'</a>';
							} else if (type.indexOf('variable')>-1) {
								// same as bove normal rediretor usage but remove the % symbols...
								citem.outerHTML = '<a href="'+redirectQURL+citem.innerHTML.replace(/%/gi,'')+'">'+citem.outerHTML+'</a>';
							} else if (type.indexOf('important')>-1) {
								// same as bove normal rediretor usage but remove the # symbols...
								citem.outerHTML = '<a href="'+redirectQURL+citem.innerHTML.replace(/#/gi,'')+'">'+citem.outerHTML+'</a>';
							} else {
								// do nothing? leave as is...
							}
						},1);
					})(j);
				}
			}
		});

	});

}

/* force the underlined link style */
codelinkstyle = document.createElement('style');
codelinkstyle .innerHTML = "code a:hover{text-decoration:underline !important;}";
document.head.appendChild(codelinkstyle);
console.log("prism.urls.js executed.");
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

09 Aug 2019, 10:53

Also, I've just added a download feature to codeboxes with a filename defined.
My brain works so much better when I go to bed early (ish) :D

For future reference:
https://www.autohotkey.com/boards/assets/javascript/core.js

Code: Select all

// joedf: add download for codeboxes
// should work for IE11, Chrome v1+, FF36+

function download_code_init(){
	var boxes = document.getElementsByTagName('code');
	for (var i = 0; i < boxes.length; i++) {
		if (boxes[i].parentNode.parentNode.getAttribute('data-filename') != null) {
			var filename = boxes[i].parentNode.parentNode.getAttribute('data-filename').trim().replace(/[<>:"\/\\\|\?\'\*]/g,'_');
			var tagP = (boxes[i].parentNode.tagName.toLowerCase() == 'pre' ? boxes[i].parentNode.previousSibling : boxes[i].previousSibling);
				tagP.innerHTML += ' - <a href="#" title="download '+filename+'" onclick="downloadCode(this); return false;">Download</a>';
		}
	}
}
// joedf: modified from https://stackoverflow.com/a/33542499/883015
window.downloadCode = function(e) {
	// get Filename (regex ensures valid and safe name) and Data
	var filename = e.parentNode.parentNode.getAttribute('data-filename').trim().replace(/[<>:"\/\\\|\?\'\*]/g,'_');
	var data = e.parentNode.parentNode.getElementsByTagName('code')[0].innerText;

	var blob = new Blob([data], {type: 'text/plain'});  
	if(window.navigator.msSaveOrOpenBlob) {
		window.navigator.msSaveBlob(blob, filename);
	} else {
		var elem = window.document.createElement('a'); 
		elem.href = window.URL.createObjectURL(blob); 
		elem.download = filename; 
		document.body.appendChild(elem); 
		elem.click();   
		document.body.removeChild(elem);
	}
}
download_code_init();
EDIT: update, added filename in the tooltip-title for download link
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: phpBB issues

11 Aug 2019, 17:26

joedf wrote:
09 Aug 2019, 08:37
Yeah I noticed that last night on my iPhone. I think I can fix this pretty easily. :+1:
EDIT: I added a 'ontouchstart' event, so tap a code box once to activate links. Also, I just thought of how I could this a lot more efficient. I'll post about it later. :think:
Does this work for you now? I’m still having no joy. Is this solution deployed across all themes? I use prosilver.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

12 Aug 2019, 12:25

I just tested with an iPad and iPhone 5s, a desktop, and laptop, FF and Chrome. :think:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: phpBB issues

13 Aug 2019, 22:01

joedf wrote:
12 Aug 2019, 12:25
I just tested with an iPad and iPhone 5s, a desktop, and laptop, FF and Chrome. :think:
It seems to be working now, :D
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

14 Aug 2019, 00:45

Great! Could be just a CDN or local cache refresh issue :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: phpBB issues

26 Aug 2019, 08:07

tank wrote:
09 Jul 2019, 07:11
so outside me being a smart ass we do have a problem with bots on this site. I have throttled the site if x number of hits in x seconds but am still actively working on the right number for both x's
This is still horrible as long time & multiple tabs user
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: phpBB issues

27 Aug 2019, 22:39

ditto +1, but it's not too bad... I just let them load in the background... :/
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
just me
Posts: 9406
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: phpBB issues

15 Feb 2020, 09:45

Hi there, still no solution.

I'm 'punished' at almost every visit at the forums, sometimes several times a day. Do you really think you need that 'punishment' for registered users? What about purchasing professional support to solve such problems? I'm willing to pay a share of the costs.
just me
Posts: 9406
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: phpBB issues

15 Feb 2020, 09:51

Related:
tank wrote:
09 Jul 2019, 07:11
so outside me being a smart ass we do have a problem with bots on this site. I have throttled the site if x number of hits in x seconds but am still actively working on the right number for both x's

Return to “Forum Issues”

Who is online

Users browsing this forum: No registered users and 19 guests