Skip to content

Commit

Permalink
Update for MyBB 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebijk committed Jul 12, 2020
1 parent 904113f commit 87e72bb
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.6 -
* Copyright (c) 2006 by Sebijk
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Möchtest du dich wirklich abmelden?";
$l['confirm_logout_okcancel'] ="(OK = Ja | Abbrechen = Nein)";
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.8 -
* License GPL
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Möchtest du dich wirklich abmelden?";
$l['confirm_logout_okcancel'] ="(OK = Ja | Abbrechen = Nein)";
?>
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.6 -
* Copyright (c) 2006 by Sebijk
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Möchten Sie sich wirklich abmelden?";
$l['confirm_logout_okcancel'] ="(OK = Ja | Abbrechen = Nein)";
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.8 -
* License GPL
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Möchten Sie sich wirklich abmelden?";
$l['confirm_logout_okcancel'] ="(OK = Ja | Abbrechen = Nein)";
?>
17 changes: 17 additions & 0 deletions inc/languages/english/asklogout.lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.8 -
* License GPL
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Are you really sure you want to logout?";
$l['confirm_logout_okcancel'] ="(OK = Yes | Cancel = No)";
?>
27 changes: 17 additions & 10 deletions inc/plugins/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,41 @@

/** Hooks einbinden **/
$plugins->add_hook("global_end", "logout_js");
$plugins->add_hook("pre_output_page", "logout");

/** Infos über Logout Abfrage **/
function logout_info()
{
return array(
"name" => "Logout Abfrage",
"name" => "Logout Abfrage / Logout ask",
"description" => "Fragt den Benutzer ob er sich wirklich abmelden möchte.",
"website" => "http://www.sebijk.com",
"author" => "Home of the Sebijk.com",
"authorsite" => "http://www.sebijk.com",
"version" => "1.4",
"version" => "1.5",
"guid" => "",
"compatibility" => "16*"
"compatibility" => "18*"
);
}

function logout_activate()
{
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("header_welcomeblock_member", "#".preg_quote('action=logout&amp;logoutkey={$mybb->user[\'logoutkey\']}')."#i", 'action=logout&amp;logoutkey={$mybb->user[\'logoutkey\']}" onclick="return log_out()');
}

// This function runs when the plugin is deactivated.
function logout_deactivate()
{
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("header_welcomeblock_member", "#".preg_quote('action=logout&amp;logoutkey={$mybb->user[\'logoutkey\']}" onclick="return log_out()')."#i", 'action=logout&amp;logoutkey={$mybb->user[\'logoutkey\']}');
}

function logout_js() {
global $lang, $headerinclude;
$lang->load("asklogout");

$headerinclude .= '<!-- start js code for logout -->
<script type="text/javascript" language="JavaScript">
<script type="text/javascript">
<!--
function log_out()
{
Expand All @@ -56,9 +68,4 @@ function log_out()
</script>
<!-- end js code for logout -->';
}

function logout($page) {
global $mybb;
$page = str_replace("action=logout&amp;logoutkey={$mybb->user['logoutkey']}", "action=logout&amp;logoutkey={$mybb->user['logoutkey']}\" onclick=\"return log_out()", $page);
}
?>
17 changes: 0 additions & 17 deletions languages/english/asklogout.lang.php

This file was deleted.

0 comments on commit 87e72bb

Please sign in to comment.