Hello everyone,
is it possible to hyperlink a link on the Paid Subscriptions Page?
Also, is it possible to add several custom pages? I did find the Simple Page plugin but I think it only allowed one page
Hello everyone,
is it possible to hyperlink a link on the Paid Subscriptions Page?
Also, is it possible to add several custom pages? I did find the Simple Page plugin but I think it only allowed one page
is it possible to hyperlink a link on the Paid Subscriptions Page?
Do you want to link the page listing all paid subscriptions or just a single subscription?
Do you want to link the page listing all paid subscriptions or just a single subscription?
A link to a single subscription works as well
But what I mean is that links inside the paid subscriptions page doesn't seem to be clickable.
But what I mean is that links inside the paid subscriptions page doesn't seem to be clickable.
May I ask you to provide a screenshot showing which links exactly you're thinking of?
May I ask you to provide a screenshot showing which links exactly you're thinking of?
The Link I'm talking about is the one similar to the pastebin link
Actually this is pure text, hence you can't add a link there.
I then started to wonder if I can't come up with some JavaScript to handle this, eventually I ended up with way more code than I expected, but it does the job in the most efficient way. You simply need to paste the code into the Footer-Code textarea found in your ACP > System > Options > General[/tt] (don't worry, it will only execute on the paid subscription list):
{if $templateName == 'paidSubscriptionList' && $templateNameApplication == 'wcf'}
<script>
(function() {
var container, childNode, match;
var containers = document.querySelectorAll('.paidSubscriptionList .containerHeadline > p:not(.marginTopTiny)');
for (var i = 0; i < containers.length; i++) {
container = containers[i];
while (/https?:\/\//.test(container.textContent)) {
match = false;
for (var j = 0, length = container.childNodes.length; j < length; j++) {
childNode = container.childNodes[j];
if (childNode.nodeType !== Node.TEXT_NODE || childNode.parentNode.nodeName === 'A') {
continue;
}
childNode.nodeValue.replace(/(https?:\/\/[^\s]+)/, function(textLink) {
match = true;
var range = document.createRange();
range.setStart(childNode, childNode.nodeValue.indexOf(textLink));
range.setEnd(childNode, childNode.nodeValue.indexOf(textLink) + textLink.length);
range.deleteContents();
var link = document.createElement('a');
link.href = textLink;
link.textContent = textLink;
range.insertNode(link);
});
if (match) {
break;
}
}
if (match === false) {
break;
}
}
}
})();
</script>
{/if}
Display More
If you don't like this huge pile of code, you can use the minified version which does the same job but is anything but readable:
{if $templateName == 'paidSubscriptionList' && $templateNameApplication == 'wcf'}
<script>
{literal}!function(){for(var e,t,n,o=document.querySelectorAll(".paidSubscriptionList .containerHeadline > p:not(.marginTopTiny)"),d=0;d<o.length;d++)for(e=o[d];/https?:\/\//.test(e.textContent);){n=!1;for(var a=0,r=e.childNodes.length;r>a&&(t=e.childNodes[a],t.nodeType!==Node.TEXT_NODE||"A"===t.parentNode.nodeName||(t.nodeValue.replace(/(https?:\/\/[^\s]+)/,function(e){n=!0;var o=document.createRange();o.setStart(t,t.nodeValue.indexOf(e)),o.setEnd(t,t.nodeValue.indexOf(e)+e.length),o.deleteContents();var d=document.createElement("a");d.href=e,d.textContent=e,o.insertNode(d)}),!n));a++);if(n===!1)break}}();{/literal}
</script>
{/if}
Yeah I guess x)
The code you just came up, that's what I needed, thank you very much!
I hope in the future versions there would be the [Enable HTML] button for the Paid Subscriptions Page, would help a lot haha
Oh wait hold on, the {if}{/if} statements are visible on all of the pages' footer, should that happen?
Oh wait hold on, the {if}{/if} statements are visible on all of the pages' footer, should that happen?
I'm still curious why I always assume that the footer code allows for template scripting
Use this version:
<script>
(function(doc) {
if (doc.body.getAttribute('data-template') !== 'paidSubscriptionList' || doc.body.getAttribute('data-application') !== 'wcf') {
return;
}
var container, childNode, match;
var containers = doc.querySelectorAll('.paidSubscriptionList .containerHeadline > p:not(.marginTopTiny)');
for (var i = 0; i < containers.length; i++) {
container = containers[i];
while (/https?:\/\//.test(container.textContent)) {
match = false;
for (var j = 0, length = container.childNodes.length; j < length; j++) {
childNode = container.childNodes[j];
if (childNode.nodeType !== Node.TEXT_NODE || childNode.parentNode.nodeName === 'A') {
continue;
}
childNode.nodeValue.replace(/(https?:\/\/[^\s]+)/, function(textLink) {
match = true;
var range = doc.createRange();
range.setStart(childNode, childNode.nodeValue.indexOf(textLink));
range.setEnd(childNode, childNode.nodeValue.indexOf(textLink) + textLink.length);
range.deleteContents();
var link = doc.createElement('a');
link.href = textLink;
link.textContent = textLink;
range.insertNode(link);
});
if (match) {
break;
}
}
if (match === false) {
break;
}
}
}
})(document);
</script>
Display More
Minified:
<script>
!function(e){if("paidSubscriptionList"===e.body.getAttribute("data-template")&&"wcf"===e.body.getAttribute("data-application"))for(var t,n,o,a=e.querySelectorAll(".paidSubscriptionList .containerHeadline > p:not(.marginTopTiny)"),d=0;d<a.length;d++)for(t=a[d];/https?:\/\//.test(t.textContent);){o=!1;for(var i=0,r=t.childNodes.length;r>i&&(n=t.childNodes[i],n.nodeType!==Node.TEXT_NODE||"A"===n.parentNode.nodeName||(n.nodeValue.replace(/(https?:\/\/[^\s]+)/,function(t){o=!0;var a=e.createRange();a.setStart(n,n.nodeValue.indexOf(t)),a.setEnd(n,n.nodeValue.indexOf(t)+t.length),a.deleteContents();var d=e.createElement("a");d.href=t,d.textContent=t,a.insertNode(d)}),!o));i++);if(o===!1)break}}(document);
</script>
Aww :(, no worries though haha
This solves everything, thank you very much again!
If I may ask another thing, is it possible to display the username of the registered user on the notices?
An example would be: User2 viewed the forums, the notice would then be: Hello User2, welcome to the forums.
or if it were User4, it would then greet User4.
Don’t have an account yet? Register yourself now and be a part of our community!