Search
Other DB Replacer questions
Forum

Tooltips J3 -> J5

Sergey's Avatar Sergey
Hello Peter,
A year ago I asked about this: regularlabs.com/forum/presale/50102-tool...4-syntax-replacement
You told me to buy DB replacer and come back. I've finally made it. )
Please help with the update. You probably already have a full answer/instruction for this, haven't you?
Thanks.
Sergey's Avatar Sergey
Well, the answer is even smaller than in the free section, that's a little disappointing...
Okay, let's copy-paste:
"What about text with quotes and rich text, e.g.,
{tip BlablaTitle::I have this huge text with lots of "quotes"<br>
<strong>bold text</strong>}tooltip{/tip}"
>
"You'd have to do some smart Regular Expressions to handle those cases, where it adds slashes to escape them: \"
Probably easiest to do that before replacing it all to the new syntax."
How to do this exactly? It's the first step, right? Where is it in the faq?

And after that I do this:
\{tip ([^\}"]+)\:([^\}"]+)\}
on:
{tip title="\1" content="\2"}
letter by letter?

2 steps and everything is fixed?
Peter van Westen's Avatar Peter van Westen ADMIN
Have you tried to do what is in the documentation?
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
No, I'm waiting for the answer. But receiving questions instead )
"Probably easiest to do that before replacing it all to the new syntax." - your words, not mine. If I do this not right, I won't fix this without restoring db.
Peter van Westen's Avatar Peter van Westen ADMIN
To deal with the quotes, try executing this a couple of times:
(\{tip [^\}"]*)"
Replace with:
\1&quot;

Then do the replacements mentioned in the docs.
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
All right, that's what I'm talking about.
I've tried BUT
I saw another issue, it brakes the path to the image:
<img src=&quot;/images/smilies/Happy_smiley.png" title=":-)" alt=":-)">)
How to solve this?
Sergey's Avatar Sergey
Another brake is with tables, sorry:
<table border=&quot;0" cellspacing="3">
Sergey's Avatar Sergey
Don't get mad, another brake with "class":
<span class=&quot;cn">
Peter van Westen's Avatar Peter van Westen ADMIN
How many {tip} tags containing html do you have in your content?
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
And do you also have tags that have the '}' character in the content?
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
How many {tip} tags containing html do you have in your content?
A looooot...
And do you also have tags that have the '}' character in the content?
Not sure, hopefully, I don't have.
Peter van Westen's Avatar Peter van Westen ADMIN
After restoring the db to undo above quote replacements...

See if this works.
\{tip ([^\}]+?)\:([^\}]+)\}
Replace:
{tip title="\1" content="\2"}

If there are just a few that get messed up by this, it is probably easiest to fix those manually.
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
That would be helpful in the future, but now I didn't do the replacement, since I saw in the preview that there will be "brakes".
And no, manually won't be the easiest.
I saw those three, maybe that's all. Are they replaceable?
Peter van Westen's Avatar Peter van Westen ADMIN
Not sure what you mean. How many matches does the above replacement give?
And do you see any instances where it would not work? If so... what?
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
I mean, there will be different img, table and span. Those are not single instances. Can you replace quote marks in them? For example, <span class="cn"> on <span class='cn'>. Will single quote marks work? The same goes for img, table.
Peter van Westen's Avatar Peter van Westen ADMIN
I know... but ignoring the quotes... have you tried doing the replacement on one of them to see if it works?

So changing a:
{tip Some Title:Some content with html}
To:
{tip title="Some Title" content="Some content with html"}

Please do some tests first!
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
Mmm... It's your basic function, why shouldn't it work? Am I missing something?
Yes, it works.
Peter van Westen's Avatar Peter van Westen ADMIN
So... again:
See if this works.
\{tip ([^\}]+?)\:([^\}]+)\}
Replace:
{tip title="\1" content="\2"}
Please post a rating at the Joomla! Extensions Directory
Sergey's Avatar Sergey
It works, only I have two colons:
{tip title="Title" content=":Content"}
\{tip ([^\}]+?)\:([^\}]+)\}
this needs to be corrected, probably like this:
\{tip ([^\}]+?)\::([^\}]+)\}
what next?
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription