1
snakes
Re: ERRATUM
  • 2006/1/16 8:36

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


The dot at the end of the email is due to the replacements array.

Look at the end:
"\1<script language="javascript">var id='\2';var host1='\3';var host2='';document.write('<a href="mailto:'+id+'@'+host1+'.'+host2+'">'+id+'@'+host1+'.'+host2+'</a>');</script>"


You see that host2 is equal to '' (empty string)
Then href will contain host1+'.'+host2, but host2 is empty so the email will have the '.' at the end.

What we do is to replace that code with:
"\1<script language="javascript">var id='\2';var host1='\3';document.write('<a href="mailto:'+id+'@'+host1+'">'+id+'@'+host1+'</a>');</script>



2
snakes
ERRATUM
  • 2005/12/29 9:14

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


There was an error in the replacement.
It was:
$replacements = array("\1<a href="\2://\3" target="_blank">\2://\3</a>", "\1<a href="http://www.\2.\3" target="_blank">www.\2.\3</a>", "\1<a href="ftp://ftp.\2.\3" target="_blank">ftp.\2.\3</a>", "\1<script language="javascript">var id='\2';var host1='\3';var host2='';document.write('<a href="mailto:'+id+'@'+host1+'.'+host2+'">'+id+'@'+host1+'.'+host2+'</a>');</script>");


But should be:
$replacements = array("\1<a href="\2://\3" target="_blank">\2://\3</a>", "\1<a href="http://www.\2.\3" target="_blank">www.\2.\3</a>", "\1<a href="ftp://ftp.\2.\3" target="_blank">ftp.\2.\3</a>", "\1<script language="javascript">var id='\2';var host1='\3';document.write('<a href="mailto:'+id+'@'+host1+'">'+id+'@'+host1+'</a>');</script>");


In the first code var host2='' this id+'@'+host1+'.'+host2 would always have a '.' (dot) at the end...

If you keep the first replacement then the search pattern array should be:
$patterns = array("/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^rn"()'<>]+)/i",
        "
/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^rn"()'<>]+)/i",
        "/(^|[^]_a-z0-9-="'
/])ftp.([a-z0-9-]+).([^rn"()'<>]+)/i",
        
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([a-z0-9-_.]+?).([^rn"()'<>[]]+)/i");


instead of:
$patterns = array("/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^
                            rn"()'
<>]+)/i",
        "
/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^
                            rn"
()'<>]+)/i",
        "/(^|[^]_a-z0-9-="'
/])ftp.([a-z0-9-]+).([^
                            
rn"()'<>]+)/i",
        
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([^rn"()'<>[]]+)/i");


For some XOOPS release, this should be(which I found better):
$patterns = array(
        
"/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^, rn"()'<>]+)/i",
        "
/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^, rn"()'<>]+)/i",
        "/(^|[^]_a-z0-9-="'
/])ftp.([a-z0-9-]+).([^, rn"()'<>]+)/i",
        
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([a-z0-9-_.]+?).([^, rn"()'<>[]]+)/i"
        );


instead of:
$patterns = array("/(^|[^]_a-z0-9-="'/])([a-z]+?)://([^, rn"()'<>]+)/i", "/(^|[^]_a-z0-9-="'/])www.([a-z0-9-]+).([^, rn"()'<>]+)/i", "/(^|[^]_a-z0-9-="'/])ftp.([a-z0-9-]+).([^, rn"()'<>]+)/i""/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([^, rn"()'<>[]]+)/i");


By the way, I've noticed that in 2.2.3 the pattenrs array have been changed and the old one was in comment. For me the new array doesn't work well, it sometimes take texts after the mail or URL into account... Uncommenting the old, commenting the news works great.



3
snakes
Re: Great Hacks!!!
  • 2005/11/8 9:54

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


tzvook can uy give me the Ohawada forum's url again plz ?
I can't find it!

It's OK, it was ohwada not ohawada...



4
snakes
Re: Great Hacks!!!
  • 2005/11/4 8:47

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


viewcat.php?cid=xx is OK.
It is just an internal link so no matter if it is hard link or not. Its OK.

viewcat.php is used to browse a category of your weblinks directory. It is not a link to external site.
The links to change are those to visit.php?lid=xxx



5
snakes
Re: Image resizing in Xoopspartners
  • 2005/10/15 1:12

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


I don't have that problem with any of my sites.
Is the problem following the hack or did it exist even before?
Does the image url start with "http://" ? Even if the image is in your own website you must put the "http://" and not just the path.



6
snakes
xoopsparnters hardlink support
  • 2005/10/14 14:00

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Hi there.
Here is a hack that I use for Weblinks and ported to xoopspartners. The first part of this hack is to add a javascript into the theme.html files of your theme. This will allow using this script in any other modules than xoopspartner.

First edit your /themes/yourThemeDir/theme.html, find the line with "</head>" and add this code before that line:
<script language="javascript">
function 
snx_hardlink(linkredirect) {
    
link.href='<{$xoops_url}>' redirect;
    return 
true;
}
</
script>


go to the /modules/xoopspartners/ folder and edit index.php. At line 76, replace
$ImagePartner "<a href='vpartner.php?id=".$array_partners[$i]["id"]."' target='_blank'>";

with this code
$ImagePartner "<a href='{$array_partners[$i]['url']}' onMouseDown='snx_hardlink(this, "/modules/xoopspartners/vpartner.php?id=".$array_partners[$i]["id"]."")' target='_blank'>";


Now edit templates/blocks/xoopspartners_block_site.html.
At line 38, replace:
<a href="<{$xoops_url}>/modules/xoopspartners/vpartner.php?id=<{$partner.id}>" target="_blank">

with this code:
<a href="<{$partner.url}>" onMouseDown="snx_hardlink(this, '/modules/xoopspartners/vpartner.php?id=<{$partner.id}>')" target="_blank">


What's happened ?
We replace each redirection URL of Xoopspartners with the real hardlink of the partner and add a javascript call when a mouse button is pressed (even before it is released). In normal situation, the partner's URL is called when the left mouse button is pressed AND THEN released. Here the javascript is called just before it is released to change the hardlink URL into an redirection URL.

The javascript function should be called like this:
<a href="[A HARD LINK URL]" onMouseDown="snx_hardlink(this, '/path/to/redir_script.php?id=[partnerID]')">[TEXT]</a>



7
snakes
Re: Nice URLs without .htaccess and mod_rewrite (url rewriting)
  • 2005/10/14 10:36

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


The objective it not to have multi links to the same page but to have URL that are nicers than having tons of ? and & in the query string.

Those who are hosted by mod_rewrite supported host will still use url rewriting, those who don't have support of this may use this way



8
snakes
Nice URLs without .htaccess and mod_rewrite (url rewriting)
  • 2005/10/14 9:58

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


hi there.

There were some hacks and modules that permit you to have nice urls:
Quote:
http://www.mysite.com/modules/myMod/index/65/xoops-is-cool
instead of
http://www.mysite.com/modules/myMod/index.php?newsid=65&msg=xoops-is-cool

To make this you have to use the url rewriting with .htaccess file.

I've discovered that you can do this without that!
Just test this, visit this site:
https://xoops.org/index.php
and now visit this one:
https://xoops.org/index.php/65/xoops-is-cool
You may notice that these are the same page.
In fact, apache is looking at the URL and travels from directories to sub directories etc... if one of those supposed directories is a file then it just open that file and ignore the rest of the URL.
Inhttps://xoops.org/index.php/65/xoops-is-cool, index.php is an existing file so /65/xoops-is-cool is ignored.
Using this URL format you can get /65/xoops-is-cool using $PHP_SELF variable.

Ciao



9
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/13 8:06

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


yeah, or you can also right click on the system icon in the admin and click on "templates", look at the template set you are using and edit the one of weblinks. Or regenerate them.

But in principle, this should be regenerated automatically when you upgrade the module...



10
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/11 7:28

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Hi Chappy.

With the hack you will see the hardlink all the time.
But if you click or right click on it (not hover) the hardlink will change.

May you give me the URL to your website so I can check it out ?

Bye




TopTop
(1) 2 3 4 ... 7 »



Login

Who's Online

179 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 179


more...

Donat-O-Meter

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

Latest GitHub Commits