vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   SQL replace - Help (https://vborg.vbsupport.ru/showthread.php?t=246568)

Fuhrmann 07-15-2010 12:30 AM

SQL replace - Help
 
Hello. Recently i just used IMPEX to import all my phpbb forumto vbulletin forum.

But, a error ocurred. All my topics that have bbcodes [spoiler], [imgsize], doesnt work. They all are like this:

[spoiler:127u0gij]
[imgsize:12dd354]

All that i want to know, is that if i can make a SQL replace in my phpadmin panel, to replace all this information to the correct:

[spoiler:127u0gij] ---> [spoiler]
[imgsize:12dd354] ---> [img]

There is a way? I will be glad if someone help me. Thanks!

borbole 07-15-2010 02:56 PM

Quote:

Originally Posted by Fuhrmann (Post 2069299)
Hello. Recently i just used IMPEX to import all my phpbb forumto vbulletin forum.

But, a error ocurred. All my topics that have bbcodes [spoiler], [imgsize], doesnt work. They all are like this:

[spoiler:127u0gij]
[imgsize:12dd354]

All that i want to know, is that if i can make a SQL replace in my phpadmin panel, to replace all this information to the correct:

[spoiler:127u0gij] ---> [spoiler]
[imgsize:12dd354] ---> [img]

There is a way? I will be glad if someone help me. Thanks!


Can you try my mod here. It does just that.

https://vborg.vbsupport.ru/showthread.php?t=239234

But if you would rather do that without a plugin but with a sql query, let me know and I will post the query here.

Fuhrmann 07-15-2010 05:13 PM

Quote:

Originally Posted by borbole (Post 2069526)
Can you try my mod here. It does just that.

https://vborg.vbsupport.ru/showthread.php?t=239234

But if you would rather do that without a plugin but with a sql query, let me know and I will post the query here.

Weel, first, thanks for the help. I cant use this mod because the "weird caracteres" are not the same. Look, every post have diferents caracters, just like this:

Post1 - > [spoiler:dasda]
Post2 -> [spoiler:12344]
Post3 -> [spoiler:11111]

I will thank you if you post the query to do this. Oh, thanks again.:D

borbole 07-15-2010 05:17 PM

Quote:

Originally Posted by Fuhrmann (Post 2069586)
Weel, first, thanks for the help. I cant use this mod because the "weird caracteres" are not the same. Look, every post have diferents caracters, just like this:

Post1 - > [spoiler:dasda]
Post2 -> [spoiler:12344]
Post3 -> [spoiler:11111]

I will thank you if you post the query to do this. Oh, thanks again.:D

You can use whatever words you want and not only weired characters and symbols.

Anyway, use this query

Code:

UPDATE post SET pagetext = replace(pagetext, ?text you want to replace?, ?replacament text?);
And replace text you want to replace?, ?replacament text? accordingly.

If your db tables use a prefix, then you should include it in the query by appending it to the table name.

Fuhrmann 07-15-2010 05:31 PM

Quote:

Originally Posted by borbole (Post 2069592)
You can use whatever words you want and not only weired characters and symbols.

Anyway, use this query

Code:

UPDATE post SET pagetext = replace(pagetext, ‘text you want to replace’, ‘replacament text’);
And replace text you want to replace’, ‘replacament text’ accordingly.

If your db tables use a prefix, then you should include it in the query by appending it to the table name.

As you see, my problem is that the weird caracteres are not the same in all posts. I dont want to view the thread, copy the "[spoiler:dasda]" and then make a query.

I have 200.000 posts in my forum, for at least 100.000 have the spoiler tag, for example, and, every post have the "[spoiler:something here]", but never repeat. It is always diferente.

The query i was looking for are some "regex" replace. This is possible? Look for some word that is not always the same throug a replace query in SQL...

Sorry about my english!

borbole 07-15-2010 06:28 PM

I think we have a misunderstanding in communication. The query I posted above does exactly what you asked about in the very first post. It replaces [spoiler:127u0gij] with [spoiler] or [imgsize:12dd354] with [img]. It works like a charm. I hve used that many times for similiar purposes when converting the forums of some of my clients.

Fuhrmann 07-16-2010 12:09 AM

Yes, i know that works, i already make some query like this. But our "misunderstanding" is i will have to do 100.000 querys to clear ALL this "spoilers" and "imgsizes" tags wrongs.


All times are GMT. The time now is 02:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01012 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete