Skip to content

Commit d4b7d19

Browse files
author
LWT Project
committed
Version 1.5.19 (15-Sep-2014 14:39)
1 parent cea99f9 commit d4b7d19

5 files changed

Lines changed: 41 additions & 12 deletions

File tree

‎edit_tags.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
}
206206
echo error_message_with_hide($message,0);
207207

208-
get_tags(1); // refresh tags cache
208+
get_tags($refresh = 1); // refresh tags cache
209209

210210
$sql = 'select count(TgID) as value from ' . $tbpref . 'tags where (1=1) ' . $wh_query;
211211
$recno = get_first_value($sql);

‎edit_texttags.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
}
209209
echo error_message_with_hide($message,0);
210210

211-
get_texttags(1); // refresh tags cache
211+
get_texttags($refresh = 1); // refresh tags cache
212212

213213
$sql = 'select count(T2ID) as value from ' . $tbpref . 'tags2 where (1=1) ' . $wh_query;
214214
$recno = get_first_value($sql);

‎info.htm‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ <h4>
231231

232232
<dd>
233233
<ul>
234-
<li>The current version is <b>1.5.18 (September 14 2014)</b>.
234+
<li>The current version is <b>1.5.19 (September 15 2014)</b>.
235235
</li>
236236

237237
<li>
@@ -2371,6 +2371,12 @@ <h4>
23712371

23722372
<dd>
23732373
<ul>
2374+
<li>1.5.19 (September 15 2014):</br />
2375+
Missing tag cache updating fixed (in "Add tag in all/marked texts or terms").<br />
2376+
Tag caches now also work properly if several instances of LWT are installed in parallel directories on the same server.</br />
2377+
</br />
2378+
</li>
2379+
23742380
<li>1.5.18 (September 14 2014):</br />
23752381
<b>New Feature:</b> Possibility to display similar terms while creating or editing a term. This will give you more language insight, and may ease inputting new terms that are similar. The number of displayed similar terms can be set from 0 (old behavior, default) to 9 on the "Settings" page. Clicking on the green icon in front of a similar term will copy the translation and romanization into the form fields for further editing. Important: If you want to use this new feature, you must change the setting "Similar terms to be displayed while adding/editing a term" to a value greater than 0. It will make more sense to do this if you have already many saved terms (e.g. more than 1,000). If you start with a language and have only a few terms, no or not very similar terms will be normally displayed and this feature will not make much sense.</br />
23762382
"https://" dictionary URIs are now allowed in the language settings. Checking of dictionary URIs in the language settings has been improved. The Glosbe dictionary page has been improved with a simple form to change the term and do a requery if you are unhappy with the query results.</br />

‎upload_words.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function savetag($item, $key, $wid) {
6262
global $tbpref;
6363
if(! in_array($item,$_SESSION['TAGS'])) {
6464
runsql('insert into ' . $tbpref . 'tags (TgText) values(' . convert_string_to_sqlsyntax($item) . ')', "");
65-
get_tags(1);
65+
get_tags($refresh = 1);
6666
}
6767
runsql('insert ignore into ' . $tbpref . 'wordtags (WtWoID, WtTgID) select ' . $wid . ', TgID from ' . $tbpref . 'tags where TgText = ' . convert_string_to_sqlsyntax($item), "");
6868
}

‎utilities.inc.php‎

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
function get_version() {
4141
global $debug;
42-
return '1.5.18 (September 14 2014)' .
42+
return '1.5.19 (September 15 2014)' .
4343
($debug ? ' <span class="red">DEBUG</span>' : '');
4444
}
4545

@@ -160,7 +160,7 @@ function get_tags($refresh = 0) {
160160
if (isset($_SESSION['TAGS'])) {
161161
if (is_array($_SESSION['TAGS'])) {
162162
if (isset($_SESSION['TBPREF_TAGS'])) {
163-
if($_SESSION['TBPREF_TAGS'] == $tbpref) {
163+
if($_SESSION['TBPREF_TAGS'] == $tbpref . url_base()) {
164164
if ($refresh == 0) return $_SESSION['TAGS'];
165165
}
166166
}
@@ -174,7 +174,7 @@ function get_tags($refresh = 0) {
174174
}
175175
mysql_free_result($res);
176176
$_SESSION['TAGS'] = $tags;
177-
$_SESSION['TBPREF_TAGS'] = $tbpref;
177+
$_SESSION['TBPREF_TAGS'] = $tbpref . url_base();
178178
return $_SESSION['TAGS'];
179179
}
180180

@@ -185,7 +185,7 @@ function get_texttags($refresh = 0) {
185185
if (isset($_SESSION['TEXTTAGS'])) {
186186
if (is_array($_SESSION['TEXTTAGS'])) {
187187
if (isset($_SESSION['TBPREF_TEXTTAGS'])) {
188-
if($_SESSION['TBPREF_TEXTTAGS'] == $tbpref) {
188+
if($_SESSION['TBPREF_TEXTTAGS'] == $tbpref . url_base()) {
189189
if ($refresh == 0) return $_SESSION['TEXTTAGS'];
190190
}
191191
}
@@ -199,7 +199,7 @@ function get_texttags($refresh = 0) {
199199
}
200200
mysql_free_result($res);
201201
$_SESSION['TEXTTAGS'] = $tags;
202-
$_SESSION['TBPREF_TEXTTAGS'] = $tbpref;
202+
$_SESSION['TBPREF_TEXTTAGS'] = $tbpref . url_base();
203203
return $_SESSION['TEXTTAGS'];
204204
}
205205

@@ -309,7 +309,7 @@ function saveWordTags($wid) {
309309
}
310310
runsql('insert into ' . $tbpref . 'wordtags (WtWoID, WtTgID) select ' . $wid . ', TgID from ' . $tbpref . 'tags where TgText = ' . convert_string_to_sqlsyntax($tag), "");
311311
}
312-
get_tags(1); // refresh tags cache
312+
get_tags($refresh = 1); // refresh tags cache
313313
}
314314
}
315315
}
@@ -336,7 +336,7 @@ function saveTextTags($tid) {
336336
}
337337
runsql('insert into ' . $tbpref . 'texttags (TtTxID, TtT2ID) select ' . $tid . ', T2ID from ' . $tbpref . 'tags2 where T2Text = ' . convert_string_to_sqlsyntax($tag), "");
338338
}
339-
get_texttags(1); // refresh tags cache
339+
get_texttags($refresh = 1); // refresh tags cache
340340
}
341341
}
342342
}
@@ -363,7 +363,7 @@ function saveArchivedTextTags($tid) {
363363
}
364364
runsql('insert into ' . $tbpref . 'archtexttags (AgAtID, AgT2ID) select ' . $tid . ', T2ID from ' . $tbpref . 'tags2 where T2Text = ' . convert_string_to_sqlsyntax($tag), "");
365365
}
366-
get_texttags(1); // refresh tags cache
366+
get_texttags($refresh = 1); // refresh tags cache
367367
}
368368
}
369369
}
@@ -438,6 +438,7 @@ function addtaglist ($item, $list) {
438438
$cnt += runsql('insert ignore into ' . $tbpref . 'wordtags (WtWoID, WtTgID) values(' . $record['WoID'] . ', ' . $tagid . ')', "");
439439
}
440440
mysql_free_result($res);
441+
get_tags($refresh = 1);
441442
return "Tag added in $cnt Terms";
442443
}
443444

@@ -457,6 +458,7 @@ function addarchtexttaglist ($item, $list) {
457458
$cnt += runsql('insert ignore into ' . $tbpref . 'archtexttags (AgAtID, AgT2ID) values(' . $record['AtID'] . ', ' . $tagid . ')', "");
458459
}
459460
mysql_free_result($res);
461+
get_texttags($refresh = 1);
460462
return "Tag added in $cnt Texts";
461463
}
462464

@@ -476,6 +478,7 @@ function addtexttaglist ($item, $list) {
476478
$cnt += runsql('insert ignore into ' . $tbpref . 'texttags (TtTxID, TtT2ID) values(' . $record['TxID'] . ', ' . $tagid . ')', "");
477479
}
478480
mysql_free_result($res);
481+
get_texttags($refresh = 1);
479482
return "Tag added in $cnt Texts";
480483
}
481484

@@ -582,6 +585,7 @@ function framesetheader($title) {
582585

583586
function pagestart_nobody($titletext, $addcss='') {
584587
global $debug;
588+
global $tbpref;
585589
@header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
586590
@header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
587591
@header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
@@ -644,6 +648,8 @@ function pagestart_nobody($titletext, $addcss='') {
644648
<script type="text/javascript" src="js/sorttable/sorttable.js" charset="utf-8"></script>
645649
<script type="text/javascript" src="js/countuptimer.js" charset="utf-8"></script>
646650
<script type="text/javascript" src="js/overlib/overlib_mini.js" charset="utf-8"></script>
651+
<!-- URLBASE : "<?php echo tohtml(url_base()); ?>" -->
652+
<!-- TBPREF : "<?php echo tohtml($tbpref); ?>" -->
647653
<script type="text/javascript">
648654
//<![CDATA[
649655
<?php echo "var STATUSES = " . json_encode(get_statuses()) . ";\n"; ?>
@@ -681,6 +687,23 @@ function pagestart($titletext,$close) {
681687

682688
// -------------------------------------------------------------
683689

690+
function url_base() {
691+
$url = parse_url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
692+
$r = $url["scheme"] . "://" . $url["host"];
693+
if(isset($url["port"])) $r .= ":" . $url["port"];
694+
if(isset($url["path"])) {
695+
$b = basename($url["path"]);
696+
if (substr($b,-4) == ".php" || substr($b,-4) == ".htm" || substr($b,-5) == ".html")
697+
$r .= dirname($url["path"]);
698+
else
699+
$r .= $url["path"];
700+
}
701+
if(substr($r,-1) !== "/") $r .= "/";
702+
return $r;
703+
}
704+
705+
// -------------------------------------------------------------
706+
684707
function pageend() {
685708
global $debug, $dspltime;
686709
if ($debug) showRequest();

0 commit comments

Comments
 (0)