Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 2 of 2
Goto page Previous  1, 2
 
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
You should act directly on the PHP files using the REFERRERS value...

This is an old piece of code I used to use:

Code: [Download] [Hide] [Select]
    $check_referer = explode('?', $_SERVER['HTTP_REFERER']);
    $check_referer = trim($check_referer[0]);

    $good_referers = array();

    if (!empty($config['hotlink_allowed'])
    {
        $good_referers = explode(',', $config['hotlink_allowed']);
    }

    $good_referers[] = $config['server_name'] . $config['script_path'];

    $errored = true;

    for ($i = 0; $i < sizeof($good_referers); $i++)
    {
        $good_referers[$i] = trim($good_referers[$i]);

        if ((strstr($check_referer, $good_referers[$i])) && ($good_referers[$i] != ''))
        {
            $errored = false;
        }
    }

    if ($errored)
    {
        die('NO HOTLINK');
        /*
        header('Content-type: image/jpeg');
        header('Content-Disposition: filename=' . $pic_info['title_reg'] . '.' . $pic_info['filetype']);
        readfile($images['no_thumbnail']);
        exit;
        */
    }

 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hi there!

Thank you for helping me. It seems to be a hot piece of code you're given me, but i have unfortunely no clue where i have to put it in there.
Can you give me a little hint for that?

Thank you very much!

Greetings, testi
 



 
GhostsearcherSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hey testi (I omit the last part to avoid Joshua jumping in and laugh )!

Just to understand the way I can explain further... How can you rate your PHP knowledge on a scale from 1 to 10?

You mentioned before that you couldn't block your "file.php" to be hotlinked, right? This code should be added almost on top of that file, but of course a bit of edit is needed to configure things properly...
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
BTW MG

Testi is using PhpBB3
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Thanks spydie for clarifying, but I already knew that.

The code I provided is just standard PHP plus a var which has to be defined... but before defining that I wanted to know how detailed I need to explain what he has to do.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hi there!

Yes, i've updated now my signature for what i use ATM. I just forget the main things to say which software i'm using.

And thank you very much Mighty, for answering me. It seems for me the right way.
Well, of course i don't know where i have to setting in the code in the file.php.
I've tried it with just copy and paste in the first line before "<?php" or below of it - But just the avatars will not shown. LOL

So i'm curious how it will really work.
And still one question: Why i have to do this with php and why i can't handle this in the htaccess?
Just asking so i can understanding that.
Thank you!

Best Greetings, Testi ^^
 




____________
What i'm using:
Forumsoftware = phpBB 3.0.8 and Icy Phoenix f7f8a52 (GIT)
Style = Black-Pearl 1.6.4 (phpbb 3 only)
MySql= 5.1.49
 
GhostsearcherSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
it´s probably, because if you use .htaccess, you´ll block all referers to hotlink, or you need to put the ones you allow , into your whitelist.

with this piece of code, it´s handelt by the script itself, with the ability to allow or disallow them in the ACP i think.

so you don´t need to edit the .htaccess all the times.

BTW htaccess would block all images from hotlinking
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
spydie wrote: [View Post]
it´s probably, because if you use .htaccess, you´ll block all referers to hotlink, or you need to put the ones you allow , into your whitelist.
[...]
BTW htaccess would block all images from hotlinking


Hi there.

I already knew this, what you say and i want this. So if you read my first post in this thread, you will see that just this line doesn't work:
Code: [Download] [Hide]
  1. RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.org/download/(.+)php/?avatar/=(.+)?$ [NC]  

And i ask me why, because all the other rules are working good for me!
I think, i have to wait for mighty.
 




____________
What i'm using:
Forumsoftware = phpBB 3.0.8 and Icy Phoenix f7f8a52 (GIT)
Style = Black-Pearl 1.6.4 (phpbb 3 only)
MySql= 5.1.49
 
GhostsearcherSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Unfortunately it is not so easy to include all possible combinations just using regular expressions in HTACCESS because phpBB 3 just use a single php file for serving any file to users (being images or zip files...).

It's tough for me to explain the whole thing, but when you use PHP to serve files, then the content could be easier controlled using PHP code instead of going through HTACCESS, because only PHP code at that stage really knows which kind of file are you serving and which kind of limitations you would like to be in place.

Anyway, back to the point... now that I know what you would like to achieve and that you need to be guided through the process... I just need some time to adjust the right code to suit your needs.

Please be patient until I find the time for doing that... I'll be back with the code sooner or later.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hello Gorgon!

You are really helpful! Thank you for that!!!
And of course you have so much time you need, because now i understand what you mean "its not so easy". I ever thought, htaccess is the ultimate weapon for this. Seems not to be. ^^
It's much fun to learn with you.
Thank you!

Best wishes, the testi of the testis. ^^
 




____________
What i'm using:
Forumsoftware = phpBB 3.0.8 and Icy Phoenix f7f8a52 (GIT)
Style = Black-Pearl 1.6.4 (phpbb 3 only)
MySql= 5.1.49
 
GhostsearcherSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
testikel wrote: [View Post]
I ever thought, htaccess is the ultimate weapon for this. Seems not to be. ^^

HTACCESS is actually the best weapon for that, because you just check things on access, avoid charging CPU with other processes. The only point is that HTACCESS is a strange and tough beast, and if you don't know how to code that properly, you can create much more problems than those you will solve.

Can I just ask why are you so worried about avatars hotlinking?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hi Mighty!

Well, that htaccess is a beast is no wonder for me. If i remind me right, i needed round'bout 4 weeks to solve my general hotlink problem in the past. Because many things didn't worked right for me and the internet - pheeeww - it is sometimes really confusing about this hotlink things. I think, you can follow me. That one wrote it works but not at me and the other one told me, that cant working, but he told me also not how i could fix that.
But thats not the point today, because my hotlink protection is working so far so good. (except the avatar thingy)

So, it is just a challenge for me to find out, why my htaccess can protect hotlinking, but not by avatars.
Again i found out, i have to put another line to my htaccess:
Code: [Download] [Hide]
  1. RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.org/download/(.+)php/?avatar/=(.+)?$ [NC]  

But if i do that: nothing happens. (i told it a couple of posts before ^^)
And as i said, it was found by me in the internet and just guess: well, the user told me it works for him. haha. -.-"
Not for me.
In the other forums of phpbb, mod_rewrite, php and so on, noone can tell me anything about that.
But you, Mighty. ^_^

So and the thing to me is just the fact, why i "just" cant fix to prevent hotlinking of avatars except an eventuelly modified file.php. Because the line of code for the htacess should working - i guess.
And if i modified the line by "experimenting with letters and copy and paste it", the avatars doesnt appears. LOL? LOL... ^^
As you can see, it is for me more than fun to fix my "problem". I want to find out why it doesnt works and i want to know how it could be works. I have no spammery or hotlinker in my forum.
But, well, i think if i want to prevent hotlink, i have to make it right.
I hope you can understand/follow me.

I have time for that and i'll dont push this thread of course because i heard much about you that you dont have so much time. So i really appreciate it if you help me in any way for my very little problem.
I'm just glad about that, that just anyone want to help me. So i can wait.

Thank you very much!

Best Greetings...
 




____________
What i'm using:
Forumsoftware = phpBB 3.0.8 and Icy Phoenix f7f8a52 (GIT)
Style = Black-Pearl 1.6.4 (phpbb 3 only)
MySql= 5.1.49
 
GhostsearcherSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Ok... so if I understand correctly I just need to play with HTACCESS and see if I can come with an HTACCESS protection.

I will have a try with HTACCESS and get back to you when I have some free time.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hi there!

I want to let you know that i'm switching right now to "icy phoenix - board", instead of my old normal phpbb3.0.8!
So it's not sooo important anymore i guess.
If you wish, you don't need anymore make your head broken about the htaccess problem. If yes, so im still curious about that. ^^
Thank you very much! (and to joshua203 to his advise for using icy ^_~)

Best Greetings, testi* ^^


P.s.: I-P looks really cool..!!!! Better than the normal phpbb 3.0.8!
 




____________
What i'm using:
Forumsoftware = phpBB 3.0.8 and Icy Phoenix f7f8a52 (GIT)
Style = Black-Pearl 1.6.4 (phpbb 3 only)
MySql= 5.1.49
 
GhostsearcherSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Test Prevent Image Hotlinking 
 
Hey Testi*, I'm glad to see that you are trying to move to Icy Phoenix, I hope you won't be disappointed.

Did you manage to convert from phpBB 3 yet?

Regarding HTACCESS, I didn't have the time to play with that yet unfortunately...
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 2 of 2
Goto page Previous  1, 2


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron