fork download
  1. <?php
  2.  
  3. define('_JEXEC', 1);
  4.  
  5. if (file_exists(__DIR__ . '/defines.php'))
  6. {
  7. include_once __DIR__ . '/defines.php';
  8. }
  9.  
  10. if (!defined('_JDEFINES'))
  11. {
  12. define('JPATH_BASE', __DIR__);
  13. require_once JPATH_BASE . '/includes/defines.php';
  14. }
  15.  
  16. require_once JPATH_BASE . '/includes/framework.php';
  17.  
  18. require_once JPATH_BASE . '/libraries/joomla/factory.php';
  19.  
  20. $db = JFactory::getDbo();
  21.  
  22. $query = $db->getQuery(true);
  23.  
  24. $qr_result = $db->setQuery('SELECT * FROM ' . $db->quoteName('#__content') . ' WHERE 1');
  25.  
  26. $list = $db->loadObjectList();
  27.  
  28. //var_dump($list);
  29.  
  30. for ($i = 0; $i < count($list); $i++){
  31. $title = $article[$i]->title;
  32. //echo $title . "<br>";
  33. $replaceFrom = '<img';
  34. $replaceTo = '<img alt="' . $title . '" ' . 'title="' . $title . '"';
  35. $qr_result = $db->setQuery(
  36. 'UPDATE ' . $db->quoteName('#__content') .
  37. ' SET ' . $db->quoteName('fulltext') .
  38. ' = REPLACE(' . $db->quoteName('fulltext') . ', ' . $db->quote($replaceFrom) . ', ' . $db->quote($replaceTo) .
  39. ') WHERE ' . $db->quoteName('title') . ' = ' . $db->quote($title));
  40. }
  41.  
  42. $result = $db->query();
Runtime error #stdin #stdout #stderr 0.01s 20520KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  require_once(/home/Q4JiLo/includes/defines.php): failed to open stream: No such file or directory in /home/Q4JiLo/prog.php on line 13
PHP Fatal error:  require_once(): Failed opening required '/home/Q4JiLo/includes/defines.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/Q4JiLo/prog.php on line 13