mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
parent
345845e5cf
commit
4c725f6246
5 changed files with 41 additions and 20 deletions
|
@ -103,6 +103,21 @@ $data['tracker_forums'] = implode(',', $data['tracker_forums']);
|
||||||
|
|
||||||
$this->store('cat_forums', $data);
|
$this->store('cat_forums', $data);
|
||||||
|
|
||||||
|
//
|
||||||
|
// jumpbox
|
||||||
|
//
|
||||||
|
if ($bb_cfg['show_jumpbox']) {
|
||||||
|
$data = array(
|
||||||
|
'guest' => get_forum_select('guest', 'f', null, null, null, 'id="jumpbox" onchange="window.location.href=\'viewforum.php?f=\'+this.value;"'),
|
||||||
|
'user' => get_forum_select('user', 'f', null, null, null, 'id="jumpbox" onchange="window.location.href=\'viewforum.php?f=\'+this.value;"'),
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->store('jumpbox', $data);
|
||||||
|
|
||||||
|
file_write($data['guest'], AJAX_HTML_DIR . '/jumpbox_guest.html', false, true, true);
|
||||||
|
file_write($data['user'], AJAX_HTML_DIR . '/jumpbox_user.html', false, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// viewtopic_forum_select
|
// viewtopic_forum_select
|
||||||
//
|
//
|
||||||
|
|
|
@ -1002,6 +1002,24 @@ function get_userdata($u, $force_name = false, $allow_guest = false)
|
||||||
return $u_data;
|
return $u_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function make_jumpbox($selected = 0)
|
||||||
|
{
|
||||||
|
global $datastore, $template, $bb_cfg;
|
||||||
|
|
||||||
|
if (!$bb_cfg['show_jumpbox']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$jumpbox = $datastore->get('jumpbox')) {
|
||||||
|
$datastore->update('jumpbox');
|
||||||
|
$jumpbox = $datastore->get('jumpbox');
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'JUMPBOX' => (IS_GUEST) ? $jumpbox['guest'] : $jumpbox['user'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
// $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode'
|
// $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode'
|
||||||
function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '', $all_forums_option = null)
|
function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '', $all_forums_option = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,17 +108,6 @@ $template->assign_vars(array(
|
||||||
'HAVE_UNREAD_PM' => $have_unread_pm,
|
'HAVE_UNREAD_PM' => $have_unread_pm,
|
||||||
));
|
));
|
||||||
|
|
||||||
// Jumpbox init
|
|
||||||
if ($bb_cfg['show_jumpbox']) {
|
|
||||||
$data = array(
|
|
||||||
'guest' => get_forum_select('guest', 'f', null, null, null, 'id="jumpbox" onchange="window.location.href=\'viewforum.php?f=\'+this.value;"'),
|
|
||||||
'user' => get_forum_select('user', 'f', null, null, null, 'id="jumpbox" onchange="window.location.href=\'viewforum.php?f=\'+this.value;"'),
|
|
||||||
);
|
|
||||||
|
|
||||||
file_write($data['guest'], AJAX_HTML_DIR . '/jumpbox_guest.html', false, true, true);
|
|
||||||
file_write($data['user'], AJAX_HTML_DIR . '/jumpbox_user.html', false, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// The following assigns all _common_ variables that may be used at any point in a template
|
// The following assigns all _common_ variables that may be used at any point in a template
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
||||||
|
@ -202,7 +191,7 @@ $template->assign_vars(array(
|
||||||
'PROFILE_URL' => BB_ROOT . PROFILE_URL,
|
'PROFILE_URL' => BB_ROOT . PROFILE_URL,
|
||||||
'TOPIC_URL' => BB_ROOT . TOPIC_URL,
|
'TOPIC_URL' => BB_ROOT . TOPIC_URL,
|
||||||
|
|
||||||
'AJAX_HTML_DIR' => hide_bb_path(AJAX_HTML_DIR),
|
'AJAX_HTML_DIR' => AJAX_HTML_DIR,
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
'BOT_UID' => BOT_UID,
|
'BOT_UID' => BOT_UID,
|
||||||
|
|
|
@ -39,6 +39,7 @@ class Common
|
||||||
*/
|
*/
|
||||||
public $known_items = [
|
public $known_items = [
|
||||||
'cat_forums' => 'build_cat_forums.php',
|
'cat_forums' => 'build_cat_forums.php',
|
||||||
|
'jumpbox' => 'build_cat_forums.php',
|
||||||
'viewtopic_forum_select' => 'build_cat_forums.php',
|
'viewtopic_forum_select' => 'build_cat_forums.php',
|
||||||
'latest_news' => 'build_cat_forums.php',
|
'latest_news' => 'build_cat_forums.php',
|
||||||
'network_news' => 'build_cat_forums.php',
|
'network_news' => 'build_cat_forums.php',
|
||||||
|
|
|
@ -78,13 +78,11 @@ $(document).ready(function(){
|
||||||
</span> \
|
</span> \
|
||||||
<input id="jumpbox-submit" type="button" class="lite" value="{L_GO}" /> \
|
<input id="jumpbox-submit" type="button" class="lite" value="{L_GO}" /> \
|
||||||
');
|
');
|
||||||
$('#jumpbox-container').one('click', function () {
|
$('#jumpbox-container').one('click', function(){
|
||||||
$('#jumpbox-title').html(' {L_LOADING} ... ');
|
$('#jumpbox-title').html(' {L_LOADING} ... ');
|
||||||
let jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? '/jumpbox_user.html' : '/jumpbox_guest.html');
|
var jumpbox_src = '/internal_data/ajax_html' + ({LOGGED_IN} ? '/jumpbox_user.html' : '/jumpbox_guest.html');
|
||||||
$(this).load(jumpbox_src);
|
$(this).load(jumpbox_src);
|
||||||
$('#jumpbox-submit').click(function () {
|
$('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); });
|
||||||
window.location.href = '{FORUM_URL}' + $('#jumpbox').val();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue