Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Populate forum_slug and topic_slug fields

@kevinjohngallagher

Member

Good Morning Dan,

It definately sounds like a conversion issue. It’s not one i’ve heard of before, but it shouldn’t be too hard to fix (though there is no existing pluign that I know of).

Baiscally you’re going to need a Title to Slug function, then iterate through every forum & topic and update the database accordingly

Basically, something like this:

$sql = "SELECT * from $bbdb->topics WHERE topic_slug ='' LIMIT 100";
$rows = $bbdb->get_rows($sql);

foreach($rows as $row)
{
$topic_slug = bb_sanitize_with_dashes($row['topic_title'],200);
$sql = "UPDATE $bbdb->topics SET topic_slug='". $topic_slug ."' WHERE topic_id=". $row['topic_id'] ." LIMIT 1; ";
}

So i’ve not tested this code at all, just guessing at it really.

It should update 100 topics at one page load.

(I do this incase i made a horrible mistake)

Then do the same for bb_forum table.

Kev

Skip to toolbar