Module for switching the read-/list-view

Posted by Thomas Seifert 
Module for switching the read-/list-view
July 02, 2004 02:44AM
I've made a simple module which allows to switch the view (threaded / flat) on the list and/or read-page.

It switches the user-setting for showing flat/threaded list/read so it will remain set for all forums once used.

After you enabled the module you've got the new var SWITCHURL available in the templates which you can use to switch the view.
Just add this link somewhere in your templates.
I.e. I've put this in header.tpl:
{if SWITCHURL}
<a href="{SWITCHURL}">switch view</a>
{/if}

Have fun with it!


Thomas Seifert
Attachments:
open | download - viewswitch.zip (1 KB)
pat
not working
July 03, 2004 03:27PM
Hi Thomas,

thank you for the mod. First I tried it with 5.0.6 Beta but got an error-message, then tried with latest CVS but nothing - not even an Error ;-)

What's wrong?

thanx
pat
Re: not working
July 04, 2004 03:06AM
what error-message?
how did you include it?
did you enable it in the admin and put the link in the template?


Thomas Seifert
pat
Re: not working
July 04, 2004 06:35AM
Hi Thomas,

I don't remember the exact phrase of the Error message but it said something about a a thing being not defined in common.php somewhere around line 300 if you want I could try to switch back to 5.0.6 to tell you more.

And yes, I enabled it in the admin and put the link in header.php as you suggested.

thanx
pat
Re: not working
July 04, 2004 07:15AM
can you give an example url?
I've installed in 2 different customer's phorum-installs and everywhere it worked out of the box.


Thomas Seifert
pat
Re: not working
July 04, 2004 11:40AM
Hi Thomas,

> can you give an example url?

no it's on my local maschine.

> I've installed in 2 different customer's
> phorum-installs and everywhere it worked out of
> the box.

I'll try again then...

thanx
pat
pat
Re: Module for switching the read-/list-view - Now working
July 04, 2004 12:02PM
Hi,

I've got it working now. What was the mistake? Well, I named the folder where the mod-files go into something different than "viewswitch" but it has to be named exactly like that for the mod to work. So, Thomas I suggest, that you include the folder into your zip-file to avoid confusion in the future.

Thank you again, for the mod it's exactly what I was desperatly trying to write in an earlier attempt. With no success of course.

thanx
pat
Re: not working
July 04, 2004 12:27PM
It IS already compressed with the foldername.
you just have to give the decompressor the right switch to use the foldername as given in zip-archive.

attached is a new version with some more reliable url-generation. previously a reload of the page switched the view also.




Thomas Seifert
Attachments:
open | download - viewswitch.zip (1.1 KB)
Re: Module for switching the read-/list-view
July 05, 2004 09:28AM
Useful feature. However whenever I RELOAD the page, it flips between threaded and non-threaded that's not desired. Can it be fixed? Thanks.
Re: Module for switching the read-/list-view
July 05, 2004 10:00AM
sounds like you are not using the one from my last post.
that was fixed there.


Thomas Seifert
Sorry, only registered users may post in this forum.

Click here to login