1
snakes
Weblinks: hardlink plus php support.
  • 2005/9/29 8:23

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Weblinks is a great module!
I've started one and fill it with empty categories...

Inspired by a javascript from Google Suggest, I've modified some Weblinks templates to support hardlink and at the same time visit.php redirection support.

Explanation:
I've noticed that from Google Suggest, when you pass the mouse cursor over a link, it seems to be a hardlink cuz you see the destination URL. But when you right click and copy the link address and paste it, the pasted value is a Google redirection script. And when you pass the mouse over that link again it has changed from hardlink to redirection link.
This is a javascript that dynamically change the hardlink into redirection link.

This is a great idea for web links: you can have real hard links and thus it is better for referencing and thanks to javascript when your visitor click on the link it will be a redirection link and thus you can count the click. Spiders don't support javascript so they will always see the hardlink.

How to change Weblinks to support this:
You'll have to modifi 3 templates files and update the installation of Weblinks in the admin section.
Here are the modification:

weblinks/templates/weblinks_header.html
<script language="javascript">
function 
weblinks_hardlink(link,lid){
  
link.href='http://www.goloom.com/modules/weblinks/visit.php?lid=' lid;
  return 
true;
}
script>

This code is to be added on the first line of the file

weblinks/templates/weblinks_link.html and
weblinks/templates/weblinks_linklist.html
replace
<a href="<{$module_url}>/visit.php?lid=<{$link.lid}>" target="_blank">

with
<a href="<{$link.url}>" onmousedown="return weblinks_hardlink(this,<{$link.lid}>)" target="_blank">


Now update the weblinks installation.

You can see the demo at
http://www.goloom.com/modules/weblinks/
At the bottom of the page you'll see recent links.
Pass the mouse over a link, you'll see the hardlink.
Right click on it, and pass the mouse again. The hardlink is changed.

2
tzvook
Re: Weblinks: hardlink plus php support.
  • 2005/9/29 9:24

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hello snakes
Nice to see more weblinks sites
R you using 2.2.x ? Do you expirience MySql problems?

3
snakes
Re: Weblinks: hardlink plus php support.
  • 2005/9/29 11:16

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


I'm using 2.0.10.
I didn't upgrade yet.

The script visit.php from WebLinks doesn't check if the lid exists. Thus when accessing visit.php?lid=299 and no link at this id will cause the browser to loop the redirection.

I added this
if(empty($url)) {
    
header("Location: /");
    exit;
}

after
$url $tbl_link->getSaniUrlByLid($lid);

4
tzvook
Re: Weblinks: hardlink plus php support.
  • 2005/9/29 14:09

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


I'll open with a "Thank you" for this little, but very usefull hack.

And close with a small suggestion ( in weblinks/templates/weblinks_header.html ) :

<script language="javascript">
function 
weblinks_hardlink(link,lid){
  
link.href='http://www.goloom.com/modules/weblinks/visit.php?lid=' lid;
  return 
true;
}
script>


Should be replaced with

<script language="javascript">
function 
weblinks_hardlink(link,lid){
  
link.href='[b]<{$module_url}>[/b]/visit.php?lid=' lid;
  return 
true;
}
script>


This one will be more compatiable with tempate and pathes ...

I also posted this thread location in Ohawada forum, hope he'll enter this one to the next version, as search engines will love this hack very much

5
tzvook
Weblinks: popular sites page hack
  • 2005/9/29 14:16

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


I have a problem with my "popular sites" page - I have a lot of categories and this page is endless ..... making it apearing without the "Xoops theme" ....

I wonder if by mistake someone spaned it on "by category" pages?
Since it'll be very similat in the Former "MyLinks" I would be happy to see this hacked in mylinks too ...

6
snakes
Re: Weblinks: popular sites page hack
  • 2005/9/29 18:22

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Quote:


Yeahhhh...
I was writing to fast and didn't notice this hehehe.
Thanks.

Is your site warpig ?
If not can I have the URL ?

7
snakes
Re: Weblinks: popular sites page hack
  • 2005/9/29 18:25

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Got it.
It's meant4u
Seems to have pb with MySQL from protector module

8
snakes
Re: Weblinks: popular sites page hack
  • 2005/9/29 18:37

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


When accessing you "Popular site". The page is endless but it displays till the end. I can see everything.

BTW, Great design!
And that's great, your weblinks is well filled.
=> 620 links!! That's cool.

I think your MySQL problem is from Protector module or a problem with your MySQL from your host server. Try to deactivate Protector module or update it.

Quote:
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/muli/www/meant4u.com/gifts/modules/protector/include/precheck.inc.php on line 26

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/muli/www/meant4u.com/gifts/modules/protector/class/protector.php on line 44

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/muli/www/meant4u.com/gifts/modules/protector/class/protector.php on line 45

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/muli/www/meant4u.com/gifts/modules/protector/include/precheck.inc.php on line 37

Warning: Invalid argument supplied for foreach() in /home/muli/www/meant4u.com/gifts/modules/protector/include/precheck.inc.php on line 46
This page cannot be displayed due to an internal error.

If you are the administrator of this site, please visit the XOOPS Troubleshooting Page for assistance.

Helpful infomation you should provide while asking for assistance:

Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34


Notice the last line:
Unable to connect to database in file class/database/databasefactory.php line 34
This certainly is a pb with the server



One more question.
I've noticed that most of your links or maybe all of them have thumbnails. Are they from submitters or did you screencapture them all ?

9
tzvook
Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/1 14:46

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hi snakes
I thought it was a MySQL Issue too and were trying to figure it out for about t weeks now (It bagan since I upgraded my MySql version).
But after analising logs I has for MySql long activity (above 10Secs) is showsabout 2000 queries that looks like that:

21:41:33 -xxxxxxsshd[8695]: Failed password for invalid user test01 from 213.247.223.4 port 52132 ssh2
Sep 28 21
:41:35 -xxxxxxsshd[8769]: Invalid user var from 213.247.223.4
Sep 28 21
:41:35 -xxxxxxsshd[8769]: Failed password for invalid user var from 213.247.223.4 port 52233 ssh2
Sep 28 21
:41:37 -xxxxxxsshd[8842]: Invalid user var from 213.247.223.4
Sep 28 21
:41:37 -xxxxxxsshd[8842]: Failed password for invalid user var from 213.247.223.4 port 52345 ssh2
Sep 28 21
:41:39 -xxxxxxsshd[8906]: Invalid user var from 213.247.223.4
Sep 28 21
:41:39 -xxxxxxsshd[8906]: Failed password for invalid user var from 213.247.223.4 port 52454 ssh2
Sep 28 21
:41:41 -xxxxxxsshd[8972]: Invalid user ircd from 213.247.223.4
Sep 28 21
:41:41 -xxxxxxsshd[8972]: Failed password for invalid user ircd from 213.247.223.4 port 52556 ssh2
Sep 28 21
:41:43 -xxxxxxsshd[9047]: Invalid user ircd from 213.247.223.4
Sep 28 21
:41:43 -xxxxxxsshd[9047]: Failed password for invalid user ircd from 213.247.223.4 port 52675 ssh2
Sep 28 21
:41:46 -xxxxxxsshd[9114]: Invalid user ircd from 213.247.223.4
Sep 28 21
:41:46 -xxxxxxsshd[9114]: Failed password for invalid user ircd from 213.247.223.4 port 52780 ssh2
Sep 28 21
:41:48 -xxxxxxsshd[9189]: Invalid user ircd from 213.247.223.4
Sep 28 21
:41:48 -xxxxxxsshd[9189]: Failed password for invalid user ircd from 213.247.223.4 port 52902 ssh2
Sep 28 21
:41:50 -xxxxxxsshd[9261]: Invalid user temp from 213.247.223.4
Sep 28 21
:41:50 -xxxxxxsshd[9261]: Failed password for invalid user temp from 213.247.223.4 port 53007 ssh2
Sep 28 21
:41:52 -xxxxxxsshd[9358]: Invalid user temp from 213.247.223.4
Sep 28 21
:41:52 -xxxxxxsshd[9358]: Failed password for invalid user temp from 213.247.223.4 port 53120 ssh2
Sep 28 21
:41:54 -xxxxxxsshd[9436]: Invalid user temp from 213.247.223.4
Sep 28 21
:41:54 -xxxxxxsshd[9436]: Failed password for invalid user temp from 213.247.223.4 port 53233 ssh2
Sep 28 21
:41:56 -xxxxxxsshd[9507]: Invalid user oracle from 213.247.223.4
Sep 28 21
:41:56 -xxxxxxsshd[9507]: Failed password for invalid user oracle from 213.247.223.4 port 53337 ssh2
Sep 28 21
:41:59 -xxxxxxsshd[9591]: Invalid user oracle from 213.247.223.4
Sep 28 21
:41:59 -xxxxxxsshd[9591]: Failed password for invalid user oracle from 213.247.223.4 port 53452 ssh2
Sep 28 21
:42:04 -xxxxxxsshd[9657]: Invalid user oracle from 213.247.223.4
Sep 28 21
:42:04 -xxxxxxsshd[9657]: Failed password for invalid user oracle from 213.247.223.4 port 53572 ssh2
Sep 28 21
:42:06 -xxxxxxsshd[9773]: Invalid user postgres from 213.247.223.4
Sep 28 21
:42:06 -xxxxxxsshd[9773]: Failed password for invalid user postgres from 213.247.223.4 port 53794 ssh2
Sep 28 21
:42:08 -xxxxxxsshd[9824]: Invalid user postgres from 213.247.223.4
Sep 28 21
:42:08 -xxxxxxsshd[9824]: Failed password for invalid user postgres from 213.247.223.4 port 53874 ssh2
Sep 28 21
:42:10 -xxxxxxsshd[9903]: Invalid user postgres from 213.247.223.4
Sep 28 21
:42:10 -xxxxxxsshd[9903]: Failed password for invalid user postgres from 213.247.223.4 port 53988 ssh2
Sep 28 21
:42:12 -xxxxxxsshd[9978]: Invalid user nagios from 213.247.223.4
Sep 28 21
:42:12 -xxxxxxsshd[9978]: Failed password for invalid user nagios from 213.247.223.4 port 54102 ssh2
Sep 28 21
:42:14 -xxxxxxsshd[10045]: Invalid user nagios from 213.247.223.4
Sep 28 21
:42:15 -xxxxxxsshd[10045]: Failed password for invalid user nagios from 213.247.223.4 port 54215 ssh2
Sep 28 21
:42:17 -xxxxxxsshd[10109]: Invalid user nagios from 213.247.223.4
Sep 28 21
:42:17 -xxxxxxsshd[10109]: Failed password for invalid user nagios from 213.247.223.4 port 54312 ssh2
Sep 28 21
:42:19 -xxxxxxsshd[10181]: Invalid user student from 213.247.223.4
Sep 28 21
:42:19 -xxxxxxsshd[10181]: Failed password for invalid user student from 213.247.223.4 port 54425 ssh2
Sep 28 21
:42:21 -xxxxxxsshd[10251]: Invalid user student from 213.247.223.4
Sep 28 21
:42:21 -xxxxxxsshd[10251]: Failed password for invalid user student from 213.247.223.4 port 54530 ssh2
Sep 28 21
:42:23 -xxxxxxsshd[10315]: Invalid user student from 213.247.223.4
Sep 28 21
:42:23 -xxxxxxsshd[10315]: Failed password for invalid user student from 213.247.223.4 port 54635 ssh2
Sep 28 22
:55:53 -xxxxxxproftpd[51753]: -xxxxxx-.co.il (84.228.89.115[84.228.89.115]) - USER ashkelonLogin successful
Sep 28 23:11:21 -xxxxxxsshd[59110]: Did not receive identification string from 211.251.39.3
Sep 28 23
:18:47 -xxxxxxsshd[61525]: Did not receive identification string from 200.63.222.10
Sep 28 23
:55:29 -xxxxxxsshd[73710]: Invalid user AK from 83.170.77.91
Sep 28 23
:55:29 -xxxxxxsshd[73710]: Failed password for invalid user AK from 83.170.77.91 port 2084 ssh2
Sep 28 23
:55:32 -xxxxxxsshd[73752]: Invalid user AL from 83.170.77.91
Sep 28 23
:55:32 -xxxxxxsshd[73752]: Failed password for invalid user AL from 83.170.77.91 port 2194 ssh2
Sep 28 23
:55:35 -xxxxxxsshd[73790]: Invalid user KA from 83.170.77.91
Sep 28 23
:55:35 -xxxxxxsshd[73790]: Failed password for invalid user KA from 83.170.77.91 port 2288 ssh2
Sep 28 23
:55:38 -xxxxxxsshd[73810]: Invalid user a-nitta from 83.170.77.91
Sep 28 23
:55:38 -xxxxxxsshd[73810]: Failed password for invalid user a-nitta from 83.170.77.91 port 2388 ssh2
Sep 28 23
:55:41 -xxxxxxsshd[73838]: Invalid user a-nitta from 83.170.77.91


It looks to me as a DOS attack and IP address is from the UK
I reported it and hope problem will dissapear, but for now .... that's the source of MySql problems.

I'll be glad to hear second opinions about it.
I think I get the "protector" massages due to it's place in the "chain of XOOPS enviro" ...

I'll get back to you about the rest .... my kids are killinng me

10
tzvook
Re: Weblinks + Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/1 15:03

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:
snakes wrote:
When accessing you "Popular site". The page is endless but it displays till the end. I can see everything.


Yep, but I get the page without the "xoops theme" ... on white background .... don't you too ?


Quote:

snakes wrote:
BTW, Great design!
And that's great, your weblinks is well filled.
=> 620 links!! That's cool.


10x, yep, I loved it too (my designer, not me ... she's great, and XOOPS is kinda hard to work with...)
620 is not enough hope it'll get to 1000 in a month or so ...

Quote:

snakes wrote:
One more question.
I've noticed that most of your links or maybe all of them have thumbnails. Are they from submitters or did you screencapture them all ?


We put the thumbs + a nice css hack for shadow effect
but we also registered to Thumbshots (for sites that are in DMOZ only), so now it looks for a thumb and {if not present} it looks for Thumbshot image ...

Login

Who's Online

365 user(s) are online (249 user(s) are browsing Support Forums)


Members: 0


Guests: 365


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits