Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 05:17 am EST

Geeklog Forums

Switching sites - not fully automatic


Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
In theory, Geeklog lets it be as easy as changing a single URL in config.php (and, if you also change your internal system, possibly a few paths too and one path in lib-common.php).

Alas, it turns out that the database stores some constant static paths.
Here's what I found:

  1. gl_blocks => older_stories: Well, at least this is only one entry and not to mention a queue based block one - so after some time, it'll be fixed.

  2. gl_stories => every entry (usually introtext/bodytext) that has image links: this is covered in this FAQ entry (the former problem isn't). One better change the images' links because unlike the older stories, they will stay broken forever.

I should mention that Geeklog 1.3.10rc1 introduced a great feature of dynamic internal links (i.e. [ story: ]), so I think those two tables should work in the same concept and use config.php's $_CONF['site_url'].
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
This post can be deleted now.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
This post can be deleted now.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Here are possible solutions you might want to consider adding to that FAQ:

  1. gl_blocks => older_stories: since it's a specific entry (and not a whole table), I think the best solution is to just edit it manually, copy the entire appropriate field to Notepad, use Notepad's replace function (old url => new url) and copy it back.

  2. gl_stories => every entry that has image links: since this involves multiple entries, you can use the following MySQL command:

    update gl_stories set some_field=replace(some_field, 'old url','new url')


"some_field" being either "introtext" or "bodytext" (if you need both, just run this query twice - once with "introtext" and once with "bodytext").

Which leads me to say that the major downside is that you have to go field by field with this (each time instead of "some_field"). Sure, one might say we only deal with two fields anyway (introtext and bodytext), but I still can't consider this a perfect solution.

I've tried to use * and % (instead of "some_field"), but they just cause an error.

So does anyone have a way to make it work in all fields with a single command?
 Quote

All times are EST. The time is now 05:17 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content