Skip to content

Commit

Permalink
Added login button in forum index
Browse files Browse the repository at this point in the history
  • Loading branch information
Nnnaaaa committed May 14, 2015
1 parent df40342 commit f76fc9c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
12 changes: 12 additions & 0 deletions adm/style/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@ <h1>{L_SETTINGS}</h1>
{S_FORM_TOKEN}
</form>

<fieldset>
<legend>for Developer</legend>

<pre><code>
$userMinecraftjp = $phpbb_container->get('minecraftjp.phpbb.model.user_minecraftjp');
$minecraftUser = $userMinecraftjp->read($user->data['user_id']);

echo 'My username is ' . $minecraftUser['username'];
echo 'My UUID is ' . $minecraftUser['uuid'];
</code></pre>
</fieldset>

<!-- INCLUDE overall_footer.html -->
10 changes: 4 additions & 6 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ public function onUserSetup($event) {
public function onPageHeaderAfter($event) {
$mode = $this->request->variable('mode', '');
if (!empty($this->config['minecraftjp_client_id']) && !empty($this->config['minecraftjp_client_secret'])) {
if ($mode == 'login' || $mode == 'register') {
$this->template->assign_vars(array(
'MINECRAFTJP_ENABLED' => 1,
'MINECRAFTJP_LOGIN_LINK' => $this->helper->route('minecraftjp_phpbb_controller', array('action' => 'login')),
));
}
$this->template->assign_vars(array(
'MINECRAFTJP_ENABLED' => 1,
'MINECRAFTJP_LOGIN_LINK' => $this->helper->route('minecraftjp_phpbb_controller', array('action' => 'login')),
));
}
}

Expand Down
1 change: 1 addition & 0 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
'MCJP_USER_DUPLICATE' => 'username or email is already taken.',
'MCJP_NOT_LOGGED' => 'Not logged.',
'MCJP_ALREADY_LINKED' => 'This account is already linked.',
'MCJP_MINECRAFT_ACCOUNT' => 'Minecraft Account',
));
1 change: 1 addition & 0 deletions language/ja/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
'MCJP_USER_DUPLICATE' => 'ユーザ名またはメールアドレスが既に登録されています。',
'MCJP_NOT_LOGGED' => 'ログインしていません。',
'MCJP_ALREADY_LINKED' => 'このアカウントは既にリンクされています。',
'MCJP_MINECRAFT_ACCOUNT' => 'Minecraft アカウント',
));
4 changes: 4 additions & 0 deletions styles/all/template/event/index_body_stat_blocks_before.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- IF S_INDEX and MINECRAFTJP_ENABLED -->
<br/>
<a href="{MINECRAFTJP_LOGIN_LINK}" class="button">{L_MCJP_LOGIN_WITH_MINECRAFTJP}</a>
<!-- ENDIF -->
1 change: 1 addition & 0 deletions styles/all/template/minecraftjp_ucp_link.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ <h2>{L_MCJP_TITLE}</h2>
<div class="panel">
<div class="inner">
<!-- IF MINECRAFTJP_IS_LINKED -->
<p>{L_MCJP_MINECRAFT_ACCOUNT}: {MINECRAFTJP_USERNAME}</p>
<a href="{MINECRAFTJP_UNLINK_URL}" class="button">{L_MCJP_UNLINK_ACCOUNT}</a>
<!-- ENDIF -->
<!-- IF not MINECRAFTJP_IS_LINKED -->
Expand Down

0 comments on commit f76fc9c

Please sign in to comment.