PDA

View Full Version : Integration with vBulletin - NZB Attachment Parser


Dismounted
01-09-2007, 10:00 PM
NZB Attachment Parser

Description:
This product will parse nzb attchments and display the contents in postbit.

Request Thread:
https://vborg.vbsupport.ru/showthread.php?t=135621

Installation:
All the installation information is in the package.

Changes:
1 Plugin
1 File Upload

Change Log:
11/01/2007 - Version 1.1
- Collapsible NZB File Content Tables

10/01/2007 - Version 1.0
- Initial Release

Dismounted
01-10-2007, 02:59 AM
/me Reserves

bashy
01-10-2007, 05:14 AM
Didnt work for me, I am using GARS, so this could be the reason :(

<if condition="$show['attachments']">
<!-- attachments -->
<div style="padding:$stylevar[cellpadding]px">

<if condition="$show['thumbnailattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_thumbnails]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[thumbnailattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[imageattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachmentlink']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[imageattachmentlinks]
</table>
</fieldset>
</if>

<if condition="$show['otherattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_files]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[otherattachments]
</table>
</fieldset>
</if>

<if condition="$show['moderatedattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attachments_pending_approval]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[moderatedattachments]
</table>
</fieldset>
</if>
</div>
<!-- / attachments -->
</if>

Theres the attachment code, I have to go work so will be back later, great hack btw :)

Dismounted
01-10-2007, 05:30 AM
What do you mean by 'It doesn't work?'

Raptor
01-10-2007, 02:50 PM
worked perfect first time - great hack

bashy
01-10-2007, 03:33 PM
Its ok, now sorted :)

I do have a question though, Would it be possible to have this so you have to
click a Show Files link and then they show?

EDIT: Sorry but when its a say DVD nzb theres lots of files and it slows the page down no end
I have had to remove this for now, If you do manage to find a way to add a link to show files
then i will deffo install again.....Thanks

Dismounted
01-11-2007, 08:06 AM
Hack Updated!

11/01/2007 - Version 1.1
- Collapsible NZB File Content Tables

sde
01-11-2007, 01:42 PM
does this require you to store your attachments in a directory vs the db?

bashy
01-11-2007, 03:25 PM
Thank you so very much Dismounted, i actually thought it was a long shot, much appreciated :)

Sorry to ask some more but...

How do i set the table so that its closed by default please?
Also the image for the nzb attchment is no longer showing for some reason
Also i would like to see a gap between the attached file and the nzb file info window please

Dismounted
01-12-2007, 03:14 AM
does this require you to store your attachments in a directory vs the db?
Yes, you must store your attachments in the file system.
Thank you so very much Dismounted, i actually thought it was a long shot, much appreciated :)

Sorry to ask some more but...

How do i set the table so that its closed by default please?
1) In 'class_nzbparser.php', find
$nzbfiletable = "<table class=\"tborder\" cellpadding=\"$cellpadding\" cellspacing=\"$cellspacing\" border=\"0\" width=\"100%\" align=\"center\"><td class=\"tcat\" colspan=\"2\"><a style=\"float: right;\" href=\"#top\" onclick=\"return toggle_collapse('nzbfile" . $nzbfileid . "');\"><img id=\"collapseimg_nzbfile" . $nzbfileid . "\" src=\"" . $imgdir_button . "/collapse_tcat.gif\" alt=\"\" border=\"0\"></a>NZB File Contents</td></table>";
Replace with:
$nzbfiletable = "<script type=\"text/javascript\">
var times=1;
function check_collapse()
{
if (times==1)
{
times=2;
return toggle_collapse('nzbfile" . $nzbfileid . "');
}
}
</script>";
$nzbfiletable .= "<table class=\"tborder\" cellpadding=\"$cellpadding\" cellspacing=\"$cellspacing\" border=\"0\" width=\"100%\" align=\"center\"><td class=\"tcat\" colspan=\"2\"><a style=\"float: right;\" href=\"#top\" onclick=\"return toggle_collapse('nzbfile" . $nzbfileid . "');\"><img id=\"collapseimg_nzbfile" . $nzbfileid . "\" src=\"" . $imgdir_button . "/collapse_tcat.gif\" alt=\"\" border=\"0\" onload=\"check_collapse();\"></a>NZB File Contents</td></table>";
Also the image for the nzb attchment is no longer showing for some reason
In postbit_attachment, find:
<!-- Start NZB Attachment Parser -->
<if condition="$attachment[attachmentextension] != 'nzb'">
<img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" />
</if>
<!-- End NZB Attachment Parser -->
Replace With:
<img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" />
Also i would like to see a gap between the attached file and the nzb file info window please
In postbit_attachment, find:
$nzb
Add before:
<br />

bashy
01-12-2007, 05:22 AM
Hi m8, thanks for all ya help

Everything is ok apart from the image still, its now there just slightly in the wrong please
Please see image.....

Can you think of any reason why having this mod/hack will make the page slow to open...
I have tested the same page with and without but its been the same results, fast without mod/hack, slow with it....I thought it was because all the files were showing, hence i wanted it closed as default, but that wernt the case lol, still want ti closed though :)

Thanks again

Dismounted
01-12-2007, 07:46 AM
Hi m8, thanks for all ya help

Everything is ok apart from the image still, its now there just slightly in the wrong please
Please see image.....
Where's the image?
Can you think of any reason why having this mod/hack will make the page slow to open...
I have tested the same page with and without but its been the same results, fast without mod/hack, slow with it....I thought it was because all the files were showing, hence i wanted it closed as default, but that wernt the case lol, still want ti closed though :)

Thanks again
The script has to parse the files no matter if the table is collapsed or not. That's why.

bashy
01-12-2007, 03:32 PM
lol...story of my life, i always forget the image, but in my favour, i did have to run out the door to go to work :)
Image enclosed (i hope lol)

That will explain why its slower opening regardless...

Dismounted
01-13-2007, 03:10 AM
lol...story of my life, i always forget the image, but in my favour, i did have to run out the door to go to work :)
Image enclosed (i hope lol)

That will explain why its slower opening regardless...
In postbit_attachment, find:
<td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
Replace With:
<td valign="top"><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>

bashy
01-13-2007, 07:49 AM
Thanks a lot, thats got it all sorted now, much appreciated :)

w1z4rd
01-13-2007, 04:45 PM
EDIT: Sorry but when its a say DVD nzb theres lots of files and it slows the page down no end I have had to remove this for now, If you do manage to find a way to add a link to show files then i will deffo install again.....Thanks


I find if you remove everything but the file list (group, poster, file size, parts) then it's not so bad with larger files.


Great hack, I tried for hours on the collapsible deal by myself before I noticed you added it.

bashy
01-14-2007, 07:39 AM
Can you advise as to how to strip (group, poster, file size, parts) please?

I find if you remove everything but the file list (group, poster, file size, parts) then it's not so bad with larger files.


Great hack, I tried for hours on the collapsible deal by myself before I noticed you added it.

w1z4rd
01-16-2007, 04:49 PM
You have to edit the table in class_nzbparser.php and remove the appropriate <td>'s.

thedvs
01-16-2007, 07:22 PM
You have to edit the table in class_nzbparser.php and remove the appropriate <td>'s.

Can u post your copy of the php to save us all some time? :)

bashy
01-16-2007, 08:05 PM
Does it make a vast improvement once modified?

w1z4rd
01-20-2007, 02:24 PM
Can u post your copy of the php to save us all some time? :)

Sorry my copy is highly modified from the original and I prefer not to.

Does it make a vast improvement once modified?

Yes it does make a very noticeable difference since your removing about 3/4 of the info that has to be parsed.

bashy
01-20-2007, 03:53 PM
Ok, thanks, i will try this :)

Narcootic
02-25-2007, 06:15 PM
Hi,

Any chance I could get this to work on 3.5.x?

Thanks

Dismounted
02-27-2007, 04:45 AM
Yea, it should work, provided you change the format of the XML abit. I forgot what you change to make it 3.5-compatible.

cunder
03-23-2007, 03:15 PM
what is the Attachment Manager code fore NZB.
??? Content-type: application/zip ???

Dismounted
03-24-2007, 02:22 AM
What are you talking about? You don't need to set any content types.

thedave99
03-25-2007, 05:57 PM
I get this error at the top of the page :

Warning: file_get_contents(/path/to/your/attachment/directory/1/1.attach) [function.file-get-contents]: failed to open stream: No such file or directory in /includes/class_nzbparser.php on line 20

And the nzb contents do not show? whats wrong?

Dismounted
03-26-2007, 11:11 AM
Are you using the file-based attachments system?

wolfe
04-22-2007, 07:07 PM
I get this error at the top of the page :

Warning: file_get_contents(/path/to/your/attachment/directory/1/1.attach) [function.file-get-contents]: failed to open stream: No such file or directory in /includes/class_nzbparser.php on line 20

And the nzb contents do not show? whats wrong?
i got same problem m8 and im using database attachments.

Dismounted
04-23-2007, 06:15 AM
You must use the file system.

wolfe
04-23-2007, 09:45 AM
sorted m8 nice one is there any for a zip / rar file which has an nzb inside it ? thx in advance

Dismounted
04-23-2007, 11:03 AM
That would require an extra zip parser which would be a pain in the a** to manage.

wolfe
04-23-2007, 05:46 PM
ok m8 what about parsing txt / nfo files also m8 is there a way of the nzb listing automaticly collapsed without it loading then collapsing.

Dismounted
04-24-2007, 06:10 AM
This hack is not designed for parsing nfo files. What is there to parse anyway?
It is possible to have it automatically collapsed, but it is chunky code. If you are trying to reduce loading times, don't bother.

wolfe
04-24-2007, 08:21 AM
This hack is not designed for parsing nfo files. What is there to parse anyway?
It is possible to have it automatically collapsed, but it is chunky code. If you are trying to reduce loading times, don't bother.
is there not a way of it showing the nfo file in a collapsible box ?

Dismounted
04-24-2007, 08:50 AM
Oh, that's what you meant. "Parse" means read and interpret data from a file with defined tags or a defined format. nfo Files are just files with text in them, so it wouldn't classified as parsing.

There are lots of ways, but this is only a hack for parsing nzb files.

wolfe
04-24-2007, 08:51 AM
could you make a nfo reader

Dismounted
04-24-2007, 09:32 AM
I could, but the discussion should not be in this thread.

thedvs
08-14-2007, 07:02 PM
I find if you remove everything but the file list (group, poster, file size, parts) then it's not so bad with larger files.


Great hack, I tried for hours on the collapsible deal by myself before I noticed you added it.

which code do you remove?

wolfe
10-05-2007, 02:18 AM
m8 its not parsing the nzb files properly anymore due to them changing.

Dismounted
10-08-2007, 06:48 AM
How are they changing?

wolfe
10-08-2007, 09:31 AM
the date="1191325406" poster="Yenc"> are in different places as they are in your code and its not displaying them properly :P

Dismounted
10-09-2007, 10:06 AM
How different are they? Provide before and after samples.

wolfe
10-09-2007, 12:04 PM
you code looks at the nzb file like this for poster and date but the new nzb code is the opisite was round.

Your Code:
if (eregi("poster=\"(.*)\" date=", $part, $matches))New Way Round
date="1191325406" poster="Yenc"so instead of show this

https://vborg.vbsupport.ru/attachment.php?attachmentid=58835&d=1168510031


it shows

Dismounted
10-09-2007, 12:10 PM
Is this for all of them or only a few select ones?

wolfe
10-09-2007, 12:10 PM
well i have checked a few random ones and they seem to be the same the nzb code has changed.

eclipse11
12-12-2007, 01:42 AM
good mod, had to strip the code because it was loading quite slow... just a quick question, i won't be using attachments with anything only this script... so would it be possible to change the attachments part just for this? (attached screenshot) maybe you could help me out?

thanks :cool:

Dismounted
12-13-2007, 04:59 AM
I believe that is possible with template edits, although I don't have a copy of vBulletin in front of me so I can't elaborate more.

thedvs
01-23-2008, 05:47 PM
which code do u strip to make it faster etc?

Dismounted
01-24-2008, 03:06 AM
It depends on what you want to strip really.

wolfe
01-24-2008, 05:48 AM
dismounted m8 would if be possible for you to make this work by parsing files that are zipped up ? thx in advanced.

Dismounted
01-25-2008, 04:17 AM
It's possible, but I don't think I have enough spare time to do it at the moment.

xixxon
11-19-2008, 05:20 PM
helo !
I need to display images in something like this ?

mojo8850
12-05-2008, 01:14 PM
Has This Been Updated For 3.7.0 +

Dismounted
12-06-2008, 02:30 AM
It might work on later versions, but I have not tested it.

Elric
01-26-2009, 03:38 AM
It works not with [hide][attach]nzb NR.[ /attach][ /hide]..:(

Dismounted
01-26-2009, 04:11 AM
The modification was never designed to work with inline attachments, and you have seen that it does not work that way. That functionality may come in the future, I hardly maintain this modification any more.

carleboy
01-06-2010, 12:40 AM
Would just like to say this works in VB3.8.x

How can i make the info box minimised as defualt please ??

Thanks

DaPike
09-19-2010, 01:57 PM
Hi,

well I'm looking for a hack like this. But I only need the age of the NZB. Perhaps the size and how many files. Who will help me to get this??
Or is it possible to use this hack for this?

Please help.

Greetz

DaPike

Xipher-FNG
06-12-2011, 05:48 AM
helo !
I need to display images in something like this ?

Sorry, but i don't have that code not more.
That is not this nzbparser but that is a full custom made script :)

And i lost my editted version of this nzb-parser.
He load very fast what i did was safe 1 time the .nzb file information in a database.
So he load 1 time that information.
Now in the normal version he load everytime the full file and that make the speed so low :)

root2012
01-11-2013, 06:05 PM
update for vb 4.1,0 I request seeking the

DaPike
01-27-2013, 08:54 PM
I'm also looking for a working version for vB 4.1.0

Can someone help please?

Dismounted
02-02-2013, 11:27 AM
Unfortunately, I will not have enough free time to port this over to any newer version of vBulletin.

root2012
02-05-2013, 12:00 AM
that's really a shame would be happy anyway if you find the time wurdes

jolinary
08-27-2013, 05:04 PM
Hi, is it possible to update your modification for vbulletin 4.2.1? Thank you to you.

ozzy47
08-28-2013, 01:20 AM
Hi, is it possible to update your modification for vbulletin 4.2.1? Thank you to you.

Did you read the post that is two posts above yours?


Unfortunately, I will not have enough free time to port this over to any newer version of vBulletin.

madness85
10-06-2013, 11:19 AM
what a shame :(

vBNinja
10-08-2013, 04:48 PM
Did you read the post that is two posts above yours?

Hi, is it possible to update your modification for vbulletin 4.2.1? Thank you to you.

what a shame :(

I ported this mod to vb4 some time ago
I'll look for it and post it if/when i find it ;)

root2012
10-09-2013, 02:25 PM
oh cool vBNinja

madness85
10-25-2013, 05:59 PM
I ported this mod to vb4 some time ago
I'll look for it and post it if/when i find it ;)

whoo :)

madness85
12-09-2013, 09:27 PM
Please someone post this for 4.2 :)

Elric
03-17-2016, 01:24 AM
Can anyone update this hack for 4.2 please ?

Darkman7030
04-10-2016, 10:42 PM
It works not with [hide][ /hide]