|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Name: Antileech Description: Allows links to be posted which can only be hit by registered members. Download: https://www.ubbdev.com/ubb/upload/00006378/antileech.txt NOTE: Once more, this is untested and i hope it works but nothings perfect. Be sure to make backups.
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
interesting mod. all looks good but this may behave a little strangely:
[code][/code]
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Yes, very nice! Except that the variable has to be a path... My suggestion: [code][/code]Then use $file as the second variable in writefileasstring
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Alrighty... i put LK's fix in. Still don't know if it works tho...
I think i fixed the problem, jordo. Using javascripts window.open will do the job!
Text file updated.
|
|
|
|
Joined: Feb 2000
Posts: 62
Member
|
Member
Joined: Feb 2000
Posts: 62 |
brett,
Not sure of the exact type of circumstance this hack might be applied to.
If I assume that some boards provide download resources from links within the board and this hack makes sure they're members before allowing the download - would that be correct?
If so, could this be applied outside the board causing normal hyperlinks to somehow call this hack before allowing a d/l?
My site provides original mp3s - I used to have a js "no right click" script to force streaming audio - but too many people complained that they couldn't stream - and therefore couldn't listen to the music - the original purpose of the site.
If my assumptions are correct, requiring forum (and therefore site) membership would be a very neat option.
How far off base am I? :rolleyes:
I'm depriving a village somewhere of an idiot.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Your right, this hack makes sure your logged in before taking you to an antileeched link. I guess i should mention to those who can't read it that to activate it you need to use the ubbcode [al]download link here[/al] or [al=download link here]download wording here[/al], much like url/email but it'll return a ultimatebb.cgi?ubb=antileech;link=somerandomletters. You can antileech anything if you want; websites, downloads, mp3's, doesn't matter. If you wanted to use it for your site, try making a new topic and put all your links in with [al], and copy the returned links to a page on your site. Just an idea. I'm not sure about mp3 sreaming, it may or it may not work because i'm using window.open to open the links. I've never tried it before. You can call the links from outside the board, yes. But if someone clicks them, they'll need to be logged in. Logging in should take them back to the download through referral. Hope i answered your questions. 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Now that I read the code again, few more bugs: 1. Try to use
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
At first i was using the name tag to identify it in ubb_lib_posting.cgi, so if someone was to edit or quote a message back to a [al] tag. I just had those 'what in the hfil was i thinking moment' when i realized that it'll make a whole new file if they submit that post, so bad idea The changes i did was move the antileech to the noncgi directory. Apply LK's fix to reading antileech files. ubb_lib_posting.cgi no longer needs editing.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
It returns two spaces before target instead of one, it won't work on edit/quote  Anyhow, I think anything else works now 
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
oops, fixed. It should return in edit/quote as a url, shouldn't it?
|
|
|
|
Joined: Feb 2000
Posts: 62
Member
|
Member
Joined: Feb 2000
Posts: 62 |
brett quote: Hope i answered your questions.
- yes you did
This could be quite useful for me - thank you, and to you too LK for the tweaking 
I'm depriving a village somewhere of an idiot.
|
|
|
|
Joined: Feb 2000
Posts: 62
Member
|
Member
Joined: Feb 2000
Posts: 62 |
brett, Is there any chance of getting an updated .txt file to include LK's tweaking? - I can't quite combine what's already there with LKs suggestions. Thanks again 
I'm depriving a village somewhere of an idiot.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
I've applied all of them thus far except for one.
LK, what did you mean add the 'if' statement from ultimatebb.cgi. [code][/code]What would adding this accomplish?
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
I mean to move the "if ($ubb eq 'etc')" to that place, so that it will be before print header. (remember that we print Content-length: X or Content-type: text/plain, so it would be bad with also content-type: text/html  )
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Finally updated the file to a good standpoint. It'll print the correct content-type now.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
There is a small problem - if this script doesn't have permission to CHMOD 777 (ie. Windows server), you can tell them to upload Perl files and run it from antileech dir. I recommend that instead of .cgi, the files in antileech dir will be .dat or whatever, and also it will automatically upload an empty index.htm to the antileech dir when it creates it - &WriteFileAsString("$vars_config{NonCGIPath}/antileech/index.htm", ""); inside the !&direxists part.
|
|
|
|
Joined: Jul 2002
Posts: 1
Junior Member
|
Junior Member
Joined: Jul 2002
Posts: 1 |
Hi there,
searched this kind of hack for quite a long time, but what do I have to do to get it run?
|
|
|
|
Joined: Oct 2001
Posts: 28
Junior Member
|
Junior Member
Joined: Oct 2001
Posts: 28 |
Is this hack working on 6.3.1.1????
Thanks
|
|
|
|
Joined: Oct 2001
Posts: 28
Junior Member
|
Junior Member
Joined: Oct 2001
Posts: 28 |
how it works? How can I make links?
|
|
|
|
Joined: Oct 2001
Posts: 28
Junior Member
|
Junior Member
Joined: Oct 2001
Posts: 28 |
Visit this link and see if u help me
http://cshock.ibboards.com/2em1/ultimatebb.php?ubb=get_topic;f=1;t=000010
|
|
|
|
Joined: Oct 2001
Posts: 28
Junior Member
|
Junior Member
Joined: Oct 2001
Posts: 28 |
Should this code:
return(qq~<a href="$vars_config{CGIPath}/ultimatebb.cgi?id=antileech&link=$anti" target="_blank">$download</a>~);
be this code: [qb] return(qq~<a href="$vars_config{CGIURL}/ultimatebb.cgi?id=antileech&link=$anti" target="_blank">$download</a>~); [/qb]
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
No it should be this: return(qq~<a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=antileech&link=$anti" target="_blank">$download</a>~); I just tried it out on your forum, what did you antileech?
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Just updated the file, try it now.
|
|
|
|
Joined: Oct 2001
Posts: 28
Junior Member
|
Junior Member
Joined: Oct 2001
Posts: 28 |
THE LINK TESTE ON THAT TOPIC
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
what the... alright try this find: open(FILE, "<$link") || print("Location: $linknn");
# binary mode? if($content_type !~ m/^(text/(html|plain))/i) { binmode FILE || &StandardHTML("Unable to open $in{link} in binary mode."); } flock(FILE, LOCK_SH) or die "Can't obtain shared lock: $!"; while (<FILE>) {print $_;} flock(FILE, LOCK_UN) or die "Can't release lock: $!"; close(FILE); Replace with just: print("Location: $linknn");
|
|
|
|
Joined: Oct 2001
Posts: 28
Junior Member
|
Junior Member
Joined: Oct 2001
Posts: 28 |
Content-Disposition: attachment; filename=
Location:
Now i just got this!
WHAT A !!!!!
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
download it now, the new routines should work.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 254
Joined: January 2000
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|