DB Replacer

Include value of column eg alias in Replace string?

Trevor Bennett

I am searching for text like [Note 1-12] using eg \[Note [0-9]{1,2} in fulltext, in a range of articles, limited in Where by catid and expressions like right(alias,3) resulting in a numeric string like '049'
and need to Replace the result of the search in many rows by eg {modal article=049-$0}049.$0{/modal}, to give the content of the individual numbered Notes article alias=049-1 as a modal pop-up, link=[Note 049.1]

I tried eg {modal article=right(alias,3)-$0}right(alias,3).$0{/modal} but unsurprizingly this shows in the Preview, [Note 1{modal article=right(alias,3)-[Note 1}right(alias,3).[Note 1{/modal} ie including that literal text 'right(alias,3)'

-can I instead get the value of that function?
- would this be any easier using eg your rereplacer extension, free or pro? I realize that rereplacer does a "temporary" change ie not of the actual content html, but this may be OK with the site owner.

Trevor Bennett

OK. that's what it looked like in the documentation. I shall try inserting my nnn, owner's local serial number, bit of alias into the fulltext, after the '[Note ' string, in every appropriate article first, using Plain Old PHPMySQL, and use DB Replacer to test and insert the Note number, {modal}{/modal} syntax etc for the multiple occurrences of numbered Notes that may be found within the article(s), not so easy in SQL!
WHEN I get it all working, I will give you a link to view the resulting conversion of notes from Printed book-style Footnotes to a more dynamic Web presentation...!
Thanks
Trevor

Trevor Bennett

I continue to have problems with SQL syntax dialect differences between PHPMyAdmin and ?DB Replacer ... I inserted the extra "serial number" into around 70 articles using SQL, and now have eg [Note 049.1] available in the fulltext of the article at http://http://songsfromtheageofsteam.uk/comic-tales/150-bar049, see source code
But I have searched in vain using DB Replacer for this string so that I can wrap it in {modal article = note-049-1} {/modal} , this working well at eg
songsfromtheageofsteam.uk/other-rivers-before-1851/57-bar666
, done by manual editing to popup the extracted Note articles.
I tried your example syntax in tutorial eg (\$[0-9]+\.[0-9][0-9]) but every variation I have tried produces either Search string not found or invalid query errors. I tried alternative ways of finding 049.1 eg [0-9]{3}[0-9]{1,2} to allow for note numbers above 9, but with no advances. I changed the square brackets to < > in case I was having special character problems, at the above url ie
songsfromtheageofsteam.uk/comic-tales/150-bar049
; my DB R search, screen print attached

Can you help please? It would be helpful also if the admin screen could retain the field values for Where/Search/Replace/Regex in a cache at least during a Joomla session; going to chaeck the text of an article wipes them and my attempts to collect them via screenprints or Notepad notes are very frustrating!
I can give you S admin access eg (hidden text)

Log in

Extra

RegularLabs.com is not affiliated with or endorsed by the Joomla Project or Open Source Matters. The Joomla name and logo are used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.