vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Integration with vBulletin - NZB Attachment Parser (https://vborg.vbsupport.ru/showthread.php?t=136063)

Dismounted 01-09-2007 10:00 PM

NZB Attachment Parser
 
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 :(

Code:

<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

Quote:

Originally Posted by sde (Post 1156246)
does this require you to store your attachments in a directory vs the db?

Yes, you must store your attachments in the file system.
Quote:

Originally Posted by bashy (Post 1156298)
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
PHP Code:

$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:
PHP Code:

$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>"

Quote:

Originally Posted by bashy (Post 1156298)
Also the image for the nzb attchment is no longer showing for some reason

In postbit_attachment, find:
HTML Code:

<!-- 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:
HTML Code:

<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" />
Quote:

Originally Posted by bashy (Post 1156298)
Also i would like to see a gap between the attached file and the nzb file info window please

In postbit_attachment, find:
PHP Code:

$nzb 

Add before:
HTML Code:

<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

Quote:

Originally Posted by bashy (Post 1156785)
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?
Quote:

Originally Posted by bashy (Post 1156785)
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

Quote:

Originally Posted by bashy (Post 1157157)
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:
HTML Code:

<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:
HTML Code:

<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

Quote:

Originally Posted by bashy (Post 1155554)
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?

Quote:

Originally Posted by w1z4rd (Post 1158172)
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

Quote:

Originally Posted by w1z4rd (Post 1160703)
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

Quote:

Originally Posted by thedvs (Post 1160862)
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.

Quote:

Originally Posted by bashy (Post 1160899)
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

Quote:

Originally Posted by thedave99 (Post 1211985)
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

Quote:

Originally Posted by Dismounted (Post 1234490)
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

Quote:

Originally Posted by w1z4rd (Post 1158172)
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.


All times are GMT. The time now is 05:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01398 seconds
  • Memory Usage 1,856KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (5)bbcode_html_printable
  • (3)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete