Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
URL problems
dudieboy
New
Hi, embed Vanilla is working well enough on my site, with a few minor problems I'd like to start working on and need coding help. So when you click on a Discussion Title in the Discussions panel, in normal Vanilla it goes directly to the last post of the thread with a URL similar to this:
http://www.danbirlew.com/vanilla/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous#Item_33
which is basically the same as the discussion URL with "s#Item_33" added to the end.
However in embed Vanilla, when you are viewing the forum through a WordPress page and click on a Discussion Title in the Discussions panel, it redirects you to a URL as follows:
http://www.danbirlew.com/forums/#/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous
The differences are that /vanilla/ (the default installation location) has been replaced by /forums/#/ which is the WordPress embedded page followed by a pound sign. Note that the "S" has been added to the end, but the "#Item_33" is missing. This URL redirects the user to a random spot about 1/3rd the way down the last page of the discussion, which is unacceptable.
However, when let the cursor hover over the discussion link, you see the correct URL, which is:
http://www.danbirlew.com/vanilla/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous#Item_33
So it's obvious that an error is occurring in converting the default URL to the 'Remote URL to Forum'. In my embed Vanilla settings this is set to http://www.danbirlew.com/forums, however I don't check the option to "Force your forum to be viewed through the Remote Url" because I want mobile users to have the option of viewing the forums full screen, rather than embedded into my WordPress page.
In summary, I'd like to alter the code of the embed Vanilla plugin so that the Remote URL redirect doesn't cut the "#Item_33" from the end.
If possible, I'd also like to alter the WordPress Discussions widget so that the URLs link the user to the same location, the last post of the thread, rather than the first page of the discussion. If possible, I'd also like to add the name of the last poster to the Discussions widget, so that it would read something like "TV on DVD- What are you watching/wish to watch and how's it working for you? Last Post by Plopper".
Please let me know any ideas on how/where to begin.
http://www.danbirlew.com/vanilla/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous#Item_33
which is basically the same as the discussion URL with "s#Item_33" added to the end.
However in embed Vanilla, when you are viewing the forum through a WordPress page and click on a Discussion Title in the Discussions panel, it redirects you to a URL as follows:
http://www.danbirlew.com/forums/#/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous
The differences are that /vanilla/ (the default installation location) has been replaced by /forums/#/ which is the WordPress embedded page followed by a pound sign. Note that the "S" has been added to the end, but the "#Item_33" is missing. This URL redirects the user to a random spot about 1/3rd the way down the last page of the discussion, which is unacceptable.
However, when let the cursor hover over the discussion link, you see the correct URL, which is:
http://www.danbirlew.com/vanilla/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous#Item_33
So it's obvious that an error is occurring in converting the default URL to the 'Remote URL to Forum'. In my embed Vanilla settings this is set to http://www.danbirlew.com/forums, however I don't check the option to "Force your forum to be viewed through the Remote Url" because I want mobile users to have the option of viewing the forums full screen, rather than embedded into my WordPress page.
In summary, I'd like to alter the code of the embed Vanilla plugin so that the Remote URL redirect doesn't cut the "#Item_33" from the end.
If possible, I'd also like to alter the WordPress Discussions widget so that the URLs link the user to the same location, the last post of the thread, rather than the first page of the discussion. If possible, I'd also like to add the name of the last poster to the Discussions widget, so that it would read something like "TV on DVD- What are you watching/wish to watch and how's it working for you? Last Post by Plopper".
Please let me know any ideas on how/where to begin.
Tagged:
0
Comments
The rewrite URL produces for question mark a "s" in string in URL, why? - Vanilla Forums
Anyway, here is quick & dirty hack. Sorry, no testing.
Lets push and see what would happen.
embedvanilla 1.0.1
/plugins/embedvanilla/local.js
replace: with: and,
insert: before the last two lines:
/plugins/embedvanilla/remote.js
insert: after the line:
What I'm starting to wonder is why Vanilla doesn't use the permalinks. The last post for the topic above has the following permalink URL: http://danbirlew.com/vanilla/discussion/comment/1007#Comment_1007 which is completely different (and much shorter) than http://www.danbirlew.com/forums/#/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous#Item_35 which is supposed to go to the same location, but instead goes to just below the top of the page. The Vanilla version of this URL (http://danbirlew.com/vanilla/discussion/50/tv-on-dvd-what-are-you-watchingwish-to-watch-and-hows-it-working-for-yous#Item_35) only works slightly better, going to the middle of the third post from the bottom. However, using the Permalink goes directly to the correct post, every time.
So is there a way to modify Vanilla core and embed Vanilla so that discussion URLs redirect to the correct permalink rather than this seemingly abstract item reference?
Sorry, I have no alternative for now.
I'm going to request help on switching to discussion/comment/ URLs on the Discussions page in another thread until someone else wants to chime in.