Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Replace word in all forum threads

Asked Modified Viewed 1,949 times
K
Ken
K
Ken 10
No Support by PM. Please use the forum.
  • Senior Member, joined since
  • Contributed 713 posts on the community forums.
  • Started 43 threads in the forums
  • Started this discussions
asked
Senior Member

I want to replace a word in all my forum threads. I know this can be done by a "simple" mysql code previewd in a custom page. Can anyone help me with the code?

I want to replace all occurrences of the word "urlsame=" with "url_self=" in my forum threads.

Maybe you could write it as a tutorial where you also explain some of the coding? This way I maybe could learn something to use later as well :)
0 replies

8 posts

M
muscapaul
M
Paul

Time flies like an arrow, fruit flies like banana (Groucho Marx)

Sites: Diptera.info (site owner); Online-Keys.net (site owner); Sciomyzidae.info (site co-owner); muscapaul.com (defunct; site owner)
  • Veteran Member, joined since
  • Contributed 1,075 posts on the community forums.
  • Started 8 threads in the forums
answered
Veteran Member

Not tested, so make dbbackup for forum first:
Put this in a custom page a preview it:

UPDATE fusion_posts SET post_message = replace( post_message, 'urlsame=', 'url_safe=' ) ;

0 replies
K
Ken
K
Ken 10
No Support by PM. Please use the forum.
  • Senior Member, joined since
  • Contributed 713 posts on the community forums.
  • Started 43 threads in the forums
  • Started this discussions
answered
Senior Member

Dont work :( (even with the <?php ...code... ?> tag)
0 replies
M
muscapaul
M
Paul

Time flies like an arrow, fruit flies like banana (Groucho Marx)

Sites: Diptera.info (site owner); Online-Keys.net (site owner); Sciomyzidae.info (site co-owner); muscapaul.com (defunct; site owner)
  • Veteran Member, joined since
  • Contributed 1,075 posts on the community forums.
  • Started 8 threads in the forums
answered
Veteran Member

Are you using another db-prefix than fusion_?
0 replies
2
2old
2
2old 10
  • Member, joined since
  • Contributed 89 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

Shouldn't that be str_replace?
0 replies
K
Ken
K
Ken 10
No Support by PM. Please use the forum.
  • Senior Member, joined since
  • Contributed 713 posts on the community forums.
  • Started 43 threads in the forums
  • Started this discussions
answered
Senior Member

Quote

muscapaul wrote:
Are you using another db-prefix than fusion_?

No, I'm using fusion_ as db-prefix.
0 replies
M
muscapaul
M
Paul

Time flies like an arrow, fruit flies like banana (Groucho Marx)

Sites: Diptera.info (site owner); Online-Keys.net (site owner); Sciomyzidae.info (site co-owner); muscapaul.com (defunct; site owner)
  • Veteran Member, joined since
  • Contributed 1,075 posts on the community forums.
  • Started 8 threads in the forums
answered
Veteran Member

Okay, I found out I saved only a part of the code when I thought to keep this handy bit of code available. Try this:
<?php
$result=dbquery ("UPDATE fusion_posts SET post_message = replace( post_message, 'urlsame=', 'url_self=' )") ;
?>
0 replies
K
Kristian Thorsen
K
Carne Diem - Seize the MEAT
  • Member, joined since
  • Contributed 164 posts on the community forums.
  • Started 26 threads in the forums
answered
Member

Quote

Ken wrote:
I want to replace a word in all my forum threads. I know this can be done by a "simple" mysql code previewd in a custom page. Can anyone help me with the code?

I want to replace all occurrences of the word "urlsame=" with "url_self=" in my forum threads.

Maybe you could write it as a tutorial where you also explain some of the coding? This way I maybe could learn something to use later as well :)


what precise will this change... what word is this
0 replies
K
Ken
K
Ken 10
No Support by PM. Please use the forum.
  • Senior Member, joined since
  • Contributed 713 posts on the community forums.
  • Started 43 threads in the forums
  • Started this discussions
answered
Senior Member

Yay! - It works great. Thanks a lot Paul :)

Quote

thokra wrote:
what precise will this change... what word is this

Like now all links in forum will open in a new (_blank) window. I have added some code (I can post it if wanted) in maincore to make the following code to open links in forum in same (_self) window.

[urlsame=http://www.kengun.com/]www.kengun.com[/url]

This is very nice when you want to open internal pages in your site and not as a new window. Because open a new (_blank) window is not always what I want.

Since the link opens in _self (same window) I felt it would be more correct to call the code url_self instead of urlsame. That's why I needed to change all urlsame to url_self . So the old urlsame links looks like this:

[url_self=http://www.kengun.com/]www.kengun.com[/url]

or like this:

[url_self]http://www.kengun.com/[/url]
Edited by Ken on 30-06-2006 11:55,
0 replies

Category Forum

General Discussion

Labels

None yet

Statistics

  • Views 0 views
  • Posts 8 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

M
M
Paul

Time flies like an arrow, fruit flies like banana (Groucho Marx)

Sites: Diptera.info (site owner); Online-Keys.net (site owner); Sciomyzidae.info (site co-owner); muscapaul.com (defunct; site owner)
  • Veteran Member, joined since
  • Contributed 1,075 posts on the community forums.
  • Started 8 threads in the forums
K
K
Ken 10
No Support by PM. Please use the forum.
  • Senior Member, joined since
  • Contributed 713 posts on the community forums.
  • Started 43 threads in the forums
  • Started this discussions
K
K
Carne Diem - Seize the MEAT
  • Member, joined since
  • Contributed 164 posts on the community forums.
  • Started 26 threads in the forums
2
2
2old 10
  • Member, joined since
  • Contributed 89 posts on the community forums.
  • Started 6 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet