![]() |
How to remove links from a database field?
I have links and Downloads Manager installed. In 1100 entries in there are dead links in the description field, due to copy -pasting of text.
I need to remove all links from the that description field, so that only plain text remains in that field. The database table is vb_linkslink and the field is linkdesc Links look like this: Code:
[url="http://www.somesite.com/entrez?Db=pubmed&Cmd=Search&Term=%22Guo%20Y%22%5BAuthor%5D&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_DiscoveryPanel.Pubmed_RVAbstractPlus"][color=black]Some author name[/color][/url] Does anyone know what query I could use to do this? |
I don't think a query would work on something like this. You'll need a custom script and need to use some sort of regular expression to find matches and remove them.
|
PHP Code:
PHP Code:
|
Where should that code go to execute it?
|
For things like that I usually create a plugin using hook misc_start and code like this:
PHP Code:
then go to page misc.php?do=fixlinks to run it, and disable or delete it when I'm done. |
New PHP file works too...
PHP Code:
|
Quote:
Nice, that is pretty simple. :) For some reason I've been under the impression that a few more things would need to be defined for that to work. |
Nope, those are the only two required lines (error_reporting, require global.php) :)
The rest are good practice but don't matter for quick one-off scripts. |
Unfortunately that didnt work as planned.
Instead of hotlinked words, I now have this: Code:
Eur J Pharmacol. (javascript:AL_get(this, 'jour', 'Eur J Pharmacol.')); 1998 Jan 12;341(2-3):131-4 Code:
Eur J Pharmacol. 1998 Jan 12;341(2-3):131-4 |
I'd revert it for now, yeah.
If you want to send me a few example rows (10-50 or so) I can get it working for you, but will be difficult without any real data. --------------- Added [DATE]1309800396[/DATE] at [TIME]1309800396[/TIME] --------------- If you want, try it again, and set $showlinks to false (4th argument to strip_bbcode). That should do the trick. |
All times are GMT. The time now is 02:20 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|