forked from GithubBackups/vichan
#461 - "Post a reply" button JS added. Signed-off-by: 8n-tech <8n-tech@users.noreply.github.com>
This commit is contained in:
parent
7257642906
commit
32061668a3
@ -14,13 +14,6 @@ $CanViewUnindexed = isset($mod["type"]) && $mod["type"] <= GlobalVolunteer;
|
|||||||
$response = array();
|
$response = array();
|
||||||
|
|
||||||
|
|
||||||
/* Prefetch some information. */
|
|
||||||
$languages = array(
|
|
||||||
"en",
|
|
||||||
"es",
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/* Determine search parameters from $_GET */
|
/* Determine search parameters from $_GET */
|
||||||
$search = array(
|
$search = array(
|
||||||
'lang' => false,
|
'lang' => false,
|
||||||
@ -48,7 +41,7 @@ if (isset( $_GET['page'] ) && $_GET['page'] != "") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Include what language (if the language is not blank and we recognize it)?
|
// Include what language (if the language is not blank and we recognize it)?
|
||||||
if (isset( $_GET['lang'] ) && $_GET['lang'] != "" && isset($languages[$search['lang']])) {
|
if (isset( $_GET['lang'] ) && $_GET['lang'] != "" && isset($config['languages'][$_GET['lang']])) {
|
||||||
$search['lang'] = $_GET['lang'];
|
$search['lang'] = $_GET['lang'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,11 +109,16 @@ foreach ($boards as $board) {
|
|||||||
$boardLang = strtolower( array_slice( explode( "_", $boardConfig['locale'] ?: "" ), 0 )[0] ); // en_US -> en OR en -> en
|
$boardLang = strtolower( array_slice( explode( "_", $boardConfig['locale'] ?: "" ), 0 )[0] ); // en_US -> en OR en -> en
|
||||||
|
|
||||||
// Check against our config search options.
|
// Check against our config search options.
|
||||||
if ( $search['lang'] !== false && $search['lang'] != $boardLang ) {
|
if ($search['lang'] !== false && $search['lang'] != $boardLang) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($config['languages'][$boardLang])) {
|
||||||
|
$board['locale'] = $config['languages'][$boardLang];
|
||||||
|
}
|
||||||
|
else {
|
||||||
$board['locale'] = $boardLang;
|
$board['locale'] = $boardLang;
|
||||||
|
}
|
||||||
|
|
||||||
$response['boards'][ $board['uri'] ] = $board;
|
$response['boards'][ $board['uri'] ] = $board;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include "inc/functions.php";
|
include "inc/functions.php";
|
||||||
include "inc/countries.php";
|
|
||||||
|
|
||||||
$admin = isset($mod["type"]) && $mod["type"]<=30;
|
$admin = isset($mod["type"]) && $mod["type"]<=30;
|
||||||
$founding_date = "October 23, 2013";
|
$founding_date = "October 23, 2013";
|
||||||
@ -47,11 +46,6 @@ $tagQueryGet['tags'] = $tagQueryTags;
|
|||||||
$tag_query = "?" . http_build_query( $tagQueryGet ) . ($tagQueryTags != "" ? "+" : "");
|
$tag_query = "?" . http_build_query( $tagQueryGet ) . ($tagQueryTags != "" ? "+" : "");
|
||||||
|
|
||||||
/* Create and distribute page */
|
/* Create and distribute page */
|
||||||
$config['additional_javascript'] = array(
|
|
||||||
'js/jquery.min.js',
|
|
||||||
'js/board-directory.js'
|
|
||||||
);
|
|
||||||
|
|
||||||
$boardsHTML = Element("8chan/boards-table.html", array(
|
$boardsHTML = Element("8chan/boards-table.html", array(
|
||||||
"config" => $config,
|
"config" => $config,
|
||||||
"boards" => $boards,
|
"boards" => $boards,
|
||||||
@ -73,6 +67,7 @@ $searchHTML = Element("8chan/boards-search.html", array(
|
|||||||
"boards" => $boards,
|
"boards" => $boards,
|
||||||
"tags" => $tags,
|
"tags" => $tags,
|
||||||
"search" => $searchJson['search'],
|
"search" => $searchJson['search'],
|
||||||
|
"languages" => $config['languages'],
|
||||||
|
|
||||||
"boards_total" => $boards_total,
|
"boards_total" => $boards_total,
|
||||||
"boards_public" => $boards_public,
|
"boards_public" => $boards_public,
|
||||||
|
@ -822,7 +822,7 @@ function loadBoardConfig( $uri ) {
|
|||||||
$config = array(
|
$config = array(
|
||||||
"locale" => "en_US",
|
"locale" => "en_US",
|
||||||
);
|
);
|
||||||
$configPath = "/{$uri}/config.php";
|
$configPath = "./{$uri}/config.php";
|
||||||
|
|
||||||
if (file_exists( $configPath ) && is_readable( $configPath )) {
|
if (file_exists( $configPath ) && is_readable( $configPath )) {
|
||||||
include( $configPath );
|
include( $configPath );
|
||||||
|
@ -185,6 +185,32 @@
|
|||||||
'message' => 'On this board, to prevent raids the number of threads that can be created per hour is limited. Please try again later, or post in an existing thread.'
|
'message' => 'On this board, to prevent raids the number of threads that can be created per hour is limited. Please try again later, or post in an existing thread.'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$config['languages'] = array(
|
||||||
|
'ch' => "汉语",
|
||||||
|
'cz' => "Čeština",
|
||||||
|
'dk' => "Dansk",
|
||||||
|
'de' => "Deutsch",
|
||||||
|
'eo' => "Esperanto",
|
||||||
|
'en' => "English",
|
||||||
|
'es' => "Español",
|
||||||
|
'fi' => "Suomi",
|
||||||
|
'fr' => "Français",
|
||||||
|
'hu' => "Magyar",
|
||||||
|
'it' => "Italiano",
|
||||||
|
'jp' => "日本語",
|
||||||
|
'jbo' => "Lojban",
|
||||||
|
'lt' => "Lietuvių Kalba",
|
||||||
|
'lv' => "Latviešu Valoda",
|
||||||
|
'no' => "Norsk",
|
||||||
|
'nl' => "Nederlands Vlaams",
|
||||||
|
'pl' => "Polski",
|
||||||
|
'pt' => "Português",
|
||||||
|
'ru' => "Русский",
|
||||||
|
'sk' => "Slovenský Jazyk",
|
||||||
|
'tw' => "Taiwanese",
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
$config['gzip_static'] = false;
|
$config['gzip_static'] = false;
|
||||||
$config['hash_masked_ip'] = true;
|
$config['hash_masked_ip'] = true;
|
||||||
$config['force_subject_op'] = false;
|
$config['force_subject_op'] = false;
|
||||||
|
@ -90,5 +90,12 @@ $(document).ready(function(){
|
|||||||
$(document).on('new_post', function(e, post) {
|
$(document).on('new_post', function(e, post) {
|
||||||
$(post).find('input[type=checkbox].delete').each(init_qpc);
|
$(post).find('input[type=checkbox].delete').each(init_qpc);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
// Bottom of the page quick reply function
|
||||||
|
$("#thread-quick-reply").show();
|
||||||
|
$("#link-quick-reply").on( 'click', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
$(window).trigger('cite', ['']);
|
||||||
|
return false;
|
||||||
|
} );
|
||||||
|
} );
|
@ -1443,7 +1443,7 @@ table.board-list-table {
|
|||||||
|
|
||||||
table.board-list-table .board-meta {
|
table.board-list-table .board-meta {
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
width: 44px;
|
width: 70px;
|
||||||
}
|
}
|
||||||
table.board-list-table .board-uri {
|
table.board-list-table .board-uri {
|
||||||
max-width: 196px;
|
max-width: 196px;
|
||||||
|
@ -28,7 +28,9 @@
|
|||||||
<option value="es">Spanish</option>
|
<option value="es">Spanish</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<optgroup label="All">
|
<optgroup label="All">
|
||||||
<option value="cn">Chinese</option>
|
{% for lang_code, lang_name in languages %}
|
||||||
|
<option value="{{lang_code}}">{{lang_name}}</option>
|
||||||
|
{% endfor %}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user