Skip to content

Commit ee9ef55

Browse files
author
LWT Project
committed
Version 1.4.0 (07-Sep-11 12:57)
1 parent 51248f5 commit ee9ef55

1 file changed

Lines changed: 100 additions & 2 deletions

File tree

‎mobile.php‎

Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
...action=1&lang=[langid] ... Language menu
1616
...action=2&lang=[langid] ... Texts in a language
1717
...action=3&lang=[langid]&text=[textid] ... Sentences of a text
18+
...action=4&lang=[langid]&text=[textid]&sent=[sentid] ... Words of a sentence
1819
LWT Mobile
1920
***************************************************************/
2021

@@ -95,7 +96,9 @@
9596

9697
?>
9798

98-
<ul id="<?php echo $action . '-' . $_REQUEST["text"]; ?>" title="<?php echo tohtml($texttitle); ?>">
99+
<ul id="<?php echo $action . '-' . $text; ?>" title="<?php echo tohtml($texttitle); ?>">
100+
<li class="group">Title</li>
101+
<li><?php echo tohtml($texttitle); ?></li>
99102

100103
<?php
101104

@@ -118,7 +121,9 @@
118121

119122
while ($record = mysql_fetch_assoc($res)) {
120123
if (trim($record["SeText"]) != '')
121-
echo '<li><a href="mobile.php#notyetimpl">' .
124+
echo '<li><a href="mobile.php?action=4&amp;lang=' .
125+
$lang . '&amp;text=' . $text .
126+
'&amp;sent=' . $record["SeID"] . '">' .
122127
tohtml($record["SeText"]) . '</a></li>';
123128
}
124129

@@ -134,6 +139,84 @@
134139

135140
/* -------------------------------------------------------- */
136141

142+
elseif ($action == 4) {
143+
144+
$lang = $_REQUEST["lang"];
145+
$text = $_REQUEST["text"];
146+
$sent = $_REQUEST["sent"];
147+
$senttext = get_first_value('select SeText as value from sentences where SeID = ' . $sent);
148+
$sql = 'select TiWordCount as Code, TiText, TiOrder, TiIsNotWord, WoID, WoTranslation, WoRomanization, WoStatus from (textitems left join words on (TiTextLC = WoTextLC) and (TiLgID = WoLgID)) where TiSeID = ' . $sent . ' and (not (TiWordCount > 1 and WoID is null)) order by TiOrder asc, TiWordCount desc';
149+
$res = mysql_query($sql);
150+
if ($res == FALSE) die("Invalid Query: $sql");
151+
152+
?>
153+
154+
<ul id="<?php echo $action . '-' . $sent; ?>" title="<?php echo tohtml($senttext); ?>">
155+
<li class="group">Sentence</li>
156+
<li><?php echo tohtml($senttext); ?></li>
157+
<li class="group">Words</li>
158+
159+
<?php
160+
161+
$saveterm = '';
162+
$savetrans = '';
163+
$saverom = '';
164+
$savestat = '';
165+
$until = 0;
166+
while ($record = mysql_fetch_assoc($res)) {
167+
$actcode = $record['Code'] + 0;
168+
$order = $record['TiOrder'] + 0;
169+
170+
if ( $order <= $until ) {
171+
continue;
172+
}
173+
if ( $order > $until ) {
174+
if (trim($saveterm) != '') {
175+
$desc = trim(($saverom != '' ? '[' . $saverom . '] ' : '') . $savetrans);
176+
echo '<li><span class="status' . $savestat . '">' . tohtml($saveterm) . '</span>' .
177+
tohtml($desc != '' ? ' → ' . $desc : '') . '</li>';
178+
}
179+
$saveterm = '';
180+
$savetrans = '';
181+
$saverom = '';
182+
$savestat = '';
183+
$until = $order;
184+
}
185+
if ($record['TiIsNotWord'] != 0 && trim($record['TiText']) != '') {
186+
echo '<li>' . tohtml($record['TiText']) . '</li>';
187+
}
188+
else {
189+
$until = $order + 2 * ($actcode-1);
190+
$saveterm = $record['TiText'];
191+
$savetrans = '';
192+
if(isset($record['WoID'])) {
193+
$savetrans = $record['WoTranslation'];
194+
if ($savetrans == '*') $savetrans = '';
195+
}
196+
$saverom = trim(isset($record['WoRomanization']) ?
197+
$record['WoRomanization'] : "");
198+
$savestat = $record['WoStatus'];
199+
}
200+
}
201+
mysql_free_result($res);
202+
if (trim($saveterm) != '') {
203+
$desc = trim(($saverom != '' ? '[' . $saverom . '] ' : '') . $savetrans);
204+
echo '<li><span class="status' . $savestat . '">' . tohtml($saveterm) . '</span>' .
205+
tohtml($desc != '' ? ' → ' . $desc : '') . '</li>';
206+
}
207+
208+
?>
209+
210+
</ul>
211+
212+
<?php
213+
214+
mysql_free_result($res);
215+
216+
} // $action == 4
217+
218+
/* -------------------------------------------------------- */
219+
137220
} // isset($_REQUEST["action"])
138221

139222
/**************************************************************/
@@ -156,6 +239,21 @@
156239
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
157240
<style type="text/css" media="screen">
158241
@import "./iui/iui.css";
242+
span.status1 {
243+
background-color: #F5B8A9;
244+
}
245+
span.status2 {
246+
background-color: #F5CCA9;
247+
}
248+
span.status3 {
249+
background-color: #F5E1A9;
250+
}
251+
span.status4 {
252+
background-color: #F5F3A9;
253+
}
254+
span.status5 {
255+
background-color: #DDFFDD;
256+
}
159257
</style>
160258
<script type="text/javascript" src="./iui/iui.js" charset="utf-8"></script>
161259
</head>

0 commit comments

Comments
 (0)