]> git.mxchange.org Git - friendica.git/blob - include/create_shadowentry.php
Bugfix for bugfix :-)
[friendica.git] / include / create_shadowentry.php
1 <?php
2 /**
3  * @file include/create_shadowentry.php
4  * @brief This script creates posts with UID = 0 for a given public post.
5  *
6  * This script is started from mod/item.php to save some time when doing a post.
7  */
8
9 use \Friendica\Core\Config;
10
11 require_once("boot.php");
12 require_once("include/threads.php");
13
14 function create_shadowentry_run($argv, $argc) {
15         global $a, $db;
16
17         if (is_null($a))
18                 $a = new App;
19
20         if (is_null($db)) {
21                 @include(".htconfig.php");
22                 require_once("include/dba.php");
23                 $db = new dba($db_host, $db_user, $db_pass, $db_data);
24                 unset($db_host, $db_user, $db_pass, $db_data);
25         }
26
27         Config::load();
28
29         if ($argc != 2) {
30                 return;
31         }
32
33         $message_id = intval($argv[1]);
34
35         add_shadow_entry($message_id);
36 }
37
38 if (array_search(__file__,get_included_files())===0){
39   create_shadowentry_run($_SERVER["argv"],$_SERVER["argc"]);
40   killme();
41 }
42 ?>