Welcome to BlogDogIt Thursday, September 16 2021 @ 05:01 PM EDT

Relativity In Syndication Absolutely Troublesome

  • Contributed by:
  • Views: 1,055
GeekLogIt
The secure CMS.I was having an issue with images not showing up and local links not working in the BlogDogIt RSS Feed. The reason was simple the fix was a bit obscure but highly effective. I posted about my experience on Geeklog.net and am re-blogging that submission here.
Converting Site-Relative Links to Absolute Paths

I have really enjoyed my Geeklog adventure thus far and thought I would share my latest success in running BlogDogIt.com (for the record I am running GL Version 1.8.1)

First let me say that I have set-up a WordPress site and a Blogger site so that I might participate with all those many bloggers utilizing those platforms. I use my pages from those services to advertise and link to my Geeklog site. Recently I created a Feedburner RSS Feed from my Geeklog feed so that I could utilize the animated Feedburner widget on those "other" blog pages. I have also added the Feedburner "Subscribe To My Site Via Email" Service link to my Geeklog page.

I was not too far into this endeavor before I noticed there was a problem with how my feed was rendering on both the Feedburner feed page and in the Updates sent to email subscribers. The problem was that for the most-part I use site-relative linking which means that all image source links and local page links were broken in the syndicated versions of the posts. Of course the fix for this is to replace all site-relative links with their absolute path counterparts.

So from now on I will be using full paths when I create my posts but as for all those previously published posts that use the site-relative links I decided to craft a MySQL statement to convert all the links in the gl_stories table to absolute paths in one "fell swoop."

Of course the very first thing I did was back-up my entire database. I then logged-in to phpmyadmin and exported my gl_stories table to a file so that even my back-up had a back-up.

The SQL statement that I ran against my Database was based on the following syntax:

PHP Formatted Code
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');


In my case the specific commands were as follows:

PHP Formatted Code
update gl_stories set introtext = replace(introtext,'="/','="http://BlogDogIt.com/');
 

and
PHP Formatted Code

update gl_stories set bodytext = replace(bodytext,'="/','="http://BlogDogIt.com/');
 

And that - as they say - was that! Mission accomplished.

Source: Geeklog.net

Share
  • Facebook
  • Google Bookmarks
  • Digg
  • Twitter
  • Reddit