Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Attachment countdown timer (like yousendit) Details »»
Attachment countdown timer (like yousendit)
Version: 2.0, by ericgtr ericgtr is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.0 Rating:
Released: 09-18-2006 Last Update: 09-26-2006 Installs: 37
Template Edits
Additional Files Is in Beta Stage  
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-20-2006, 01:23 AM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #13  
Old 09-20-2006, 01:39 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 09-20-2006, 01:45 AM
VietPirates VietPirates is offline
 
Join Date: Aug 2006
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #15  
Old 09-20-2006, 01:59 AM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #16  
Old 09-20-2006, 03:55 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #17  
Old 09-20-2006, 04:33 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #18  
Old 09-20-2006, 10:11 AM
bang bang is offline
 
Join Date: Sep 2005
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what is the point of this hack? what good does it really do, besides pissing people off?
Reply With Quote
  #19  
Old 09-20-2006, 11:53 AM
danielg danielg is offline
 
Join Date: Jan 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #20  
Old 09-20-2006, 01:00 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #21  
Old 09-20-2006, 01:03 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:00 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09598 seconds
  • Memory Usage 2,328KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete