Sunday, November 11, 2007

Combining multiple blogs into a single feed

Tip: Combining multiple blogs into a single feed

I will be using Movable Type's default RSS 2.0 template, simply for size reasons. These template changes can apply just as easily to Atom feeds or any other feed template you can come up with.

First, here is the default template:


First, here is the default template:

"?>


<$MTBlogName remove_html="1" encode_xml="1"$>
<$MTBlogURL$>
<$MTBlogDescription remove_html="1" encode_xml="1"$>
<$MTBlogLanguage ietf="1"$>
Copyright <$MTDate format="%Y"$>
<$MTEntryDate format_name="rfc822"$>
http://www.sixapart.com/movabletype/?v=<$MTVersion$>
http://blogs.law.harvard.edu/tech/rss



<$MTEntryTitle remove_html="1" encode_xml="1"$>
<$MTEntryBody encode_xml="1"$>
<$MTEntryPermalink encode_xml="1"$>
<$MTEntryPermalink encode_xml="1"$>
<$MTEntryCategory remove_html="1" encode_xml="1"$>
<$MTEntryDate format_name="rfc822"$>




Next, we will substitute MTMultiBlogEntries for MTEntries. This will get the last 15 entries from the combined entry list of all of the included blogs. There are a number of options that will be available in the next major release of MultiBlog, but for now we will simply make use of the include_blogs attribute. In this example, the ids of the three blogs we wish to integrate will be 7, 21, and 24.

The blog ids can be retreived simply by going to the main menu for the particular blog and making note of the blog_id parameter in the URL.

Here are the modified portions of the template:

      <$MTEntryDate format_name="rfc822"$>



<$MTEntryTitle remove_html="1" encode_xml="1"$>
<$MTEntryBody encode_xml="1"$>
<$MTEntryPermalink encode_xml="1"$>
<$MTEntryPermalink encode_xml="1"$>
<$MTEntryCategory remove_html="1" encode_xml="1"$>
<$MTEntryDate format_name="rfc822"$>




That's it!

For bonus points, let's add some information to the feed. We will add the blog name to the entry title so that entries from the different blogs can be distinguished.

<$MTBlogName remove_html="1" encode_xml="1"$>: <$MTEntryTitle remove_html="1" encode_xml="1"$>

Or, if you only want entries that are not from the current blog to have the blog names prepended to the titles:

<mtmultiblogifnotlocalblog><$MTBlogName remove_html="1" encode_xml="1"$>: </mtmultiblogifnotlocalblog><$MTEntryTitle remove_html="1" encode_xml="1"$>

If there are any other integration issues I can address, please let me know.


http://rayners.org/plugins/2005/08/tip_combining_m.html

Thursday, September 27, 2007

Integrating Google AdSense with PHP-Fusion Templates, Themes

1. Google Adsense in PHP fusion integrate

Easy way to integrate Google AdSense in to PHP-Fusion Template is to use separate panel for each AdSense placement.

Follow the following steps:

1. Log in as Admin
2. Navigate to Admin Panel --> System Admin --> Panels
3. Click on Add New Panel
4. Enter a name to the panel. Panel File Name -"None"
5. Under Panel Contents ad the following code:

opentable (“Advertisement”);
?>
// your code of Google Adsense clean-set here:

closetable ();
6. Save the Panel by making it Public.
7. Activate the panel by selecting "Enable" in the Panel Control panel options.

You are ready with AdSense on your website.

You can adjust the Ad position in your website using Panel Management/Panel Control Panel.

2. Layer Ads in PHP fusion integrate

Also so-called Layer of Layer Ads can be integrated fast and simply in PHP fusion:

1. Open the file subheader.php in your root listing of PHP fusion.

2. Stands for search the line in

3. Insert now before this line your source code of Layer Ads

e.g.:

- Replace now all double quotation marks with simple quotation marks

In the above example then would look in such a way:



- Store the file and loads it on your Web space

- Finished, now is the source code of Layer Ads on all sides of your CMS PHP fusion.