/* Plugin Name: Feed List Plugin URI: http://rawlinson.us/blog/articles/feedlist-plugin/ Description: Displays any ATOM or RSS feed in your blog. Author: Bill Rawlinson Author URI: http://blog.rawlinson.us/ Version: 2.2 */ // include files $relroot = dirname(__FILE__).'/../../'; // get the magpie libary if (file_exists($relroot . 'wp-includes/rss.php')) { require_once($relroot . 'wp-includes/rss.php'); } else if(file_exists($relroot . 'wp-includes/rss-functions.php')){ require_once($relroot . 'wp-includes/rss-functions.php'); } else { function FeedListInitError(){ ?>
');
print_r($val);
print('');
}
/* end utility functions */
}
function rssLinkListFilter($text)
{
return preg_replace_callback("//", "feedListFilter", $text);
}
/* Templates can call any of these functions */
function rssLinkList($args){
if(!is_array($args)){
$args = func_get_args();
}
return feedList($args);
}
function feedList($args){
if(!is_array($args)){
$args = func_get_args();
}
$feed = new FeedList($args);
return $feed->FeedListFeed();
}
function randomFeedList($args){
if(!is_array($args)){
$this->args = parse_str($args,$a);
$this->args = $a;
}
$feed = new FeedList($args);
return $feed->FeedListFile();
}
function feedListFilter($args){
$args = explode(",",$args[1]);
if(count($args) == 1 && !strpos($args[0],":=")){
$a = array();
$a["rss_feed_url"] = $args[0];
$args = $a;
} else {
$a = array();
foreach($args as $arg){
$arg = explode(":=",$arg);
$a[$arg[0]] = $arg[1];
}
$args = $a;
}
$feed = new FeedList($args);
return $feed->FeedListFilter();
}
/* end template functions */
if (function_exists('add_filter'))
{
add_filter('the_content', 'rssLinkListFilter');
}
if(function_exists('FeedListInitError')){
add_action('admin_head','FeedListInitError');
}
?>
$theTitle=wp_title(" - ", false);
if($theTitle != "") {
?>
26 Oct // php the_time('Y') ?>
Nginx rewrites are simple but there’s not as much documentation as there is with Apache2. Here’s how I set up my rewrites on Nginx install of MU Wordpress and BBPress.
I’ll go through things bit by bit then give a complete server sample. (Not a complete conf file because other tutorials cover the rest of that better.)
In other words all this code will go in between:
server {......}
First of all you need to make sure you have static files set up so that the actual location is not over ridden with rewrites. Otherwise you’ll get a 404 error.
Here’s the code:
location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
{
root /home/YOURDIRECTORY/public_html;
expires 30d;
break;
}
Note that here you need to change ‘yourdirectory’ to the directory which your public_html folder is.
If you don’t include the root of your folder and you have multiple sites in different home folders then Nginx will default to your first listed server root which is probably /usr/local/nginx/html. That will cause you 404’s.
rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
break;
}
location /forums/ {
root /home/YOURDIRECTORY/public_html/forums;
index index.php;if (!-e $request_filename) {
rewrite ^/forums/topic/(.*)$ /forums/topic.php?q=$1 last;
rewrite ^/forums/forum/(.*)$ /forums/forum.php?q=$1 last;
rewrite ^/forums/profile/(.*)$ /forums/profile.php?q=$1 last;
rewrite ^/forums/view/(.*)$ /forums/view.php?q=$1 last;
rewrite ^/forums/tags/(.*)$ /forums/tags.php?q=$1 last;
rewrite ^/forums/rss/(.*)$ /forums/rss.php?q=$1 last;
rewrite ^/forums/bb-admin/ /forums/bb-admin/index.php last;
rewrite ^/forums/ /forums/index.php last;break;
}
}
So that’s how you do the complete BBPress Wordpress MU Integration on Nginx with pretty URL rewrites. Click here for a nginx server conf file example. (Remember this is the server part of the entire nginx.conf file)
3 Responses
[…] How to do your Nginx rewrites on a Multi User Wordpress Integrated with BBPress […]
Your site looks cool,really informative…
[…] Link […]
Leave a reply