XF 2 One click to open all threads from the viewed page

We are on forum_view, there we find normally 20 threads with a title and a link.
To open these 20 threads i have to click 20 times.

I want to have a button, then i click it and all my links will open



Maybe like this:


button on forum_view with ugp for admin/mod opens a new page.

Then we reload the page with:

if button_click, then
<script type="text/javascript">
window.open('url_of_thread_#n', '_blank');
window.open('url_of_thread_#n+19', '_blank');
</script>

so the addon needs to do:
one ugp
one template change with something like
if button_clicked => loop threads as thread
{
javascript window_open with thread_url
}
 
20 threads would be in a single page. What about that other pages threads?

Like, I'm on second page of the forums and next 20 threads are displaying, while I'll click over the button, the currently loaded 20 threads should display in a new tab of browser regardless how many threads are in previous and next pages.

Right ?
 
You are on page 1 with #1 to 20;
the button opens the links #1 to #20;

You are on page 2 with #21 to 40;
the button opens the links #21 to #40;

when we use just a reload, you dont have to care for that.
We just look loop $threads into the javascript.

Dont think too complicated; the only question is, if that idea works with JS and onLoad.
But probably this addon is to small for a paid coder and i should try it for myself.

if admin and if ?reload=1
loop threads as thread
javascript onLoad = thread_url

then i just add &reload=1 to the url (or add a button to do that)
 
Hmm, any idea why this doesn't work?

Code:
<xf:if is="$xf.visitor.is_admin">
<script type="text/javascript">
    <xf:foreach loop="$threads" value="$thread">
        window.onload = function(){
         window.open("/threads/.{$thread.thread_id}/", "_blank");
    }
    </xf:foreach>
</script>
</xf:if>
 
I suggest to write this all in the js rather than using it with the XF template.


And this would be something like this
$(document).ready(function(){

openThreads();

})

function openThreads()
{
$('.structItem-title a').each(function(key,item){
window.open($(item).attr('href'));
});
}

I haven't tested it but seems like you will do that by yourself but this would work. Window.open by default open this in a new tab
 
Looks like you are a bot? Or a personal marketing consultant?
Imagine that 100 other people would fill this forum with such messages for every question here!
Thank you.

You didn’t ask a question, you posted an addon/ custom service request. If you learn to post in the proper place, maybe you would get the answer you are looking for. ;)
 
Last edited:
Thank you.

Code:
<xf:js>
window.open('https://www.google.com', '_blank')
</xf:js>

Is it possible to allow popups just for one url?

As said, send me a quote, and let's start. I work here from dusk till dawn and have no vampire power.
So i am happy about any help.
 
Top Bottom