示例#1
0
}
echo "modulo={$modulo}\ndir={$orderDirection}\n";
$query = "SELECT DISTINCT type from " . $dbname . ".node where type != \"\" ORDER BY type " . $orderDirection;
echo "Q={$query}\n";
$rslt = mysql_query($query, $db);
while ($thisRow = mysql_fetch_assoc($rslt)) {
    $content_type = trim($thisRow['type']);
    //	$content_type="featured_article";
    $currtime = date("M j g:i a");
    fwrite($progress_log, "\n{$content_type} -- {$currtime}\n");
    // Convert all language-neutral nodes to us-en
    $retval = convertNeutralNodesToEnglish($content_type);
    //  Fetch an array of English-language Node Identifiers (nid's) of a given content type
    //  Passing an empty value will fetch ALL published English nodes
    //     $modulo = "EVEN  |  ODD   |   (empty) "   will return, even, odd, or all nodes
    $nodeAry = fetchEnglishNodes($content_type, $modulo);
    //   Translate each English Langauge node into the specified language
    foreach ($nodeAry as $nid) {
        //      $nid = 11419;
        //	$content_type="campaign";
        //  Has the node already been processed?
        $chkQry = "SELECT status from sovee.progress where node=\"" . $nid . "\" AND language=\"" . $to_languages[0] . "\"";
        $chkRslt = mysql_query($chkQry, $db);
        $nodeComplete = 0;
        while ($xrow = mysql_fetch_assoc($chkRslt)) {
            $nodeComplete = $xrow['status'];
        }
        if ($nodeComplete == 0) {
            echo "PROCESSING {$content_type} NODE {$nid}\n\n";
            fwrite($progress_log, "      {$nid}\n");
            $translatedXMLary = translateOneNode($nid, $to_languages, $content_type);
示例#2
0
$token = getSoveeAuthToken();
// Begin main loop
//   Iterate over a list of Drupal content-types
//   then process all English nodes of that type
$query = "SELECT DISTINCT type from " . $dbname . ".node where type != \"\" ORDER BY type ASC";
$rslt = mysql_query($query, $db);
while ($thisRow = mysql_fetch_assoc($rslt)) {
    $content_type = trim($thisRow['type']);
    //	$content_type="page";
    $currtime = date("M j g:i a");
    fwrite($progress_log, "\n{$content_type} -- {$currtime}\n");
    // Convert all language-neutral nodes to us-en
    $retval = convertNeutralNodesToEnglish($content_type);
    //  Fetch an array of English-language Node Identifiers (nid's) of a given content type
    //  Passing an empty value will fetch ALL published English nodes
    $nodeAry = fetchEnglishNodes($content_type);
    //   Translate each English Langauge node into the specified language
    foreach ($nodeAry as $nid) {
        //      $nid = 11419;
        //	$content_type="campaign";
        //  Has the node already been processed?
        $chkQry = "SELECT status from sovee.progress where node=\"" . $nid . "\"";
        $chkRslt = mysql_query($chkQry, $db);
        $nodeComplete = 0;
        while ($xrow = mysql_fetch_assoc($chkRslt)) {
            $nodeComplete = $xrow['status'];
        }
        if ($nodeComplete == 0) {
            echo "PROCESSING {$content_type} NODE {$nid}\n\n";
            fwrite($progress_log, "      {$nid}\n");
            $translatedXMLary = translateOneNode($nid, $to_languages, $content_type);