Quote:
Originally Posted by Dragonsys
oh cool. let us know how it goes
|
It went like this. . .
Code:
The following dependencies were not met:
This product is not compatible with version 5.1.10 of vBulletin. (Compatible starting with 3.6.0 / Incompatible with 5.0.0 and greater)
Worth a try. . .
And for your curiosity, this is what the .xml looks like.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="intextlinkingbop5" active="1">
<title>Open Internal Links In Same Page - Ported By BOP5</title>
<description>This will add JavaScript to every page that will make all links to the same domain open in the same tab or window. Only external links will open in new tabs.</description>
<version>1.0</version>
<url><![CDATA[http://www.qapla.com/mods/misc.php?do=producthelp&pid=intextlinkingbop5]]></url>
<versioncheckurl><![CDATA[http://www.qapla.com/mods/misc.php?do=productcheck&pid=intextlinkingbop5]]></versioncheckurl>
<dependencies>
<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="5.0.0" />
</dependencies>
<codes>
</codes>
<templates>
</templates>
<stylevardfns>
</stylevardfns>
<stylevars>
</stylevars>
<plugins>
<plugin active="1" executionorder="5">
<title>Add Internal Linking JavaScript</title>
<hookname>replacement_vars</hookname>
<phpcode><![CDATA[// Blankwin JavaScript function
// written by Alen Grakalic, provided by Css Globe (cssglobe.com)
// please visit http://cssglobe.com/post/1281/open-external-links-in-new-window-automatically/ for more info
// MODIFIED BY BirdOPrey5 (vbulletin.org / Qapla.com) for use on vBulletin forums
global $vbulletin;
$ddom = $_SERVER['HTTP_HOST'];
if ($vbulletin->options['bop5bil_en'])
{
$domainslist = explode("\r\n" , $vbulletin->options['bop5bil_domains']);
if ($domainslist[0] == '')
$domainslist[0] = str_ireplace('www.', '', $ddom);
$di = 0;
$js_vars = 'var dlists = new Array(); ' . " \r\n";
$dmax = count($domainslist);
//At least 1 domain in list
while ($di < $dmax)
{
$js_vars .= " dlists[{$di}] = '" . $domainslist[$di] . "'; \r\n";
$di++;
}
$find = "</body>";
$replace = '
<script type="text/javascript">
this.blankwin = function(){
'. $js_vars . '
var hostname = window.location.hostname;
hostname = hostname.replace("www.","").toLowerCase();
var a = document.getElementsByTagName("a");
this.check = function(obj){
var href = obj.href.toLowerCase();
var dbopcount = 0;
if (href.indexOf("http://")!=-1)
{
for (jdi = 0; jdi <= dlists.length; jdi++)
{
if (href.indexOf(dlists[jdi]) == -1)
{
//alert("NO MATCH " + dlists[jdi] + " " + href);
dbopcount = dbopcount; //Do nothing
}
else
{
//alert("match " + dlists[jdi] + " " + href);
dbopcount++;
}
}
if (dbopcount > 0)
return true; //If this link URL was an internal URL
else //there were no matches to any internal domain, so leave it external
return false;
}
else
{
return false;
}
//return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? false : true;
};
this.set = function(obj){
obj.target = "_self";
};
for (var i=0;i<a.length;i++){
if(check(a[i])) set(a[i]);
};
};
// script initiates on page load.
this.addEvent = function(obj,type,fn){
if(obj.attachEvent){
obj[\'e\'+type+fn] = fn;
obj[type+fn] = function(){obj[\'e\'+type+fn](window.event );}
obj.attachEvent(\'on\'+type, obj[type+fn]);
} else {
obj.addEventListener(type,fn,false);
};
};
addEvent(window,"load",blankwin);
</script>
';
$newtext = str_replace ($find, $replace . $find, $newtext);
}]]></phpcode>
</plugin>
</plugins>
<phrases>
<phrasetype name="vBulletin Settings" fieldname="vbsettings">
<phrase name="setting_bop5bil_domains_desc" date="1343585395" username="BirdOPrey5" version="1.0"><![CDATA[List of domains that should be considered internal (they will open in the current window or tab), <b>one per line.</b> Do not include the "www." if any, just the domain name and extension.<br />
<br />
Example: <br />
<br />
qapla.com <br />
birdoprey5.com <br />
<br />
If left blank the mod will attempt to auto-detect the domain name.]]></phrase>
<phrase name="setting_bop5bil_domains_title" date="1343585395" username="BirdOPrey5" version="1.0"><![CDATA[List of Domains to Open in Same Tab/Window]]></phrase>
<phrase name="setting_bop5bil_en_desc" date="1343585395" username="BirdOPrey5" version="1.0"><![CDATA[Enables or disables the entire mod.]]></phrase>
<phrase name="setting_bop5bil_en_title" date="1343585395" username="BirdOPrey5" version="1.0"><![CDATA[Enable Mod?]]></phrase>
<phrase name="settinggroup_betterintlinksbop5" date="1343585395" username="BirdOPrey5" version="1.0"><![CDATA[Open Internal Links In Same Page - Ported By BOP5]]></phrase>
</phrasetype>
</phrases>
<options>
<settinggroup name="betterintlinksbop5" displayorder="65535">
<setting varname="bop5bil_en" displayorder="10">
<datatype>free</datatype>
<optioncode>yesno</optioncode>
<defaultvalue>1</defaultvalue>
</setting>
<setting varname="bop5bil_domains" displayorder="20">
<datatype>free</datatype>
<optioncode>textarea</optioncode>
</setting>
</settinggroup>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
<navigation>
</navigation>
</product>
Cheers.