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 cxq09_content WHERE 1");
  25.  
  26. $list = $db->loadObjectList();
  27.  
  28. foreach($list as $article){
  29. $title = $article->title;
  30. echo $title . "\n";
  31. $replaceFrom = '<img';
  32. $replaceTo = '<img alt=\"' . $title . '\" ' . 'title=\"' . $title . '\"';
  33. $qr_result = $db->setQuery(
  34. 'UPDATE ' . $db->quoteName('#__content') .
  35. ' SET ' . $db->quoteName('fulltext') .
  36. ' = REPLACE(' . $db->quoteName('fulltext') . ', ' . $db->quote($replaceFrom) . ', ' . $db->quote($replaceTo) .
  37. ') WHERE ' . $db->quoteName($title) . ' = ' . $title);
  38. }
  39.  
  40.  
  41.  
  42. $result = $db->query();
Runtime error #stdin #stdout #stderr 0.02s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  require_once(/home/XcP0zS/includes/defines.php): failed to open stream: No such file or directory in /home/XcP0zS/prog.php on line 13
PHP Fatal error:  require_once(): Failed opening required '/home/XcP0zS/includes/defines.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/XcP0zS/prog.php on line 13