phpBB issues

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: phpBB issues

Re: phpBB issues

Post by joedf » 16 Feb 2020, 14:30

I have used it too just yesterday and seemed fine. :+1:

Re: phpBB issues

Post by gregster » 16 Feb 2020, 05:34

gregster wrote:
15 Feb 2020, 10:43
Possibly related: The 'banhammer' seems to still create short forum timeouts
Right now, it worked just fine. I will further observe...

Re: phpBB issues

Post by joedf » 15 Feb 2020, 14:36

Hmmm weird, havent experienced that myself, for me it's mainly when I clear the forum cache for site changes... :think:

Re: phpBB issues

Post by gregster » 15 Feb 2020, 10:43

@joedf:
Possibly related: The 'banhammer' seems to still create short forum timeouts, not every time and not as bad as last autumn, but still sometimes - and more unpredictable now.
I didn't use it at all for two months when it was really bad (when I messaged you about it), but at the moment 2-3 times a day - and others team members use it, too. Not sure if something was done about it...

But I think the throttling when opening many pages was much worse last year... the initial settings were annoying for sure.

Re: phpBB issues

Post by joedf » 15 Feb 2020, 10:05

Just me! Sorry about this, I will immediately notify tank. :+1:

Re: phpBB issues

Post by just me » 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

Re: phpBB issues

Post by just me » 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.

Re: phpBB issues

Post by joedf » 27 Aug 2019, 22:39

ditto +1, but it's not too bad... I just let them load in the background... :/

Re: phpBB issues

Post by jNizM » 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

Re: phpBB issues

Post by joedf » 14 Aug 2019, 00:45

Great! Could be just a CDN or local cache refresh issue :+1:

Re: phpBB issues

Post by TAC109 » 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

Re: phpBB issues

Post by joedf » 12 Aug 2019, 12:25

I just tested with an iPad and iPhone 5s, a desktop, and laptop, FF and Chrome. :think:

Re: phpBB issues

Post by TAC109 » 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.

Re: phpBB issues

Post by joedf » 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

Re: phpBB issues

Post by joedf » 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.");

Re: phpBB issues

Post by joedf » 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:

Re: phpBB issues

Post by TAC109 » 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?

Re: phpBB issues

Post by joedf » 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:

Re: phpBB issues

Post by kczx3 » 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?

Re: phpBB issues

Post by joedf » 06 Aug 2019, 14:23

@kczx3 Very cool! :+1:
@jeeswg Good to hear :crazy:

Top