PDA

View Full Version : Popular Links Hack


maestrosdelweb
28 Jan 2003, 07:49
This hack will save the urls posted in the messages of your forum and count the visits to each url. Then you'll be able to list the popular Urls of your forum in a separate page.

Hack Facts:
New DB Table: 1
New Files: 2
File Modifications: 1
New Templates: 2
Template Modifications: 1

Download the .zip and follow the Install.txt file.

Any comment will be apreciated.

maestrosdelweb
28 Jan 2003, 07:52
The live demo can be accesed in:
http://www.forosdelweb.com/links_out.php

Enjoy it..

And by the way this is my first hack.

I hope its useful.

Davey
28 Jan 2003, 08:55
Cool man, this hack looks sweet!
Thanks!! :).
Keep up the good work.

Dave.

PS: /me installs ;).

Automated
28 Jan 2003, 10:15
A very interesting hack :p

Davey
28 Jan 2003, 10:19
Ah found a bug :P.
It uses http://www.yoururl.com/out.php?http://www.otherurl.com
It interprets it as a url, and doesn't redirect to http://www.otherurl.com.
Can you fix it?

Dave.

Davey
28 Jan 2003, 13:43
Nevermind it seems too buggy for me.
I'm on the brink of releasing my script and I need urls to function correctly, seeing as my attachments don't.
/me uninstalls.
Sorry.
Maybe another time :).

Dave.

maestrosdelweb
28 Jan 2003, 14:10
Davey. If I can help you somhow to make it work let me know. Your error is weird.

Slynderdale
28 Jan 2003, 15:50
You should url encode the right url before you output it or youll get errors with urls.

Slynderdale
28 Jan 2003, 15:56
hmm, see if this works:

find:

$hyperlink = iif(trim($hyperlink)=="" or $hyperlink==$url, iif(strlen($url)>55,substr($url,0,35)."...".substr($url,-15),$url) ,$hyperlink);
return "<a href=\"/out.php?$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";
}


above it add:

$righturl = htmlentities(urlencode($righturl));


in out.php find:

$UrlAdr = $_SERVER['QUERY_STRING'];


under it add:

$UrlAdr = urldecode($UrlAdr);



tell me if that works.

Dean C
28 Jan 2003, 16:48
Looks like a very nice hack - i might just convert this to suit my needs :)

Thanks

- miSt

maestrosdelweb
28 Jan 2003, 19:05
Thanks to Slynderdale for the update to fix that bug

I'll add that to the .zip file.

msu
28 Jan 2003, 21:57
cooooooooool hack

thanx maestrosdelweb

and keep up the good work :)

AussieSat
29 Jan 2003, 10:44
I couldn't tell if this hack uses permissions - I guess not?
Will popular links in private forums show for all users?

maestrosdelweb
29 Jan 2003, 15:14
I haven't use perrmissions.

All links in the forum are getting recorded.

What you could do is show the Most Popular links only to one group of users but that's not yet implemented.

NuclioN
29 Jan 2003, 22:06
?? when users click a link in a forum they get an error:

Warning: Cannot add header information - headers already sent by (output started etc etc

ricoche
31 Jan 2003, 12:54
Hi there,

I must admit this hack looks pretty nice.

Unfortunately I had to uninstall it because of the URL errors as stated previously above. Even with the fixed code I was still getting error pages.

I think I'll wait until this becomes more stable.

Sorry about that.

:(

Slynderdale
31 Jan 2003, 15:48
Originally posted by ricoche
Hi there,

I must admit this hack looks pretty nice.

Unfortunately I had to uninstall it because of the URL errors as stated previously above. Even with the fixed code I was still getting error pages.

I think I'll wait until this becomes more stable.

Sorry about that.

:(


I'll look into it more later, I'm planning to add forum permission as well to it later too.

Molok
01 Feb 2003, 17:58
Originally posted by NuclioN
?? when users click a link in a forum they get an error:

Warning: Cannot add header information - headers already sent by (output started etc etc

you must set in out php your forums url by $yourforum

maestrosdelweb
04 Feb 2003, 17:00
The changes to the code suggested by Slynderdale should fix the error.

The .zip file was updated with the changes.

fla5h
04 Feb 2003, 18:35
Great hack m8, a problem I found was that if the person posts the link in HTML, the hack is bypassed.

Yeah you can just ban html, but I thought I'd inform you, and is there a workaround ?

gmarik
09 Jun 2003, 18:23
Oh, and could you add "in" links?!

maestrosdelweb
10 Jun 2003, 00:11
Yes. Great suggestion. So users can link back to your website.. Let me work on it soon.

gmarik
10 Jun 2003, 13:12
Oh, I could send you some php sources that have this option, need the files? I could send them via e-mail to you.

Another suggestion: add a table with links and paths to images. If the link listed in link_ou.php is the one, that has an image, an additional image is shown, something like a small banner.