WordPress.org

Plugin Directory


Ignore:
Timestamp:
07/30/08 23:47:09 (6 years ago)
Author:
mark8barnes
Message:
 
Location:
sermon-browser/branches/0.10-0.23
Files:
1 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • sermon-browser/branches/0.10-0.23/dictionary.php

    r57037 r57039  
    33$mdict = array( 
    44    '[filters_form]' => '<?php bb_print_filters() ?>', 
     5    '[tag_cloud]' => '<?php bb_print_tag_clouds() ?>', 
    56    '[sermons_count]' => '<?php bb_print_sermons_count() ?>', 
    67    '[sermons_loop]' => '<?php foreach ($sermons as $sermon): ?><?php $stuff = bb_get_stuff($sermon) ?>', 
     
    2324    '[next_page]' => '<?php bb_print_next_page_link() ?>', 
    2425    '[previous_page]' => '<?php bb_print_prev_page_link() ?>',   
    25     '[podcast_for_search]' => '<?php bb_print_podcast_url() ?>', 
     26    '[podcast_for_search]' => '<?php echo bb_podcast_url() ?>', 
    2627    '[podcast]' => '<?php echo get_option("sb_podcast") ?>', 
     28    '[itunes_podcast]' => '<?php echo str_replace("http://", "itpc://", get_option("sb_podcast")) ?>', 
     29    '[itunes_podcast_for_search]' => '<?php echo str_replace("http://", "itpc://", bb_podcast_url()) ?>', 
    2730    '[podcasticon]' => '<img alt="Subscribe to full podcast" title="Subscribe to full podcast" class="podcasticon" src="<?php echo get_bloginfo("wpurl") ?>/wp-content/plugins/sermonbrowser/icons/podcast.png"/>', 
    2831    '[podcasticon_for_search]' => '<img alt="Subscribe to custom podcast" title="Subscribe to custom podcast" class="podcasticon" src="<?php echo get_bloginfo("wpurl") ?>/wp-content/plugins/sermonbrowser/icons/podcast_custom.png"/>', 
  • sermon-browser/branches/0.10-0.23/frontend.php

    r57037 r57039  
    88// word list for URL building purpose 
    99$wl = array('preacher', 'title', 'date', 'enddate', 'series', 'service', 'sortby', 'dir', 'page', 'sermon_id', 'book', 'stag', 'podcast'); 
    10  
    1110// hooks & filters 
    1211add_action('template_redirect', 'bb_hijack'); 
     
    10099function bb_sermons_filter($content) { 
    101100    global $wpdb, $clr; 
    102     global $wordpressRealPath; 
    103     if (!strstr($content, '[sermons]')) return $content; 
     101    global $wordpressRealPath, $isMe; 
     102    if (!strstr($content, '[sermons]')) {  
     103        $isMe = false; return $content; 
     104    } else { 
     105        $isMe = true; 
     106    } 
    104107    ob_start(); 
    105108     
     
    136139 
    137140function bb_build_url($arr, $clear = false) { 
    138     global $wl, $post; 
    139     $id = ($post->ID) ? $post->ID : $post; 
    140     $sef = substr(get_permalink($id),0,-1); 
     141    global $wl, $post, $pageid, $wpdb; 
     142    if (!$pageid) { 
     143        $pageid = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content = '[sermons]' AND post_status = 'publish' AND post_date < NOW();"); 
     144    } 
     145    $sef = substr(get_permalink($pageid),0,-1); 
    141146    $foo = array_merge((array) $_GET, (array) $_POST, $arr); 
    142147    foreach ($foo as $k => $v) { 
     
    150155 
    151156function bb_print_header() { 
    152     global $sermon_domain; 
     157    global $sermon_domain, $sermompage; 
    153158    $url = get_bloginfo('wpurl'); 
    154159?> 
     
    187192} 
    188193 
    189 function bb_print_podcast_url() { 
    190     echo str_replace(' ', '%20', bb_build_url(array('podcast' => 1))); 
     194function bb_podcast_url() { 
     195    return str_replace(' ', '%20', bb_build_url(array('podcast' => 1))); 
    191196} 
    192197 
     
    414419 
    415420function bb_count_sermons($filter) { 
    416     global $wpdb; 
    417     $default_filter = array( 
    418         'title' => '', 
    419         'preacher' => 0, 
    420         'date' => '', 
    421         'enddate' => '', 
    422         'series' => 0, 
    423         'service' => 0, 
    424         'book' => '', 
    425         'tag' => '', 
    426     );   
    427     $filter = array_merge($default_filter, $filter);     
    428     if ($filter['title'] != '') { 
    429         $cond = "AND (m.title LIKE '%" . mysql_real_escape_string($filter['title']) . "%' OR m.description LIKE '%" . mysql_real_escape_string($filter['title']) . "%' "; 
    430     } 
    431     if ($filter['preacher'] != 0) { 
    432         $cond .= 'AND m.preacher_id = ' . (int) $filter['preacher'] . ' '; 
    433     } 
    434     if ($filter['date'] != '') { 
    435         $cond .= 'AND m.date >= "' . mysql_real_escape_string($filter['date']) . '" '; 
    436     } 
    437     if ($filter['enddate'] != '') { 
    438         $cond .= 'AND m.date <= "' . mysql_real_escape_string($filter['date']) . '" '; 
    439     } 
    440     if ($filter['series'] != 0) { 
    441         $cond .= 'AND m.series_id = ' . (int) $filter['series'] . ' '; 
    442     } 
    443     if ($filter['service'] != 0) { 
    444         $cond .= 'AND m.service_id = ' . (int) $filter['service'] . ' '; 
    445     }        
    446     if ($filter['book'] != '') { 
    447         $cond .= 'AND bs.book_name = "' . mysql_real_escape_string($filter['book']) . '" '; 
    448     } else { 
    449         $bs = "AND bs.order = 0 AND bs.type= 'start' "; 
    450     } 
    451     if ($filter['tag'] != '') { 
    452         $cond .= 'AND t.name LIKE "%' . mysql_real_escape_string($filter['tag']) . '%" '; 
    453     } 
    454     $query = "SELECT DISTINCT m.id  
    455         FROM {$wpdb->prefix}sb_sermons as m  
    456         LEFT JOIN {$wpdb->prefix}sb_preachers as p ON m.preacher_id = p.id  
    457         LEFT JOIN  {$wpdb->prefix}sb_services as s ON m.service_id = s.id  
    458         LEFT JOIN {$wpdb->prefix}sb_series as ss ON m.series_id = ss.id  
    459         LEFT JOIN {$wpdb->prefix}sb_books_sermons as bs ON bs.sermon_id = m.id $bs  
    460         LEFT JOIN {$wpdb->prefix}sb_books as b ON bs.book_name = b.name  
    461         LEFT JOIN {$wpdb->prefix}sb_sermons_tags as st ON st.sermon_id = m.id  
    462         LEFT JOIN {$wpdb->prefix}sb_tags as t ON t.id = st.tag_id  
    463         WHERE 1 = 1 $cond"; 
    464     return count($wpdb->get_results($query)); 
    465 } 
    466  
    467 function bb_get_sermons($filter, $order, $page = 1, $limit = 10) { 
     421    global $wpdb, $sermoncount; 
     422    if (!$sermoncount) { 
     423        $default_filter = array( 
     424            'title' => '', 
     425            'preacher' => 0, 
     426            'date' => '', 
     427            'enddate' => '', 
     428            'series' => 0, 
     429            'service' => 0, 
     430            'book' => '', 
     431            'tag' => '', 
     432        );   
     433        $filter = array_merge($default_filter, $filter);     
     434        if ($filter['title'] != '') { 
     435            $cond = "AND (m.title LIKE '%" . mysql_real_escape_string($filter['title']) . "%' OR m.description LIKE '%" . mysql_real_escape_string($filter['title']). "%' OR t.name LIKE '%" . mysql_real_escape_string($filter['title']) . "%') "; 
     436        } 
     437        if ($filter['preacher'] != 0) { 
     438            $cond .= 'AND m.preacher_id = ' . (int) $filter['preacher'] . ' '; 
     439        } 
     440        if ($filter['date'] != '') { 
     441            $cond .= 'AND m.date >= "' . mysql_real_escape_string($filter['date']) . '" '; 
     442        } 
     443        if ($filter['enddate'] != '') { 
     444            $cond .= 'AND m.date <= "' . mysql_real_escape_string($filter['enddate']) . '" '; 
     445        } 
     446        if ($filter['series'] != 0) { 
     447            $cond .= 'AND m.series_id = ' . (int) $filter['series'] . ' '; 
     448        } 
     449        if ($filter['service'] != 0) { 
     450            $cond .= 'AND m.service_id = ' . (int) $filter['service'] . ' '; 
     451        }        
     452        if ($filter['book'] != '') { 
     453            $cond .= 'AND bs.book_name = "' . mysql_real_escape_string($filter['book']) . '" '; 
     454        } else { 
     455            $bs = "AND bs.order = 0 AND bs.type= 'start' "; 
     456        } 
     457        if ($filter['tag'] != '') { 
     458            $cond .= 'OR t.name LIKE "%' . ($filter['title']) . '%" '; 
     459        } 
     460        $query = "SELECT COUNT(*)  
     461            FROM {$wpdb->prefix}sb_sermons as m  
     462            LEFT JOIN {$wpdb->prefix}sb_preachers as p ON m.preacher_id = p.id  
     463            LEFT JOIN {$wpdb->prefix}sb_services as s ON m.service_id = s.id  
     464            LEFT JOIN {$wpdb->prefix}sb_series as ss ON m.series_id = ss.id  
     465            LEFT JOIN {$wpdb->prefix}sb_books_sermons as bs ON bs.sermon_id = m.id $bs  
     466            LEFT JOIN {$wpdb->prefix}sb_books as b ON bs.book_name = b.name  
     467            LEFT JOIN {$wpdb->prefix}sb_sermons_tags as st ON st.sermon_id = m.id  
     468            LEFT JOIN {$wpdb->prefix}sb_tags as t ON t.id = st.tag_id  
     469            WHERE 1 = 1 $cond "; 
     470        $sermoncount = $wpdb->get_var($query); 
     471    } 
     472    return $sermoncount; 
     473} 
     474 
     475function bb_get_sermons($filter, $order, $page = 1, $limit = 15) { 
    468476    global $wpdb; 
    469477    $default_filter = array( 
     
    487495    $page = (int) $page; 
    488496    if ($filter['title'] != '') { 
    489         $cond = "AND (m.title LIKE '%" . mysql_real_escape_string($filter['title']) . "%' OR m.description LIKE '%" . mysql_real_escape_string($filter['title']) . "%') "; 
     497        $cond = "AND (m.title LIKE '%" . mysql_real_escape_string($filter['title']) . "%' OR m.description LIKE '%" . mysql_real_escape_string($filter['title']). "%' OR t.name LIKE '%" . mysql_real_escape_string($filter['title']) . "%') "; 
    490498    } 
    491499    if ($filter['preacher'] != 0) { 
     
    496504    } 
    497505    if ($filter['enddate'] != '') { 
    498         $cond .= 'AND m.date <= "' . mysql_real_escape_string($filter['date']) . '" '; 
     506        $cond .= 'AND m.date <= "' . mysql_real_escape_string($filter['enddate']) . '" '; 
    499507    } 
    500508    if ($filter['series'] != 0) { 
     
    510518    } 
    511519    if ($filter['tag'] != '') { 
    512         $cond .= 'AND t.name LIKE "%' . mysql_real_escape_string($filter['tag']) . '%" '; 
     520        $cond .= 'OR t.name LIKE "%' . mysql_real_escape_string($filter['title']) . '%" '; 
    513521    } 
    514522    $offset = $limit * ($page - 1); 
     
    523531        FROM {$wpdb->prefix}sb_sermons as m  
    524532        LEFT JOIN {$wpdb->prefix}sb_preachers as p ON m.preacher_id = p.id  
    525         LEFT JOIN  {$wpdb->prefix}sb_services as s ON m.service_id = s.id  
     533        LEFT JOIN {$wpdb->prefix}sb_services as s ON m.service_id = s.id  
    526534        LEFT JOIN {$wpdb->prefix}sb_series as ss ON m.series_id = ss.id  
    527535        LEFT JOIN {$wpdb->prefix}sb_books_sermons as bs ON bs.sermon_id = m.id $bs  
     
    530538        LEFT JOIN {$wpdb->prefix}sb_tags as t ON t.id = st.tag_id  
    531539        WHERE 1 = 1 $cond ORDER BY ". $order['by'] . " " . $order['dir'] . " LIMIT " . $offset . ", " . $limit; 
     540         
    532541    return $wpdb->get_results($query); 
    533542} 
     
    613622                    <td class="field"><input type="text" name="date" id="date" value="<?php echo mysql_real_escape_string($_REQUEST['date']) ?>" /></td> 
    614623                    <td class="fieldname rightcolumn"><?php _e('End date', $sermon_domain) ?></td> 
    615                     <td class="field"><input type="text" name="date" id="enddate" value="<?php echo mysql_real_escape_string($_REQUEST['enddate']) ?>" /></td> 
     624                    <td class="field"><input type="text" name="enddate" id="enddate" value="<?php echo mysql_real_escape_string($_REQUEST['enddate']) ?>" /></td> 
    616625                </tr> 
    617626                <tr> 
  • sermon-browser/branches/0.10-0.23/multi.php

    r57037 r57039  
    1 <a style="font-weight:bold; font-size: 120%" href="<?php echo get_option("sb_podcast") ?>">Subscribe to our podcast</a><br />(automatically downloads <b>all</b> new sermons to your computer, iPod or MP3 player). 
     1<div class="sermon-browser"> 
    22 
    3 <div class="sermon-browser"> 
    43    <h2>Filters</h2>         
     4 
    55    <?php bb_print_filters() ?> 
     6 
     7    <div style="clear:both"><div class="podcastcustom"><a href="<?php echo bb_podcast_url() ?>"><img alt="Subscribe to custom podcast" title="Subscribe to custom podcast" class="podcasticon" src="<?php echo get_bloginfo("wpurl") ?>/wp-content/plugins/sermonbrowser/icons/podcast_custom.png"/></a><span><a href="<?php echo bb_podcast_url() ?>">Subscribe to custom podcast</a></span><br />(new sermons that match this <b>search</b>)</div><div class="podcastall"><a href="<?php echo get_option("sb_podcast") ?>"><img alt="Subscribe to full podcast" title="Subscribe to full podcast" class="podcasticon" src="<?php echo get_bloginfo("wpurl") ?>/wp-content/plugins/sermonbrowser/icons/podcast.png"/></a><span><a href="<?php echo get_option("sb_podcast") ?>">Subscribe to full podcast</a></span><br />(<b>all</b> new sermons)</div> 
     8 
     9</div> 
     10 
    611    <h2>Sermons (<?php bb_print_sermons_count() ?>)</h2>     
     12 
    713    <div class="floatright"><?php bb_print_next_page_link() ?></div> 
     14 
    815    <div class="floatleft"><?php bb_print_prev_page_link() ?></div> 
    9     <div style="clear:both"><a href="<?php bb_print_podcast_url() ?>">Subscribe to a podcast for this search</a><br />(automatically downloads sermons <b>that match this search</b> to your computer, iPod or MP3 player).</div> 
     16 
    1017    <table class="sermons"> 
     18 
    1119    <?php foreach ($sermons as $sermon): ?><?php $stuff = bb_get_stuff($sermon) ?>   
     20 
    1221        <tr> 
     22 
    1323            <td class="sermon-title"><a href="<?php bb_print_sermon_link($sermon) ?>"><?php echo stripslashes($sermon->title) ?></a></td> 
     24 
    1425        </tr> 
     26 
    1527        <tr> 
     28 
    1629            <td class="sermon-passage"><?php $foo = unserialize($sermon->start); $bar = unserialize($sermon->end); echo bb_get_books($foo[0], $bar[0]) ?> (Part of the <a href="<?php bb_print_series_link($sermon) ?>"><?php echo stripslashes($sermon->series) ?></a> series).</td> 
     30 
    1731        </tr> 
     32 
    1833        <tr> 
     34 
    1935            <td class="files"><?php foreach ((array) $stuff["Files"] as $file): ?><?php bb_print_file($file) ?><?php endforeach ?></td> 
     36 
    2037        </tr> 
     38 
    2139        <tr> 
     40 
    2241            <td class="urls"><?php foreach ((array) $stuff["URLs"] as $url): ?><?php bb_print_url($url) ?><?php endforeach ?></td> 
     42 
    2343        </tr> 
     44 
    2445        <tr> 
     46 
    2547            <td class="embed"><?php foreach ((array) $stuff["Code"] as $code): ?><?php bb_print_code($code) ?><?php endforeach ?></td> 
     48 
    2649        </tr> 
     50 
    2751        <tr> 
     52 
    2853            <td class="preacher">Preached by <a href="<?php bb_print_preacher_link($sermon) ?>"><?php echo stripslashes($sermon->preacher) ?></a> on <?php echo date("j F Y", strtotime($sermon->date)) ?> (<a href="<?php bb_print_service_link($sermon) ?>"><?php echo stripslashes($sermon->service) ?></a>).</td> 
     54 
    2955        </tr> 
     56 
    3057    <?php endforeach ?> 
     58 
    3159    </table> 
     60 
    3261    <div class="floatright"><?php bb_print_next_page_link() ?></div> 
     62 
    3363    <div class="floatleft"><?php bb_print_prev_page_link() ?></div> 
     64 
     65    <div id="poweredbysermonbrowser">Powered by <a href="http://www.4-14.org.uk/sermon-browser">Sermon Browser</a></div> 
     66 
    3467</div> 
  • sermon-browser/branches/0.10-0.23/readme.txt

    r57037 r57039  
    154154* [podcast] - Link to the podcast of all sermons 
    155155* [podcast_for_search] - Link to the podcast of sermons that match the current search 
     156* [itunes_podcast] - iTunes (itpc://) link to the podcast of all sermons 
     157* [itunes_podcast_for_search] - iTunes (itpc://) link to the podcast of sermons that match the current search 
    156158* [podcasticon] - Displays the icon used for the main podcast 
    157159* [podcasticon_for_search] - Displays the icon used for the custom podcast 
  • sermon-browser/branches/0.10-0.23/sermon.php

    r57037 r57039  
    55Description: Add sermons to your Wordpress blog. Coding by <a href="http://codeandmore.com/">Tien Do Xuan</a>. Design  
    66Author: Mark Barnes 
    7 Version: 0.2 
     7Version: 0.21 
    88Author URI: http://www.4-14.org.uk/ 
    99 
     
    127127            } else {                 
    128128                $oname = mysql_real_escape_string($_POST['oname']);  
    129                 if ($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sb_stuff WHERE name = '$fname'") == 0 && rename($wordpressRealPath.get_option('sb_sermon_upload_dir').$oname, $wordpressRealPath.get_option('sb_sermon_upload_dir').$fname)) { 
     129                if ( !is_writable($wordpressRealPath.get_option('sb_sermon_upload_dir').$fname) && rename($wordpressRealPath.get_option('sb_sermon_upload_dir').$oname, $wordpressRealPath.get_option('sb_sermon_upload_dir').$fname)) { 
    130130                    $wpdb->query("UPDATE {$wpdb->prefix}sb_stuff SET name = '$fname' WHERE id = $fid;"); 
    131131                    echo 'renamed'; 
     
    146146            $cond .= 'and m.series_id = ' . (int) $_POST['series'] . ' '; 
    147147        } 
    148         $m = $wpdb->get_results("SELECT m.id, m.title, m.date, p.name as pname, s.name as sname, ss.name as ssname FROM {$wpdb->prefix}sb_sermons as m, {$wpdb->prefix}sb_preachers as p, {$wpdb->prefix}sb_services as s, {$wpdb->prefix}sb_series as ss where m.preacher_id = p.id and m.service_id = s.id and m.series_id = ss.id $cond ORDER BY m.title asc LIMIT $st, 15;");    
     148        $m = $wpdb->get_results("SELECT m.id, m.title, m.date, p.name as pname, s.name as sname, ss.name as ssname FROM {$wpdb->prefix}sb_sermons as m, {$wpdb->prefix}sb_preachers as p, {$wpdb->prefix}sb_services as s, {$wpdb->prefix}sb_series as ss where m.preacher_id = p.id and m.service_id = s.id and m.series_id = ss.id $cond ORDER BY m.date desc, s.time desc LIMIT $st, 15;"); 
     149        $cnt = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sb_sermons as m, {$wpdb->prefix}sb_preachers as p, {$wpdb->prefix}sb_services as s, {$wpdb->prefix}sb_series as ss where m.preacher_id = p.id and m.service_id = s.id and m.series_id = ss.id $cond;");   
     150         
    149151?> 
    150152        <?php foreach ($m as $sermon): ?>                    
    151153            <tr class="<?php echo ++$i % 2 == 0 ? 'alternate' : '' ?>"> 
    152154                <th style="text-align:center" scope="row"><?php echo $sermon->id ?></th> 
    153                 <td><?php echo $sermon->title ?></td> 
    154                 <td><?php echo $sermon->pname ?></td> 
    155                 <td><?php echo $sermon->date ?></td> 
    156                 <td><?php echo $sermon->sname ?></td> 
    157                 <td><?php echo $sermon->ssname ?></td> 
     155                <td><?php echo stripslashes($sermon->title) ?></td> 
     156                <td><?php echo stripslashes($sermon->pname) ?></td> 
     157                <td><?php echo stripslashes($sermon->date) ?></td> 
     158                <td><?php echo stripslashes($sermon->sname) ?></td> 
     159                <td><?php echo stripslashes($sermon->ssname) ?></td> 
    158160                <td style="text-align:center"> 
    159161                    <a href="<?php echo $url ?>/wp-admin/admin.php?page=sermonbrowser/new_sermon.php&mid=<?php echo $sermon->id ?>"><?php _e('Edit', $sermon_domain) ?></a> | <a onclick="return confirm('Are you sure?')" href="<?php echo $url ?>/wp-admin/admin.php?page=sermonbrowser/sermon.php&mid=<?php echo $sermon->id ?>"><?php _e('Delete', $sermon_domain) ?></a> 
     
    161163            </tr> 
    162164        <?php endforeach ?> 
     165<script type="text/javascript"> 
     166<?php if($cnt<15 || $cnt <= $st+15): ?> 
     167    jQuery('#right').css('display','none'); 
     168    <?php elseif($cnt > $st+15): ?> 
     169    jQuery('#right').css('display',''); 
     170<?php endif ?> 
     171 
     172     
     173 
     174</script> 
    163175<?php 
    164176    } elseif ($_POST['fetchU'] || $_POST['fetchL'] || $_POST['search']) { // ajax pagination (uploads) 
     
    177189        <?php 
    178190        // sync db & upload dir 
    179         $wanted = array(-1); 
     191        /*$wanted = array(-1); 
    180192        foreach ((array) $abc as $k => $file) { 
    181193            if (!file_exists($wordpressRealPath.get_option('sb_sermon_upload_dir').$file->name)) { 
     
    183195                unset($abc[$k]); 
    184196            }            
    185         } 
     197        }*/ 
    186198        //$wpdb->query("DELETE FROM {$wpdb->prefix}sb_stuff WHERE id IN (".implode(', ', (array) $wanted).")"); 
    187199        ?> 
     
    206218                    } 
    207219                    </script> 
    208                         <a id="link<?php echo $file->id ?>" href="javascript:rename(<?php echo $file->id ?>, '<?php echo $file->name ?>')"><?php _e('Rename', $sermon_domain) ?></a> | <a onclick="return deletelinked_<?php echo $file->id;?>('<?php echo str_replace("'", '', $file->name) ?>', '<?php echo str_replace("'", '', $file->title) ?>');" href="javascript:kill(<?php echo $file->id ?>, '<?php echo $file->name ?>');"><?php _e('Delete', $sermon_domain) ?></a>  
     220                    <?php if (is_writable($wordpressRealPath.get_option('sb_sermon_upload_dir').$file->name)): ?> 
     221                        <a id="link<?php echo $file->id ?>" href="javascript:rename(<?php echo $file->id ?>, '<?php echo $file->name ?>')"><?php _e('Rename', $sermon_domain) ?></a> | <a onclick="return deletelinked_<?php echo $file->id;?>('<?php echo str_replace("'", '', $file->name) ?>', '<?php echo str_replace("'", '', $file->title) ?>');" href="javascript:kill(<?php echo $file->id ?>, '<?php echo $file->name ?>');"><?php _e('Delete', $sermon_domain) ?></a> 
     222                    <?php endif ?>    
    209223                </td> 
    210224            </tr> 
     
    268282    <div class="floatleft">[previous_page]</div> 
    269283    [creditlink] 
    270 </div></div>HERE; 
     284</div> 
     285HERE; 
    271286    $barz = <<<HERE 
    272287<div class="sermon-browser-results"> 
    273     <h2>[sermon_title] <span class="scripture">[passages_loop][passage] [/passages_loop]</span></h2> 
    274     <span style="font-size: 120%">[preacher_link], [date]</span><br /> 
     288    <h2>[sermon_title] <span class="scripture">([passages_loop][passage] [/passages_loop])</span></h2> 
     289    <span class="preacher">[preacher_link], [date]</span><br /> 
    275290    Part of the [series_link] series, preached at a [service_link] service<br /> 
    276291    Tags: [tags]<br /> 
     
    300315    [creditlink] 
    301316</div> 
    302         HERE; 
     317HERE; 
    303318 
    304319$defaultStyle = <<<HERE 
     
    309324div.sermon-browser table.sermons { 
    310325    width: 100%; 
     326    clear:both; 
    311327} 
    312328 
     
    398414} 
    399415 
     416div.sermon-browser-results span.preacher { 
     417    font-size: 120%; 
     418} 
     419 
     420div.sermon-browser-results span.scripture { 
     421    font-size: 80%; 
     422} 
     423 
    400424div.esv span.chapter-num { 
    401425    font-weight: bold; 
     
    409433} 
    410434 
    411 #poweredbysermonbrowser { 
    412     float:right; 
     435div.sermon-browser #poweredbysermonbrowser { 
     436    text-align:center; 
     437} 
     438div.sermon-browser-results #poweredbysermonbrowser { 
     439    text-align:right; 
     440} 
     441 
     442table.nearby-sermons { 
     443    width: 100%; 
     444} 
     445 
     446table.nearby-sermons td, table.nearby-sermons th { 
     447    text-align: center; 
     448} 
     449 
     450table.nearby-sermons .earlier { 
     451    padding-right: 1em; 
     452    text-align: left; 
     453} 
     454 
     455table.nearby-sermons .later { 
     456    padding-left: 1em; 
     457    text-align:right; 
     458} 
     459 
     460table.nearby-sermons td { 
     461    width: 33%; 
     462    vertical-align: top; 
     463} 
     464 
     465ul.sermon-widget { 
     466    list-style-type:none; 
     467    margin:0; 
     468    padding: 0; 
     469} 
     470 
     471ul.sermon-widget li { 
     472    list-style-type:none; 
     473    margin:0; 
     474    padding: 0.25em 0; 
     475} 
     476 
     477ul.sermon-widget li span.sermon-title{ 
     478    font-weight:bold; 
    413479} 
    414480HERE; 
    415481   $defaultMultiForm = $fooz; $defaultSingleForm = $barz; 
    416     
    417     if (get_option('sb_sermon_db_version') == '1.2') { 
    418         return; 
    419     } 
     482   add_option('sb_sermon_style', base64_encode($defaultStyle)); 
     483 
    420484    
    421485   $sermonUploadDir = $defaultSermonPath; 
     
    429493      } 
    430494   } 
    431  
     495if(!is_dir($wordpressRealPath.$sermonUploadDir.'images') && @mkdir($wordpressRealPath.$sermonUploadDir.'images')){ 
     496         @chmod($wordpressRealPath.$sermonUploadDir.'images', 0777); 
     497       } 
    432498    switch (get_option('sb_sermon_db_version')) { 
    433499        case '1.0': 
     
    453519        case '1.1': 
    454520            add_option('sb_sermon_style', base64_encode($defaultStyle)); 
     521    if(!is_dir($wordpressRealPath.$sermonUploadDir.'images') && @mkdir($wordpressRealPath.$sermonUploadDir.'images')){ 
     522         @chmod($wordpressRealPath.$sermonUploadDir.'images', 0777); 
     523       } 
    455524            update_option('sb_sermon_db_version', '1.2');    
    456525            return; 
     
    624693function bb_add_pages() { 
    625694    global $sermon_domain; 
    626     add_menu_page(__('Sermons', $sermon_domain), __('Sermons', $sermon_domain), 8, __FILE__, 'bb_manage_sermons'); 
    627     add_submenu_page(__FILE__, __('Sermons', $sermon_domain), __('Sermons', $sermon_domain), 8, __FILE__, 'bb_manage_sermons'); 
    628     add_submenu_page(__FILE__, __('New Sermon', $sermon_domain), __('New Sermon', $sermon_domain), 8, 'sermonbrowser/new_sermon.php', 'bb_new_sermon'); 
    629     add_submenu_page(__FILE__, __('Preachers', $sermon_domain), __('Preachers', $sermon_domain), 8, 'sermonbrowser/preachers.php', 'bb_manage_preachers'); 
    630     add_submenu_page(__FILE__, __('Series &amp; Services', $sermon_domain), __('Series &amp; Services', $sermon_domain), 8, 'sermonbrowser/manage.php', 'bb_manage_everything'); 
    631     add_submenu_page(__FILE__, __('Uploads', $sermon_domain), __('Uploads', $sermon_domain), 8, 'sermonbrowser/uploads.php', 'bb_uploads'); 
    632     add_submenu_page(__FILE__, __('Options', $sermon_domain), __('Options', $sermon_domain), 8, 'sermonbrowser/options.php', 'bb_options'); 
    633     add_submenu_page(__FILE__, __('Help', $sermon_domain), __('Help', $sermon_domain), 8, 'sermonbrowser/help.php', 'bb_help'); 
     695    add_menu_page(__('Sermons', $sermon_domain), __('Sermons', $sermon_domain), 'edit_posts', __FILE__, 'bb_manage_sermons'); 
     696    add_submenu_page(__FILE__, __('Sermons', $sermon_domain), __('Sermons', $sermon_domain), 'edit_posts', __FILE__, 'bb_manage_sermons'); 
     697    add_submenu_page(__FILE__, __('New Sermon', $sermon_domain), __('New Sermon', $sermon_domain), 'publish_posts', 'sermonbrowser/new_sermon.php', 'bb_new_sermon'); 
     698    add_submenu_page(__FILE__, __('Preachers', $sermon_domain), __('Preachers', $sermon_domain), 'manage_categories', 'sermonbrowser/preachers.php', 'bb_manage_preachers'); 
     699    add_submenu_page(__FILE__, __('Series &amp; Services', $sermon_domain), __('Series &amp; Services', $sermon_domain), 'manage_categories', 'sermonbrowser/manage.php', 'bb_manage_everything'); 
     700    add_submenu_page(__FILE__, __('Uploads', $sermon_domain), __('Uploads', $sermon_domain), 'upload_files', 'sermonbrowser/uploads.php', 'bb_uploads'); 
     701    add_submenu_page(__FILE__, __('Options', $sermon_domain), __('Options', $sermon_domain), 'manage_options', 'sermonbrowser/options.php', 'bb_options'); 
     702    add_submenu_page(__FILE__, __('Help', $sermon_domain), __('Help', $sermon_domain), 'read', 'sermonbrowser/help.php', 'bb_help'); 
    634703} 
    635704 
     
    659728             @chmod($wordpressRealPath.$dir, 0777);  
    660729          } 
    661         }            
     730        } 
     731        if(!is_dir($wordpressRealPath.$sermonUploadDir.'images') && @mkdir($wordpressRealPath.$sermonUploadDir.'images')){ 
     732         @chmod($wordpressRealPath.$sermonUploadDir.'images', 0777); 
     733       }             
    662734        $checkSermonUpload = checkSermonUploadable(); 
    663735        switch ($checkSermonUpload) { 
     
    690762             @chmod($wordpressRealPath.$dir, 0777);  
    691763          } 
    692         }            
     764        } 
     765    if(!is_dir($wordpressRealPath.$dir.'images') && @mkdir($wordpressRealPath.$sermonUploadDir.'images')){ 
     766         @chmod($wordpressRealPath.$dir.'images', 0777); 
     767       }             
    693768        $checkSermonUpload = checkSermonUploadable(); 
    694769        switch ($checkSermonUpload) { 
     
    796871        $table_name = $wpdb->prefix."sb_stuff"; 
    797872        if ($wpdb->get_var("show tables like '$table_name'") == $table_name) $wpdb->query("DROP TABLE $table_name"); 
     873         
    798874        delete_option('sb_sermon_upload_dir'); 
    799875        delete_option('sb_sermon_upload_url'); 
    800876        delete_option('sb_sermon_single_form'); 
    801877        delete_option('sb_sermon_multi_form'); 
    802          
     878        delete_option('sb_podcast'); 
     879        delete_option('sb_sermon_db_version'); 
     880        delete_option('sb_sermon_style'); 
    803881        echo '<div id="message" class="updated fade"><p><b>'.__('Uninstall completed. Please deactivate the plugin', $sermon_domain).'</b></div>'; 
    804882    } 
     
    890968            <li><a href="#poweredby">Can I turn off the "Powered by Sermonbrowser" link?</a></li> 
    891969            <li><a href="#publicprivate">What is the difference between the public and private podcast feeds?</a></li> 
    892             <li><a href="#differentpodcasts">On the sermons page, what is the difference between subscribing to our podcast, and subscribing to a podcast for this search?</a></li> 
     970            <li><a href="#differentpodcasts">On the sermons page, what is the difference between subscribing to <b>full</b> podcast, and subscribing to a <b>custom</b> podcast?</a></li> 
     971            <li><a href="#itunes">Why doesn't iTunes recognise the podcast links?</a></li> 
    893972            <li><a href="#sortorder">Can I change the default sort order of the sermons?</a></li> 
    894973            <li><a href="#pagenotfound">Why do I get a page not found error when I click on my podcast feed?</a></li> 
     
    9351014        <h4 id="differentpodcasts">On the sermons page, what is the difference between subscribing to our podcast, and subscribing to a podcast for this search?</h4> 
    9361015        <p>The link called <strong>subscribe to full podcast</strong> gives a podcast of <em>all</em> sermons that you add to your site through SermonBrowser. But it may be that some people may just want to subscribe to a feed for certain speakers, or for a certain service. If they wish to do this, they should set the search filters and perform their search, then click on the <strong>Subscribe to custom podcast </strong>link. This will give them a podcast according to the filter they selected. You could also copy this link, and display it elsewhere on the site - for example to provide separate feeds for morning and evening services.</p> 
     1016        <h4 id="iTunes">Why doesn't iTunes recognise the podcast links?</h4> 
     1017        <p>iTunes requires its own special links that are slightly different from other podcasting software. If you would like to display these links, you need to edit your template and add the tags [itunes_podcast] and [itunes_podcast_for_search].</p> 
    9371018        <h4 id="sortorder">Can I change the default sort order of the sermons?</h4> 
    9381019        <p>Unfortunately not. Unless the viewer specified otherwise, Sermonbrowser always displays the most recent sermons at the top.</p> 
     
    9621043            <li><b>[podcast]</b> - Link to the podcast of all sermons</li> 
    9631044            <li><b>[podcast_for_search]</b> - Link to the podcast of sermons that match the current search</li> 
     1045            <li><b>[itunes_podcast]</b> - iTunes (itpc://) link to the podcast of all sermons</li> 
     1046            <li><b>[itunes_podcast_for_search]</b> - iTunes (itpc://) link to the podcast of sermons that match the current search</li> 
    9641047            <li><b>[podcasticon]</b> - Displays the icon used for the main podcast</li> 
    9651048            <li><b>[podcasticon_for_search]</b> - Displays the icon used for the custom podcast</li> 
     
    10181101            $filename = basename($_FILES['upload']['name']); 
    10191102            $prefix = ''; 
    1020             $dest = $wordpressRealPath.'/wp-content/plugins/sermonbrowser/preachers/'.$filename; 
     1103            $dest = $wordpressRealPath.get_option('sb_sermon_upload_dir').'images/'.$filename; 
    10211104            if (move_uploaded_file($_FILES['upload']['tmp_name'], $dest)) { 
    10221105                $filename = $prefix.mysql_real_escape_string($filename); 
     
    10281111        } else { 
    10291112            $wpdb->query("UPDATE {$wpdb->prefix}sb_preachers SET name = '$name', description = '$description', image = '$filename' WHERE id = $pid"); 
    1030             if ($_POST['old'] != $filename || isset($_POST['remove'])) { 
    1031                 @unlink($wordpressRealPath.'/wp-content/plugins/sermonbrowser/preachers/'.mysql_real_escape_string($_POST['old'])); 
     1113            if ($_POST['old'] != $filename) { 
     1114                @unlink($wordpressRealPath.get_option('sb_sermon_upload_dir').'images/'.mysql_real_escape_string($_POST['old'])); 
    10321115            }            
     1116        } 
     1117        if(isset($_POST['remove'])){ 
     1118            $wpdb->query("UPDATE {$wpdb->prefix}sb_preachers SET name = '$name', description = '$description', image = '' WHERE id = $pid"); 
     1119            @unlink($wordpressRealPath.get_option('sb_sermon_upload_dir').'images/'.mysql_real_escape_string($_POST['old'])); 
    10331120        } 
    10341121        echo "<script>document.location = '$url/wp-admin/admin.php?page=sermonbrowser/preachers.php&saved=true';</script>"; 
     
    10411128        }else { 
    10421129            $p = $wpdb->get_row("SELECT image FROM {$wpdb->prefix}sb_preachers WHERE id = $die"); 
    1043             @unlink($wordpressRealPath.'/wp-content/plugins/sermonbrowser/preachers/'.$p->image); 
     1130            @unlink($wordpressRealPath.get_option('sb_sermon_upload_dir').'images/'.$p->image); 
    10441131            $wpdb->query("DELETE FROM {$wpdb->prefix}sb_preachers WHERE id = $die"); 
    10451132        } 
     
    10741161                    <td> 
    10751162                        <?php if ($_GET['act'] == 'edit'): ?> 
    1076                         <div><img src="<?php echo $url ?>/wp-content/plugins/sermonbrowser/preachers/<?php echo $preacher->image ?>"></div> 
     1163                        <div><img src="<?php echo $url ?><?php echo get_option('sb_sermon_upload_dir').'images/'.$preacher->image ?>"></div> 
    10771164                        <input type="hidden" name="old" value="<?php echo $preacher->image ?>"> 
    10781165                        <?php endif ?> 
     
    11111198                        <td><?php echo $preacher->id ?></td> 
    11121199                        <td><?php echo stripslashes($preacher->name) ?></td> 
    1113                         <td><img src="<?php echo empty($preacher->image) ? '' : $url.'/wp-content/plugins/sermonbrowser/preachers/'.$preacher->image ?>"></td> 
     1200                        <td><img src="<?php echo empty($preacher->image) ? '' : $url.get_option('sb_sermon_upload_dir').'images/'.$preacher->image ?>"></td> 
    11141201                        <td align="center"> 
    11151202                            <a href="<?php echo $url ?>/wp-admin/admin.php?page=sermonbrowser/preachers.php&act=edit&pid=<?php echo $preacher->id ?>"><?php _e('Edit', $sermon_domain) ?></a> | <a onclick="return confirm('Are you sure?')" href="<?php echo $url ?>/wp-admin/admin.php?page=sermonbrowser/preachers.php&act=kill&pid=<?php echo $preacher->id ?>"><?php _e('Delete', $sermon_domain) ?></a> 
     
    13301417    global $wpdb, $filetypes, $sermon_domain; 
    13311418    global $wordpressRealPath; 
    1332     ini_set('max_input_time','300'); 
     1419    ini_set('max_input_time','600'); 
    13331420    // sync 
    13341421    bb_scan_dir(); 
     
    13591446    if($_POST['clean']) { 
    13601447        // sync (but different from last time) 
     1448        $unlinked = $wpdb->get_results("SELECT f.*, s.title FROM {$wpdb->prefix}sb_stuff AS f LEFT JOIN {$wpdb->prefix}sb_sermons AS s ON f.sermon_id = s.id WHERE f.sermon_id = 0 AND f.type = 'file' ORDER BY f.name;"); 
     1449        $linked = $wpdb->get_results("SELECT f.*, s.title FROM {$wpdb->prefix}sb_stuff AS f LEFT JOIN {$wpdb->prefix}sb_sermons AS s ON f.sermon_id = s.id WHERE f.sermon_id <> 0 AND f.type = 'file' ORDER BY f.name;"); 
    13611450        $wanted = array(-1); 
    13621451     
     
    23332422    if ($dh = @opendir($dir)) { 
    23342423        while (false !== ($file = readdir($dh))) { 
    2335             if ($file != "." && $file != ".." && is_dir($file) && !in_array($file, $bnn)) {              
     2424            if ($file != "." && $file != ".." && !is_dir($dir.$file) && !in_array($file, $bnn)) {                
    23362425                $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$file', 0);"); 
    23372426            }    
  • sermon-browser/branches/0.10-0.23/single.php

    r57037 r57039  
    11<div class="sermon-browser-results"> 
    2     <h2><?php echo stripslashes($sermon["Sermon"]->title) ?> <span style="font-size: 80%"><?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): ?><?php echo bb_get_books($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i]) ?><?php endfor ?></h2> 
    3     <span style="font-size: 120%"><a href="<?php bb_print_preacher_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->preacher) ?></a>, <?php echo date("j F Y", strtotime($sermon["Sermon"]->date)) ?></span><br /> 
     2 
     3    <h2><?php echo stripslashes($sermon["Sermon"]->title) ?> <span class="scripture">(<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): ?><?php echo bb_get_books($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i]) ?> <?php endfor ?>)</span></h2> 
     4 
     5    <span class="preacher"><a href="<?php bb_print_preacher_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->preacher) ?></a>, <?php echo date("j F Y", strtotime($sermon["Sermon"]->date)) ?></span><br /> 
     6 
    47    Part of the <a href="<?php bb_print_series_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->series) ?></a> series, preached at a <a href="<?php bb_print_service_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->service) ?></a> service<br /> 
     8 
    59    Tags: <?php bb_print_tags($sermon["Tags"]) ?><br /> 
     10 
    611    <?php foreach ((array) $sermon["Files"] as $file): ?>    
     12 
    713        <?php bb_print_file($file) ?>   
     14 
    815    <?php endforeach ?> 
     16 
    917    <?php foreach ((array) $sermon["URLs"] as $url): ?> 
     18 
    1019        <?php bb_print_url($url) ?>   
     20 
    1121    <?php endforeach ?> 
     22 
    1223    <?php foreach ((array) $sermon["Code"] as $code): ?> 
     24 
    1325        <br /><?php bb_print_code($code) ?><br /> 
     26 
    1427    <?php endforeach ?> 
     28 
    1529    <br />   
    16     <b>Other sermons preached at a similar time:</b> 
    17     <ul> 
    18         <li>Earlier: <?php bb_print_prev_sermon_link($sermon["Sermon"]) ?></li> 
    19         <li>Same day: <?php bb_print_sameday_sermon_link($sermon["Sermon"]) ?></li> 
    20         <li>Later: <?php bb_print_next_sermon_link($sermon["Sermon"]) ?></li> 
    21     </ul> 
     30 
     31    <table class="nearby-sermons"> 
     32 
     33        <tr> 
     34 
     35            <th class="earlier">Earlier:</th> 
     36 
     37            <th>Same day:</th> 
     38 
     39            <th class="later">Later:</th> 
     40 
     41        </tr> 
     42 
     43        <tr> 
     44 
     45            <td class="earlier"><?php bb_print_prev_sermon_link($sermon["Sermon"]) ?></td> 
     46 
     47            <td><?php bb_print_sameday_sermon_link($sermon["Sermon"]) ?></td> 
     48 
     49            <td class="later"><?php bb_print_next_sermon_link($sermon["Sermon"]) ?></td> 
     50 
     51        </tr> 
     52 
     53    </table> 
     54 
    2255    <?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo add_esv_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i]); endfor ?> 
     56 
     57    <div id="poweredbysermonbrowser">Powered by <a href="http://www.4-14.org.uk/sermon-browser">Sermon Browser</a></div> 
     58 
    2359</div> 
  • sermon-browser/branches/0.10-0.23/style.css

    r57037 r57039  
    11.sermon-browser h2 { 
     2 
    23    clear: both; 
    3 } 
     4 
     5} 
     6 
     7 
     8 
     9div.sermon-browser table.sermons { 
     10 
     11    width: 100%; 
     12 
     13    clear:both; 
     14 
     15} 
     16 
     17 
    418 
    519div.sermon-browser table.sermons td.sermon-title { 
     20 
    621    font-weight:bold; 
     22 
    723    font-size: 140%; 
     24 
    825    padding-top: 2em; 
    9 } 
     26 
     27} 
     28 
     29 
    1030 
    1131div.sermon-browser table.sermons td.sermon-passage { 
     32 
    1233    font-weight:bold; 
     34 
    1335    font-size: 110%; 
    14 } 
     36 
     37} 
     38 
     39 
    1540 
    1641div.sermon-browser table.sermons td.preacher { 
     42 
    1743    border-bottom: 1px solid #444444; 
    18 } 
     44 
     45} 
     46 
     47 
    1948 
    2049div.sermon-browser table.sermons td.files img { 
     50 
    2151    border: none; 
     52 
    2253    margin-right: 24px; 
    23 } 
     54 
     55} 
     56 
     57 
    2458 
    2559table.sermonbrowser td.fieldname { 
     60 
    2661    font-weight:bold; 
     62 
    2763    padding-right: 10px; 
     64 
    2865    vertical-align:bottom; 
    29 } 
     66 
     67} 
     68 
     69 
    3070 
    3171table.sermonbrowser td.field input, table.sermonbrowser td.field select{ 
     72 
    3273    width: 170px; 
    33 } 
     74 
     75} 
     76 
     77 
    3478 
    3579table.sermonbrowser td.field  #date, table.sermonbrowser td.field #enddate { 
    36     width: 150px; /* This width should be 20 pixels less than the width above */ 
    37 } 
     80 
     81    width: 150px; 
     82 
     83} 
     84 
     85 
    3886 
    3987table.sermonbrowser td { 
     88 
    4089    white-space: nowrap; 
     90 
    4191    padding-top: 5px; 
     92 
    4293    padding-bottom: 5px; 
    43 } 
     94 
     95} 
     96 
     97 
    4498 
    4599table.sermonbrowser td.rightcolumn { 
     100 
    46101    padding-left: 10px; 
    47 } 
     102 
     103} 
     104 
     105 
    48106 
    49107div.sermon-browser div.floatright { 
     108 
    50109    float: right 
    51 } 
     110 
     111} 
     112 
     113 
    52114 
    53115div.sermon-browser div.floatleft { 
     116 
    54117    float: left 
    55 } 
    56  
    57 img.sermon-icon , img.site-icon{ 
     118 
     119} 
     120 
     121 
     122 
     123img.sermon-icon , img.site-icon { 
     124 
    58125    border: none; 
    59 } 
    60  
    61 div.esv span.chapter-num, div.ebSnippet-title, div.chapterHeading, div.paragraphHeading { 
     126 
     127} 
     128 
     129 
     130 
     131div.podcastall { 
     132 
     133    float:left; 
     134 
     135    border: 2px solid #FC9328; 
     136 
     137    background: #fff0c8 url(icons/podcast_background.png) repeat-x; 
     138 
     139    padding: 0.3em; 
     140 
     141} 
     142 
     143 
     144 
     145div.podcastall img.podcasticon, div.podcastcustom img.podcasticon { 
     146 
     147    float:left; 
     148 
     149    margin-right: 1em; 
     150 
     151    border: none; 
     152 
     153} 
     154 
     155 
     156 
     157div.podcastall span a{ 
     158 
     159    color: #FC9328; 
     160 
    62161    font-weight: bold; 
     162 
     163    font-size:125%; 
     164 
     165} 
     166 
     167 
     168 
     169div.podcastcustom { 
     170 
     171    float:right; 
     172 
     173    border: 2px solid #b83ee5; 
     174 
     175    background: #fce4ff url(icons/podcast_custom_background.png) repeat-x; 
     176 
     177    padding: 0.3em; 
     178 
     179} 
     180 
     181div.podcastcustom span a{ 
     182 
     183    color: #b83ee5; 
     184 
     185    font-weight: bold; 
     186 
     187    font-size:125%; 
     188 
     189} 
     190 
     191 
     192 
     193div.sermon-browser-results span.preacher { 
     194 
     195    font-size: 120%; 
     196 
     197} 
     198 
     199 
     200 
     201div.sermon-browser-results span.scripture { 
     202 
     203    font-size: 80%; 
     204 
     205} 
     206 
     207 
     208 
     209div.esv span.chapter-num { 
     210 
     211    font-weight: bold; 
     212 
    63213    font-size: 150%; 
    64     margin: 0.75em 0; 
    65 } 
    66  
    67 div.esv span.verse-num, span.verseNum { 
     214 
     215} 
     216 
     217 
     218 
     219div.esv span.verse-num { 
     220 
    68221    vertical-align:super; 
     222 
    69223    line-height: 1em; 
     224 
    70225    font-size: 65%; 
    71 } 
     226 
     227} 
     228 
     229 
     230 
     231div.sermon-browser #poweredbysermonbrowser { 
     232 
     233    text-align:center; 
     234 
     235} 
     236 
     237div.sermon-browser-results #poweredbysermonbrowser { 
     238 
     239    text-align:right; 
     240 
     241} 
     242 
     243 
    72244 
    73245table.nearby-sermons { 
    74     width:100% 
    75 } 
    76  
    77 table.nearby-sermons th { 
    78     font-weight: bold; 
    79 } 
    80  
    81 table.nearby-sermons th, table.nearby-sermons td { 
     246 
     247    width: 100%; 
     248 
     249} 
     250 
     251 
     252 
     253table.nearby-sermons td, table.nearby-sermons th { 
     254 
    82255    text-align: center; 
    83     line-height: 1.2em; 
    84     padding: 0 1em; 
     256 
     257} 
     258 
     259 
     260 
     261table.nearby-sermons .earlier { 
     262 
     263    padding-right: 1em; 
     264 
     265    text-align: left; 
     266 
     267} 
     268 
     269 
     270 
     271table.nearby-sermons .later { 
     272 
     273    padding-left: 1em; 
     274 
     275    text-align:right; 
     276 
     277} 
     278 
     279 
     280 
     281table.nearby-sermons td { 
     282 
    85283    width: 33%; 
     284 
    86285    vertical-align: top; 
    87 } 
    88  
    89 table.nearby-sermons .earlier { 
    90     text-align: left; 
     286 
     287} 
     288 
     289 
     290 
     291ul.sermon-widget { 
     292 
     293    list-style-type:none; 
     294 
     295    margin:0; 
     296 
    91297    padding: 0; 
    92 } 
    93  
    94 table.nearby-sermons .later { 
    95     text-align: right; 
    96     padding: 0; 
    97 } 
    98  
    99 div.sermon-browser-results span.scripture{ 
    100     font-size: 80% 
    101 } 
     298 
     299} 
     300 
     301 
     302 
     303ul.sermon-widget li { 
     304 
     305    list-style-type:none; 
     306 
     307    margin:0; 
     308 
     309    padding: 0.25em 0; 
     310 
     311} 
     312 
     313 
     314 
     315ul.sermon-widget li span.sermon-title{ 
     316 
     317    font-weight:bold; 
     318 
     319} 
  • sermon-browser/branches/0.10-0.23/widget.php

    r57037 r57039  
    2828} 
    2929 
     30 
    3031function widget_sermon_init() { 
    3132    global $sermon_domain; 
     
    5859 
    5960function widget_sermon( $args, $widget_args = 1 ) { 
    60     global $sermon_domain; 
     61    global $sermon_domain, $isMe; 
    6162    extract( $args, EXTR_SKIP ); 
    6263    if ( is_numeric($widget_args) ) 
     
    7273    extract($options[$number]); 
    7374     
     75?> 
     76<?php 
    7477    echo $before_widget; 
    75  
     78    echo $before_title . $title . $after_title; 
    7679    // Do stuff for this widget, drawing data from $options[$number] 
    7780    $sermons = bb_get_sermons(array( 
     
    8386    ); 
    8487?> 
     88    <ul class="sermon-widget"> 
    8589    <?php foreach ((array) $sermons as $sermon): ?> 
    86         <span class="sermon-title"><a href="<?php bb_print_sermon_link($sermon) ?>"><?php echo stripslashes($sermon->title) ?></a></span><br /> 
    87         <?php if ($preacherz): ?><span class="preacher"><?php _e('Preached by ', $sermon_domain) ?><a href="<?php bb_print_preacher_link($sermon) ?>"><?php echo stripslashes($sermon->preacher) ?></a></span><br /><?php endif ?> 
    88         <?php if ($book): ?><span class="sermon-passage"><?php $foo = unserialize($sermon->start); $bar = unserialize($sermon->end); echo bb_get_books($foo[0], $bar[0]) ?></span><br /><?php endif ?> 
    89         <br />       
     90        <li><span class="sermon-title"><a href="<?php bb_print_sermon_link($sermon) ?>"><?php echo stripslashes($sermon->title) ?></a></span> 
     91            <?php if ($book): ?><span class="sermon-passage">(<?php $foo = unserialize($sermon->start); $bar = unserialize($sermon->end); echo bb_get_books($foo[0], $bar[0]) ?>)</span><?php endif ?> 
     92            <?php if ($preacherz): ?><span class="sermon-preacher"> <?php _e('by', $sermon_domain) ?> <a href="<?php bb_print_preacher_link($sermon) ?>"><?php echo stripslashes($sermon->preacher) ?></a></span><?php endif ?> 
     93            <?php if ($date): ?><span class="sermon-date"> <?php _e(' on ', $sermon_domain); echo date("j F Y", strtotime($sermon->date)); ?></span>.<?php endif ?> 
     94        </li>        
    9095    <?php endforeach ?> 
    91 <?php 
    92      
    93     echo $after_widget; 
    94 } 
    95  
     96    </ul> 
     97<?php echo $after_widget; ?> 
     98<?php 
     99} 
    96100function widget_sermon_control( $widget_args = 1 ) { 
    97101    global $wpdb, $sermon_domain, $books; 
     
    145149            $series = (int) $widget_sermon_instance['series']; 
    146150            $book = (int) $widget_sermon_instance['book']; 
    147             $options[$widget_number] = array( 'limit' => $limit, 'preacherz' => $preacherz, 'book' => $book, 'preacher' => $preacher, 'service' => $service, 'series' => $series );  // Even simple widgets should store stuff in array, rather than in scalar 
     151            $title = strip_tags(stripslashes($widget_sermon_instance['title'])); 
     152            $date = (int) $widget_sermon_instance['date']; 
     153            $options[$widget_number] = array( 'limit' => $limit, 'preacherz' => $preacherz, 'book' => $book, 'preacher' => $preacher, 'service' => $service, 'series' => $series, 'title' => $title, 'date' => $date);  // Even simple widgets should store stuff in array, rather than in scalar 
    148154        } 
    149155 
     
    163169        $service = ''; 
    164170        $series = ''; 
     171        $title =''; 
     172        $date = ''; 
    165173    } else { 
    166174        $limit = attribute_escape($options[$number]['limit']); 
     
    170178        $preacherz = (int) $options[$number]['preacherz']; 
    171179        $book = (int) $options[$number]['book']; 
     180        $title = attribute_escape($options[$number]['title']); 
     181        $date = (int) $options[$number]['date']; 
    172182    } 
    173183 
     
    175185    // the widget are stored in one $_POST variable: $_POST['widget-many'][$number] 
    176186?> 
     187        <p><?php _e('Title:'); ?> <input class="widefat" id="widget-sermon-title" name="widget-sermon[<?php echo $number; ?>][title]" type="text" value="<?php echo $title; ?>" /></p> 
    177188        <p> 
    178189            <?php _e('Number of sermons: ', $sermon_domain) ?><input class="widefat" id="widget-sermon-limit-<?php echo $number; ?>" name="widget-sermon[<?php echo $number; ?>][limit]" type="text" value="<?php echo $limit; ?>" /><br /> 
     
    182193            <input type="checkbox" id="widget-sermon-book-<?php echo $number ?>" name="widget-sermon[<?php echo $number ?>][book]" <?php echo $book ? 'checked=checked' : '' ?> value="1"> <?php _e('Display bible passage', $sermon_domain) ?><br /> 
    183194             
     195            <input type="checkbox" id="widget-sermon-date-<?php echo $number ?>" name="widget-sermon[<?php echo $number ?>][date]" <?php echo $date ? 'checked=checked' : '' ?> value="1"> <?php _e('Display the date', $sermon_domain) ?><br /> 
    184196            <?php _e('Preacher: ', $sermon_domain) ?><br /> 
    185197            <select name="widget-sermon[<?php echo $number; ?>][preacher]" id="widget-sermon-preacher-<?php echo $number; ?>"> 
Note: See TracChangeset for help on using the changeset viewer.