PHP & Blogger Template

btoth

Person that uses a Mac
Well, getting Blogger to work with a PHP site is a pain. :D I thought I had a bright idea with this as my template and assign Blogger's output to variables that I can use later:

PHP:
/*	blogger vars
*/

$BlogPageTitle = "<$BlogPageTitle$>";	

$BlogMetaData = "<$BlogMetaData$>";

$BlogHeader = "	
	<div id='header'>
	
		<h1 id='blog-title'>
		<ItemPage><a href='<$BlogURL$>'></ItemPage>
		<$BlogTitle$>
		<ItemPage></a></ItemPage>
		</h1>
		<p id='description'><$BlogDescription$></p>
	
	</div>
";

$BlogArchiveInfo = "		
	<MainOrArchivePage>

		<h2 class='sidebar-title'>Archives</h2>
		<ul class='archive-list'>
			<BloggerArchives>
			<li><a href='<$BlogArchiveURL$>'><$BlogArchiveName$></a></li>
			</BloggerArchives>
		</ul>
	</MainOrArchivePage>
";
	
		
		
		
$BlogMainContent = "		
		
	<Blogger>
	
		<BlogDateHeader>
			<h2 class='date-header'><$BlogDateHeaderDate$></h2>
		</BlogDateHeader>
	 
		<!-- Begin .post -->
		<div class='post'><a name='<$BlogItemNumber$>'></a>
			<BlogItemTitle>
				<h3 class='post-title'>
				<BlogItemUrl><a href='<$BlogItemUrl$>' title='external link'></BlogItemUrl>
				<$BlogItemTitle$>
				<BlogItemUrl></a></BlogItemUrl>
				</h3>
			</BlogItemTitle>
	
			<div class='post-body'>
				<div>
					<$BlogItemBody$>
				</div>
			</div>
		
			<p class='post-footer'>
			<em>posted by <$BlogItemAuthorNickname$> at <a href='<$BlogItemPermalinkUrl$>' title='permanent link'><$BlogItemDateTime$></a></em>
			<MainOrArchivePage><BlogItemCommentsEnabled>
	
			<a class='comment-link' href='<$BlogItemPermalinkURL$>#comments'><$BlogItemCommentCount$> comments</a>
			</BlogItemCommentsEnabled></MainOrArchivePage>  <$BlogItemControl$>
			</p>
		</div>
		<!-- End .post -->
	  

		<!-- Begin #comments -->
		<ItemPage>
			<div id='comments'>

				<BlogItemCommentsEnabled><a name='comments'></a>
				<h4><$BlogItemCommentCount$> Comments:</h4>
				<dl id='comments-block'>
					<BlogItemComments>
						<dt class='comment-poster' id='c<$BlogCommentNumber$>'><a name='c<$BlogCommentNumber$>'></a>
							<$BlogCommentAuthor$> said...
						</dt>
						<dd class='comment-body'>

							<p><$BlogCommentBody$></p>
						</dd>
						<dd class='comment-timestamp'><a href='#<$BlogCommentNumber$>' title='comment permalink'><$BlogCommentDateTime$></a>
							<$BlogCommentDeleteIcon$>
						</dd>
					</BlogItemComments>
				</dl>
				<p class='comment-timestamp'>

				<$BlogItemCreate$>
				</p>
				</BlogItemCommentsEnabled>
				<p class='comment-timestamp'>
				<a href='<$BlogURL$>'>&lt;&lt; Home</a>
				</p>
			</div>

		</ItemPage>

		<!-- End #comments -->

	</Blogger>

";

The problem is that Blogger uses double-quotes in its HTML tags and, when it replaces the Blogger tags, PHP cannot parse it as a string. AddSlashes() doesn't seem to help.

Any ideas? Store it as a plain text file and read it in that way? Seems like a lot of trouble to go through.
 
If you have access to PHP on your site, why are you using blogger? There's quite a few good blog systems available out there you could use instead. Why not Word Press or Movable Type?
 
mdnky said:
If you have access to PHP on your site, why are you using blogger? There's quite a few good blog systems available out there you could use instead. Why not Word Press or Movable Type?

Unfortunately, my personal server overheated and my basic ISP hosting (that I get with our DSL package) doesn't include MySQL. I was under the impression that most of the other PHP-based systems require access to a database.
 
Back
Top