";
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/pdf', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//Word Documents
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/msword', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//Powerpoint Documents
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/vnd.ms-powerpoint', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//Excel Documents
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/vnd.ms-excel', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//Zipped Files
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/zip', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//Rar files
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/x-rar-compressed', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//x-tar files
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/x-tar', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//x-gzip files
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/x-gzip', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//ODS
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/vnd.oasis.opendocument.spreadsheet', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
}
}
//ODF
if ( $files = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'application/vnd.oasis.opendocument.formula', //MIME Type condition
))){
foreach( $files as $file ){ //setup array for more than one file attachment
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage
$file_name_array=explode("/",$file_link);
$file_name=array_reverse($file_name_array); //creates an array out of the url and grabs the filename
$sAttachmentString .= "
";
if(!empty($mp3->post_title)) : //checking to make sure the post title isn't empty
endif;
if(!empty($mp3->post_content)) : //checking to make sure something exists in post_content (description)
endif;
$sAttachmentString .= "";
$sAttachmentString .= "";
$sAttachmentString .= "".$mp3->post_title." - ".$mp3->post_content."";
$sAttachmentString .= "
";
endforeach;
$sAttachmentString .= "
";
endif;
//Video Support flv, mp4, etc. added with 0.2
$videoss = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'video', //MIME Type condition
) );
if (!empty($videoss)) :
$blogg = get_bloginfo('url');
$urlp = $blogg."/wp-content/plugins/auto-attachments";
$sAttachmentString .= "
";
if(!empty($videos->post_title)) : //checking to make sure the post title isn't empty
endif;
if(!empty($videos->post_content)) : //checking to make sure something exists in post_content (description)
endif;
$sAttachmentString .= "";
$sAttachmentString .= "";
$sAttachmentString .= "".$videos->post_title." - ".$videos->post_content."";
$sAttachmentString .= "
";
endforeach;
$sAttachmentString .= "
";
endif;
if (get_option('galeri') == 'yes') {
if ( $galeriresim = get_children(array( //do only if there are attachments of these qualifications
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'image', //MIME Type condition
))){
foreach( $galeriresim as $galerir ){ //setup array for more than one file attachment
$blogg = get_bloginfo('url');
$urlp = $blogg."/wp-content/plugins/auto-attachments";
$file_link = wp_get_attachment_url($galerir->ID); //get the url for linkage
$file_name_array=explode("/",$galrerir_link);
$sAttachmentString .= "