PDA

View Full Version : Miscellaneous Hacks - Attachment countdown timer (like yousendit)


ericgtr
19 Sep 2006, 19:00
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

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

to

<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)


<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

<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)

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

scrollbars=yes,resizable=yes,width=470,height=300


To change the countdown time, look in the showfile_redirect template for:

var waitTime=10;

and

var blocksize=(barwidth-2)/waitTime/10;


As always, enjoy and please click the install button if you use it :)

nix
19 Sep 2006, 20:08
very nice. Thanks!

FleaBag
19 Sep 2006, 20:22
Yes it's cool, thanks for the contribution.

soletrader
19 Sep 2006, 22:44
I run 3.6.0 but can not get the attachment popop window to show up. Any suggestions? Thank you

ericgtr
19 Sep 2006, 22:46
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
19 Sep 2006, 22:48
yea i run vbseo. Anyway to get this fixed? I think this hack is great.

ericgtr
19 Sep 2006, 22:52
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
19 Sep 2006, 23:59
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
20 Sep 2006, 01:51
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
20 Sep 2006, 02:50
Nice hack, ericgtr!

Suggestion: registered users see attachments with ads ;)

ericgtr
20 Sep 2006, 03:23
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:

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


I'll update the instructions with this :)

Hornstar
20 Sep 2006, 03:39
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
20 Sep 2006, 03:45
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
20 Sep 2006, 03:59
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:

<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)

<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
20 Sep 2006, 05:55
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
20 Sep 2006, 06:33
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
20 Sep 2006, 12:11
what is the point of this hack? what good does it really do, besides pissing people off?

danielg
20 Sep 2006, 13:53
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
20 Sep 2006, 15:00
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.

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

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
20 Sep 2006, 15:03
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
21 Sep 2006, 14:26
It's great.Thanx

Hornstar
22 Sep 2006, 00:11
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

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

to

<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
22 Sep 2006, 16:06
Request complete, see the first post for updated instructions and thanks for the vbseo fix! :)

Hornstar
23 Sep 2006, 08:54
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
23 Sep 2006, 13:05
hornstar, how do i change no rel novbseo to 1? Where do I go and what do I fix? thank you

Barakat
23 Sep 2006, 13:27
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
24 Sep 2006, 00:30
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
24 Sep 2006, 01:45
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
24 Sep 2006, 10:58
Hey ericgtr just trying to work out if you will be able to do some of the requests in my post/s http://www.vbulletin.org/forum/showpost.php?p=1080293&postcount=22 and http://www.vbulletin.org/forum/showpost.php?p=1081275&postcount=24

Thanks.

ericgtr
25 Sep 2006, 23:14
Updated, please see first post for new instructions and layout. It will now show all the attachments as they should be.

Hornstar
27 Sep 2006, 06:17
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/gunbound-world-champion-bots-hacks-download/22516-gunboundwc-aimbot.html?styleid=1

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

Thanks.

Hornstar
27 Sep 2006, 06:21
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
27 Sep 2006, 15:09
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
27 Sep 2006, 21:45
Yes , thanks for fixing it i will check it 2nite

Barakat
28 Sep 2006, 03:36
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
28 Sep 2006, 06:48
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
02 Oct 2006, 22:15
bump, just making sure this fantastic add on is not dying.

Shazz
02 Oct 2006, 22:37
*Installed.

Hornstar
09 Oct 2006, 11:03
:/ hope your still alive and well :) am I the only one who is having problems still?

YLP1
27 Oct 2006, 00:29
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

Milez
12 Nov 2006, 22:51
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.

Good god dude, Google contentlink and don't hijack threads. Use a PM instead.

Anyone tested this on vb 3.6.2 or .3 yet?

Shazz
12 Nov 2006, 23:43
/me confirms

webgroup
24 Jan 2007, 06:29
Thanks for this hack!!!

I was making 55 to 65 daily with adsense, now im making 85 to 95 daily!!
Just by adding this hack to my site.

One thing, I cant see this on my postbit_attachment template:

scrollbars=yes,resizable=yes,width=470,height=300

ericgtr
24 Jan 2007, 15:12
Thanks for this hack!!!

I was making 55 to 65 daily with adsense, now im making 85 to 95 daily!!
Just by adding this hack to my site.

One thing, I cant see this on my postbit_attachment template:

scrollbars=yes,resizable=yes,width=470,height=300
It will only apply if what you have in the page exceeds the width :)

webgroup
28 Jan 2007, 02:44
I found one small glitch:

If there are more than 1 attachments on the post, when you wait for the timer and the time is up, all the atchments lisnk will show, but only 1, the one you clicked will be available.
This is confusing my users, they think that the other files are not availeble or something.

To fix this, only the attachment you clicked must be shown on the popoup window, then you hace to clcik and open a new window for each of the attachments on the post.

Fixing this will make the script perfect.

Thanks!

w1z4rd
30 Jan 2007, 21:17
This a great mod. Any chance this could have a BBcode like [timer]? That way you can use this great functionality with content besides attachments.

webgroup
02 Feb 2007, 07:12
I found one small glitch:

If there are more than 1 attachments on the post, when you wait for the timer and the time is up, all the atchments lisnk will show, but only 1, the one you clicked will be available.
This is confusing my users, they think that the other files are not availeble or something.

To fix this, only the attachment you clicked must be shown on the popoup window, then you hace to clcik and open a new window for each of the attachments on the post.

Fixing this will make the script perfect.

Thanks!


Any help?

Lizard306
02 Feb 2007, 10:25
I found one small glitch:

If there are more than 1 attachments on the post, when you wait for the timer and the time is up, all the atchments lisnk will show, but only 1, the one you clicked will be available.
This is confusing my users, they think that the other files are not availeble or something.

To fix this, only the attachment you clicked must be shown on the popoup window, then you hace to clcik and open a new window for each of the attachments on the post.

Fixing this will make the script perfect.

Thanks!

same problem with at www.chitchatters.net

there is a problem if there are more than one attachments :(

it would great if the above suggestion can be implemented :) otherwise it becomes quite unusable for forums where people attach more than 1 picture.

webgroup
03 Feb 2007, 06:33
where is eric?

ericgtr
07 Feb 2007, 21:14
For now I have changed this mod to Beta until I can get this resloved. Thanks for the report guys, I will let you know when it's fixed.

webgroup
11 Feb 2007, 08:57
Thank you eric!

We are ansiously waiting : )

Smiry Kin's
12 Feb 2007, 02:53
just a suggestion, could there be a limit some where added,

e.g if they downloaded the attachment, there have to wait X days X hours X minutes before they can download again, saves people downloading when unnessary, and abusing it.

let me know. if possible. :)

webgroup
07 Mar 2007, 23:45
still waiting for the update.

Shazz
07 Mar 2007, 23:46
If you have more then 1 attachment per post, its a MAJOR problem :)

webgroup
08 Mar 2007, 02:40
If you have more then 1 attachment per post, its a MAJOR problem :)


Yep u are right!

I need this to be fixed so bad, I even could throw a few bucks to anyone who can fix this!!

Shazz
08 Mar 2007, 03:04
Yep u are right!

I need this to be fixed so bad, I even could throw a few bucks to anyone who can fix this!!

Mmm... Same
Don't have hours to spend on it =\

webgroup
08 Mar 2007, 03:30
any coder needs $30.00?

Shazz
08 Mar 2007, 03:55
any coder needs $30.00?

Ill add on to that, name it :)

ericgtr
08 Mar 2007, 15:43
Guys, I need to spend a little time with this and I will get it fixed for you. I will be out for the next week but I will make it a priority when I get back.

Shazz
08 Mar 2007, 21:28
Guys, I need to spend a little time with this and I will get it fixed for you. I will be out for the next week but I will make it a priority when I get back.

Sounds good eric, thanx :D

board.trash
15 Mar 2007, 16:23
thank you very much, this hack is very nice and it works great @vb 3.6.5!

is it available to cache the templates in the next version?

If you have more then 1 attachment per post, its a MAJOR problem

is there any update from the coder to fix this? i hope so :)

taydu
16 Mar 2007, 03:59
it's possible to just show the attachment after the count down instead of the whole post ?

webgroup
19 Mar 2007, 03:10
Guys, I need to spend a little time with this and I will get it fixed for you. I will be out for the next week but I will make it a priority when I get back.

today is sunday, still waiting for the update :(

Shazz
19 Mar 2007, 03:43
today is sunday, still waiting for the update :(

/me waits with you
Oh well at least there is something

webgroup
21 Mar 2007, 10:11
any news?

brihan
29 Mar 2007, 00:30
Just checking.

I hope that the multiple picture fix is possible.

Shazz
29 Mar 2007, 01:04
Just checking.

I hope that the multiple picture fix is possible.

No...

webgroup
16 Apr 2007, 22:00
any news??

webgroup
16 Apr 2007, 22:04
anybody interesed in $30.00 via paypal for fixing this mod>?

thanks

Shazz
16 Apr 2007, 22:22
I removed it and decided to go with a vB.org system :D

webgroup
16 Apr 2007, 23:25
I removed it and decided to go with a vB.org system :D

???

Adam21
29 May 2007, 19:35
Any updates on this?

webgroup
29 Jun 2007, 22:36
still waiting for a fix

Censtudios
03 Jul 2007, 19:45
the demo doesnt work. it asks you to login... lol

Zi55
10 Jul 2007, 08:50
Please guys , we are really need this hack man ericgtr fix it !!!! we are really need it

webgroup
10 Aug 2007, 20:35
Im still offering $30 for a fix

Shazz
10 Aug 2007, 21:17
Im still offering $30 for a fix

Still haven't givin up lol
No replies to your request in service requests forum?

webgroup
16 Aug 2007, 20:23
2 contacted me but then disappeared

I'm offering $50.00 now

webgroup
21 Aug 2007, 20:09
nobody?

webgroup
06 Dec 2007, 22:14
still waiting

qdin
17 Jan 2008, 05:23
thanx a lot

yahoooh
04 Aug 2008, 09:18
any update so it will be work in vb 3.7.2 and for unregistered users only ?

webgroup
17 Aug 2011, 05:04
is something like this available for 4.1.5?

webgroup
16 Sep 2011, 05:31
Hello, I am offering $50 for an update for 4.1.5
Please PM me

muyar
14 Jun 2015, 13:57
Please update for 4.2.2

moded12
01 May 2016, 17:17
any update for this issue