Skip to content

Commit

Permalink
v1.6.9 Bugfix: getting texts from feed
Browse files Browse the repository at this point in the history
  • Loading branch information
andreask7 committed Dec 21, 2014
1 parent 62a01ab commit e68e9f3
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions do_feeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$edit_text=1;
}
}
$doc[0]=array('link' => $row['FlLink'],
$doc[0]=array('link' => empty($row['FlLink'])?('#'.$row['FlID']):$row['FlLink'],
'title' => $row['FlTitle'],
'audio' => $row['FlAudio'],
'text' => $row['FlText']);
Expand Down Expand Up @@ -368,7 +368,7 @@
}
echo '</td>';
echo '<td class="td1 center" style="vertical-align: middle">';
if(!empty($row['FlLink'])) echo '<a href="' . trim($row['FlLink']) . '" title="' . trim($row['FlLink']) . '" onclick="window.open(\'' . $row['FlLink'] . '\');return false;"><img src="icn/external.png" alt="-" /></a>';
if(!empty($row['FlLink']) && substr(trim($row['FlLink']),0,1)!='#') echo '<a href="' . trim($row['FlLink']) . '" title="' . trim($row['FlLink']) . '" onclick="window.open(\'' . $row['FlLink'] . '\');return false;"><img src="icn/external.png" alt="-" /></a>';
echo '</td><td class="td1 center">' . $row['FlDate'] . '</td>';
echo '</tr>';
}
Expand Down
4 changes: 2 additions & 2 deletions do_text_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
quickMenu();
echo getPreviousAndNextTextLinks($textid, 'do_text.php?start=', FALSE, '&nbsp; | &nbsp;');
echo '&nbsp; | &nbsp;<a href="do_test.php?text=' . $textid . '" target="_top"><img src="icn/question-balloon.png" title="Test" alt="Test" /></a> &nbsp;<a href="print_text.php?text=' . $textid . '" target="_top"><img src="icn/printer.png" title="Print" alt="Print" />' . get_annotation_link($textid) . ' &nbsp;<a target="_top" href="edit_texts.php?chg=' . $textid . '"><img src="icn/document--pencil.png" title="Edit Text" alt="Edit Text" /></a>&nbsp; | &nbsp;<a href="new_word.php?text=' . $textid . '&amp;lang=' . $langid . '" target="ro"><img src="icn/sticky-note--plus.png" title="New Term" alt="New Term" /></a>';
echo '</h4><table><tr><td><h3>READ&nbsp;▶</h3></td><td class="width99pc"><h3>' . tohtml($title) . (isset($sourceURI) ? ' <a href="' . $sourceURI . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Text Source" alt="Text Source" /></a>' : '') . '</h3></td></tr></table>';
echo '</h4><table><tr><td><h3>READ&nbsp;▶</h3></td><td class="width99pc"><h3>' . tohtml($title) . (isset($sourceURI) && substr(trim($sourceURI),0,1)!='#' ? ' <a href="' . $sourceURI . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Text Source" alt="Text Source" /></a>' : '') . '</h3></td></tr></table>';

$showAll = getSettingZeroOrOne('showallwords', 1);

Expand All @@ -91,4 +91,4 @@
<?php
pageend();

?>
?>
2 changes: 1 addition & 1 deletion edit_texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
echo '<td nowrap="nowrap" class="td1 center">&nbsp;<a href="do_text.php?start=' . $record['TxID'] . '"><img src="icn/book-open-bookmark.png" title="Read" alt="Read" /></a>&nbsp; <a href="do_test.php?text=' . $record['TxID'] . '"><img src="icn/question-balloon.png" title="Test" alt="Test" /></a>&nbsp;</td>';
echo '<td nowrap="nowrap" class="td1 center">&nbsp;<a href="print_text.php?text=' . $record['TxID'] . '"><img src="icn/printer.png" title="Print" alt="Print" /></a>&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?arch=' . $record['TxID'] . '"><img src="icn/inbox-download.png" title="Archive" alt="Archive" /></a>&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?chg=' . $record['TxID'] . '"><img src="icn/document--pencil.png" title="Edit" alt="Edit" /></a>&nbsp; <span class="click" onclick="if (confirm (\'Are you sure?\')) location.href=\'' . $_SERVER['PHP_SELF'] . '?del=' . $record['TxID'] . '\';"><img src="icn/minus-button.png" title="Delete" alt="Delete" /></span>&nbsp;</td>';
if ($currentlang == '') echo '<td class="td1 center">' . tohtml($record['LgName']) . '</td>';
echo '<td class="td1 center">' . tohtml($record['TxTitle']) . ' <span class="smallgray2">' . tohtml($record['taglist']) . '</span> &nbsp;' ; if($audio != ''){ echo '<img src="';print_file_path('icn/speaker-volume.png');echo '" title="With Audio" alt="With Audio" />';} else echo ''; echo (isset($record['TxSourceURI']) ? ' <a href="' . $record['TxSourceURI'] . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Link to Text Source" alt="Link to Text Source" /></a>' : '') . ($record['annotlen'] ? ' <a href="print_impr_text.php?text=' . $record['TxID'] . '"><img src="icn/tick.png" title="Annotated Text available" alt="Annotated Text available" /></a>' : '') . '</td>';
echo '<td class="td1 center">' . tohtml($record['TxTitle']) . ' <span class="smallgray2">' . tohtml($record['taglist']) . '</span> &nbsp;' ; if($audio != ''){ echo '<img src="';print_file_path('icn/speaker-volume.png');echo '" title="With Audio" alt="With Audio" />';} else echo ''; echo (isset($record['TxSourceURI']) && substr(trim($record['TxSourceURI']),0,1)!='#' ? ' <a href="' . $record['TxSourceURI'] . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Link to Text Source" alt="Link to Text Source" /></a>' : '') . ($record['annotlen'] ? ' <a href="print_impr_text.php?text=' . $record['TxID'] . '"><img src="icn/tick.png" title="Annotated Text available" alt="Annotated Text available" /></a>' : '') . '</td>';
if ($showCounts) {
echo '<td class="td1 center"><span title="Total">&nbsp;' . $txttotalwords . '&nbsp;</span></td>';
echo '<td class="td1 center"><span title="Saved" class="status4">&nbsp;' . ($txtworkedall > 0 ? '<a href="edit_words.php?page=1&amp;query=&amp;status=&amp;tag12=0&amp;tag2=&amp;tag1=&amp;text_mode=0&amp;text=' . $record['TxID'] . '">' . $txtworkedwords . '+' . $txtworkedexpr . '</a>' : '0' ) . '&nbsp;</span></td>';
Expand Down
2 changes: 1 addition & 1 deletion js/jq_pgm.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function check() {
count = 0;
$('input.checkurl').each( function(n) {
if($(this).val().trim().length > 0) {
if(($(this).val().trim().indexOf('http://') != 0) && ($(this).val().trim().indexOf('https://') != 0)) {
if(($(this).val().trim().indexOf('http://') != 0) && ($(this).val().trim().indexOf('https://') != 0) && ($(this).val().trim().indexOf('#') != 0)) {
alert('ERROR\n\nField "' + $(this).attr('data_info') + '" must start with "http://" or "https://" if not empty.');
count++;
}
Expand Down
2 changes: 1 addition & 1 deletion print_impr_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
quickMenu();
echo getPreviousAndNextTextLinks($textid, 'print_impr_text.php?text=', TRUE, '&nbsp; | &nbsp;');
echo '&nbsp; | &nbsp;<a href="do_text.php?start=' . $textid . '" target="_top"><img src="icn/book-open-bookmark.png" title="Read" alt="Read" /></a> &nbsp;<a href="do_test.php?text=' . $textid . '" target="_top"><img src="icn/question-balloon.png" title="Test" alt="Test" /></a> &nbsp;<a href="print_text.php?text=' . $textid . '" target="_top"><img src="icn/printer.png" title="Print" alt="Print" /> &nbsp;<a target="_top" href="edit_texts.php?chg=' . $textid . '"><img src="icn/document--pencil.png" title="Edit Text" alt="Edit Text" /></a>';
echo '</h4><h3>ANN.TEXT&nbsp;▶ ' . tohtml($title) . (isset($sourceURI) ? ' <a href="' . $sourceURI . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Text Source" alt="Text Source" /></a>' : '') . '</h3>';
echo '</h4><h3>ANN.TEXT&nbsp;▶ ' . tohtml($title) . (isset($sourceURI) && substr(trim($sourceURI),0,1)!='#' ? ' <a href="' . $sourceURI . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Text Source" alt="Text Source" /></a>' : '') . '</h3>';

echo "<p id=\"printoptions\"><b>Improved Annotated Text";

Expand Down
4 changes: 2 additions & 2 deletions print_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function output_text($saveterm,$saverom,$savetrans,$savetags,
quickMenu();
echo getPreviousAndNextTextLinks($textid, 'print_text.php?text=', FALSE, '&nbsp; | &nbsp;');
echo '&nbsp; | &nbsp;<a href="do_text.php?start=' . $textid . '" target="_top"><img src="icn/book-open-bookmark.png" title="Read" alt="Read" /></a> &nbsp;<a href="do_test.php?text=' . $textid . '" target="_top"><img src="icn/question-balloon.png" title="Test" alt="Test" /></a>' . get_annotation_link($textid) . ' &nbsp;<a target="_top" href="edit_texts.php?chg=' . $textid . '"><img src="icn/document--pencil.png" title="Edit Text" alt="Edit Text" /></a>';
echo '</h4><h3>PRINT&nbsp;▶ ' . tohtml($title) . (isset($sourceURI) ? ' <a href="' . $sourceURI . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Text Source" alt="Text Source" /></a>' : '') . '</h3>';
echo '</h4><h3>PRINT&nbsp;▶ ' . tohtml($title) . (isset($sourceURI) && substr(trim($sourceURI),0,1)!='#' ? ' <a href="' . $sourceURI . '" target="_blank"><img src="'.get_file_path('icn/chain.png').'" title="Text Source" alt="Text Source" /></a>' : '') . '</h3>';

echo "<p id=\"printoptions\">Terms with <b>status(es)</b> <select id=\"status\" onchange=\"{val=document.getElementById('status').options[document.getElementById('status').selectedIndex].value;location.href='print_text.php?text=" . $textid . "&amp;status=' + val;}\">";
echo get_wordstatus_selectoptions($statusrange, true, true, false);
Expand Down Expand Up @@ -232,4 +232,4 @@ function output_text($saveterm,$saverom,$savetrans,$savetags,
echo "</p></div>";

pageend();
?>
?>
7 changes: 6 additions & 1 deletion utilities.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,15 @@ function get_text_from_rsslink($feed_data,$NfArticleSection,$NfFilterTags,$NfCha
}
}
if(isset($feed_data[$key]['text'])){
$data[$key]['TxSourceURI'] = $feed_data[$key]['link'];
$link = trim($feed_data[$key]['link']);
if(substr($link,0,1)=='#'){
runsql('UPDATE ' . $tbpref . 'feedlinks SET FlLink=' . convert_string_to_sqlsyntax($link) . ' where FlID = ' .substr($link,1) , "");
}
$data[$key]['TxSourceURI'] = $link;
$HTMLString=str_replace (array('>','<'),array('> ',' <'),$feed_data[$key]['text']);//$HTMLString=str_replace (array('>','<'),array('> ',' <'),$HTMLString);
}
else{
$data[$key]['TxSourceURI'] = $feed_data[$key]['link'];
$HTMLString = file_get_contents(trim($data[$key]['TxSourceURI']));
if(!empty($HTMLString)){
$encod = '';
Expand Down

0 comments on commit e68e9f3

Please sign in to comment.