Results 11 to 17 of 17
-
9th Aug 2010, 12:44 AM #11OPMember
whats the php-imdb link for? imdbphp is better
http://projects.izzysoft.de/trac/imdbphp
If you use Yawns leecher script a lot of the time you have to copy/paste the nfo from the post and it works with the sites that are leeched, so this is just to save time.
its 14 lines of code and im not good with coding, its not ment to be a full on converter
I just posted it to help people not to get bashed
just seen your post, it isnt working
Warning: preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 20 in /var/www/vhosts/xxxxxx/nfo.php on line 7
-
9th Aug 2010, 01:00 AM #12Respected Developer
Ok, that would be a bug in the regular expression engine since that's a valid regex. If I move the escaped slash to the front it magically works.
PHP Code:<?
echo "<form method='post' action=''>"
."<textarea id='nfo' name='nfo' rows='15' cols='80' style='width: 100%'></textarea>"
."<input type='submit' name='go' value='Remove Shite' />"
."</form>";
if (isset($_POST['go'])) {
$cleaned = preg_replace('/([^\\\w\d\s\-:.,\/]+)/', '', html_entity_decode($_POST['nfo']));
// you don't need to do this in this case
//$cleaned = preg_replace('/[ ]*(\r{0,1}\n)[ ]*/', '$1', $cleaned);
$cleaned = preg_replace('/(ripper|supplier|genre|release date|theater date|source|aspect ratio|video format|video resolution|video bitrate|audio bitrate|runtime|rating|language|subtitle|substitle|dvd date|audio format|video aspect|video length|theatre date|framerate|video codec|audio codec|dir name|artist|album|year|retail|label|encoder|quality|grabber|ripped|video fps|imdb rating)/i', '[b]$1[/b]', $cleaned);
echo "<pre>".$cleaned."</pre>";
}
?>
-
9th Aug 2010, 01:10 AM #13OPMember
I did try to use html_entity_decode, but got the same result as you get with that code.
the page is filled with numbers..
eg. 9604960496009600960096049604 so I tried using regex to remove them, then clean up whitespace, but the results wernt reliable so i ended up with the code i posted.
-
9th Aug 2010, 01:34 AM #14Respected Developer
That would be a charset issue. Try:
PHP Code:html_entity_decode($_POST['nfo'], ENT_COMPAT, 'UTF-8')
-
9th Aug 2010, 01:43 AM #15OPMember
The results are worse using that.
I did try using html_entity_decode with charsets and lots of different methods of cleaning the code using regex before dumping it & trying a different method and seeming im only using the code for a few NFO sites it works well enough for me
eg. i want to clean this up and post it on a site, the script cleans it up
http://nfomation.net/info/1281172910...rerip-done.nfo
-
9th Aug 2010, 02:23 AM #16Respected Developer
See this is why after a while I really started hating PHP. It's a great language for the job but it's filled with tiny issues, bugs and design flaws. Unbelievable.
This thread is only a few lines of code and we already found:
- there's at least one bug in the regex parser
- the HTML decoder is flawed or has poor error compensating (or unsupported encoding)
All hail C#/.NET.
-
9th Aug 2010, 03:40 AM #17OPMember
I have updated the 1st post with a working example, and stated that it will only work with nfo's for sites used by Yawns leecher.
I think that's the confusion, i didn't make this to work with full ascii nfos only for the sites i needed
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Forums Post
By V!P in forum Webmaster DiscussionReplies: 0Last Post: 25th Oct 2012, 12:43 PM -
Forums to post
By TheA10tion in forum Forum and DDL DiscussionReplies: 1Last Post: 4th Jul 2011, 12:58 PM -
One post to many Forums?
By dilll1990 in forum Web Application/Script SupportReplies: 7Last Post: 17th Feb 2011, 06:52 AM -
looking for forums to post
By StarTech in forum Community CooperativeReplies: 37Last Post: 8th Sep 2009, 06:29 PM
themaManager - edit and manage...
Version 4.22 released. Open older version (or...