]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/fixup_hashtags.php
Make attachment fit better in notice: drop text and link
[quix0rs-gnu-social.git] / scripts / fixup_hashtags.php
index 87bbecfb44ed57fbcfa21b4d9d4203fd39048efa..343c9ee1440a2f598478d3caa10e82c793045b69 100755 (executable)
@@ -24,9 +24,10 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
     exit();
 }
 
-define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-define('STATUSNET', true);
-define('LACONICA', true); // compatibility
+define('INSTALLDIR', dirname(__DIR__));
+define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public');
+define('GNUSOCIAL', true);
+define('STATUSNET', true);  // compatibility
 
 require_once(INSTALLDIR . '/lib/common.php');
 
@@ -39,7 +40,9 @@ while ($notice->fetch()) {
     common_log(LOG_INFO, 'Getting tags for notice #' . $notice->id);
     $notice->saveTags();
     $original = clone($notice);
-    $notice->rendered = common_render_content($notice->content, $notice);
+    $notice->rendered = common_render_content($notice->content,
+                                              $notice->getProfile(),
+                                              $notice->hasParent() ? $notice->getParent() : null);
     $result = $notice->update($original);
     if (!$result) {
         common_log_db_error($notice, 'UPDATE', __FILE__);