We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
[ C ] BBcode for movies/tv shows
Topic Started: Nov 18 2017, 06:26 PM (363 Views)
Harvyy
Member Avatar
Member
[ *  *  * ]
Private
Zetaboard

I submitted this request over a year ago and it's no longer working. The hosting site changed its terms and wants money now. Was wondering if somebody could make a bbcode for embedding movies/tv shows details in a post.

https://developers.themoviedb.org/4/getting-started/authorization
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Find a new site that offers a free API and I'll update my code to work with that site.
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
https://www.themoviedb.org/documentation/api
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I'm not sure about that one. You have to register for an API key and you have to attribute them. Perhaps there's another one you can find that's not so restrictive?
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
https://github.com/maddox/imdb-party
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It doesn't look like that code utilizes JSON, which is what my code will require.
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
This is a new api key from the original site in your code, thought i give it another try after they updated the site.

http://www.omdbapi.com/?i=tt3896198&apikey=9b1ce9ac


Edited by Harvyy, Nov 24 2017, 10:43 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Clear your cache and let me know if the code works now.
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
still not working for me and i cant find any other api, so mods can close this requests. Thanks for the help cory.
Edited by Harvyy, Nov 27 2017, 11:55 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
If you're using the script found here, then it should be working, at least it does on my test board.
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
okay it works now lol, thanks. Is there a way to make the information stick permanently after posted, so in case the site updates again i don't lose all the information on the topic?
Some movies have remakes like the Justice League but when I type in justice league I get the animated series and not the recent movie that was released this November. If possible can you make so that I have to enter the year along with the movie title within the bbcode for clarification.
This appears toward the end: Posted Image
Edited by Harvyy, Nov 28 2017, 11:08 AM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I think the information can be preserved, but it would require a total rewrite of the code and the actual contents of the post on the compose post screen will change instead of just a BBCode being transformed on the topic page.

Here's the year version: http://support.zathyus.com/topic/7004159/1/#post30011365

The extra text should no longer be appearing upon clearing your cache.
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
okay thanks, one last thing, I would like a few changes made to the info in the year's version:

removal of the Metascore, rating and replace it with: Language and Production Company(s) thank you.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try this instead:
Code:
 
<script type="text/javascript">
// By Cory
// http://s1.zetaboards.com/Cory/index/

$('#c_bbcode button:last').after(' <button type="button" name="IMDB" onclick="ZetaIMDB()">IMDB</button>');

function ZetaIMDB() {
var tVal = ZetaPrompt('IMDB', 'Title of Film');
if (tVal !== null) {
var yVal = prompt('Leave field blank to insert no year', 'Year of Film');

if (yVal !== null) {
ZetaInsert('[IMDB=' + yVal + ']' + tVal + '[/IMDB]');
}
}
}

$('td:contains([/IMDB]):not(:has(textarea)), div.search_results:contains([/IMDB]), #blog blockquote:contains([/IMDB])').each(function() {
$(this).html($(this).html().replace(/\[IMDB=([0-9]+|)\](.+?)\[\/IMDB\]/gi, '<div class="movies"><span class="m-year" style="display: none">$1</span><span class="movie" style="display: none">$2</span><span style="font-size: 25px"><span class="title"></span> (<span class="year"></span>)</span><br /><br /><span class="rated"></span> | <span class="runtime"></span> | <span class="genre"></span> | <span class="released"></span> (<span class="country"></span>)<br /><br /><span class="poster"></span><br /><br /><span class="director"><strong>Director</strong>: </span><br /><span class="writer"><strong>Writers</strong>: </span><br /><span class="actors"><strong>Stars</strong>: </span><br /><span class="language"><strong>Language</strong>: </span><br /><span class="production"><strong>Production</strong>: </span><br /><span class="rating"><strong>Rating</strong>: </span>/10<br /><span class="plot"><strong>Storyline</strong>: </span></div>'));
});

$('div.movies').each(function() {
var $this = $(this);
var mYear = $this.find('span.m-year').text();
var mName = $this.find('span.movie').text().replace(/ /gi, '+');

$.getJSON('http://www.omdbapi.com/?t=' + mName + '&y=' + mYear + '&plot=full&r=json&apikey=9b1ce9ac', function(data) {
var items = [];
$.each(data, function(key, val) {
items.push('<span class="' + key + '">' + val + '</span>');
});

for (var i = 0; i < items.length; i++) {
(function(i) {
$(items[i]).appendTo($this);
})(i);
}

$this.find('span.imdbID, span.Type, span.Response, span.imdbVotes, span.Awards, span.Ratings, span.DVD, span.BoxOffice, span.Website, span.totalSeasons, span.Metascore').hide();
$this.find('span.Title').appendTo($this.find('span.title'));
$this.find('span.Year').appendTo($this.find('span.year'));
$this.find('span.imdbRating').appendTo($this.find('span.rating'));
$this.find('span.Poster').appendTo($this.find('span.poster'));
$this.find('span.Rated').appendTo($this.find('span.rated'));
$this.find('span.Runtime').appendTo($this.find('span.runtime'));
$this.find('span.Genre').appendTo($this.find('span.genre'));
$this.find('span.Released').appendTo($this.find('span.released'));
$this.find('span.Country').appendTo($this.find('span.country'));
$this.find('span.Plot').appendTo($this.find('span.plot'));
$this.find('span.Director').appendTo($this.find('span.director'));
$this.find('span.Writer').appendTo($this.find('span.writer'));
$this.find('span.Actors').appendTo($this.find('span.actors'));
$this.find('span.Language').appendTo($this.find('span.language'));
$this.find('span.Production').appendTo($this.find('span.production'));
$this.find('span.poster').html('<img src="' + $this.find('span.poster').text() + '" style="max-height: 200px" alt="Poster" />');
});
});
</script>
Offline Profile Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
Thank you, that is all.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1