Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2010, 12:30 AM
Fuhrmann Fuhrmann is offline
 
Join Date: May 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 07-15-2010, 02:56 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fuhrmann View Post
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.
Reply With Quote
  #3  
Old 07-15-2010, 05:13 PM
Fuhrmann Fuhrmann is offline
 
Join Date: May 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by borbole View Post
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.
Reply With Quote
  #4  
Old 07-15-2010, 05:17 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fuhrmann View Post
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.
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.
Reply With Quote
  #5  
Old 07-15-2010, 05:31 PM
Fuhrmann Fuhrmann is offline
 
Join Date: May 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by borbole View Post
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!
Reply With Quote
  #6  
Old 07-15-2010, 06:28 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 07-16-2010, 12:09 AM
Fuhrmann Fuhrmann is offline
 
Join Date: May 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:46 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.03629 seconds
  • Memory Usage 2,224KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete