Chell's Roost
A politically independent, tree hugging, anti-lima bean, Heathen gramma's blog & gallery on Freya's day, Merrymoon 18, 2262 RE
RSSHome  •  Comments Policy  •  About  •  Photo Gallery  •  Contact  •  Links
Merrymoon 14, 2261 RE (May 14, 2011)  10:09 am

The call I had been avoiding answering for not long enough:

WildBlue Rep: I’m calling to tell you about a new download we have for you. It’s the WildBlue optimizer.
Me: I’m going to save you some time here. The optimizer does not work under Linux, so it won’t work on my system.
WildBlue Rep: What’s Linux?
Me: It’s an operating system, like Windows. Except your optimizer does not work under it.
WildBlue Rep: What’s an operating system?
Me: *facepalm*

Comments (2)

Horning 10, 2261 RE (February 10, 2011)  7:08 pm

Last month I posted a way to create a blog page in OpenCart that uses a single category of an existing WordPress blog. Here is how to give that page its own RSS feed that links to that blog page you created in your store instead of to WordPress outside your store.

Create a new file and paste the following code in it.


<?php print '<?xml version="1.0" encoding="ISO-8859-1" ?>'; ?>
<rss version="2.0">
<?php
$link = mysql_connect('DB_HOST', 'DB_USERNAME', 'DB_PASSWORD') or die();
mysql_select_db('YOUR_DB') or die();
?>
<channel>
<title>YOUR_STORE_NAME</title>
<?php
$query = 'SELECT * FROM TABLEPREFIX_term_relationships, TABLEPREFIX_posts WHERE TABLEPREFIX_term_relationships.term_taxonomy_id = ## AND TABLEPREFIX_term_relationships.object_id = TABLEPREFIX_posts.ID ORDER BY TABLEPREFIX_posts.post_date DESC LIMIT 3';
$wppostsresult = mysql_query($query) or die();
while ($line = mysql_fetch_array($wppostsresult)) {
?>
<item>
<title><?php print $line['post_title']; ?></title>
<pubDate><?php print date('D, d M Y H:i:s', strtotime($line['post_date'])); ?></pubDate>
<author>YOUR_NAME</author>
<description><?php print $line['post_content']; ?></description>
<link>URL_OF_YOUR_BLOG_PAGE</link>
</item>
<?php
}
mysql_free_result($wppostsresult);
?>
</channel>
<?php
mysql_close($link);
?>
</rss>

In that code, replace the single instance of DB_HOST with your database host, DB_USERNAME with your database username, DB_PASSWORD with your database password, and YOUR_DB with your WordPress database. That code could be called from a separate file, but for simplicity here, it’s included in this one. Replace YOUR_STORE_NAME with the name of your store or blog.

Like in my previous post, replace the six instances of TABLEPREFIX with your WordPress database table prefix, and the one instance of ## with the desired category’s term_taxonomy_id (see previous step one). Change the limit (number of posts to retrieve) to something other than 3 if you wish. Replace the single instance of YOUR_NAME with your blog author (or this can be retrieved as a field from the database), and URL_OF_YOUR_BLOG_PAGE to the url of your store blog. Save the file as blogfeed.php, and upload it to your top store directory.

Paste the following code into your blog template’s common/header.tpl file, between the <head></head> tags.


<?php if($_SERVER['REQUEST_URI'] == '/YOURSUBDIRECTORY/blog'): ?>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="FULL_URL_TO/blogfeed.php" />
<?php endif; ?>

If your blog is in a subdirectory, replace YOURSUBDIRECTORY with it, or if it is in the top directory, delete the /YOURSUBDIRECTORY part. Note that this is not the full url. Replace FULL_URL_TO with the full url to your blogfeed.php file.

Now your customers should be able to subscribe to a blog feed that is exclusively for your store, while you can avoid having to install a separate blog program. You can see this solution live on my store’s blog.

Comments (2)

Snowmoon 14, 2261 RE (January 14, 2011)  9:28 pm

Here is a quick way to get a single category of your WordPress blog posts onto your OpenCart page. I’ve done this using OpenCart 1.4.9.3 with SEO url’s enabled, the default theme, and WordPress 3.0.4. As always, back up your file before editing.

  1. Get your desired category’s term_taxonomy_id from the term_relationships table in your WordPress database.
  2. In your OpenCart, create an additional information page with the seo link of blog.
  3. Place the following code in the “middle” section of your OpenCart theme’s template/information/information.tpl file. If your store is in a subdirectory, change /blog to /YOURSUBDIRECTORY/blog.

    <?php
    if($_SERVER['REQUEST_URI'] == '/blog'):
    $query = 'SELECT * FROM TABLEPREFIX_term_relationships, TABLEPREFIX_posts WHERE TABLEPREFIX_term_relationships.term_taxonomy_id = ## AND TABLEPREFIX_term_relationships.object_id = TABLEPREFIX_posts.ID ORDER BY TABLEPREFIX_posts.post_date DESC LIMIT 3';
    $wppostsresult = mysql_query($query) or die('Query failed: ' . mysql_error());
    while ($line = mysql_fetch_array($wppostsresult)) {
    print '<h2>'. $line['post_title'] . '</h2><div>'. $line['post_date'] .'</div><div>' . $line['post_content'] . '</div>';
    }
    mysql_free_result($wppostsresult);
    endif;
    ?>

  4. Replace the six instances of “TABLEPREFIX” in the code with that of your WordPress database tables.
  5. Replace the one instance of ## in the code with the number you retrieved in step one.
  6. Change the limit to however many posts you want displayed. Change the HTML to display the elements how you wish.
  7. Now the posts in that category should appear in your WordPress blog (unless you disable this) as well as in your online shop blog.

Comments (0)

Yule 18, 2260 RE (December 18, 2010)  1:47 pm

Plain ol’ call and text cell phones are bad enough, but my worst fears about “smartphones” are true. Do these phones really enhance life enough to make giving away every stitch of privacy worth it? And just as it’s good to have endless data available for our perusal and convenience on the internet, there have to be times when we can disconnect completely from all the technology and live our private, practical lives.

Comments (1)

Yule 9, 2260 RE (December 9, 2010)  4:18 pm

Let’s say an unsavory character who worked at a hunting goods store broke into the store after hours with a buddy. And he stole a gun from a case and placed it on the counter for his buddy to take. And his buddy went out and shot someone with the gun. It’s obvious that the shooter should pay for his crime. But how about the manufacturer of the counter? After all, the counter displayed the gun along with numerous other items that could have been used for good or bad by anyone who came in. Or just maybe counters and guns are merely tools, though the real tool in this case is the one who started it all by stealing the gun from his employer and giving it away.

Julian Assange is the founder of WikiLeaks, which is a valuable resource for keeping governments transparent. WikiLeaks is the counter that displays what an information shopper might find useful. Bradley Manning is a tool, a traitor who stole sensitive military information from the country he was sworn to serve, and gave it away freely. Julian Assange isn’t the criminal here. That focus is misplaced. Far from being honored by Berkeley, Manning ought to reap the ultimate traitor’s rewards.

Comments (0)

Hunting 28, 2260 RE (October 28, 2010)  9:58 am

Studies on the chemistry of love seem to prove time and again what we already know through experience and common lore. After all, who experiences love without the rush it brings to mind, interconnected emotions, and body? There’s even science behind why each of us is drawn to a certain type.

The science of it is interesting, but in small doses. Best to take the larger doses of the sweet addiction itself.

Comments (0)

Next Page »

Creative Commons License
This text from Chell's Roost is licensed under a Creative Commons Attribution-NoDerivs 3.0 Unported License. If you use it, link the work to http://chellsroost.com, and attribute it to Chell's Roost. Images and sounds © 2012, all rights reserved.

DreamBook Read my DreamBook guestbook!
Sign my DreamBook!

Valid XHTML 1.0 Strict Valid CSS!

Proudly powered by WordPress 3.3.2
61,004 spams blocked by Akismet