WordPress.org

Plugin Directory

Changeset 52078 for sermon-browser/trunk


Ignore:
Timestamp:
06/26/08 19:13:34 (6 years ago)
Author:
mark8barnes
Message:
 
Location:
sermon-browser/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sermon-browser/trunk/frontend.php

    r51888 r52078  
    3131} 
    3232 
     33function sb_query_char () { 
     34    global $sef; 
     35    if (strpos($sef, '?')===FALSE) { 
     36        return '?'; 
     37    } else { 
     38        return '&'; 
     39    } 
     40} 
     41 
     42 
    3343//Modify page title 
    3444function sb_page_title($title) { 
     
    4757    if (SAVEQUERIES) { 
    4858        global $wpdb; 
    49         echo '<!--'; 
     59        echo '<!-- '; 
    5060        echo($wpdb->num_queries.' queries. '.timer_stop().' seconds.'); 
    51         echo '\n'; 
     61        echo chr(13); 
    5262        print_r($wpdb->queries); 
    53         echo '--!>'; 
     63        echo chr(13); 
     64        echo ' -->'; 
    5465    } 
    5566} 
     
    458469        } 
    459470    } 
    460     if (strpos($sef, '?')===FALSE) { 
    461         return $sef.'?' . implode('&', $bar); 
    462     } else { 
    463         return $sef.'&' . implode('&', $bar); 
    464     } 
     471    return $sef.sb_query_char().implode('&', $bar); 
    465472} 
    466473 
     
    654661            $param="file_name"; } 
    655662        $url = URLencode($url); 
    656         echo ' <a href="'.sb_display_url().'?download&'.$param.'='.$url.'">Download</a>'; 
     663        echo ' <a href="'.sb_display_url().sb_query_char().'download&'.$param.'='.$url.'">Download</a>'; 
    657664    } 
    658665    echo '</div>'; 
     
    826833    $url = get_bloginfo('wpurl'); 
    827834     
    828     $preachers = $wpdb->get_results("SELECT p.*, count(p.id) AS count FROM {$wpdb->prefix}sb_preachers AS p LEFT JOIN {$wpdb->prefix}sb_sermons AS s ON p.id = s.preacher_id GROUP BY p.id ORDER BY count DESC, s.date DESC");   
    829     $series = $wpdb->get_results("SELECT ss.*, count(ss.id) AS count FROM {$wpdb->prefix}sb_series AS ss LEFT JOIN {$wpdb->prefix}sb_sermons AS sermons ON ss.id = sermons.series_id GROUP BY ss.id ORDER BY sermons.date DESC"); 
    830     $services = $wpdb->get_results("SELECT s.*, count(s.id) AS count FROM {$wpdb->prefix}sb_services AS s LEFT JOIN {$wpdb->prefix}sb_sermons AS sermons ON s.id = sermons.service_id GROUP BY s.id ORDER BY count DESC"); 
    831     $book_count = $wpdb->get_results("SELECT bs.book_name AS name, count( b.id ) AS count FROM {$wpdb->prefix}sb_books_sermons AS bs LEFT JOIN {$wpdb->prefix}sb_books AS b ON bs.book_name = b.name WHERE bs.type = 'start' GROUP BY b.id");    
     835    $preachers = $wpdb->get_results("SELECT p.*, count(p.id) AS count FROM {$wpdb->prefix}sb_preachers AS p JOIN {$wpdb->prefix}sb_sermons AS s ON p.id = s.preacher_id GROUP BY p.id ORDER BY count DESC, s.date DESC");    
     836    $series = $wpdb->get_results("SELECT ss.*, count(ss.id) AS count FROM {$wpdb->prefix}sb_series AS ss JOIN {$wpdb->prefix}sb_sermons AS sermons ON ss.id = sermons.series_id GROUP BY ss.id ORDER BY sermons.date DESC"); 
     837    $services = $wpdb->get_results("SELECT s.*, count(s.id) AS count FROM {$wpdb->prefix}sb_services AS s JOIN {$wpdb->prefix}sb_sermons AS sermons ON s.id = sermons.service_id GROUP BY s.id ORDER BY count DESC"); 
     838    $book_count = $wpdb->get_results("SELECT bs.book_name AS name, count( b.id ) AS count FROM {$wpdb->prefix}sb_books_sermons AS bs JOIN {$wpdb->prefix}sb_books AS b ON bs.book_name = b.name WHERE bs.type = 'start' GROUP BY b.id");     
    832839    $sb = array(         
    833840        'Title' => 'm.title', 
  • sermon-browser/trunk/sermon.php

    r51888 r52078  
    55Description: Add sermons to your Wordpress blog. Main coding by <a href="http://codeandmore.com/">Tien Do Xuan</a>. Design and additional coding 
    66Author: Mark Barnes 
    7 Version: 0.30 
     7Version: 0.30.1 
    88Author URI: http://www.4-14.org.uk/ 
    99 
     
    3333 
    3434// URLs and paths 
    35 $ser_ver = '1.1'; 
    3635$url = get_bloginfo('wpurl'); 
    3736global $wordpressRealPath; 
     
    222221function sb_sermon_install () { 
    223222   global $wpdb, $mdict, $sdict, $books;     
    224    global $ser_ver; 
    225223   global $sermon_domain, $sef; 
    226224   global $wordpressRealPath; 
     
    10541052                if (move_uploaded_file($_FILES['upload']['tmp_name'], $dest)) { 
    10551053                    $filename = $prefix.mysql_real_escape_string($filename); 
    1056                     $query = "INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$filename', 0);"; 
     1054                    $query = "INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$filename', 0, 0);"; 
    10571055                    $wpdb->query($query); 
    10581056                    echo '<div id="message" class="updated fade"><p><b>'.__('Files saved to database.', $sermon_domain).'</b></div>'; 
     
    15781576                if ($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sb_stuff WHERE name = '$filename'") == 0 && move_uploaded_file($_FILES['upload']['tmp_name'][$uid], $dest)) { 
    15791577                    $filename = $prefix.mysql_real_escape_string($filename); 
    1580                     $queryz = "INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$filename', $id, 0);"; 
     1578                    $queryz = "INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$filename', $id, 0, 0);"; 
    15811579                    $wpdb->query($queryz);                   
    15821580                } else { 
     
    15921590            if (!empty($urlz)) { 
    15931591                $urlz = mysql_real_escape_string($urlz); 
    1594                 $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES(null, 'url', '$urlz', $id, 0);"); 
     1592                $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES(null, 'url', '$urlz', $id, 0, 0);"); 
    15951593            }            
    15961594        } 
     
    15991597            if (!empty($code)) { 
    16001598                $code = base64_encode(stripslashes($code)); 
    1601                 $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES(null, 'code', '$code', $id), 0;"); 
     1599                $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES(null, 'code', '$code', $id, 0, 0)"); 
    16021600            } 
    16031601        } 
     
    20552053        while (false !== ($file = readdir($dh))) { 
    20562054            if ($file != "." && $file != ".." && !is_dir($dir.$file) && !in_array($file, $bnn)) {                
    2057                 $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$file', 0);"); 
     2055                $wpdb->query("INSERT INTO {$wpdb->prefix}sb_stuff VALUES (null, 'file', '$file', 0, 0);"); 
    20582056            }    
    20592057        } 
Note: See TracChangeset for help on using the changeset viewer.