Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

collection_download_process_text_file()

Description

Add resource data/collection_resource data to text file during a collection download.

Parameters

ColumnTypeDefaultDescription
$ref integer
$collection integer
$filename string

Return

void

Location

include/collections_functions.php lines 3537 to 3571

Definition

 
function collection_download_process_text_file($ref$collection$filename)
    {
    global 
$lang$zipped_collection_textfile$includetext$size$subbed_original$k$text$sizetext;

    if ((
$zipped_collection_textfile==true)&&($includetext=="true"))
        {
        if (
$size==""){$sizetext="";}else{$sizetext="-".$size;}
        if (
$subbed_original) { $sizetext '(' $lang['substituted_original'] . ')'; }
        if(
$k === '')
            {
            
$fields get_resource_field_data($ref);
            }
        else
            {
            
// External shares should take into account fields that are not meant to show in that case
            
$fields get_resource_field_data($reffalsetrueNULLtrue);
            }
        
$commentdata=get_collection_resource_comment($ref,$collection);
        if (
count($fields)>0)
            { 
            
$text.= ($sizetext=="" "" $sizetext) ." "$filename"\r\n-----------------------------------------------------------------\r\n";
            
$text.= $lang["resourceid"] . ": " $ref "\r\n";
                for (
$i=0;$i<count($fields);$i++){
                    
$value=$fields[$i]["value"];
                    
$title=str_replace("Keywords - ","",$fields[$i]["title"]);
                    if ((
trim($value)!="")&&(trim($value)!=",")){$text.= wordwrap("* " $title ": " i18n_get_translated($value) . "\r\n"65);}
                }
            if(
trim($commentdata['comment'])!=""){$text.= wordwrap($lang["comment"] . ": " $commentdata['comment'] . "\r\n"65);}    
            if(
trim($commentdata['rating'])!=""){$text.= wordwrap($lang["rating"] . ": " $commentdata['rating'] . "\r\n"65);}   
            
$text.= "-----------------------------------------------------------------\r\n\r\n";    
            }
        }

    return;
    }

This article was last updated 15th July 2020 05:05 Europe/London time based on the source file dated 14th July 2020 15:34 Europe/London time.