BBcode in database dump?

Support for IntegraMOD 141

Moderator: Integra Moderator

BBcode in database dump?

PostAuthor: shedt_v » Tue Jun 12, 2007 9:46 am

Code: Select all
[b]Bolded text[/b]  Sincerely,  Edward [/font][/size]


I'm trying to mass- find and replace a phrase that is in my database like 350 times. The problem is that some of the text is bolded, so when i click find, it does not find it properly.

What do these numbers and letters represent? I'm kinda hacking my way around it and would like to know mostly for learning purposes.
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

Re: BBcode in database dump?

PostAuthor: Teelk » Wed Jun 13, 2007 10:17 pm

That's a good question, I'm not too sure why it generates those random numbers. Mike might know the reason, or Evolver since he did quite a bit of work with bbcodes. I do know that 1.4.1 bbcode/database relationship is not up to snuff and I was working on an update before my hiatus and did eventually fix it. I'll have to dig into my files and find it. It does require an edit/submit to resubmit the post to the database however... but still, it generates those numbers in the database. I'll have to take a closer look and see what they mean.
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

PostAuthor: shedt_v » Thu Jun 14, 2007 6:16 am

Thank you, this is all really cool for me. I've been getting IntegraMod up and running on a local network at work via XAMPP, and I have been learning quite abit about PHP, Apache, mysql etc. I'm no wizard but I'm slowly learning. It's really awesome to have a problem and to take the time to learn to fix it.

For this I just edited around the numbers. It worked, but it would be cool if the numbers are not there. If you have any information or even fixes please do share them.

Thank you!
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

PostAuthor: shedt_v » Mon Jul 30, 2007 7:11 am

Bump, any ideas? I'm going to see what removing them does.
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

PostAuthor: shedt_v » Thu Aug 09, 2007 6:23 am

Could anyone suggest where I could learn more about this?
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

Re: BBcode in database dump?

PostAuthor: Whisky » Thu Aug 09, 2007 7:28 am

Those numbers are the bbcode_uid

It's used to control that your bbcode has been parsed.

if you open the file include/bbcode.php and look a bit closer at it, you'll see that when the text and the bbcode tags are parsed, a var called $uid is added systematicaly to the bbcode tag , like this]     // and for bolding text.     $text = preg_replace("#(.*?)#si", "\1", $text);[/php]

This is the function that generate this number randomly:
Code: Select all
function make_bbcode_uid(){     // Unique ID for this message..       $uid = dss_rand();     $uid = substr($uid, 0, BBCODE_UID_LEN);       return $uid;}  function dss_rand(){      $rand = mt_rand (1,9999999999);    $rand = md5($rand);      return substr($rand, 16);}



If you want to learn more, you'll find usefull information there:
http://www.phpbb.com/community/viewtopi ... &sk=t&sd=a
Last edited by Whisky on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
I am the Lizard King, I can do anything

Whisky
Sr Integra Member
Sr Integra Member
 
Posts: 256
Likes: 0 post
Liked in: 0 post
Joined: Thu May 18, 2006 2:28 am
Cash on hand: 0.00
Location: Brussels

PostAuthor: shedt_v » Thu Aug 09, 2007 8:35 am

thank you so much, I really appreciate it.

p.s. Would it be hard to remove the numbers or to set them as such they are not random? Security is not an issue here for me.
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

Re: BBcode in database dump?

PostAuthor: Whisky » Thu Aug 09, 2007 8:51 am

You mean to remove/change them in the future, or what you already have in your DB?
Last edited by Whisky on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
I am the Lizard King, I can do anything

Whisky
Sr Integra Member
Sr Integra Member
 
Posts: 256
Likes: 0 post
Liked in: 0 post
Joined: Thu May 18, 2006 2:28 am
Cash on hand: 0.00
Location: Brussels

PostAuthor: shedt_v » Thu Aug 09, 2007 9:47 am

Both I guess, if I have too, I will go through and manually edit by hand. But it would be nice to change the code so that those numbers are not showing. Basically when editing my DB dump, I want to be able to find and replace the same thing over and over again, but with the numbers it's not the same each time.

Thank you again I will read into it more.
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

PostAuthor: shedt_v » Thu Aug 09, 2007 9:53 am

OK So I changed a tag from bbcode to html and the html tag is fine. So far it's mostly for bold text, url and such. I will try to edit them all by hand. ouch 400 or so.



EDIT

Would there be away to dump my DB without those numbers? I'm working with about 400 KB articles, trying to find away to replace all the BBcode with html tags.


EDIT

http://domain-name/kb.php?mode=edit&k=13

I wish I could open or dump every article somehow, do a mass find and replace. Any ideas? I'm just opening each one and cut and paste into wordpad, and doing a find replace on the bbcode. so far so good.
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00

Re: BBcode in database dump?

PostAuthor: Whisky » Fri Aug 10, 2007 2:01 am

Since each bbcode_uid is different and randomized I don't see anyway to do it with SQL.

Bu what do you want to do exactly? Why get rid of this?
Last edited by Whisky on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
I am the Lizard King, I can do anything

Whisky
Sr Integra Member
Sr Integra Member
 
Posts: 256
Likes: 0 post
Liked in: 0 post
Joined: Thu May 18, 2006 2:28 am
Cash on hand: 0.00
Location: Brussels

PostAuthor: shedt_v » Fri Aug 10, 2007 6:59 am

I have different articles that share similar text, but sometimes I need to change and or add etc. So if the text is bolded, and I need to do a mass find and replace, the uid in the database dump changes. If I want to change:

Thank You Very Much

into

Thank You very Much and have a nice day.

If it is bolded, each time I search I cannot do a mass find and replace.


I can do it into pieces I guess and only search and replace stuff inside the bbcode. But if I want to change two sentences that are both bolded I will have to do them separately.

Not a big deal though. Thank you for your help!
Last edited by shedt_v on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

shedt_v
Integra Member
Integra Member
 
Posts: 114
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 09, 2006 8:37 am
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: Google [Bot], Helter