/**
 * list_podcasts
 * 
 * 
 * 
 * 
 * 
 * 
 */
function get_podcasts($config_layout, $formats = '')
{
    // get layout config from database
    if (empty($config_layout)) {
        $config = get_settings('layout');
        $config_layout = $config['layout'];
    }
    if (is_array($formats)) {
        $formats = "'" . implode("','", $formats) . "'";
    } else {
        $formats = "'mp3','mp4','m4a','m4b','m4p','m4v','mov','aac','pdf'";
    }
    $conn = reader_connect();
    $query = "SELECT\n\t\t\t\t\tarticles.id, \n\t\t\t\t \tarticles.title, \n\t\t\t\t\tarticles.url, \n\t\t\t\t\tarticles.summary,\n\t\t\t\t\tarticles.body,\n\t\t\t\t\tarticles.date_uploaded,\n\t\t\t\t\tarticles.seo_keywords,\n\t\t\t\t\tcategories.title AS category_title, \n\t\t\t\t\tcategories.url AS category_url,\n\t\t\t\t\tcategories.type AS category_type,\n\t\t\t\t\tcategories.summary AS category_summary,\n\t\t\t\t\tcategories.description AS category_description,\n\t\t\t\t\tauthors.name AS author_name, \n\t\t\t\t\tauthors.url AS author_url,\n\t\t\t\t\tattachments.title AS attachment_title, \n\t\t\t\t\tattachments.filename,\n\t\t\t\t\tattachments.ext, \n\t\t\t\t\tattachments.size, \n\t\t\t\t\tattachments.mime\n\t\t\t\tFROM attachments_map \n\t\t\t\t\tLEFT JOIN articles ON attachments_map.article_id = articles.id\n\t\t\t\t\tLEFT JOIN attachments ON attachments_map.attachment_id = attachments.id\n\t\t\t\t\tLEFT JOIN authors ON articles.author_id = authors.id \n\t\t\t\t\tLEFT JOIN categories ON articles.category_id = categories.id \n\t\t\t\tWHERE articles.status = 'P'\n\t\t\t\t\tAND articles.date_uploaded <= NOW()\n\t\t\t\t\tAND attachments.ext IN (" . $formats . ")";
    // category url
    if (isset($_GET['category_id'])) {
        $query .= " AND articles.category_id = " . (int) $_GET['category_id'];
    }
    // sort order
    $query .= " ORDER BY date_uploaded DESC\n\t\t\t\t\tLIMIT 0, " . (int) $config_layout['per_page'];
    $result = $conn->query($query);
    $data = array();
    while ($row = $result->fetch_assoc()) {
        $row = stripslashes_deep($row);
        // do we need a summary?
        if (empty($row['summary']) && $config_layout['list_style'] == 'summary') {
            $row['summary'] = create_summary($row['body']);
        }
        // do we need the full body?
        if ($config_layout['list_style'] != 'full') {
            unset($row['body']);
        } else {
            $row['body'] = convert_relative_urls($row['body']);
        }
        // create links
        $link = $config_layout['url_style'] == 'blog' ? WW_REAL_WEB_ROOT . '/' . date('Y/m/d', strtotime($row['date_uploaded'])) . '/' . $row['url'] . '/' : WW_REAL_WEB_ROOT . '/' . $row['category_url'] . '/' . $row['url'] . '/';
        $row['link'] = $link;
        $row['itunes_link'] = WW_WEB_ROOT . '/download/' . $row['ext'] . '/' . $row['filename'];
        $data[] = $row;
    }
    $result->close();
    return $data;
}
Ejemplo n.º 2
0
    if (!empty($details['summary'])) {
        echo '
		<itunes:subtitle text="' . $details['summary'] . '"/>';
    }
    // itunes summary
    if (!empty($details['description'])) {
        echo '
		<itunes:summary text="' . $details['description'] . '"/>';
    }
    echo '
		<itunes:explicit>no</itunes:explicit>';
}
// loop through content
foreach ($feed_content as $item) {
    $item_title = $item['title'];
    $item_description = empty($item['summary']) ? create_summary($item['body']) : prepare_string($item['summary']);
    $item_body = '';
    // show complete article?
    if (!empty($config['admin']['complete_feed'])) {
        $body_text = "<p><strong>" . $item_description . "</strong></p>";
        $body_text .= strip_inline_styles($item['body']);
        $item_body = "<content:encoded><![CDATA[" . $body_text . "]]></content:encoded>";
    }
    $item_date = date('r', strtotime($item['date_uploaded']));
    // start output to browser
    echo '
		<item>
			<title>' . $item_title . '</title>
			<description>' . $item_description . '</description>
			' . $item_body . '
			<link>' . $item['link'] . '</link>';
Ejemplo n.º 3
0
         draw_export_options($current_session_g["project"]);
         draw_page_bottom();
     }
     break;
     # PRESENT TOOLS MENU.  IN: (none)
 # PRESENT TOOLS MENU.  IN: (none)
 case "tools":
     draw_page_top($page);
     draw_tools_page();
     draw_page_bottom();
     break;
     # PRESENT EXECUTIVE SUMMARY REPORT.  IN: (none)
 # PRESENT EXECUTIVE SUMMARY REPORT.  IN: (none)
 case "summary":
     draw_page_top($page);
     create_summary($project_table);
     draw_page_bottom();
     break;
     # PRINT AUDIT LIST OF DELETED BUG LINKS.  IN: (none)
     # Note, this is currently only accessible via admin, but it should not be particularly sensitive
 # PRINT AUDIT LIST OF DELETED BUG LINKS.  IN: (none)
 # Note, this is currently only accessible via admin, but it should not be particularly sensitive
 case "deletedissues":
     draw_page_top($page);
     parse_xml_file(CT_XML_BUGS_FILE, CT_DROP_HISTORY, "ID", CT_ASCENDING);
     $bug_table =& $xml_array_g;
     # Copy by reference, so don't call parse_xml_file again
     print_deleted_bugs($bug_table);
     draw_page_bottom();
     break;
     # DISPLAY AUDIT TRAIL.  IN: $id