Advertisement:

Automatically change URL to IURL when same domain

Aloittaja flame baiter, elokuu 19, 2007, 09:15:36 AP

« edellinen - seuraava »

flame baiter


karlbenson

#1
It wouldn't be that hard to do.

If noone else has a go at this, I'll take a stab at it once I've finished updating my other mods.

Theres two different types of matches you could make to decide whether to use internal.  Which would you prefer?

based on matching the $scripturl variable (http://www.simplemachines.org/community/index.php)
or
domain based (but then you've got subdomain and server ip matching)

If it were me, I'd opt for option 1

flame baiter

Uhh, technical question. No idea.

I just want all links on www.*.mysite.*.com to be linked with UIRL instead of URL, that's all.

Or, you could do both and make an option? I don't really understand what you mean to be honest.

karlbenson

Basically I will have to check each link whether it is classed as internal.

It would depend on what you define 'Internal' to mean.

Do you ONLY mean links internal to your forum? eg all smf.org's forum links start with 'http://www.simplemachines.org/community/index.php'

Or do you mean absolutely ANY link hosted on your domain
eg
http://custom.simplemachines.org/mods/index.php?mod=485
(its not on the forum, its on the same domain (simplemachines.org)
and its on a subdomain (the bit before .simplemachines.org eg 'custom')

flame baiter

Ohh, now I see. I meant absolutely any link on my domain, yes.

"If it were me, I'd opt for option 1" - uhm, why do you think option 1 is better?

Maybe adding both and an option would be best to satisfy all needs.

karlbenson

Well has as luck would have it, I'm re-writing my anonym.to mod at the moment which needs to detect whether links are internal.

Detecting whether its an $script url is a SIMPLE match.

Where as match your domain or subdomain is alot more code. (it would require options because if you were using a free host or a free subdomain provider. It would detect their domain.)

Theres also the option as to whether you want to convert urls which are IP based. (again you wouldnt want it to convert them on a free or shared host)

Advertisement: