function texttodocount2($text)
{
    $c = textwordcount($text) - textworkcount($text);
    if ($c > 0) {
        return '<span title="To Do" class="status0">&nbsp;' . $c . '&nbsp;</span>&nbsp;&nbsp;&nbsp;<input type="button" onclick="iknowall(' . $text . ');" value=" I KNOW ALL " />';
    } else {
        return '<span title="To Do" class="status0">&nbsp;' . $c . '&nbsp;</span>';
    }
}
Example #2
0
<th class="th1 sorttable_numeric clickable">Unkn.<br />Words</th>
<th class="th1 sorttable_numeric clickable">Unkn.<br />%</th>
</tr>

<?php 
        $sql = 'select TxID, TxTitle, LgName, TxAudioURI, TxSourceURI, length(TxAnnotatedText) as annotlen, ifnull(concat(\'[\',group_concat(distinct T2Text order by T2Text separator \', \'),\']\'),\'\') as taglist from ((' . $tbpref . 'texts left JOIN ' . $tbpref . 'texttags ON TxID = TtTxID) left join ' . $tbpref . 'tags2 on T2ID = TtT2ID), ' . $tbpref . 'languages where LgID=TxLgID ' . $wh_lang . $wh_query . ' group by TxID ' . $wh_tag . ' order by ' . $sorts[$currentsort - 1] . ' ' . $limit;
        if ($debug) {
            echo $sql;
        }
        $res = do_mysql_query($sql);
        $showCounts = getSettingWithDefault('set-show-text-word-counts') + 0;
        while ($record = mysql_fetch_assoc($res)) {
            if ($showCounts) {
                flush();
                $txttotalwords = textwordcount($record['TxID']);
                $txtworkedwords = textworkcount($record['TxID']);
                $txtworkedexpr = textexprcount($record['TxID']);
                $txtworkedall = $txtworkedwords + $txtworkedexpr;
                $txttodowords = $txttotalwords - $txtworkedwords;
                $percentunknown = 0;
                if ($txttotalwords != 0) {
                    $percentunknown = round(100 * $txttodowords / $txttotalwords, 0);
                    if ($percentunknown > 100) {
                        $percentunknown = 100;
                    }
                    if ($percentunknown < 0) {
                        $percentunknown = 0;
                    }
                }
            }
            $audio = $record['TxAudioURI'];
Example #3
0
In case this is not legally possible, any entity is granted the
right to use this work for any purpose, without any conditions, 
unless such conditions are required by law.

Developed by J.P. in 2011, 2012.
***************************************************************/
/**************************************************************
Call: ajax_word_counts.php?id=[textid]
Calculating Word Counts, Ajax call in edit_texts.php
***************************************************************/
include "connect.inc.php";
include "settings.inc.php";
include "utilities.inc.php";
$id = $_POST["id"] + 0;
$txttotalwords = textwordcount($id);
$txtworkedwords = textworkcount($id);
$txtworkedexpr = textexprcount($id);
$txtworkedall = $txtworkedwords + $txtworkedexpr;
$txttodowords = $txttotalwords - $txtworkedwords;
$percentunknown = 0;
if ($txttotalwords != 0) {
    $percentunknown = round(100 * $txttodowords / $txttotalwords, 0);
    if ($percentunknown > 100) {
        $percentunknown = 100;
    }
    if ($percentunknown < 0) {
        $percentunknown = 0;
    }
}
$r = array();
$r[] = '<span title="Total">&nbsp;' . $txttotalwords . '&nbsp;</span>';