help with the OUT link

daddycaddy

New Member
hi there,
i would like to make the out link similar to how xtremetop100 is ...
right now if you click on the title or banner you go directly to the website
also "open in a new tab" will not count as a vote

<code>
<a href="{$url}" onclick="out(this,'{$username}');" class="show_banner" title="{$title}" rel="nofollow">{$title}</a></div>
</code>

so it will be nice if it will be something like:
http://www.topaddress.com/index.php?a=out&u=name but right now that link just adds OUT's without loading the user page

hope someone can help me with this
thanks
 

Basti

Administrator
Staff member
Yea, damn browser kicked us in the butt when they removed this stuff partly lol

onclick="out(this,'{$username}');" can be removed

If you use clearn urls change the link {$url} to {$list_url}/out/{$username}/
Open your .htaccess file ( topsite root where settings_sql.php is ) and find this line
Code:
################ Beautify dynamic url sets
On a new blank line below it, add the following
Code:
RewriteRule ^out/(.*)/ index.php?a=out&u=$1&go=1 [L]
If you not use clean urls, your edit was almost right :)
Code:
{$list_url}/index.php?a=out&amp;u={$username}&amp;go=1
( &amp; is & but html encoded so it not triggers a html validation error )


Files to edit:
table_row.html
table_row_premium.html
table_top_row.html
table_top_row_premium.html
stats.html
search_result.html
featured_member.html
 

panzerdude

Member
just to double check, is possible to edit the wraper.html for the vote out code script at the bottom.


here is the orginal.

out_url = '{$list_url}/index.php?a=out&u=' + username+'&go=1';


my question, is something like this ok below?

out_url = '{$list_url}/out/{$username}/';
 
Last edited:

Mark

Administrator
Staff member
I don't think so, but its worth testing to make sure (make sure you test in many browsers as this can be sticky). There is no benefit I am aware of messing with those out links.
 

panzerdude

Member
I don't think so, but its worth testing to make sure (make sure you test in many browsers as this can be sticky). There is no benefit I am aware of messing with those out links.

This is giving some html validation error, its no big deal I was just looking for another way. What does that part of the code do anyway Mark so I know what to check for. thanks


out_url = '{$list_url}/index.php?a=out&u=' + username+'&go=1';
 

Mark

Administrator
Staff member
ahh for validation you have a couple different options if memory serves, but testing is needed.

If this function is broken, your clicks out will not increase the out count.

option 1: replace & with &amp;

Code:
out_url = '{$list_url}/index.php?a=out&amp;u=' + username+'&amp;go=1';
option 2:

Code:
//<![CDATA[
out_url = '{$list_url}/index.php?a=out&u=' + username+'&go=1';
//]]>
option 3:

Code:
<![CDATA[
out_url = '{$list_url}/index.php?a=out&u=' + username+'&go=1';
]]>
option 4:

Code:
<!--
out_url = '{$list_url}/index.php?a=out&u=' + username+'&go=1';
-->

option 5:

make a new file call outclean.js with this content in it:

Code:
function out(link,username) {
out_url = '{$list_url}/index.php?a=out&u=' + username+'&go=1';
link.href = out_url; // For browsers that don't support setAttribute
link.setAttribute('href', out_url);
}
then add this tnear the bottom of your child/wrapper template (and remove the function above)

<script src="outclean.js"type="text/javascript"></script>


NOTE: your might need to replace {$list_url} with http://yourdomainname.com in that external file as template variables will not work.

its also very possible none of these will work :) I am sure there is a reason we left it "as is" but please let us know your findingsif it works and validates I'll test further and roll this change into the next core release.
 

panzerdude

Member
Hi, no luck with those. But I did get close with the last one with the outclean js file.

I cant seems to get rid of the {$list_url} from the URL, even if I remove it from the outclean.js it still shows up in the url.
 

panzerdude

Member
hmm sounds like a cache issue, that should not be possible
I'll give it another go, I've just been on this cloudflare for the past few days, but honestly I've seen no benefit and my site has been slower at times. I'll let you know again when I'm sorted out, Thanks Mark
 

Mark

Administrator
Staff member
yup, that would explain it :) look forward to hearing how this works out for you
 

panzerdude

Member
I got it sorted Mark with the outclean.js, I just had to remove the {$list_url} and rename the file to have it load fresh.


Im down to 9 errors now on the validator, those are from disqus and google, none from VL.


I also use this too, if you wanted test further for any future core releases. Cheers

Code:
  <!--[if gte IE 9]>
        <link rel="stylesheet" type="text/css" media="screen" href="skins/{$skin_name}/ie9.css" />
        <![endif]-->
 
Last edited:

Basti

Administrator
Staff member
out_url = '{$list_url}/out/{$username}/';
Just to let you know and point out, this wouldnt do you any good at all.
The reason to change your out link is as browsers changed their behavour on the "onclick" which just works these days with left mouseclick. What you call the backround by changing this line is just 1 more request to your server, as you now involve htaccess also and it needs to map the friendly url to the original, which is useless anyway, as the user never sees that.
The user clicks link, js redirects user the out.php, which in turn redirects to user website.

You really doesnt change a thing, nothing at all by changing that line.

Either remove the onclick ( and the function js ) and use out/username in the links href or keep the default
 
Top