Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Editing WindowLinks Extension
I would like help editing the WindowLinks Extension so that it opens links in the new window, and doesnt give you the option to turn it off... (In order to keep visitors on your site...)
<?php
/*
Extension Name: Window Links
Extension Url: http://boxofjunk.net/blog/filter/vanilla/
Description: Allows users to open external links in a new window or in the same window.
Version: 1.0
Author: Liam Cooke
Author Url: http://boxofjunk.net/
*/
// Language definitions
$Context->Dictionary['ExternalLinks'] = 'External links';
$Context->Dictionary['WindowLinksToggle'] = 'Open external links in a new window';
// Add the script on comments pages
if (in_array($Context->SelfUrl, array("comments.php")) && $Context->Session->UserID > 0) {
if ($Context->Session->User->Preference('UseWindowLinks')) {
$Head->AddScript('extensions/WindowLinks/functions.js');
}
}
// Allow people to turn off this evil extension
if ($Context->SelfUrl == 'account.php' && $Context->Session->UserID > 0) {
if (ForceIncomingString('PostBackAction', '') == 'Functionality') {
function PreferencesForm_ToggleWindowLinks(&$PreferencesForm) {
$PreferencesForm->AddPreference(
'ExternalLinks', // preferences section
'WindowLinksToggle', // language code
'UseWindowLinks' // setting name
);
}
$Context->AddToDelegate(
'PreferencesForm',
'Constructor',
'PreferencesForm_ToggleWindowLinks');
}
}
?>
</code
0
This discussion has been closed.