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)
-   -   Miscellaneous Hacks - Attachment countdown timer (like yousendit) (https://vborg.vbsupport.ru/showthread.php?t=127041)

ericgtr 09-18-2006 10:00 PM

Attachment countdown timer (like yousendit)
 
Show your attachments for guests (or any usergroup you like) in a javascript window with a niftly little progress bar, sort of like yousendit or rapidshare. You can also place ads in this window, it's perfect if you have a board with many attachments.

Preview it here as guests see them http://www.guitarblast.com/showthread.php?t=805 (registered users see attachments normally)

This is currently in beta until I can resolve the following issue
It will not show more than one attachment per thread, I am currently working on this and will update when I get it resolved.


NOTE: THIS WILL ONLY WORK WITH 3.6.0 FINAL AND WILL FAIL IN ALL EARLIER VERSIONS, BOTH RC'S AND BETAS!
^ Don't mean to yell but this is very important :)


Update: (Version 2.0) Due to reported bugs this needed a complete rewrite. To upgrade, re-import the product-attachment_window.xml and select overwrite. Then replace the postbit_attachment template.

vBseo fix, thanks hornstar1337 and the vbseo team for helping out with this.

Modified the display in the thread to appear just as it does for registered users, also applied this to the popup window.

To upgrade to this version, run the installer again and select overwrite. Then replace the postbit_attachment template.

vBseo Fix. The problem was with the google analytics code. There was 2 ways to fix this, either disable the google analytics code, or replace this code from within postbit_attachment
Code:

<a href="javascript:history.go(0)"
to
Code:

<a rel="novbseo" href="javascript:history.go(0)"
and to ensure the vbseo config file is set to 1 (allow) for rel novbseo

Install time: 2 minutes

Product installer
4 New files
5 New templates (added by plugin)
1 Template edit

Upload showfile.php and showfile_redirect to your /forumroot and upload class_showfile.php and class_showfile_redirect.php to forumroot/includes/

Import product-attachment_window.xml by going to Plugins & Products > Manage Products [Add/Import Product]

Template edit

In postbit_attachment

replace all with this: (note that you can add any additional groups to the "$bbuserinfo['usergroupid'], array" that you want this to show up for)

Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(1, 3))">

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<tr>
        <td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif"></td>
        <td><a href="javascript:history.go(0)" onClick="MM_openBrWindow('showfile_redirect.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]','','scrollbars=yes,resizable=yes,width=470,height=300')"><strong>$attachment[filename]</strong></a>
 ($attachment[filesize]<if condition="$show['views']"><if condition="$show['views']"></if>, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>
</tr>
<else />
<tr>
        <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>
        <td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>
</tr>
</if>

In template SHOWTHREAD_FILE and showfile_redirect find this and change it to your site, or remove if you don't want to suggest that they register
Code:

<div align="center"><a href="http://www.YOURSITE.COM/FORUM/register.php" target="_blank">Registered Users</a> do not have to wait.</div>
Tweak to your setup:

In template SHOWTHREAD_FILE and showfile_redirect find this and place your ads there (there are two instances)
Code:

<!-- START AD CODE -->

<!-- END AD CODE -->

To change the size of the popup window, in template postbit_attachment find this and change to your liking:
Code:

scrollbars=yes,resizable=yes,width=470,height=300
To change the countdown time, look in the showfile_redirect template for:
Code:

var waitTime=10;
and
Code:

var blocksize=(barwidth-2)/waitTime/10;
As always, enjoy and please click the install button if you use it :)

nix 09-19-2006 06:08 PM

very nice. Thanks!

FleaBag 09-19-2006 06:22 PM

Yes it's cool, thanks for the contribution.

soletrader 09-19-2006 08:44 PM

I run 3.6.0 but can not get the attachment popop window to show up. Any suggestions? Thank you

ericgtr 09-19-2006 08:46 PM

It looks like your URL's are rewritten, you have an SEO mod installed?

Wait, I just tested and it does work with vrewrite at least. Are you sure you've uploaded all the files and ran the product install?

soletrader 09-19-2006 08:48 PM

yea i run vbseo. Anyway to get this fixed? I think this hack is great.

ericgtr 09-19-2006 08:52 PM

I looked at your site and the attachment won't launch the window. Double check that you've completely overwritten the contents of the postbit_attachment template as per the instructions.

soletrader 09-19-2006 09:59 PM

I disabled it at the moment. I did completly overwrite the postbit_attachment template but could not get it to work. Perhaps it has something to do with the fact I am running vbseo?

ericgtr 09-19-2006 11:51 PM

I could be, I don't have that mod but if they have a section where you can exclude files from being rewritten you can add showfile.php and upload class_showfile.php and see if that works.

VietPirates 09-20-2006 12:50 AM

Nice hack, ericgtr!

Suggestion: registered users see attachments with ads ;)

ericgtr 09-20-2006 01:23 AM

Quote:

Originally Posted by VietPirates
Nice hack, ericgtr!

Suggestion: registered users see attachments with ads ;)

Thanks!

It's easy to add registered users (or any other group you like) just add the usergroup to this array in the postbit_attachment. So it would look like this:
Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(1, 2, 3))">
I'll update the instructions with this :)

Hornstar 09-20-2006 01:39 AM

This is really good, ill make it so this will happen to registered members, so it creates another incentive for premium members on my site.

however im hopping that something like this can be included in DownloadsII maybe if you get time you could take a look and work something out for us over there.

Thanks for this great release.

edit:

Request
Just wondering if you could do this but without the popup? Because im thinking pop up blockers are becomming more and more common and this may make it hard for some members to understand why they cant download it, then they will spam and say why they cant download it. But if that request cant work, then maybe some instructions next to the link like, a popup will open with the download link, iono, just a thought i just had now.

Thanks again.

VietPirates 09-20-2006 01:45 AM

Quote:

Originally Posted by ericgtr
Thanks!

It's easy to add registered users (or any other group you like) just add the usergroup to this array in the postbit_attachment.

I meant registered users see attachments with ads, but no countdown timer :knockedout:

Thx, ericgtr!

ericgtr 09-20-2006 01:59 AM

Quote:

Originally Posted by hornstar1337
This is really good, ill make it so this will happen to registered members, so it creates another incentive for premium members on my site.

however im hopping that something like this can be included in DownloadsII maybe if you get time you could take a look and work something out for us over there.

Thanks for this great release.

edit:

Request
Just wondering if you could do this but without the popup? Because im thinking pop up blockers are becomming more and more common and this may make it hard for some members to understand why they cant download it, then they will spam and say why they cant download it. But if that request cant work, then maybe some instructions next to the link like, a popup will open with the download link, iono, just a thought i just had now.

Thanks again.

Well, what you can do is find this in postbit_attachment:
Code:

<a href="javascript:history.go(0)" onClick="MM_openBrWindow('showfile.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]','','scrollbars=yes,resizable=yes,width=470,height=300')"><strong>Get File!</strong></a>
And replace it with this: (you can see where the wording is if you want to change it)
Code:

<a href="javascript:history.go(0)" onClick="MM_openBrWindow('showfile.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]','','scrollbars=yes,resizable=yes,width=470,height=300')"><strong>Get File!</strong>(requires popups enabled)</a>

Hornstar 09-20-2006 03:55 AM

Okay thanks, that should help for now, ill see how it goes on the site over the next week, but what do you think is the chance of having the timer standard for certain usergroups? without a popup?

Hornstar 09-20-2006 04:33 AM

edit: installed it, I also have vbseo installed, so I disabled attachment re writing, dont know how to stop rewriting of those 2 other files tho, but ive put in a thread over at vbseo for that part, if it is.

When i click on an attachment it reloads the page instead of popping up the attachment.

do you think that is a problem with vbseo or a something else?

bang 09-20-2006 10:11 AM

what is the point of this hack? what good does it really do, besides pissing people off?

danielg 09-20-2006 11:53 AM

What, if I wanted this feature behind a thumbnail image, say a gif file?

Now it works only with non-images, right?

Thanks, very good work.

Daniel

ericgtr 09-20-2006 01:00 PM

Quote:

Originally Posted by hornstar1337
edit: installed it, I also have vbseo installed, so I disabled attachment re writing, dont know how to stop rewriting of those 2 other files tho, but ive put in a thread over at vbseo for that part, if it is.

When i click on an attachment it reloads the page instead of popping up the attachment.

do you think that is a problem with vbseo or a something else?

Someone else has this issue with vbseo also, I don't have it installed or I would try to work it out.

Quote:

what is the point of this hack? what good does it really do, besides pissing people off?
It is designed only for unregistered users (or any other group you may want to add) and ideally will help promote registrations. It also provides a link with a statement saying "Registered users do not have to wait".

Quote:

Now it works only with non-images, right?
Correct, as the default system is currently only designed that way. If there is a mod out there (haven't looked) that allows for thumbnails to be displayed but not opened, this could probably be applied to it though.

ericgtr 09-20-2006 01:03 PM

Quote:

Originally Posted by hornstar1337
Okay thanks, that should help for now, ill see how it goes on the site over the next week, but what do you think is the chance of having the timer standard for certain usergroups? without a popup?

I'll look into different timer settings for different groups but the popup will have to stay :)

Arda MENDES 09-21-2006 12:26 PM

It's great.Thanx

Hornstar 09-21-2006 10:11 PM

Update
It is now working after getting the fix from vbseo. The problem was with the google analytics code. There was 2 ways to fix this, either disable the google analytics code, or replace this code from within postbit_attachment
Code:

<a href="javascript:history.go(0)"
to
Code:

<a rel="novbseo" href="javascript:history.go(0)"
and to ensure the vbseo config file is set to 1 (allow) for rel novbseo

So that takes care of the problems for anyone with vbseo thanks to Oleg Ignatiuk from vbseo for helping me.

---------------------------------------------------------------------------

Request/suggestions

Pictures tell a 1000 words so ill upload the pics i took which should explain what I mean best.

The old view pic is what the attachment window used to look like, I kinda want this to remain the same, so as you can see in the new view, how things have changed because of this hack, I feel it would be best for everyone if we kept this looking the same as before.

In request 1 and 2, they are actually happening in both pics.

The description should be on top instead of below, and I would like to see if the link to download the attachment could be added to the description like how it used to be.

They are probably really small edits, such as adding a <br> or < br/>
(forget which one is the standard now) to make them on seperate lines but i dont want to screw things up so I thought it would be best to leave it to someone more advanced like yourself :)

Thanks for the great hack, hopefully you will get some time to fulfil these requests.

Thanks.

ericgtr 09-22-2006 02:06 PM

Request complete, see the first post for updated instructions and thanks for the vbseo fix! :)

Hornstar 09-23-2006 06:54 AM

Okay thanks but there was 2 things you left out,

1. Attachments are still on 1 line. instead of on seperate lines.
2. In the popup window, the name should go before what, eg.

It should be like this:

[Skin.rar 541.5 KB], (483 views) <--- This
Then ---> You have 25 seconds left before this link is active.
Get File

As for one attachment you can understand it, but when you got more then 1 attachment it is confusing.

3. If you can make the name of the attachment linked to the download after 25 seconds as well.

4. There is seems to be another bug, this may be partially part of statement (2.) that i mentioned.

Here is what my window looks like

You have 25 seconds left before this link is active.
Get File (This link here is the only one that will download even tho it says 25 seconds above)

File Type: rar [CELiTE.rar 681.1 KB], (696 views)
You have 25 seconds left before this link is active.
Get File

File Type: rar [Rakion By Pass.rar 454.0 KB], (662 views)
You have 0 seconds left before this link is active.
Get File (This file is not able to be downloaded even tho it says 0 seconds)

File Type: rar [Skin.rar 541.5 KB], (483 views)



also once the 25 seconds is up, can the next attachment start timing down, instead of them having to close the window and then clicking on the next attachement, or even better, when they click get file, it starts timming down, but only 1 file can time down at a time.


If the above could be fixed up it would be really awesome, and then after those are done, I got another suggestion/request but ill wait until you can get these done.

Thanks :)

soletrader 09-23-2006 11:05 AM

hornstar, how do i change no rel novbseo to 1? Where do I go and what do I fix? thank you

Barakat 09-23-2006 11:27 AM

Quote:

Originally Posted by hornstar1337
As for one attachment you can understand it, but when you got more then 1 attachment it is confusing.

it u have more than one file in the post the download just only works on the below file even if you choose the file in above ....

Hornstar 09-23-2006 10:30 PM

Quote:

Originally Posted by soletrader
hornstar, how do i change no rel novbseo to 1? Where do I go and what do I fix? thank you

in your includes file you will find your vbseo config file, open that, then search for novbseo and you will need to make sure that is on 1. For better instructions head over to vbseo.com and you will find the thread that I made and the answer in there.

@ Barakat:
I'm not sure if your confirmming the bug I stated or not, but it is a problem either way. Just check the screeen shots in my post above, and my post below it will explain it as well.

Thanks.

ericgtr 09-23-2006 11:45 PM

Quote:

Originally Posted by Barakat
it u have more than one file in the post the download just only works on the below file even if you choose the file in above ....

I will get some time tomorrow to work on this and see if I can get that part working.

Hornstar 09-24-2006 08:58 AM

Hey ericgtr just trying to work out if you will be able to do some of the requests in my post/s https://vborg.vbsupport.ru/showpost....3&postcount=22 and https://vborg.vbsupport.ru/showpost....5&postcount=24

Thanks.

ericgtr 09-25-2006 09:14 PM

Updated, please see first post for new instructions and layout. It will now show all the attachments as they should be.

Hornstar 09-27-2006 04:17 AM

thanks for the update.

Okay the forum view looks good now. however it is not working for me. (probably something simple to fix.)

When I click on the download link, the pop-up window loads the site instead of the download.

I'll go over everything again, but here is a test link http://www.gamerzneeds.net/forums/gu...html?styleid=1

Only installed on the default skin. need to be reg to download on the site as well.

Thanks.

Hornstar 09-27-2006 04:21 AM

edit:

worked out that the new files are not in the attachement as stated here

Upload showfile.php and showfile_redirect to your /forumroot and upload class_showfile.php and class_showfile_redirect.php to forumroot/includes/

I also dont have template showfile_redirect so I guess the product is the old one as well.

Can you upload the attachment again.

Thanks.

ericgtr 09-27-2006 01:09 PM

Quote:

Originally Posted by hornstar1337
edit:

worked out that the new files are not in the attachement as stated here

Upload showfile.php and showfile_redirect to your /forumroot and upload class_showfile.php and class_showfile_redirect.php to forumroot/includes/

I also dont have template showfile_redirect so I guess the product is the old one as well.


Can you upload the attachment again.

Thanks.

Ouch, you were right. I have uploaded the proper distribution again, thanks for pointing that out. Try now :)

Barakat 09-27-2006 07:45 PM

Yes , thanks for fixing it i will check it 2nite ยค

Barakat 09-28-2006 01:36 AM

i try it but i found that if u have more than one attachment file in ur post
and u want to download the 2nd or the 3rd one it will give u that file but in a name of the 1st file , and look how many messeges do u have all together in the attach window.

You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 0 seconds left before this link is active.

Hornstar 09-28-2006 04:48 AM

Quote:

Originally Posted by Barakat
i try it but i found that if u have more than one attachment file in ur post
and u want to download the 2nd or the 3rd one it will give u that file but in a name of the 1st file , and look how many messeges do u have all together in the attach window.

You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 20 seconds left before this link is active.You have 0 seconds left before this link is active.


you beat me to it. the same is happening to me.

I must say that it is looking alot better then last time, but this little bug is still occuring.

and im also getting some other weird things, that you will notice in the screen shot.

Thanks.

Hornstar 10-02-2006 08:15 PM

bump, just making sure this fantastic add on is not dying.

Shazz 10-02-2006 08:37 PM

*Installed.

Hornstar 10-09-2006 09:03 AM

:/ hope your still alive and well :) am I the only one who is having problems still?

YLP1 10-26-2006 10:29 PM

EricGTR, I am sorry to go off topic but I have to know where to find this awesome mod that you have on your site.

I don't know what to call it so I took screen shots of it.

I really need something this on my site and would really appreciate it knowing where I can get it.

Thanks in advance


All times are GMT. The time now is 10:15 AM.

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.01554 seconds
  • Memory Usage 1,857KB
  • 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
  • (13)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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