Log in

View Full Version : Popular Links Hack


maestrosdelweb
01-27-2003, 10:00 PM
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
01-28-2003, 06:52 AM
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
01-28-2003, 07:55 AM
Cool man, this hack looks sweet!
Thanks!! :).
Keep up the good work.

Dave.

PS: /me installs ;).

Automated
01-28-2003, 09:15 AM
A very interesting hack :p

Davey
01-28-2003, 09:19 AM
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
01-28-2003, 12:43 PM
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.
* Davey uninstalls.
Sorry.
Maybe another time :).

Dave.

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

Slynderdale
01-28-2003, 02:50 PM
You should url encode the right url before you output it or youll get errors with urls.

Slynderdale
01-28-2003, 02:56 PM
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
01-28-2003, 03:48 PM
Looks like a very nice hack - i might just convert this to suit my needs :)

Thanks

- miSt

maestrosdelweb
01-28-2003, 06:05 PM
Thanks to Slynderdale for the update to fix that bug

I'll add that to the .zip file.

msu
01-28-2003, 08:57 PM
cooooooooool hack

thanx maestrosdelweb

and keep up the good work :)

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

maestrosdelweb
01-29-2003, 02:14 PM
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
01-29-2003, 09:06 PM
?? 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
01-31-2003, 11:54 AM
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
01-31-2003, 02:48 PM
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
02-01-2003, 04:58 PM
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
02-04-2003, 04:00 PM
The changes to the code suggested by Slynderdale should fix the error.

The .zip file was updated with the changes.

fla5h
02-04-2003, 05:35 PM
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
06-09-2003, 05:23 PM
Oh, and could you add "in" links?!

maestrosdelweb
06-09-2003, 11:11 PM
Yes. Great suggestion. So users can link back to your website.. Let me work on it soon.

gmarik
06-10-2003, 12:12 PM
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.