YouTube playlist not displaying in forum preview mode
2 posters
Page 1 of 1
YouTube playlist not displaying in forum preview mode
Hey!
Since the last script changes on my forum (ref.: https://help.forumotion.com/t146030-preview-latest-topics#1001565 ) the YouTube player isn't displaying correctly in preview mode (as a guest) no more. It only happens when clicking the preview topic symbol, tho.
Logged in: http://prntscr.com/aar1ld
Guest view: http://prntscr.com/aar33j
Looks a bit sloppy without the nice player, doesn't it? Should be something small and annoying in one of those JS we may have overlooked I guess. Anyway, help is appreciated @Ange Tuteur. Ty! Btw, if you need the player script I'll be PMing you with that one. Once again, it's copyrighted material.
Board version: phpBB3
Link to my ws: http://www.friendcodes.nl (http://fcnl.actieforum.com)
Sammy
Since the last script changes on my forum (ref.: https://help.forumotion.com/t146030-preview-latest-topics#1001565 ) the YouTube player isn't displaying correctly in preview mode (as a guest) no more. It only happens when clicking the preview topic symbol, tho.
Logged in: http://prntscr.com/aar1ld
Guest view: http://prntscr.com/aar33j
Looks a bit sloppy without the nice player, doesn't it? Should be something small and annoying in one of those JS we may have overlooked I guess. Anyway, help is appreciated @Ange Tuteur. Ty! Btw, if you need the player script I'll be PMing you with that one. Once again, it's copyrighted material.
Board version: phpBB3
Link to my ws: http://www.friendcodes.nl (http://fcnl.actieforum.com)
Sammy
Last edited by RoXaNNeX on March 7th 2016, 8:44 pm; edited 1 time in total
Guest- Guest
Re: YouTube playlist not displaying in forum preview mode
Sorry for bumping this one, eventhough I'm aware Ange's not around no more. I'm still stuck with this one.
Guest- Guest
Re: YouTube playlist not displaying in forum preview mode
Hey,
JavaScript executes client-side when the page is loaded, so when the page is retrieved via AJAX it gets the raw HTML without executed javascripts. You can bypass this little quirk by creating a function in the global namespace that can be reinvoked. Firstly, if the script is using jQuery's docready function, remove this at the very beginning of the script :
and this at the very end of the script :
Next add this to the very beginning of the script :
and this to the very end :
Lastly change the placement of the script to "All pages" and save.
Almost done !! Create a new script "in the topics" ( or whatever the previous placement of the script was ) and paste this as the code :
Now edit the preview script and replace this :
by :
after this you should be good.
JavaScript executes client-side when the page is loaded, so when the page is retrieved via AJAX it gets the raw HTML without executed javascripts. You can bypass this little quirk by creating a function in the global namespace that can be reinvoked. Firstly, if the script is using jQuery's docready function, remove this at the very beginning of the script :
- Code:
$(function() {
and this at the very end of the script :
- Code:
});
Next add this to the very beginning of the script :
- Code:
function parseYoutubePlayer() {
and this to the very end :
- Code:
};
Lastly change the placement of the script to "All pages" and save.
Almost done !! Create a new script "in the topics" ( or whatever the previous placement of the script was ) and paste this as the code :
- Code:
if (window.parseYoutubePlayer) {
$(parseYoutubePlayer);
}
Now edit the preview script and replace this :
- Code:
$('#topicPreviewing').load($(this).siblings('a.topictitle, .table-title a').attr('href') + ($(this).siblings('a.topictitle')[0] ? ' .post:eq(0)' : ' .post:last'));
by :
- Code:
$('#topicPreviewing').load($(this).siblings('a.topictitle, .table-title a').attr('href') + ($(this).siblings('a.topictitle')[0] ? ' .post:eq(0)' : ' .post:last'), function() {
if (window.parseYoutubePlayer) {
parseYoutubePlayer();
}
});
after this you should be good.
Re: YouTube playlist not displaying in forum preview mode
Oh yeah!! This is exactly how I imagined how it should be after changing the preview dimensions as well. It's so fine now! Look @ that music topic preview going now. I'm falling in love with my own website over and over again lol. This is so darn good, it's absolutely fabulous!
Thanks a lot for your help without posting the original scripts, masta @Ange Tuteur !
Love,
Sammy.
Thanks a lot for your help without posting the original scripts, masta @Ange Tuteur !
Love,
Sammy.
Guest- Guest
Re: YouTube playlist not displaying in forum preview mode
Topic solved and archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Youtube Fan Forum
» Displaying user's viewing each forum
» Forum not displaying properly on mobile
» forum displaying wrong tittle?
» Time Displaying Incorrectly On Forum
» Displaying user's viewing each forum
» Forum not displaying properly on mobile
» forum displaying wrong tittle?
» Time Displaying Incorrectly On Forum
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum