<?php
{
include_once __DIR__ . '/defines.php' ;
}
{
define ( 'JPATH_BASE' , __DIR__
) ; require_once JPATH_BASE . '/includes/defines.php' ;
}
require_once JPATH_BASE . '/includes/framework.php' ;
require_once JPATH_BASE . '/libraries/joomla/factory.php' ;
$db = JFactory:: getDbo ( ) ;
$query = $db -> getQuery ( true ) ;
$qr_result = $db -> setQuery ( 'SELECT * FROM ' . $db -> quoteName ( '#__content' ) . ' WHERE 1' ) ;
$list = $db -> loadObjectList ( ) ;
//var_dump($list);
for ( $i = 0 ; $i < count ( $list ) ; $i ++ ) { $title = $article [ $i ] -> title ;
//echo $title . "<br>";
$replaceFrom = '<img' ;
$replaceTo = '<img alt="' . $title . '" ' . 'title="' . $title . '"' ;
$qr_result = $db -> setQuery (
'UPDATE ' . $db -> quoteName ( '#__content' ) .
' SET ' . $db -> quoteName ( 'fulltext' ) .
' = REPLACE(' . $db -> quoteName ( 'fulltext' ) . ', ' . $db -> quote ( $replaceFrom ) . ', ' . $db -> quote ( $replaceTo ) .
') WHERE ' . $db -> quoteName ( 'title' ) . ' = ' . $db -> quote ( $title ) ) ;
}
$result = $db -> query ( ) ;
PD9waHAKCmRlZmluZSgnX0pFWEVDJywgMSk7CgppZiAoZmlsZV9leGlzdHMoX19ESVJfXyAuICcvZGVmaW5lcy5waHAnKSkKewogIGluY2x1ZGVfb25jZSBfX0RJUl9fIC4gJy9kZWZpbmVzLnBocCc7Cn0KCmlmICghZGVmaW5lZCgnX0pERUZJTkVTJykpCnsKICBkZWZpbmUoJ0pQQVRIX0JBU0UnLCBfX0RJUl9fKTsKICByZXF1aXJlX29uY2UgSlBBVEhfQkFTRSAuICcvaW5jbHVkZXMvZGVmaW5lcy5waHAnOwp9CgpyZXF1aXJlX29uY2UgSlBBVEhfQkFTRSAuICcvaW5jbHVkZXMvZnJhbWV3b3JrLnBocCc7CgpyZXF1aXJlX29uY2UgSlBBVEhfQkFTRSAuICcvbGlicmFyaWVzL2pvb21sYS9mYWN0b3J5LnBocC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