Previous Thread
Next Thread
Print Thread
Rate Thread
#153828 06/13/2002 3:58 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
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.

Sponsored Links
#153829 06/13/2002 6:06 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
interesting mod. all looks good but this may behave a little strangely:

[code][/code]

#153830 06/13/2002 11:32 PM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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

#153831 06/14/2002 1:03 AM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
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.

#153832 06/14/2002 2:20 AM
Joined: Feb 2000
Posts: 62
Member
Member
Offline
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.
Sponsored Links
#153833 06/14/2002 2:19 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
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. smile

#153834 06/14/2002 2:34 PM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Now that I read the code again, few more bugs:
1. Try to use
Code
[/code]instead of:
Code
</pre></div></div>Then use the ultimatebb.cgi "if" right after:[code]
2. Why "name" attribute for ? you're not using #name, right?

3. Don't use cgipath/Members, use memberspath.

4. Make that if !DirExists for members/antileech, create it. (see cp_upgrade.cgi)

#153835 06/14/2002 4:12 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
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 shocked

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.

#153836 06/14/2002 4:29 PM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
smile

It returns two spaces before target instead of one, it won't work on edit/quote tipsy Anyhow, I think anything else works now smile

#153837 06/15/2002 1:22 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
oops, fixed. It should return in edit/quote as a url, shouldn't it?

Sponsored Links
#153838 06/15/2002 2:28 PM
Joined: Feb 2000
Posts: 62
Member
Member
Offline
Joined: Feb 2000
Posts: 62
brett
quote:
Hope i answered your questions.
- yes you did laugh

This could be quite useful for me - thank you, and to you too LK for the tweaking smile


I'm depriving a village somewhere of an idiot.
#153839 06/15/2002 6:11 PM
Joined: Feb 2000
Posts: 62
Member
Member
Offline
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 smile


I'm depriving a village somewhere of an idiot.
#153840 06/16/2002 7:09 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
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?

#153841 06/17/2002 4:17 AM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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 tipsy )

#153842 08/28/2002 10:00 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
Finally updated the file to a good standpoint. It'll print the correct content-type now.

#153843 08/29/2002 12:39 AM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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.

#153844 09/13/2002 1:39 AM
Joined: Jul 2002
Posts: 1
Junior Member
Junior Member
Offline
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?

#153845 10/03/2002 2:47 PM
Joined: Oct 2001
Posts: 28
Junior Member
Junior Member
Offline
Joined: Oct 2001
Posts: 28
Is this hack working on 6.3.1.1????

Thanks

#153846 10/05/2002 2:43 PM
Joined: Oct 2001
Posts: 28
Junior Member
Junior Member
Offline
Joined: Oct 2001
Posts: 28
how it works? How can I make links?

#153847 10/05/2002 3:58 PM
Joined: Oct 2001
Posts: 28
Junior Member
Junior Member
Offline
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

#153848 10/05/2002 5:09 PM
Joined: Oct 2001
Posts: 28
Junior Member
Junior Member
Offline
Joined: Oct 2001
Posts: 28
Should this
Quote
code:
Code
	return(qq~<a href="$vars_config{CGIPath}/ultimatebb.cgi?id=antileech&link=$anti" target="_blank">$download</a>~);

be this
code:
[qb]
Code
	return(qq~<a href="$vars_config{CGIURL}/ultimatebb.cgi?id=antileech&link=$anti" target="_blank">$download</a>~);
[/qb]

#153849 10/05/2002 7:10 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
No it should be this:
Code
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?

#153850 10/05/2002 7:20 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
Just updated the file, try it now.

#153851 10/05/2002 7:28 PM
Joined: Oct 2001
Posts: 28
Junior Member
Junior Member
Offline
Joined: Oct 2001
Posts: 28
THE LINK TESTE ON THAT TOPIC

#153852 10/05/2002 7:43 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
what the...
alright try this
Code
find: 
open(FILE, "<$link") &#0124;&#0124; print("Location: $linknn");

# binary mode?
if($content_type !~ m/^(text/(html|plain))/i) {
binmode FILE &#0124;&#0124; &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");

#153853 10/05/2002 8:03 PM
Joined: Oct 2001
Posts: 28
Junior Member
Junior Member
Offline
Joined: Oct 2001
Posts: 28
Content-Disposition: attachment; filename=

Location:

Now i just got this!

WHAT A !!!!!

#153854 10/05/2002 10:16 PM
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
download it now, the new routines should work.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)