Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 General Discussions
  #1  
Old 12-15-2015, 10:43 AM
DemOnstar's Avatar
DemOnstar DemOnstar is offline
 
Join Date: Dec 2012
Posts: 859
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dragonsys View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04151 seconds
  • Memory Usage 2,230KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete