]> git.mxchange.org Git - friendica.git/commitdiff
Updated modules to allow for partial overrides without errors
authorAndrej Stieben <e-mail@stieben.de>
Fri, 5 Feb 2016 20:52:39 +0000 (21:52 +0100)
committerAndrej Stieben <e-mail@stieben.de>
Fri, 5 Feb 2016 20:52:39 +0000 (21:52 +0100)
Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.

123 files changed:
mod/_well_known.php
mod/acctlink.php
mod/acl.php
mod/admin.php
mod/allfriends.php
mod/amcd.php
mod/api.php
mod/apps.php
mod/attach.php
mod/babel.php
mod/bookmarklet.php
mod/cb.php
mod/common.php
mod/community.php
mod/contactgroup.php
mod/contacts.php
mod/content.php
mod/credits.php
mod/crepair.php
mod/delegate.php
mod/dfrn_confirm.php
mod/dfrn_notify.php
mod/dfrn_poll.php
mod/directory.php
mod/dirfind.php
mod/display.php
mod/editpost.php
mod/events.php
mod/fbrowser.php
mod/filer.php
mod/filerm.php
mod/follow.php
mod/friendica.php
mod/fsuggest.php
mod/group.php
mod/hcard.php
mod/help.php
mod/hostxrd.php
mod/ignored.php
mod/install.php
mod/invite.php
mod/item.php
mod/like.php
mod/localtime.php
mod/lockview.php
mod/login.php
mod/lostpass.php
mod/maintenance.php
mod/manage.php
mod/match.php
mod/message.php
mod/modexp.php
mod/mood.php
mod/msearch.php
mod/navigation.php
mod/network.php
mod/newmember.php
mod/nodeinfo.php
mod/nogroup.php
mod/noscrape.php
mod/notes.php
mod/notice.php
mod/notifications.php
mod/notify.php
mod/oembed.php
mod/oexchange.php
mod/openid.php
mod/opensearch.php
mod/ostatus_subscribe.php
mod/p.php
mod/parse_url.php
mod/photo.php
mod/photos.php
mod/ping.php
mod/poco.php
mod/poke.php
mod/post.php
mod/pretheme.php
mod/probe.php
mod/profile.php
mod/profile_photo.php
mod/profiles.php
mod/profperm.php
mod/proxy.php
mod/pubsub.php
mod/pubsubhubbub.php
mod/qsearch.php
mod/randprof.php
mod/receive.php
mod/redir.php
mod/regmod.php
mod/removeme.php
mod/repair_ostatus.php
mod/rsd_xml.php
mod/salmon.php
mod/search.php
mod/session.php
mod/settings.php
mod/share.php
mod/smilies.php
mod/starred.php
mod/statistics_json.php
mod/subthread.php
mod/suggest.php
mod/tagger.php
mod/tagrm.php
mod/toggle_mobile.php
mod/uexport.php
mod/uimport.php
mod/update_community.php
mod/update_display.php
mod/update_network.php
mod/update_notes.php
mod/update_profile.php
mod/videos.php
mod/view.php
mod/viewcontacts.php
mod/viewsrc.php
mod/wall_attach.php
mod/wall_upload.php
mod/wallmessage.php
mod/webfinger.php
mod/xrd.php

index 33070a1ecdf4dc071d65aabd94b67f530be47efe..6c33136f957a2576bf8a121404782aa23ece0f03 100644 (file)
@@ -2,6 +2,7 @@
 require_once("mod/hostxrd.php");\r
 require_once("mod/nodeinfo.php");\r
 \r
+if(! function_exists('_well_known_init')) {\r
 function _well_known_init(&$a){\r
        if ($a->argc > 1) {\r
                switch($a->argv[1]) {\r
@@ -19,7 +20,9 @@ function _well_known_init(&$a){
        http_status_exit(404);\r
        killme();\r
 }\r
+}\r
 \r
+if(! function_exists('wk_social_relay')) {\r
 function wk_social_relay(&$a) {\r
 \r
        define('SR_SCOPE_ALL', 'all');\r
@@ -64,3 +67,4 @@ function wk_social_relay(&$a) {
        echo json_encode($relay, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);\r
        exit;\r
 }\r
+}\r
index a2365803ac46047e1c1a2497520b21e46f9e0171..a551e3dbd673f6f7d62f6f71482bc15c8e59824f 100644 (file)
@@ -2,8 +2,8 @@
 
 require_once('include/Scrape.php');
 
+if(! function_exists('acctlink_init')) {
 function acctlink_init(&$a) {
-
        if(x($_GET,'addr')) {
                $addr = trim($_GET['addr']);
                $res = probe_url($addr);
@@ -14,3 +14,4 @@ function acctlink_init(&$a) {
                }
        }
 }
+}
index f5e04b96a75154ee76a042222925754164cfeaa4..5666ccabb8112646f9c01217a9994d86edda8d3c 100644 (file)
@@ -3,8 +3,8 @@
 
 require_once("include/acl_selectors.php");
 
+if(! function_exists('acl_init')) {
 function acl_init(&$a){
        acl_lookup($a);
 }
-
-
+}
index 7f9000807be62021fa9535778bdc5bd5972b5c97..ff17c0b8c44b510f294f9e2322ea1cf68a13149a 100644 (file)
@@ -2,7 +2,7 @@
 
  /**
  * @file mod/admin.php
- * 
+ *
  * @brief Friendica admin
  */
 
@@ -23,6 +23,7 @@ require_once("include/text.php");
  * @param App $a
  *
  */
+if(! function_exists('admin_post')) {
 function admin_post(&$a){
 
 
@@ -110,6 +111,7 @@ function admin_post(&$a){
        goaway($a->get_baseurl(true) . '/admin' );
        return; // NOTREACHED
 }
+}
 
 /**
  * @brief Generates content of the admin panel pages
@@ -128,6 +130,7 @@ function admin_post(&$a){
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_content')) {
 function admin_content(&$a) {
 
        if(!is_site_admin()) {
@@ -245,6 +248,7 @@ function admin_content(&$a) {
                return $o;
        }
 }
+}
 
 /**
  * @brief Subpage with some stats about "the federation" network
@@ -260,6 +264,7 @@ function admin_content(&$a) {
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_federation')) {
 function admin_page_federation(&$a) {
        // get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
        // social and statusnet nodes this node is knowing
@@ -284,7 +289,7 @@ function admin_page_federation(&$a) {
                // what versions for that platform do we know at all?
                // again only the active nodes
                $v = q('SELECT count(*) AS total, version FROM gserver
-                       WHERE last_contact > last_failure AND platform LIKE "%s" 
+                       WHERE last_contact > last_failure AND platform LIKE "%s"
                        GROUP BY version
                        ORDER BY version;', $p);
 
@@ -301,12 +306,12 @@ function admin_page_federation(&$a) {
                                $newVC = $vv['total'];
                                $newVV = $vv['version'];
                                $posDash = strpos($newVV, '-');
-                               if($posDash) 
+                               if($posDash)
                                        $newVV = substr($newVV, 0, $posDash);
                                if(isset($newV[$newVV]))
-                                       $newV[$newVV] += $newVC; 
+                                       $newV[$newVV] += $newVC;
                                else
-                                       $newV[$newVV] = $newVC; 
+                                       $newV[$newVV] = $newVC;
                        }
                        foreach ($newV as $key => $value) {
                                array_push($newVv, array('total'=>$value, 'version'=>$key));
@@ -361,6 +366,7 @@ function admin_page_federation(&$a) {
                '$baseurl' => $a->get_baseurl(),
        ));
 }
+}
 
 /**
  * @brief Admin Inspect Queue Page
@@ -375,6 +381,7 @@ function admin_page_federation(&$a) {
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_queue')) {
 function admin_page_queue(&$a) {
        // get content from the queue table
        $r = q("SELECT c.name,c.nurl,q.id,q.network,q.created,q.last from queue as q, contact as c where c.id=q.cid order by q.cid, q.created;");
@@ -394,6 +401,7 @@ function admin_page_queue(&$a) {
                '$entries' => $r,
        ));
 }
+}
 
 /**
  * @brief Admin Summary Page
@@ -406,6 +414,7 @@ function admin_page_queue(&$a) {
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_summary')) {
 function admin_page_summary(&$a) {
        $r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`");
        $accounts = array(
@@ -452,12 +461,14 @@ function admin_page_summary(&$a) {
                '$plugins' => array( t('Active plugins'), $a->plugins )
        ));
 }
+}
 
 /**
  * @brief Process send data from Admin Site Page
- * 
+ *
  * @param App $a
  */
+if(! function_exists('admin_page_site_post')) {
 function admin_page_site_post(&$a) {
        if(!x($_POST,"page_site")) {
                return;
@@ -770,6 +781,7 @@ function admin_page_site_post(&$a) {
        return; // NOTREACHED
 
 }
+}
 
 /**
  * @brief Generate Admin Site subpage
@@ -779,6 +791,7 @@ function admin_page_site_post(&$a) {
  * @param  App $a
  * @return string
  */
+if(! function_exists('admin_page_site')) {
 function admin_page_site(&$a) {
 
        /* Installed langs */
@@ -983,7 +996,7 @@ function admin_page_site(&$a) {
                '$form_security_token'  => get_form_security_token("admin_site")
 
        ));
-
+}
 }
 
 /**
@@ -998,6 +1011,7 @@ function admin_page_site(&$a) {
  * @param App $a
  * @return string
  **/
+if(! function_exists('admin_page_dbsync')) {
 function admin_page_dbsync(&$a) {
 
        $o = '';
@@ -1073,14 +1087,15 @@ function admin_page_dbsync(&$a) {
        }
 
        return $o;
-
+}
 }
 
 /**
  * @brief Process data send by Users admin page
- * 
+ *
  * @param App $a
  */
+if(! function_exists('admin_page_users_post')) {
 function admin_page_users_post(&$a){
        $pending        =       ( x($_POST, 'pending')                  ? $_POST['pending']             : array() );
        $users          =       ( x($_POST, 'user')                     ? $_POST['user']                : array() );
@@ -1171,6 +1186,7 @@ function admin_page_users_post(&$a){
        goaway($a->get_baseurl(true) . '/admin/users' );
        return; // NOTREACHED
 }
+}
 
 /**
  * @brief Admin panel subpage for User management
@@ -1184,6 +1200,7 @@ function admin_page_users_post(&$a){
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_users')) {
 function admin_page_users(&$a){
        if($a->argc>2) {
                $uid = $a->argv[3];
@@ -1336,7 +1353,7 @@ function admin_page_users(&$a){
        $o .= paginate($a);
        return $o;
 }
-
+}
 
 /**
  * @brief Plugins admin page
@@ -1354,6 +1371,7 @@ function admin_page_users(&$a){
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_plugins')) {
 function admin_page_plugins(&$a){
 
        /*
@@ -1479,17 +1497,19 @@ function admin_page_plugins(&$a){
                '$baseurl' => $a->get_baseurl(true),
                '$function' => 'plugins',
                '$plugins' => $plugins,
-               '$pcount' => count($plugins), 
+               '$pcount' => count($plugins),
                '$noplugshint' => sprintf( t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s'), 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
                '$form_security_token' => get_form_security_token("admin_themes"),
        ));
 }
+}
 
 /**
  * @param array $themes
  * @param string $th
  * @param int $result
  */
+if(! function_exists('toggle_theme')) {
 function toggle_theme(&$themes,$th,&$result) {
        for($x = 0; $x < count($themes); $x ++) {
                if($themes[$x]['name'] === $th) {
@@ -1504,12 +1524,14 @@ function toggle_theme(&$themes,$th,&$result) {
                }
        }
 }
+}
 
 /**
  * @param array $themes
  * @param string $th
  * @return int
  */
+if(! function_exists('theme_status')) {
 function theme_status($themes,$th) {
        for($x = 0; $x < count($themes); $x ++) {
                if($themes[$x]['name'] === $th) {
@@ -1523,12 +1545,13 @@ function theme_status($themes,$th) {
        }
        return 0;
 }
-
+}
 
 /**
  * @param array $themes
  * @return string
  */
+if(! function_exists('rebuild_theme_table')) {
 function rebuild_theme_table($themes) {
        $o = '';
        if(count($themes)) {
@@ -1542,7 +1565,7 @@ function rebuild_theme_table($themes) {
        }
        return $o;
 }
-
+}
 
 /**
  * @brief Themes admin page
@@ -1560,6 +1583,7 @@ function rebuild_theme_table($themes) {
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_themes')) {
 function admin_page_themes(&$a){
 
        $allowed_themes_str = get_config('system','allowed_themes');
@@ -1734,13 +1758,14 @@ function admin_page_themes(&$a){
                '$form_security_token' => get_form_security_token("admin_themes"),
        ));
 }
-
+}
 
 /**
  * @brief Prosesses data send by Logs admin page
- * 
+ *
  * @param App $a
  */
+if(! function_exists('admin_page_logs_post')) {
 function admin_page_logs_post(&$a) {
        if(x($_POST,"page_logs")) {
                check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
@@ -1758,6 +1783,7 @@ function admin_page_logs_post(&$a) {
        goaway($a->get_baseurl(true) . '/admin/logs' );
        return; // NOTREACHED
 }
+}
 
 /**
  * @brief Generates admin panel subpage for configuration of the logs
@@ -1775,6 +1801,7 @@ function admin_page_logs_post(&$a) {
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_logs')) {
 function admin_page_logs(&$a){
 
        $log_choices = array(
@@ -1806,6 +1833,7 @@ function admin_page_logs(&$a){
                '$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE );\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
        ));
 }
+}
 
 /**
  * @brief Generates admin panel subpage to view the Friendica log
@@ -1825,6 +1853,7 @@ function admin_page_logs(&$a){
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_viewlogs')) {
 function admin_page_viewlogs(&$a){
        $t = get_markup_template("admin_viewlogs.tpl");
        $f = get_config('system','logfile');
@@ -1861,12 +1890,14 @@ function admin_page_viewlogs(&$a){
                '$logname' =>  get_config('system','logfile')
        ));
 }
+}
 
 /**
  * @brief Prosesses data send by the features admin page
- * 
+ *
  * @param App $a
  */
+if(! function_exists('admin_page_features_post')) {
 function admin_page_features_post(&$a) {
 
        check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
@@ -1898,23 +1929,25 @@ function admin_page_features_post(&$a) {
        goaway($a->get_baseurl(true) . '/admin/features' );
        return; // NOTREACHED
 }
+}
 
 /**
  * @brief Subpage for global additional feature management
- * 
+ *
  * This functin generates the subpage 'Manage Additional Features'
  * for the admin panel. At this page the admin can set preferences
- * for the user settings of the 'additional features'. If needed this 
+ * for the user settings of the 'additional features'. If needed this
  * preferences can be locked through the admin.
- * 
+ *
  * The returned string contains the HTML code of the subpage 'Manage
  * Additional Features'
- * 
+ *
  * @param App $a
  * @return string
  */
+if(! function_exists('admin_page_features')) {
 function admin_page_features(&$a) {
-       
+
        if((argc() > 1) && (argv(1) === 'features')) {
                $arr = array();
                $features = get_features(false);
@@ -1933,7 +1966,7 @@ function admin_page_features(&$a) {
                                );
                        }
                }
-               
+
                $tpl = get_markup_template("admin_settings_features.tpl");
                $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("admin_manage_features"),
@@ -1945,3 +1978,4 @@ function admin_page_features(&$a) {
                return $o;
        }
 }
+}
index 356a389b83693ce291ae4b4afce726dcad7e0105..8843265a99ed9a92a2637252b0911e69eabc2e58 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/Contact.php');
 require_once('include/contact_selectors.php');
 require_once('mod/contacts.php');
 
+if(! function_exists('allfriends_content')) {
 function allfriends_content(&$a) {
 
        $o = '';
@@ -97,3 +98,4 @@ function allfriends_content(&$a) {
 
        return $o;
 }
+}
index a2a1327e6df8b47c5452eb2fe0e1780294b26988..141a80429887094774fab8bd894095b6a4559a6d 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-
+if(! function_exists('amcd_content')) {
 function amcd_content(&$a) {
 //header("Content-type: text/json");
 echo <<< EOT
@@ -46,4 +46,5 @@ echo <<< EOT
 }
 EOT;
 killme();
-}
\ No newline at end of file
+}
+}
index da2c40c3055a54b566cfd92bdcaf6a40680b65a0..67564836e8386b6a58abadc2d4fd51999fe5edbe 100644 (file)
@@ -1,10 +1,8 @@
 <?php
-
 require_once('include/api.php');
 
+if(! function_exists('oauth_get_client')) {
 function oauth_get_client($request){
-
-
        $params = $request->get_parameters();
        $token = $params['oauth_token'];
 
@@ -19,9 +17,10 @@ function oauth_get_client($request){
 
        return $r[0];
 }
+}
 
+if(! function_exists('api_post')) {
 function api_post(&$a) {
-
        if(! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
@@ -31,9 +30,10 @@ function api_post(&$a) {
                notice( t('Permission denied.') . EOL);
                return;
        }
-
+}
 }
 
+if(! function_exists('api_content')) {
 function api_content(&$a) {
        if ($a->cmd=='api/oauth/authorize'){
                /*
@@ -114,3 +114,4 @@ function api_content(&$a) {
        echo api_call($a);
        killme();
 }
+}
index a821ef5d5b89192b5534df7e8b78cd074e9a7964..e807feae74e537c76110e33ccdf5f0ceb66bba63 100644 (file)
@@ -1,25 +1,23 @@
 <?php
-
+if(! function_exists('apps_content')) {
 function apps_content(&$a) {
-    $privateaddons = get_config('config','private_addons');
-      if ($privateaddons === "1") {
-       if((! (local_user())))  {
-       info( t("You must be logged in to use addons. "));
-      return;};
-}
-
-      $title = t('Applications');
+  $privateaddons = get_config('config','private_addons');
+  if ($privateaddons === "1") {
+    if((! (local_user()))) {
+      info( t("You must be logged in to use addons. "));
+      return;
+    }
+  }
 
-       if(count($a->apps)==0)
-               notice( t('No installed applications.') . EOL);
+  $title = t('Applications');
 
+  if(count($a->apps)==0)
+    notice( t('No installed applications.') . EOL);
 
-       $tpl = get_markup_template("apps.tpl");
-       return replace_macros($tpl, array(
-               '$title' => $title,
-               '$apps' => $a->apps,
-       ));
-
-       
-
+  $tpl = get_markup_template("apps.tpl");
+  return replace_macros($tpl, array(
+    '$title' => $title,
+    '$apps' => $a->apps,
+  ));
+}
 }
index 03f850f0d1749972d7e68e63de295007bf856cb5..849faa26ec54ebc45fa9c6a32a476f2b162834ff 100644 (file)
@@ -1,7 +1,7 @@
 <?php
-
 require_once('include/security.php');
 
+if(! function_exists('attach_init')) {
 function attach_init(&$a) {
 
        if($a->argc != 2) {
@@ -47,3 +47,4 @@ function attach_init(&$a) {
        killme();
        // NOTREACHED
 }
+}
index d31e090c554ee7f0b2c4eb6e716ed5b0d1f646ab..56455bdb21dd342192c01cfe59efe26ed3455038 100644 (file)
@@ -9,55 +9,56 @@ function visible_lf($s) {
        return str_replace("\n",'<br />', $s);
 }
 
+if(! function_exists('babel_content')) {
 function babel_content(&$a) {
 
        $o .= '<h1>Babel Diagnostic</h1>';
 
        $o .= '<form action="babel" method="post">';
        $o .= t('Source (bbcode) text:') . EOL . '<textarea name="text" >' . htmlspecialchars($_REQUEST['text']) .'</textarea>' . EOL;
-       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>';
 
        $o .= '<br /><br />';
 
        $o .= '<form action="babel" method="post">';
        $o .= t('Source (Diaspora) text to convert to BBcode:') . EOL . '<textarea name="d2bbtext" >' . htmlspecialchars($_REQUEST['d2bbtext']) .'</textarea>' . EOL;
-       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>';
 
        $o .= '<br /><br />';
 
        if(x($_REQUEST,'text')) {
 
                $text = trim($_REQUEST['text']);
-               $o .= "<h2>" . t("Source input: ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($text) . EOL. EOL; 
+               $o .= "<h2>" . t("Source input: ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($text) . EOL. EOL;
 
                $html = bbcode($text);
-               $o .= "<h2>" . t("bb2html (raw HTML): ") . "</h2>" . EOL. EOL; 
-               $o .= htmlspecialchars($html). EOL. EOL; 
+               $o .= "<h2>" . t("bb2html (raw HTML): ") . "</h2>" . EOL. EOL;
+               $o .= htmlspecialchars($html). EOL. EOL;
 
                //$html = bbcode($text);
-               $o .= "<h2>" . t("bb2html: ") . "</h2>" . EOL. EOL; 
-               $o .= $html. EOL. EOL; 
+               $o .= "<h2>" . t("bb2html: ") . "</h2>" . EOL. EOL;
+               $o .= $html. EOL. EOL;
 
                $bbcode = html2bbcode($html);
-               $o .= "<h2>" . t("bb2html2bb: ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($bbcode) . EOL. EOL; 
+               $o .= "<h2>" . t("bb2html2bb: ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($bbcode) . EOL. EOL;
 
                $diaspora = bb2diaspora($text);
-               $o .= "<h2>" . t("bb2md: ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($diaspora) . EOL. EOL; 
+               $o .= "<h2>" . t("bb2md: ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($diaspora) . EOL. EOL;
 
                $html = Markdown($diaspora);
-               $o .= "<h2>" . t("bb2md2html: ") . "</h2>" . EOL. EOL; 
-               $o .= $html. EOL. EOL; 
+               $o .= "<h2>" . t("bb2md2html: ") . "</h2>" . EOL. EOL;
+               $o .= $html. EOL. EOL;
 
                $bbcode = diaspora2bb($diaspora);
-               $o .= "<h2>" . t("bb2dia2bb: ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($bbcode) . EOL. EOL; 
+               $o .= "<h2>" . t("bb2dia2bb: ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($bbcode) . EOL. EOL;
 
                $bbcode = html2bbcode($html);
-               $o .= "<h2>" . t("bb2md2html2bb: ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($bbcode) . EOL. EOL; 
+               $o .= "<h2>" . t("bb2md2html2bb: ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($bbcode) . EOL. EOL;
 
 
 
@@ -66,14 +67,15 @@ function babel_content(&$a) {
        if(x($_REQUEST,'d2bbtext')) {
 
                $d2bbtext = trim($_REQUEST['d2bbtext']);
-               $o .= "<h2>" . t("Source input (Diaspora format): ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($d2bbtext) . EOL. EOL; 
+               $o .= "<h2>" . t("Source input (Diaspora format): ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($d2bbtext) . EOL. EOL;
 
 
                $bb = diaspora2bb($d2bbtext);
-               $o .= "<h2>" . t("diaspora2bb: ") . "</h2>" . EOL. EOL; 
-               $o .= visible_lf($bb) . EOL. EOL; 
+               $o .= "<h2>" . t("diaspora2bb: ") . "</h2>" . EOL. EOL;
+               $o .= visible_lf($bb) . EOL. EOL;
        }
 
        return $o;
 }
+}
index be8645c1fde901924032a4e88e48397d58f6a1c4..4db6bf401eef49d976e2f6e5f18c3abbb5590fb4 100644 (file)
@@ -1,12 +1,14 @@
 <?php
-
 require_once('include/conversation.php');
 require_once('include/items.php');
 
+if(! function_exists('bookmarklet_init')) {
 function bookmarklet_init(&$a) {
        $_GET["mode"] = "minimal";
 }
+}
 
+if(! function_exists('bookmarklet_content')) {
 function bookmarklet_content(&$a) {
        if(!local_user()) {
                $o = '<h2>'.t('Login').'</h2>';
@@ -44,3 +46,4 @@ function bookmarklet_content(&$a) {
 
        return $o;
 }
+}
index 6375d23984d708c989b81d53699843f9235fb076..04d01302c11504fff949580487ab7bc6af2950b0 100644 (file)
@@ -4,21 +4,28 @@
  * General purpose landing page for plugins/addons
  */
 
-
+if(! function_exists('cb_init')) {
 function cb_init(&$a) {
        call_hooks('cb_init');
 }
+}
 
+if(! function_exists('cb_post')) {
 function cb_post(&$a) {
        call_hooks('cb_post', $_POST);
 }
+}
 
+if(! function_exists('cb_afterpost')) {
 function cb_afterpost(&$a) {
        call_hooks('cb_afterpost');
 }
+}
 
+if(! function_exists('cb_content')) {
 function cb_content(&$a) {
        $o = '';
        call_hooks('cb_content', $o);
        return $o;
-}
\ No newline at end of file
+}
+}
index c9409b3ef1eaa041f57b8ff68c9c32b28a3afe38..4cdbe9641b3c006fd0b3c39bfaa3ef798f917ae0 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/Contact.php');
 require_once('include/contact_selectors.php');
 require_once('mod/contacts.php');
 
+if(! function_exists('common_content')) {
 function common_content(&$a) {
 
        $o = '';
@@ -144,3 +145,4 @@ function common_content(&$a) {
 
        return $o;
 }
+}
index b6d72a35555a64f375b1402fc3188c93357c3579..c64c6216b167095ab2f24702938ff373e1900302 100644 (file)
@@ -1,15 +1,14 @@
 <?php
-
+if(! function_exists('community_init')) {
 function community_init(&$a) {
        if(! local_user()) {
                unset($_SESSION['theme']);
                unset($_SESSION['mobile-theme']);
        }
-
-
+}
 }
 
-
+if(! function_exists('community_content')) {
 function community_content(&$a, $update = 0) {
 
        $o = '';
@@ -115,7 +114,9 @@ function community_content(&$a, $update = 0) {
 
        return $o;
 }
+}
 
+if(! function_exists('community_getitems')) {
 function community_getitems($start, $itemspage) {
        if (get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY)
                return(community_getpublicitems($start, $itemspage));
@@ -140,9 +141,10 @@ function community_getitems($start, $itemspage) {
        );
 
        return($r);
-
+}
 }
 
+if(! function_exists('community_getpublicitems')) {
 function community_getpublicitems($start, $itemspage) {
        $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
                        `author-name` AS `name`, `owner-avatar` AS `photo`,
@@ -157,3 +159,4 @@ function community_getpublicitems($start, $itemspage) {
 
        return($r);
 }
+}
index bf81afe079118767cd83e3917871e6cf34e510ff..0291350b21ed154dd5379253feb22c6d1f73ca47 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/group.php');
 
+if(! function_exists('contactgroup_content')) {
 function contactgroup_content(&$a) {
 
 
@@ -47,4 +48,5 @@ function contactgroup_content(&$a) {
        }
 
        killme();
-}
\ No newline at end of file
+}
+}
index 0b421433e0bdd1d52ef32d212f94786c270d1393..cef8bdb8978671ddac5cb1548ee799bcb49dc60a 100644 (file)
@@ -7,6 +7,7 @@ require_once('include/Scrape.php');
 require_once('mod/proxy.php');
 require_once('include/Photo.php');
 
+if(! function_exists('contacts_init')) {
 function contacts_init(&$a) {
        if(! local_user())
                return;
@@ -38,7 +39,7 @@ function contacts_init(&$a) {
 
                        if (($a->data['contact']['network'] != "") AND ($a->data['contact']['network'] != NETWORK_DFRN)) {
                                $networkname = format_network_name($a->data['contact']['network'],$a->data['contact']['url']);
-                       } else 
+                       } else
                                $networkname = '';
 
                        $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
@@ -88,9 +89,10 @@ function contacts_init(&$a) {
                '$base' => $base
        ));
 
-
+}
 }
 
+if(! function_exists('contacts_batch_actions')) {
 function contacts_batch_actions(&$a){
        $contacts_id = $_POST['contact_batch'];
        if (!is_array($contacts_id)) return;
@@ -132,10 +134,10 @@ function contacts_batch_actions(&$a){
                goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
        else
                goaway($a->get_baseurl(true) . '/contacts');
-
+}
 }
 
-
+if(! function_exists('contacts_post')) {
 function contacts_post(&$a) {
 
        if(! local_user())
@@ -215,10 +217,11 @@ function contacts_post(&$a) {
                $a->data['contact'] = $r[0];
 
        return;
-
+}
 }
 
 /*contact actions*/
+if(! function_exists('_contact_update')) {
 function _contact_update($contact_id) {
        $r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
        if (!$r)
@@ -239,7 +242,9 @@ function _contact_update($contact_id) {
                // pull feed and consume it, which should subscribe to the hub.
                proc_run('php',"include/onepoll.php","$contact_id", "force");
 }
+}
 
+if(! function_exists('_contact_update_profile')) {
 function _contact_update_profile($contact_id) {
        $r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
        if (!$r)
@@ -299,7 +304,9 @@ function _contact_update_profile($contact_id) {
        // Update the entry in the gcontact table
        update_gcontact_from_probe($data["url"]);
 }
+}
 
+if(! function_exists('_contact_block')) {
 function _contact_block($contact_id, $orig_record) {
        $blocked = (($orig_record['blocked']) ? 0 : 1);
        $r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d",
@@ -308,8 +315,10 @@ function _contact_block($contact_id, $orig_record) {
                intval(local_user())
        );
        return $r;
-
 }
+}
+
+if(! function_exists('_contact_ignore')) {
 function _contact_ignore($contact_id, $orig_record) {
        $readonly = (($orig_record['readonly']) ? 0 : 1);
        $r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d",
@@ -319,6 +328,9 @@ function _contact_ignore($contact_id, $orig_record) {
        );
        return $r;
 }
+}
+
+if(! function_exists('_contact_archive')) {
 function _contact_archive($contact_id, $orig_record) {
        $archived = (($orig_record['archive']) ? 0 : 1);
        $r = q("UPDATE `contact` SET `archive` = %d WHERE `id` = %d AND `uid` = %d",
@@ -331,14 +343,18 @@ function _contact_archive($contact_id, $orig_record) {
        }
        return $r;
 }
+}
+
+if(! function_exists('_contact_drop')) {
 function _contact_drop($contact_id, $orig_record) {
        $a = get_app();
 
        terminate_friendship($a->user,$a->contact,$orig_record);
        contact_remove($orig_record['id']);
 }
+}
 
-
+if(! function_exists('contacts_content')) {
 function contacts_content(&$a) {
 
        $sort_type = 0;
@@ -799,7 +815,9 @@ function contacts_content(&$a) {
 
        return $o;
 }
+}
 
+if(! function_exists('contacts_tab')) {
 function contacts_tab($a, $contact_id, $active_tab) {
        // tabs
        $tabs = array(
@@ -873,7 +891,9 @@ function contacts_tab($a, $contact_id, $active_tab) {
 
        return $tab_str;
 }
+}
 
+if(! function_exists('contact_posts')) {
 function contact_posts($a, $contact_id) {
 
        $r = q("SELECT `url` FROM `contact` WHERE `id` = %d", intval($contact_id));
@@ -901,7 +921,9 @@ function contact_posts($a, $contact_id) {
 
        return $o;
 }
+}
 
+if(! function_exists('_contact_detail_for_template')) {
 function _contact_detail_for_template($rr){
 
        $community = '';
@@ -952,5 +974,5 @@ function _contact_detail_for_template($rr){
                'url' => $url,
                'network' => network_to_name($rr['network'], $rr['url']),
        );
-
+}
 }
index c5a55561167e767ab02c63b490e14f899e2ceb91..ab0fe7e4bf2a37a884f4154f297b2ad05d6e4797 100644 (file)
@@ -15,7 +15,7 @@
 // fast - e.g. one or two milliseconds to fetch parent items for the current content,
 // and 10-20 milliseconds to fetch all the child items.
 
-
+if(! function_exists('content_content')) {
 function content_content(&$a, $update = 0) {
 
        require_once('include/conversation.php');
@@ -61,7 +61,7 @@ function content_content(&$a, $update = 0) {
 
        $o = '';
 
-       
+
 
        $contact_id = $a->cid;
 
@@ -100,7 +100,7 @@ function content_content(&$a, $update = 0) {
                        $def_acl = array('allow_cid' => $str);
        }
 
-       
+
        $sql_options  = (($star) ? " and starred = 1 " : '');
        $sql_options .= (($bmark) ? " and bookmark = 1 " : '');
 
@@ -137,7 +137,7 @@ function content_content(&$a, $update = 0) {
        }
        elseif($cid) {
 
-               $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d 
+               $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d
                                AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
                        intval($cid)
                );
@@ -304,9 +304,9 @@ function content_content(&$a, $update = 0) {
        echo json_encode($o);
        killme();
 }
+}
 
-
-
+if(! function_exists('render_content')) {
 function render_content(&$a, $items, $mode, $update, $preview = false) {
 
        require_once('include/bbcode.php');
@@ -373,7 +373,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
 
-                       // "New Item View" on network page or search page results 
+                       // "New Item View" on network page or search page results
                        // - just loop through the items and format them minimally for display
 
                        //$tpl = get_markup_template('search_item.tpl');
@@ -389,7 +389,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                $sparkle     = '';
 
                                if($mode === 'search' || $mode === 'community') {
-                                       if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) 
+                                       if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
                                                && ($item['id'] != $item['parent']))
                                                continue;
                                        $nickname = $item['nickname'];
@@ -436,7 +436,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $drop = array(
                                        'dropping' => $dropping,
-                                       'select' => t('Select'), 
+                                       'select' => t('Select'),
                                        'delete' => t('Delete'),
                                );
 
@@ -526,11 +526,11 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                                $comments[$item['parent']] = 1;
                                        else
                                                $comments[$item['parent']] += 1;
-                               } elseif(! x($comments,$item['parent'])) 
+                               } elseif(! x($comments,$item['parent']))
                                        $comments[$item['parent']] = 0; // avoid notices later on
                        }
 
-                       // map all the like/dislike activities for each parent item 
+                       // map all the like/dislike activities for each parent item
                        // Store these in the $alike and $dlike arrays
 
                        foreach($items as $item) {
@@ -617,14 +617,14 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ;
 
-                               $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
+                               $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
                                        || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
                                        ? t('Private Message')
                                        : false);
 
 
                                // Top-level wall post not written by the wall owner (wall-to-wall)
-                               // First figure out who owns it. 
+                               // First figure out who owns it.
 
                                $osparkle = '';
 
@@ -651,13 +651,13 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                                if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
 
                                                        // The author url doesn't match the owner (typically the contact)
-                                                       // and also doesn't match the contact alias. 
-                                                       // The name match is a hack to catch several weird cases where URLs are 
+                                                       // and also doesn't match the contact alias.
+                                                       // The name match is a hack to catch several weird cases where URLs are
                                                        // all over the park. It can be tricked, but this prevents you from
                                                        // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
-                                                       // well that it's the same Bob Smith. 
+                                                       // well that it's the same Bob Smith.
 
-                                                       // But it could be somebody else with the same name. It just isn't highly likely. 
+                                                       // But it could be somebody else with the same name. It just isn't highly likely.
 
 
                                                        $owner_url = $item['owner-link'];
@@ -666,7 +666,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                                        $template = $wallwall;
                                                        $commentww = 'ww';
                                                        // If it is our contact, use a friendly redirect link
-                                                       if((link_compare($item['owner-link'],$item['url'])) 
+                                                       if((link_compare($item['owner-link'],$item['url']))
                                                                && ($item['network'] === NETWORK_DFRN)) {
                                                                $owner_url = $redirect_url;
                                                                $osparkle = ' sparkle';
@@ -678,7 +678,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                }
 
                                $likebuttons = '';
-                               $shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false); 
+                               $shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false);
 
                                if($page_writeable) {
 /*                                     if($toplevelpost) {  */
@@ -698,7 +698,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                        if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
                                                $comment = replace_macros($cmnt_tpl,array(
-                                                       '$return_path' => '', 
+                                                       '$return_path' => '',
                                                        '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
                                                        '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
                                                        '$id' => $item['item_id'],
@@ -739,7 +739,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $drop = array(
                                        'dropping' => $dropping,
-                                       'select' => t('Select'), 
+                                       'select' => t('Select'),
                                        'delete' => t('Delete'),
                                );
 
@@ -805,9 +805,9 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $shiny = "";
                                if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
-                                       $shiny = 'shiny'; 
+                                       $shiny = 'shiny';
 
-                               // 
+                               //
                                localize_item($item);
 
 
@@ -897,5 +897,5 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
 
        return $threads;
-
+}
 }
index f8cfb03f3782230e51ded8a973fb7e0455f2233c..8e6321760b91b18d10aec000d9a70a105404750b 100644 (file)
@@ -5,6 +5,7 @@
  * addons repository will be listed though ATM)
  */
 
+if(! function_exists('credits_content')) {
 function credits_content (&$a) {
     /* fill the page with credits */
     $f = fopen('util/credits.txt','r');
@@ -18,3 +19,4 @@ function credits_content (&$a) {
        '$names'         => $arr,
     ));
 }
+}
index 5b4db09dac1f16ab7a0500ccf6b8e90e9cd90dc5..50502b49875e976a68fcd342c1d7044cea0553b5 100644 (file)
@@ -2,6 +2,7 @@
 require_once("include/contact_selectors.php");
 require_once("mod/contacts.php");
 
+if(! function_exists('crepair_init')) {
 function crepair_init(&$a) {
        if(! local_user())
                return;
@@ -28,8 +29,9 @@ function crepair_init(&$a) {
                profile_load($a, "", 0, get_contact_details_by_url($contact["url"]));
        }
 }
+}
 
-
+if(! function_exists('crepair_post')) {
 function crepair_post(&$a) {
        if(! local_user())
                return;
@@ -91,9 +93,9 @@ function crepair_post(&$a) {
 
        return;
 }
+}
 
-
-
+if(! function_exists('crepair_content')) {
 function crepair_content(&$a) {
 
        if(! local_user()) {
@@ -180,5 +182,5 @@ function crepair_content(&$a) {
        ));
 
        return $o;
-
+}
 }
index 20d2e605e0a2d91c90e1d664567037d6baf1902d..d421de37643791dcbf613850a5152560b415ee4e 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 require_once('mod/settings.php');
 
+if(! function_exists('delegate_init')) {
 function delegate_init(&$a) {
        return settings_init($a);
 }
+}
 
-
+if(! function_exists('delegate_content')) {
 function delegate_content(&$a) {
 
        if(! local_user()) {
@@ -90,12 +92,12 @@ function delegate_content(&$a) {
 
        // find every contact who might be a candidate for delegation
 
-       $r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s' 
+       $r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s'
                and contact.uid = %d and contact.self = 0 and network = '%s' ",
                dbesc(normalise_link($a->get_baseurl())),
                intval(local_user()),
                dbesc(NETWORK_DFRN)
-       ); 
+       );
 
        if(! count($r)) {
                notice( t('No potential page delegates located.') . EOL);
@@ -144,5 +146,5 @@ function delegate_content(&$a) {
 
        return $o;
 
-
+}
 }
index 27c04a908d297bb738e1c9ba9382d00ad01c2488..00e215e334cb6d88b778d9dea3a3da7400f45149 100644 (file)
@@ -16,6 +16,7 @@
 
 require_once('include/enotify.php');
 
+if(! function_exists('dfrn_confirm_post')) {
 function dfrn_confirm_post(&$a,$handsfree = null) {
 
        if(is_array($handsfree)) {
@@ -801,5 +802,5 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
 
        goaway(z_root());
        // NOTREACHED
-
+}
 }
index 4aa777b5503e63cfc257ed9340188a6c0dbefdf4..04500e89ad24e71d77da91562970d7367db7487f 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/event.php');
 
 require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
 
+if(! function_exists('dfrn_notify_post')) {
 function dfrn_notify_post(&$a) {
     logger(__function__, LOGGER_TRACE);
        $dfrn_id      = ((x($_POST,'dfrn_id'))      ? notags(trim($_POST['dfrn_id']))   : '');
@@ -213,8 +214,9 @@ function dfrn_notify_post(&$a) {
 
        // NOTREACHED
 }
+}
 
-
+if(! function_exists('dfrn_notify_content')) {
 function dfrn_notify_content(&$a) {
 
        if(x($_GET,'dfrn_id')) {
@@ -338,5 +340,5 @@ function dfrn_notify_content(&$a) {
 
                killme();
        }
-
+}
 }
index ab6637607e564b2d71eb2ba1353b6944a6216c65..82c75d28cfb28ac27035575a462b3d472e487bb9 100644 (file)
@@ -3,7 +3,7 @@ require_once('include/items.php');
 require_once('include/auth.php');
 require_once('include/dfrn.php');
 
-
+if(! function_exists('dfrn_poll_init')) {
 function dfrn_poll_init(&$a) {
 
 
@@ -160,7 +160,7 @@ function dfrn_poll_init(&$a) {
 
                        if($final_dfrn_id != $orig_id) {
                                logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
-                               // did not decode properly - cannot trust this site 
+                               // did not decode properly - cannot trust this site
                                xml_status(3, 'Bad decryption');
                        }
 
@@ -195,11 +195,11 @@ function dfrn_poll_init(&$a) {
                        return; // NOTREACHED
                }
        }
-
+}
 }
 
 
-
+if(! function_exists('dfrn_poll_post')) {
 function dfrn_poll_post(&$a) {
 
        $dfrn_id      = ((x($_POST,'dfrn_id'))      ? $_POST['dfrn_id']              : '');
@@ -257,7 +257,7 @@ function dfrn_poll_post(&$a) {
 
                        if($final_dfrn_id != $orig_id) {
                                logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
-                               // did not decode properly - cannot trust this site 
+                               // did not decode properly - cannot trust this site
                                xml_status(3, 'Bad decryption');
                        }
 
@@ -377,7 +377,9 @@ function dfrn_poll_post(&$a) {
 
        }
 }
+}
 
+if(! function_exists('dfrn_poll_content')) {
 function dfrn_poll_content(&$a) {
 
        $dfrn_id         = ((x($_GET,'dfrn_id'))         ? $_GET['dfrn_id']              : '');
@@ -562,3 +564,4 @@ function dfrn_poll_content(&$a) {
                }
        }
 }
+}
index 294a55585df14ed8eca9856edabd395ad1eefb31..7ce1530efc5aa36e879d565346f4428f7c87f634 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-
+if(! function_exists('directory_init')) {
 function directory_init(&$a) {
        $a->set_pager_itemspage(60);
 
@@ -16,23 +16,23 @@ function directory_init(&$a) {
                unset($_SESSION['mobile-theme']);
        }
 
-
+}
 }
 
-
+if(! function_exists('directory_post')) {
 function directory_post(&$a) {
        if(x($_POST,'search'))
                $a->data['search'] = $_POST['search'];
 }
+}
 
-
-
+if(! function_exists('directory_content')) {
 function directory_content(&$a) {
        global $db;
 
        require_once("mod/proxy.php");
 
-       if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) || 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) ||
                (get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
                notice( t('Public access denied.') . EOL);
                return;
@@ -123,14 +123,14 @@ function directory_content(&$a) {
                        }
 //                     if(strlen($rr['dob'])) {
 //                             if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
-//                                     $details .= '<br />' . t('Age: ') . $years ; 
+//                                     $details .= '<br />' . t('Age: ') . $years ;
 //                     }
 //                     if(strlen($rr['gender']))
 //                             $details .= '<br />' . t('Gender: ') . $rr['gender'];
 
 
                        // show if account is a community account
-                       /// @TODO The other page types should be also respected, but first we need a good 
+                       /// @TODO The other page types should be also respected, but first we need a good
                        /// translatiion and systemwide consistency for displaying the page type
                        if((intval($rr['page-flags']) == PAGE_COMMUNITY) OR (intval($rr['page-flags']) == PAGE_PRVGROUP))
                                $community = true;
@@ -158,7 +158,7 @@ function directory_content(&$a) {
                        else {
                                $location_e = $location;
                        }
-                       
+
                        $photo_menu = array(array(t("View Profile"), zrl($profile_link)));
 
                        $entry = array(
@@ -217,3 +217,4 @@ function directory_content(&$a) {
 
        return $o;
 }
+}
index 0dfe4d67a9b61960623d963f0f58718ccbabe2be..f5e90705b760ebcdb3134fe4323caf6ef44d61b9 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/Contact.php');
 require_once('include/contact_selectors.php');
 require_once('mod/contacts.php');
 
+if(! function_exists('dirfind_init')) {
 function dirfind_init(&$a) {
 
        if(! local_user()) {
@@ -19,9 +20,9 @@ function dirfind_init(&$a) {
 
        $a->page['aside'] .= follow_widget();
 }
+}
 
-
-
+if(! function_exists('dirfind_content')) {
 function dirfind_content(&$a, $prefix = "") {
 
        $community = false;
@@ -235,3 +236,4 @@ function dirfind_content(&$a, $prefix = "") {
 
        return $o;
 }
+}
index 4e33927072bdf8123e17abc7a485a22dd768666a..9995a2b3efc2c0e0587a37d0dd2d1ca05b3c81e7 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-
+if(! function_exists('display_init')) {
 function display_init(&$a) {
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
@@ -85,9 +85,10 @@ function display_init(&$a) {
        }
 
        profile_load($a, $nick, 0, $profiledata);
-
+}
 }
 
+if(! function_exists('display_fetchauthor')) {
 function display_fetchauthor($a, $item) {
 
        $profiledata = array();
@@ -220,7 +221,9 @@ function display_fetchauthor($a, $item) {
 
        return($profiledata);
 }
+}
 
+if(! function_exists('display_content')) {
 function display_content(&$a, $update = 0) {
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
@@ -522,4 +525,4 @@ function display_content(&$a, $update = 0) {
 
        return $o;
 }
-
+}
index 9a80d0b2f4ba622badbaac42f617e973eeed926a..ee4d61e60a7c61182e177e77404fe16bbdcc1d22 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/acl_selectors.php');
 
+if(! function_exists('editpost_content')) {
 function editpost_content(&$a) {
 
        $o = '';
@@ -150,7 +151,5 @@ function editpost_content(&$a) {
        ));
 
        return $o;
-
 }
-
-
+}
index 653ae489b8f97c8022fe68fcd6f7513e4b5fe009..3dc20e535a2829b42262190573f7b68b4b25ce7f 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/datetime.php');
 require_once('include/event.php');
 require_once('include/items.php');
 
+if(! function_exists('events_post')) {
 function events_post(&$a) {
 
        logger('post: ' . print_r($_REQUEST,true));
@@ -156,9 +157,9 @@ function events_post(&$a) {
 
        goaway($_SESSION['return_url']);
 }
+}
 
-
-
+if(! function_exists('events_content')) {
 function events_content(&$a) {
 
        if(! local_user()) {
@@ -578,3 +579,4 @@ function events_content(&$a) {
                return $o;
        }
 }
+}
index 0a2a7dead52048cf3dfd1860b11da789921d47fd..73510ef58a13c4355ea1d55d34dfb4b61aa6740f 100644 (file)
@@ -10,6 +10,7 @@ require_once('include/Photo.php');
 /**
  * @param App $a
  */
+if(! function_exists('fbrowser_content')) {
 function fbrowser_content($a){
 
        if (!local_user())
@@ -141,5 +142,5 @@ function fbrowser_content($a){
                killme();
        }
 
-
+}
 }
index 4e79f337dcff22502ac15d4c0673872253678312..02b8d68978f44897ae0b0d4716fec28a6f99a521 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
+if(! function_exists('filer_content')) {
 function filer_content(&$a) {
 
        if(! local_user()) {
@@ -30,8 +30,9 @@ function filer_content(&$a) {
                        '$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')),
                        '$submit' => t('Save'),
                ));
-               
+
                echo $o;
        }
        killme();
 }
+}
index c266082c8ffe2e76a3fbe866df080e3a3159401d..be3456b58dcebdb6a24d2127032fa84204942fbd 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('filerm_content')) {
 function filerm_content(&$a) {
 
        if(! local_user()) {
@@ -25,3 +26,4 @@ function filerm_content(&$a) {
 
        killme();
 }
+}
index b92a0d980fb57e1150214c07aee7e5b590277c05..a8fdc31b5a2fd5775570fe8a0e21dc91ff0ab594 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/follow.php');
 require_once('include/Contact.php');
 require_once('include/contact_selectors.php');
 
+if(! function_exists('follow_content')) {
 function follow_content(&$a) {
 
        if(! local_user()) {
@@ -148,7 +149,9 @@ function follow_content(&$a) {
 
        return $o;
 }
+}
 
+if(! function_exists('follow_post')) {
 function follow_post(&$a) {
 
        if(! local_user()) {
@@ -185,3 +188,4 @@ function follow_post(&$a) {
        goaway($return_url);
        // NOTREACHED
 }
+}
index aad5964baf6e5d1ddf737e88f46b636cb255d6d7..18d045f2d57d44244c605cf978dc14394388d241 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('friendica_init')) {
 function friendica_init(&$a) {
        if ($a->argv[1]=="json"){
                $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
@@ -56,9 +57,9 @@ function friendica_init(&$a) {
                killme();
        }
 }
+}
 
-
-
+if(! function_exists('friendica_content')) {
 function friendica_content(&$a) {
 
        $o = '';
@@ -70,7 +71,7 @@ function friendica_content(&$a) {
        $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
        $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
 
-       $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';        
+       $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
 
        $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a></p><p>';
        $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
@@ -102,8 +103,8 @@ function friendica_content(&$a) {
        else
                $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
 
-       call_hooks('about_hook', $o);   
+       call_hooks('about_hook', $o);
 
        return $o;
-
+}
 }
index 6b1cbd7533be8ca44f6e9ce19c32609cdbf74490..26a5e980635f5f788547f62b3385c0f875702c0d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('fsuggest_post')) {
 function fsuggest_post(&$a) {
 
        if(! local_user()) {
@@ -39,11 +39,11 @@ function fsuggest_post(&$a) {
                                VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
                                intval(local_user()),
                                intval($contact_id),
-                               dbesc($r[0]['name']), 
-                               dbesc($r[0]['url']), 
-                               dbesc($r[0]['request']), 
-                               dbesc($r[0]['photo']), 
-                               dbesc($hash), 
+                               dbesc($r[0]['name']),
+                               dbesc($r[0]['url']),
+                               dbesc($r[0]['request']),
+                               dbesc($r[0]['photo']),
+                               dbesc($hash),
                                dbesc(datetime_convert())
                        );
                        $r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
@@ -65,11 +65,11 @@ function fsuggest_post(&$a) {
 
        }
 
-
+}
 }
 
 
-
+if(! function_exists('fsuggest_content')) {
 function fsuggest_content(&$a) {
 
        require_once('include/acl_selectors.php');
@@ -100,7 +100,7 @@ function fsuggest_content(&$a) {
 
        $o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
 
-       $o .= contact_selector('suggest','suggest-select', false, 
+       $o .= contact_selector('suggest','suggest-select', false,
                array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true));
 
 
@@ -109,3 +109,4 @@ function fsuggest_content(&$a) {
 
        return $o;
 }
+}
index 5b28784f5663cc1b7056125b26619416e9e76b6d..2f8053eefb8ed5bb717b528841aa91f3930c9a3b 100644 (file)
@@ -1,18 +1,21 @@
 <?php
 
+if(! function_exists('validate_members')) {
 function validate_members(&$item) {
        $item = intval($item);
 }
+}
 
+if(! function_exists('group_init')) {
 function group_init(&$a) {
        if(local_user()) {
                require_once('include/group.php');
                $a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
        }
 }
+}
 
-
-
+if(! function_exists('group_post')) {
 function group_post(&$a) {
 
        if(! local_user()) {
@@ -64,7 +67,9 @@ function group_post(&$a) {
        }
        return;
 }
+}
 
+if(! function_exists('group_content')) {
 function group_content(&$a) {
        $change = false;
 
@@ -229,5 +234,5 @@ function group_content(&$a) {
        }
 
        return replace_macros($tpl, $context);
-
+}
 }
index 6d2d9e2ebfc38f03761ec6b0595787db981184f9..af49423de38c408adaaf1ef30edbaa5e29225fef 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('hcard_init')) {
 function hcard_init(&$a) {
 
        $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
@@ -15,7 +16,7 @@ function hcard_init(&$a) {
        $profile = 0;
        if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
                $which = $a->user['nickname'];
-               $profile = $a->argv[1];         
+               $profile = $a->argv[1];
        }
 
        profile_load($a,$which,$profile);
@@ -23,7 +24,7 @@ function hcard_init(&$a) {
        if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
                $a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
        }
-       if(x($a->profile,'openidserver'))                               
+       if(x($a->profile,'openidserver'))
                $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
        if(x($a->profile,'openid')) {
                $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']);
@@ -42,10 +43,9 @@ function hcard_init(&$a) {
        $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
        $a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
        header('Link: <' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
-       
+
        $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
        foreach($dfrn_pages as $dfrn)
                $a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
-
 }
-
+}
index 5465d3e900f9827438de3c60fbf492f920914c01..320e622fa51c06674787d54e7c4d3513f8b9467e 100644 (file)
@@ -18,6 +18,7 @@ if (!function_exists('load_doc_file')) {
 
 }
 
+if(! function_exists('help_content')) {
 function help_content(&$a) {
 
        nav_set_selected('help');
@@ -98,5 +99,5 @@ function help_content(&$a) {
                }
                </style>".$html;
        return $html;
-
+}
 }
index 4121764f1a526b340fc1c4805aa705a0a8a0f97a..5b178e9b8f668be56980435db6d75a3dc78592eb 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/crypto.php');
 
+if(! function_exists('hostxrd_init')) {
 function hostxrd_init(&$a) {
        header('Access-Control-Allow-Origin: *');
        header("Content-type: text/xml");
@@ -27,5 +28,5 @@ function hostxrd_init(&$a) {
        ));
        session_write_close();
        exit();
-
+}
 }
index e876b4ef8b929ebb0ba661687b4baf04ea63697d..8a681a11543d053ca3ffeeaa0b7d2809164e6ce7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('ignored_init')) {
 function ignored_init(&$a) {
 
        $ignored = 0;
@@ -43,3 +43,4 @@ function ignored_init(&$a) {
        echo json_encode($ignored);
        killme();
 }
+}
index 8434b38e387f21e7953bc68b9c2163750284cd34..be90acba109c26966254cc50c0195ddf94343ba9 100755 (executable)
@@ -3,7 +3,7 @@ require_once "include/Photo.php";
 
 $install_wizard_pass=1;
 
-
+if(! function_exists('install_init')) {
 function install_init(&$a){
 
        // $baseurl/install/testrwrite to test if rewite in .htaccess is working
@@ -11,20 +11,21 @@ function install_init(&$a){
                echo "ok";
                killme();
        }
-       
+
        // We overwrite current theme css, because during install we could not have a working mod_rewrite
        // so we could not have a css at all. Here we set a static css file for the install procedure pages
        $a->config['system']['theme'] = "../install";
        $a->theme['stylesheet'] = $a->get_baseurl()."/view/install/style.css";
-       
-       
-       
+
+
+
        global $install_wizard_pass;
        if (x($_POST,'pass'))
                $install_wizard_pass = intval($_POST['pass']);
-
+}
 }
 
+if(! function_exists('install_post')) {
 function install_post(&$a) {
        global $install_wizard_pass, $db;
 
@@ -112,14 +113,18 @@ function install_post(&$a) {
                break;
        }
 }
+}
 
+if(! function_exists('get_db_errno')) {
 function get_db_errno() {
        if(class_exists('mysqli'))
                return mysqli_connect_errno();
        else
                return mysql_errno();
 }
+}
 
+if(! function_exists('install_content')) {
 function install_content(&$a) {
 
        global $install_wizard_pass, $db;
@@ -304,6 +309,7 @@ function install_content(&$a) {
 
        }
 }
+}
 
 /**
  * checks   : array passed to template
@@ -312,7 +318,8 @@ function install_content(&$a) {
  * required : boolean
  * help                : string optional
  */
-function check_add(&$checks, $title, $status, $required, $help){
+if(! function_exists('check_add')) {
+function check_add(&$checks, $title, $status, $required, $help) {
        $checks[] = array(
                'title' => $title,
                'status' => $status,
@@ -320,7 +327,9 @@ function check_add(&$checks, $title, $status, $required, $help){
                'help'  => $help,
        );
 }
+}
 
+if(! function_exists('check_php')) {
 function check_php(&$phpath, &$checks) {
        $passed = $passed2 = $passed3 = false;
        if (strlen($phpath)){
@@ -370,9 +379,10 @@ function check_php(&$phpath, &$checks) {
                check_add($checks, t('PHP register_argc_argv'), $passed3, true, $help);
        }
 
-
+}
 }
 
+if(! function_exists('check_keys')) {
 function check_keys(&$checks) {
 
        $help = '';
@@ -392,10 +402,10 @@ function check_keys(&$checks) {
                $help .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
        }
        check_add($checks, t('Generate encryption keys'), $res, true, $help);
-
+}
 }
 
-
+if(! function_exists('check_funcs')) {
 function check_funcs(&$checks) {
        $ck_funcs = array();
        check_add($ck_funcs, t('libCurl PHP module'), true, true, "");
@@ -457,8 +467,9 @@ function check_funcs(&$checks) {
        /*if((x($_SESSION,'sysmsg')) && is_array($_SESSION['sysmsg']) && count($_SESSION['sysmsg']))
                notice( t('Please see the file "INSTALL.txt".') . EOL);*/
 }
+}
 
-
+if(! function_exists('check_htconfig')) {
 function check_htconfig(&$checks) {
        $status = true;
        $help = "";
@@ -473,9 +484,10 @@ function check_htconfig(&$checks) {
        }
 
        check_add($checks, t('.htconfig.php is writable'), $status, false, $help);
-
+}
 }
 
+if(! function_exists('check_smarty3')) {
 function check_smarty3(&$checks) {
        $status = true;
        $help = "";
@@ -489,9 +501,10 @@ function check_smarty3(&$checks) {
        }
 
        check_add($checks, t('view/smarty3 is writable'), $status, true, $help);
-
+}
 }
 
+if(! function_exists('check_htaccess')) {
 function check_htaccess(&$checks) {
        $a = get_app();
        $status = true;
@@ -511,7 +524,9 @@ function check_htaccess(&$checks) {
                // cannot check modrewrite if libcurl is not installed
        }
 }
+}
 
+if(! function_exists('check_imagik')) {
 function check_imagik(&$checks) {
        $imagick = false;
        $gif = false;
@@ -528,16 +543,18 @@ function check_imagik(&$checks) {
                check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
        }
 }
+}
 
-
-
+if(! function_exists('manual_config')) {
 function manual_config(&$a) {
        $data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
        $o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
        $o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
        return $o;
 }
+}
 
+if(! function_exists('load_database_rem')) {
 function load_database_rem($v, $i){
        $l = trim($i);
        if (strlen($l)>1 && ($l[0]=="-" || ($l[0]=="/" && $l[1]=="*"))){
@@ -546,8 +563,9 @@ function load_database_rem($v, $i){
                return $v."\n".$i;
        }
 }
+}
 
-
+if(! function_exists('load_database')) {
 function load_database($db) {
 
        require_once("include/dbstructure.php");
@@ -567,7 +585,9 @@ function load_database($db) {
 
        return $errors;
 }
+}
 
+if(! function_exists('what_next')) {
 function what_next() {
        $a = get_app();
        $baseurl = $a->get_baseurl();
@@ -579,5 +599,4 @@ function what_next() {
                .t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
                ."</p>";
 }
-
-
+}
index ccf876c7c0d1cfb400f40daa52aa2c563a32482b..1f559dabc0445ac62b7cfd27d35f35035947fdf3 100644 (file)
@@ -9,6 +9,7 @@
 
 require_once('include/email.php');
 
+if(! function_exists('invite_post')) {
 function invite_post(&$a) {
 
        if(! local_user()) {
@@ -49,7 +50,7 @@ function invite_post(&$a) {
                        notice(  sprintf( t('%s : Not a valid email address.'), $recip) . EOL);
                        continue;
                }
-               
+
                if($invonly && ($x || is_site_admin())) {
                        $code = autoname(8) . srand(1000,9999);
                        $nmessage = str_replace('$invite_code',$code,$message);
@@ -70,8 +71,8 @@ function invite_post(&$a) {
                else
                        $nmessage = $message;
 
-               $res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'), 
-                       $nmessage, 
+               $res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'),
+                       $nmessage,
                        "From: " . $a->user['email'] . "\n"
                        . 'Content-type: text/plain; charset=UTF-8' . "\n"
                        . 'Content-transfer-encoding: 8bit' );
@@ -93,8 +94,9 @@ function invite_post(&$a) {
        notice( sprintf( tt("%d message sent.", "%d messages sent.", $total) , $total) . EOL);
        return;
 }
+}
 
-
+if(! function_exists('invite_content')) {
 function invite_content(&$a) {
 
        if(! local_user()) {
@@ -134,7 +136,7 @@ function invite_content(&$a) {
                '$msg_text' => t('Your message:'),
                '$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
                        . $linktxt
-                       . "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:') 
+                       . "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:')
                        . "\r\n" . "\r\n" . $a->get_baseurl() . '/profile/' . $a->user['nickname']
                        . "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendica.com') . "\r\n" . "\r\n"  ,
                '$submit' => t('Submit')
@@ -142,3 +144,4 @@ function invite_content(&$a) {
 
        return $o;
 }
+}
index 8c5a479646ec992c98bd0b701e2a3cbdc51d012a..f8f2e0fafe49f04a42f5f20c4cfd55e6907c9c52 100644 (file)
@@ -25,6 +25,7 @@ require_once('include/text.php');
 require_once('include/items.php');
 require_once('include/Scrape.php');
 
+if(! function_exists('item_post')) {
 function item_post(&$a) {
 
        if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
@@ -1017,7 +1018,9 @@ function item_post(&$a) {
        item_post_return($a->get_baseurl(), $api_source, $return_path);
        // NOTREACHED
 }
+}
 
+if(! function_exists('item_post_return')) {
 function item_post_return($baseurl, $api_source, $return_path) {
        // figure out how to return, depending on from whence we came
 
@@ -1037,9 +1040,9 @@ function item_post_return($baseurl, $api_source, $return_path) {
        echo json_encode($json);
        killme();
 }
+}
 
-
-
+if(! function_exists('item_content')) {
 function item_content(&$a) {
 
        if((! local_user()) && (! remote_user()))
@@ -1058,6 +1061,7 @@ function item_content(&$a) {
        }
        return $o;
 }
+}
 
 /**
  * This function removes the tag $tag from the text $body and replaces it with
@@ -1071,6 +1075,7 @@ function item_content(&$a) {
  *
  * @return boolean true if replaced, false if not replaced
  */
+if(! function_exists('handle_tag')) {
 function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") {
        require_once("include/Scrape.php");
        require_once("include/socgraph.php");
@@ -1245,8 +1250,9 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
 
        return array('replaced' => $replaced, 'contact' => $r[0]);
 }
+}
 
-
+if(! function_exists('store_diaspora_comment_sig')) {
 function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $post_id) {
        // We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key
 
@@ -1284,3 +1290,4 @@ function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item,
 
        return;
 }
+}
index 8d383b9abe4ffad8726a3596eec1f2119dcda0d4..ef483a1f9eed3ca264086edc3d37d77b3380504d 100755 (executable)
@@ -5,6 +5,7 @@ require_once('include/bbcode.php');
 require_once('include/items.php');
 require_once('include/like.php');
 
+if(! function_exists('like_content')) {
 function like_content(&$a) {
        if(! local_user() && ! remote_user()) {
                return false;
@@ -28,11 +29,11 @@ function like_content(&$a) {
        killme(); // NOTREACHED
 //     return; // NOTREACHED
 }
-
+}
 
 // Decide how to return. If we were called with a 'return' argument,
 // then redirect back to the calling page. If not, just quietly end
-
+if(! function_exists('like_content_return')) {
 function like_content_return($baseurl, $return_path) {
 
        if($return_path) {
@@ -45,4 +46,4 @@ function like_content_return($baseurl, $return_path) {
 
        killme();
 }
-
+}
index d1453bc5272bd3cf2aa5ad8017853c75fdc44a85..fc500f4dd9b0c6711206bcc5cacb0d9eaa81575c 100644 (file)
@@ -2,7 +2,7 @@
 
 require_once('include/datetime.php');
 
-
+if(! function_exists('localtime_post')) {
 function localtime_post(&$a) {
 
        $t = $_REQUEST['time'];
@@ -13,9 +13,10 @@ function localtime_post(&$a) {
 
        if($_POST['timezone'])
                $a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
-
+}
 }
 
+if(! function_exists('localtime_content')) {
 function localtime_content(&$a) {
        $t = $_REQUEST['time'];
        if(! $t)
@@ -38,12 +39,12 @@ function localtime_content(&$a) {
 
        $o .= '<form action ="' . $a->get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
 
-       $o .= '<p>' . t('Please select your timezone:') . '</p>'; 
+       $o .= '<p>' . t('Please select your timezone:') . '</p>';
 
        $o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
 
        $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
 
        return $o;
-
-}
\ No newline at end of file
+}
+}
index 0ae54c8c125f92d07616113a7b52865e3d61fed1..82f93f498566e7be8b8fb5ef9cfdeb93483bb0d1 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-
+if(! function_exists('lockview_content')) {
 function lockview_content(&$a) {
-  
+
        $type = (($a->argc > 1) ? $a->argv[1] : 0);
        if (is_numeric($type)) {
                $item_id = intval($type);
@@ -10,13 +10,13 @@ function lockview_content(&$a) {
        } else {
                $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
        }
-  
+
        if(! $item_id)
                killme();
 
        if (!in_array($type, array('item','photo','event')))
                killme();
-     
+
        $r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
                dbesc($type),
                intval($item_id)
@@ -33,7 +33,7 @@ function lockview_content(&$a) {
        }
 
 
-       if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) 
+       if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
                && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
 
                echo t('Remote privacy information not available.') . '<br />';
@@ -53,7 +53,7 @@ function lockview_content(&$a) {
                        dbesc(implode(', ', $allowed_groups))
                );
                if(count($r))
-                       foreach($r as $rr) 
+                       foreach($r as $rr)
                                $l[] = '<b>' . $rr['name'] . '</b>';
        }
        if(count($allowed_users)) {
@@ -61,7 +61,7 @@ function lockview_content(&$a) {
                        dbesc(implode(', ',$allowed_users))
                );
                if(count($r))
-                       foreach($r as $rr) 
+                       foreach($r as $rr)
                                $l[] = $rr['name'];
 
        }
@@ -71,7 +71,7 @@ function lockview_content(&$a) {
                        dbesc(implode(', ', $deny_groups))
                );
                if(count($r))
-                       foreach($r as $rr) 
+                       foreach($r as $rr)
                                $l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
        }
        if(count($deny_users)) {
@@ -79,12 +79,12 @@ function lockview_content(&$a) {
                        dbesc(implode(', ',$deny_users))
                );
                if(count($r))
-                       foreach($r as $rr) 
+                       foreach($r as $rr)
                                $l[] = '<strike>' . $rr['name'] . '</strike>';
 
        }
 
        echo $o . implode(', ', $l);
        killme();
-
+}
 }
index d09fc1868f55adb2525f734666abeae77c22be38..47c329eb63c75dd99efea1a254c17997064bf1b2 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-
+if(! function_exists('login_content')) {
 function login_content(&$a) {
        if(x($_SESSION,'theme'))
                unset($_SESSION['theme']);
@@ -9,5 +9,5 @@ function login_content(&$a) {
        if(local_user())
                goaway(z_root());
        return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
-
+}
 }
index 938d1cbb008ada25359cf6a68514760a2d98fc6f..0c4bb1a8335ffc38a9cce9a08a86df5bcc99b799 100644 (file)
@@ -4,6 +4,7 @@ require_once('include/email.php');
 require_once('include/enotify.php');
 require_once('include/text.php');
 
+if(! function_exists('lostpass_post')) {
 function lostpass_post(&$a) {
 
        $loginame = notags(trim($_POST['login-name']));
@@ -74,10 +75,10 @@ function lostpass_post(&$a) {
                'body' => $body));
 
        goaway(z_root());
-
+}
 }
 
-
+if(! function_exists('lostpass_content')) {
 function lostpass_content(&$a) {
 
 
@@ -164,5 +165,5 @@ function lostpass_content(&$a) {
 
                return $o;
        }
-
+}
 }
index b50c94c9b93d9a6acb748cea3d3da6a680041ec1..02de29108f892fb3ea85c4b9b3c2b1206af97969 100644 (file)
@@ -1,7 +1,8 @@
 <?php
-
+if(! function_exists('maintenance_content')) {
 function maintenance_content(&$a) {
        return replace_macros(get_markup_template('maintenance.tpl'), array(
                '$sysdown' => t('System down for maintenance')
        ));
 }
+}
index adcc3d787aac0d58563cbd5d38e82e50384498d2..6af3db99710bf598541fe346ac923b903c72d8d7 100644 (file)
@@ -2,7 +2,7 @@
 
 require_once("include/text.php");
 
-
+if(! function_exists('manage_post')) {
 function manage_post(&$a) {
 
        if(! local_user())
@@ -87,9 +87,9 @@ function manage_post(&$a) {
        goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] );
        // NOTREACHED
 }
+}
 
-
-
+if(! function_exists('manage_content')) {
 function manage_content(&$a) {
 
        if(! local_user()) {
@@ -144,5 +144,5 @@ function manage_content(&$a) {
        ));
 
        return $o;
-
+}
 }
index 3b0367b4290e1efd02ccbd945eca34fb4e79bb4d..f4936b28dc95b5ca67cfd31a8e02000125d93b28 100644 (file)
@@ -13,6 +13,7 @@ require_once('mod/proxy.php');
  * @param App &$a
  * @return void|string
  */
+if(! function_exists('match_content')) {
 function match_content(&$a) {
 
        $o = '';
@@ -109,3 +110,4 @@ function match_content(&$a) {
 
        return $o;
 }
+}
index 1724ebc424e7ac048cd68cb25195eddc4c78e772..1f11797d8b9ac6255c4e8a6b1a46e1f3d4c5489b 100644 (file)
@@ -3,6 +3,7 @@
 require_once('include/acl_selectors.php');
 require_once('include/message.php');
 
+if(! function_exists('message_init')) {
 function message_init(&$a) {
 
        $tabs = '';
@@ -36,9 +37,10 @@ function message_init(&$a) {
                '$baseurl' => $a->get_baseurl(true),
                '$base' => $base
        ));
-
+}
 }
 
+if(! function_exists('message_post')) {
 function message_post(&$a) {
 
        if(! local_user()) {
@@ -91,7 +93,7 @@ function message_post(&$a) {
        }
        else
                goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
-
+}
 }
 
 // Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
@@ -171,7 +173,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
 }}
 
 
-
+if(! function_exists('message_content')) {
 function message_content(&$a) {
 
        $o = '';
@@ -530,7 +532,9 @@ function message_content(&$a) {
                return $o;
        }
 }
+}
 
+if(! function_exists('get_messages')) {
 function get_messages($user, $lstart, $lend) {
 
        return q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`,
@@ -541,7 +545,9 @@ function get_messages($user, $lstart, $lend) {
                intval($user), intval($lstart), intval($lend)
        );
 }
+}
 
+if(! function_exists('render_messages')) {
 function render_messages($msg, $t) {
 
        $a = get_app();
@@ -593,3 +599,4 @@ function render_messages($msg, $t) {
 
        return $rslt;
 }
+}
index bba2c2882d065e5fc2320f5ed8582718f5940b9a..282d55a24bdfac026c81d20b1a79ff95b0feac4a 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('library/asn1.php');
 
+if(! function_exists('modexp_init')) {
 function modexp_init(&$a) {
 
        if($a->argc != 2)
@@ -29,6 +30,5 @@ function modexp_init(&$a) {
        echo 'RSA' . '.' . $m . '.' . $e ;
 
        killme();
-
 }
-
+}
index eee11e20c5b27bc3ac5e055071b713cd113339f0..2476f06562e0f76af80b88d7122608511563b386 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
+if(! function_exists('mood_init')) {
 function mood_init(&$a) {
 
        if(! local_user())
@@ -59,7 +59,7 @@ function mood_init(&$a) {
 
        $uri = item_new_uri($a->get_hostname(),$uid);
 
-       $action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]); 
+       $action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]);
 
        $arr = array();
 
@@ -105,9 +105,9 @@ function mood_init(&$a) {
 
        return;
 }
+}
 
-
-
+if(! function_exists('mood_content')) {
 function mood_content(&$a) {
 
        if(! local_user()) {
@@ -138,5 +138,5 @@ function mood_content(&$a) {
        ));
 
        return $o;
-
+}
 }
index 89de5b70576f354653ad4daf8645d5aa5b843876..3b1b0b617ad185765d392e1c6b48d22d7bdc939b 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('msearch_post')) {
 function msearch_post(&$a) {
 
        $perpage = (($_POST['n']) ? $_POST['n'] : 80);
@@ -26,8 +27,8 @@ function msearch_post(&$a) {
        if(count($r)) {
                foreach($r as $rr)
                        $results[] = array(
-                               'name' => $rr['name'], 
-                               'url' => $a->get_baseurl() . '/profile/' . $rr['nickname'], 
+                               'name' => $rr['name'],
+                               'url' => $a->get_baseurl() . '/profile/' . $rr['nickname'],
                                'photo' => $a->get_baseurl() . '/photo/avatar/' . $rr['uid'] . '.jpg',
                                'tags' => str_replace(array(',','  '),array(' ',' '),$rr['pub_keywords'])
                        );
@@ -38,5 +39,5 @@ function msearch_post(&$a) {
        echo json_encode($output);
 
        killme();
-
-}
\ No newline at end of file
+}
+}
index 5db69b171eed52f67fea8f65bd21ccb5df55c3ce..8fbabfda96af63f5326697add93984a617b7fb38 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once("include/nav.php");
 
+if(! function_exists('navigation_content')) {
 function navigation_content(&$a) {
 
        $nav_info = nav_info($a);
@@ -22,5 +23,5 @@ function navigation_content(&$a) {
                '$apps' => $a->apps,
                '$clear_notifs' => t('Clear notifications')
        ));
-
+}
 }
index a07c5868ec995d467bd3eaa9ea9da3762c2a7cac..9b07384e1b58ae410728df8fe5e87f37144cbca5 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+
+if(! function_exists('network_init')) {
 function network_init(&$a) {
        if(! local_user()) {
                notice( t('Permission denied.') . EOL);
@@ -153,9 +155,10 @@ function network_init(&$a) {
        $a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
        $a->page['aside'] .= saved_searches($search);
        $a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
-
+}
 }
 
+if(! function_exists('saved_searches')) {
 function saved_searches($search) {
 
        if(! feature_enabled(local_user(),'savedsearch'))
@@ -204,7 +207,7 @@ function saved_searches($search) {
        ));
 
        return $o;
-
+}
 }
 
 /**
@@ -222,6 +225,7 @@ function saved_searches($search) {
  *
  * @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
  */
+if(! function_exists('network_query_get_sel_tab')) {
 function network_query_get_sel_tab($a) {
        $no_active='';
        $starred_active = '';
@@ -278,10 +282,12 @@ function network_query_get_sel_tab($a) {
 
        return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
 }
+}
 
 /**
  * Return selected network from query
  */
+if(! function_exists('network_query_get_sel_net')) {
 function network_query_get_sel_net() {
        $network = false;
 
@@ -291,7 +297,9 @@ function network_query_get_sel_net() {
 
        return $network;
 }
+}
 
+if(! function_exists('network_query_get_sel_group')) {
 function network_query_get_sel_group($a) {
        $group = false;
 
@@ -301,8 +309,9 @@ function network_query_get_sel_group($a) {
 
        return $group;
 }
+}
 
-
+if(! function_exists('network_content')) {
 function network_content(&$a, $update = 0) {
 
        require_once('include/conversation.php');
@@ -886,4 +895,4 @@ function network_content(&$a, $update = 0) {
 
        return $o;
 }
-
+}
index aa55c3a098804f7e77e696e07167ecf35c9c7ad1..ef253333028155c17a0e32f0dcd379dad5ae23f1 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('newmember_content')) {
 function newmember_content(&$a) {
 
 
@@ -15,7 +16,7 @@ function newmember_content(&$a) {
 
        $o .= '<ul>';
 
-       $o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL; 
+       $o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
 
        $o .= '</ul>';
 
@@ -23,7 +24,7 @@ function newmember_content(&$a) {
 
        $o .= '<ul>';
 
-       $o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL; 
+       $o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
 
        $o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
 
@@ -33,7 +34,7 @@ function newmember_content(&$a) {
 
        $o .= '<ul>';
 
-       $o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;  
+       $o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
 
        $o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
 
@@ -46,7 +47,7 @@ function newmember_content(&$a) {
        $o .= '<ul>';
 
     $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
-       
+
        if(! $mail_disabled)
                $o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
 
@@ -82,3 +83,4 @@ function newmember_content(&$a) {
 
        return $o;
 }
+}
index ba310a10514151c6cac11a507709164a6b4046c6..7f8939182e7fd52d88c454fc3084400e9ac3e826 100644 (file)
@@ -1,12 +1,13 @@
 <?php
 /**
  * @file mod/nodeinfo.php
- * 
+ *
  * Documentation: http://nodeinfo.diaspora.software/schema.html
 */
 
 require_once("include/plugin.php");
 
+if(! function_exists('nodeinfo_wellknown')) {
 function nodeinfo_wellknown(&$a) {
        if (!get_config("system", "nodeinfo")) {
                http_status_exit(404);
@@ -19,7 +20,9 @@ function nodeinfo_wellknown(&$a) {
        echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
        exit;
 }
+}
 
+if(! function_exists('nodeinfo_init')) {
 function nodeinfo_init(&$a){
        if (!get_config("system", "nodeinfo")) {
                http_status_exit(404);
@@ -143,9 +146,9 @@ function nodeinfo_init(&$a){
        echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
        exit;
 }
+}
 
-
-
+if(! function_exists('nodeinfo_cron')) {
 function nodeinfo_cron() {
 
        $a = get_app();
@@ -260,5 +263,5 @@ function nodeinfo_cron() {
         logger("cron_end");
        set_config('nodeinfo','last_calucation', time());
 }
-
+}
 ?>
index 9f6e9784331851b702434245f24256313612d6e4..818b0da77abbb59ad20a07eac225624ef35f6558 100644 (file)
@@ -4,6 +4,7 @@ require_once('include/Contact.php');
 require_once('include/socgraph.php');
 require_once('include/contact_selectors.php');
 
+if(! function_exists('nogroup_init')) {
 function nogroup_init(&$a) {
 
        if(! local_user())
@@ -17,8 +18,9 @@ function nogroup_init(&$a) {
 
        $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
 }
+}
 
-
+if(! function_exists('nogroup_content')) {
 function nogroup_content(&$a) {
 
        if(! local_user()) {
@@ -66,5 +68,5 @@ function nogroup_content(&$a) {
        ));
 
        return $o;
-
+}
 }
index 51bd7234cf283a6b63e1d55d5af7e814ec6a589d..49fe2b9a37cb4ec02df1856b5ea1c53723fa1c90 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('noscrape_init')) {
 function noscrape_init(&$a) {
 
        if($a->argc > 1)
@@ -62,5 +63,5 @@ function noscrape_init(&$a) {
        header('Content-type: application/json; charset=utf-8');
        echo json_encode($json_info);
        exit;
-
+}
 }
index 73c1507e3e044d8ea62538192104eafdc9d1cd0f..7817e25547f2a119294bf47395e0a991d691b4eb 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('notes_init')) {
 function notes_init(&$a) {
 
        if(! local_user())
@@ -12,10 +13,10 @@ function notes_init(&$a) {
        nav_set_selected('home');
 
 //     profile_load($a,$which,$profile);
-
+}
 }
 
-
+if(! function_exists('notes_content')) {
 function notes_content(&$a,$update = false) {
 
        if(! local_user()) {
@@ -69,12 +70,12 @@ function notes_content(&$a,$update = false) {
        // Construct permissions
 
        // default permissions - anonymous user
-       
+
        $sql_extra = " AND `allow_cid` = '<" . $a->contact['id'] . ">' ";
 
        $r = q("SELECT COUNT(*) AS `total`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
-               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 
+               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0
                AND `item`.`deleted` = 0 AND `item`.`type` = 'note'
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self` = 1
                AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 0
@@ -90,7 +91,7 @@ function notes_content(&$a,$update = false) {
 
        $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
-               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 
+               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                and `item`.`moderated` = 0 AND `item`.`type` = 'note'
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self` = 1
                AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 0
@@ -109,10 +110,10 @@ function notes_content(&$a,$update = false) {
                foreach($r as $rr)
                        $parents_arr[] = $rr['item_id'];
                $parents_str = implode(', ', $parents_arr);
-               $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`, 
-                       `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
+
+               $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`,
+                       `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                        FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                        WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
@@ -135,3 +136,4 @@ function notes_content(&$a,$update = false) {
        $o .= paginate($a);
        return $o;
 }
+}
index 19cf53189a1476dfb9795026ab9b23139ad0160f..a42d60dd401f344e4d564229711366c6452ce0e3 100644 (file)
@@ -1,7 +1,8 @@
 <?php
-       /* identi.ca -> friendica items permanent-url compatibility */
-       
-       function notice_init(&$a){
+/* identi.ca -> friendica items permanent-url compatibility */
+
+if(! function_exists('notice_init')) {
+       function notice_init(&$a) {
                $id = $a->argv[1];
                $r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
                                intval($id)
@@ -16,5 +17,5 @@
 
                }
                return;
-
        }
+}
index a267b7c95826921e75504b2a8cb77e5499ad6a8b..c7421b2d42589e78872d625f5a2699c7d71c7813 100644 (file)
@@ -3,6 +3,7 @@ include_once("include/bbcode.php");
 include_once("include/contact_selectors.php");
 include_once("include/Scrape.php");
 
+if(! function_exists('notifications_post')) {
 function notifications_post(&$a) {
 
        if(! local_user()) {
@@ -58,11 +59,11 @@ function notifications_post(&$a) {
                }
        }
 }
+}
 
 
 
-
-
+if(! function_exists('notifications_content')) {
 function notifications_content(&$a) {
 
        if(! local_user()) {
@@ -579,3 +580,4 @@ function notifications_content(&$a) {
        $o .= paginate($a);
        return $o;
 }
+}
index 02260514af91493b287a06438fd799e016c224e5..7acac1084af94805d692ddb8a0f2771a01939bcb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('notify_init')) {
 function notify_init(&$a) {
        if(! local_user())
                return;
@@ -42,10 +42,10 @@ function notify_init(&$a) {
                echo $j;
                killme();
        }
-
+}
 }
 
-
+if(! function_exists('notify_content')) {
 function notify_content(&$a) {
        if(! local_user())
                return login();
@@ -80,5 +80,5 @@ function notify_content(&$a) {
 
        return $o;
 
-
+}
 }
index cb478cb8605d7054133a6e9ab371e2dbb9187d9b..021cbab6fdc8921dcd95727e31a70cc43bbfaead 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 require_once("include/oembed.php");
 
-function oembed_content(&$a){
+if(! function_exists('oembed_content')) {
+function oembed_content(&$a) {
        // logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
 
        if ($a->argv[1]=='b2h'){
@@ -33,3 +34,4 @@ function oembed_content(&$a){
        }
        killme();
 }
+}
index bbb436e7021ab3f0ad8088fedfde4772e46b0891..1e7c9b23c9e412427fc225d8ce2bd29acabfb770 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('oexchange_init')) {
 function oexchange_init(&$a) {
 
        if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
@@ -11,9 +11,10 @@ function oexchange_init(&$a) {
                killme();
        }
 
-
+}
 }
 
+if(! function_exists('oexchange_content')) {
 function oexchange_content(&$a) {
 
        if(! local_user()) {
@@ -26,13 +27,13 @@ function oexchange_content(&$a) {
                return;
        }
 
-       $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url'])) 
+       $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url']))
                ? urlencode(notags(trim($_REQUEST['url']))) : '');
-       $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title'])) 
+       $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title']))
                ? '&title=' . urlencode(notags(trim($_REQUEST['title']))) : '');
-       $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description'])) 
+       $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description']))
                ? '&description=' . urlencode(notags(trim($_REQUEST['description']))) : '');
-       $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) 
+       $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags']))
                ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : '');
 
        $s = fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags);
@@ -52,7 +53,5 @@ function oexchange_content(&$a) {
        $_REQUEST = $post;
        require_once('mod/item.php');
        item_post($a);
-
 }
-
-
+}
index 5d5539f00eb4e696429903179c1ae1b8022136d7..a92a124c0d06a8978dd72f5b9cbaede0cf43d20b 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 
-
 require_once('library/openid.php');
 
-
+if(! function_exists('openid_content')) {
 function openid_content(&$a) {
 
        $noid = get_config('system','no_openid');
@@ -25,8 +24,8 @@ function openid_content(&$a) {
                                goaway(z_root());
                        }
 
-                       $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` 
-                               FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 
+                       $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey`
+                               FROM `user` WHERE `openid` = '%s' AND `blocked` = 0
                                AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 LIMIT 1",
                                dbesc($authid)
                        );
@@ -40,7 +39,7 @@ function openid_content(&$a) {
                                require_once('include/security.php');
                                authenticate_success($r[0],true,true);
 
-                               // just in case there was no return url set 
+                               // just in case there was no return url set
                                // and we fell through
 
                                goaway(z_root());
@@ -94,3 +93,4 @@ function openid_content(&$a) {
        goaway(z_root());
        // NOTREACHED
 }
+}
index ff748d1c5360cbc2a0d28ade8d196a8a7b7fe5df..f3d55a102950673255158347af47db6c64937d1c 100644 (file)
@@ -1,18 +1,18 @@
 <?php
-    function opensearch_content(&$a) {
-       
+if(! function_exists('opensearch_content')) {
+  function opensearch_content(&$a) {
                $tpl = get_markup_template('opensearch.tpl');
-       
+
                header("Content-type: application/opensearchdescription+xml");
-       
+
                $o = replace_macros($tpl, array(
                        '$baseurl' => $a->get_baseurl(),
                        '$nodename' => $a->get_hostname(),
                ));
-               
+
                echo $o;
-               
+
                killme();
-               
        }
-?>
\ No newline at end of file
+}
+?>
index 6cca0bf67942537b75020a43008623e678cb734b..a21436db49f32e9418d4657ad59da9b8979e688e 100644 (file)
@@ -3,6 +3,7 @@
 require_once('include/Scrape.php');
 require_once('include/follow.php');
 
+if(! function_exists('ostatus_subscribe_content')) {
 function ostatus_subscribe_content(&$a) {
 
        if(! local_user()) {
@@ -76,3 +77,4 @@ function ostatus_subscribe_content(&$a) {
 
        return $o;
 }
+}
index 92b72dc1cec8c19fa4a467a0f9fb19226056f825..225b831fea66c3751b5a8f444d180c37342cb201 100644 (file)
--- a/mod/p.php
+++ b/mod/p.php
@@ -4,7 +4,8 @@ This file is part of the Diaspora protocol. It is used for fetching single publi
 */
 require_once("include/diaspora.php");
 
-function p_init($a){
+if(! function_exists('p_init')) {
+function p_init($a) {
        if ($a->argc != 2) {
                header($_SERVER["SERVER_PROTOCOL"].' 510 '.t('Not Extended'));
                killme();
@@ -79,3 +80,4 @@ function p_init($a){
 
        killme();
 }
+}
index a1ca5a3db5e2e1c831d35bada4b52a3502b54183..481cb89361b6f70be3b104891f923af8661499ef 100644 (file)
@@ -1,14 +1,14 @@
 <?php
-/** 
+/**
  * @file mod/parse_url.php
- * 
+ *
  * @todo https://developers.google.com/+/plugins/snippet/
- * 
+ *
  * @verbatim
  * <meta itemprop="name" content="Toller Titel">
  * <meta itemprop="description" content="Eine tolle Beschreibung">
  * <meta itemprop="image" content="http://maple.libertreeproject.org/images/tree-icon.png">
- * 
+ *
  * <body itemscope itemtype="http://schema.org/Product">
  *   <h1 itemprop="name">Shiny Trinket</h1>
  *   <img itemprop="image" src="{image-url}" />
@@ -27,6 +27,7 @@ if(!function_exists('deletenode')) {
        }
 }
 
+if(! function_exists('completeurl')) {
 function completeurl($url, $scheme) {
        $urlarr = parse_url($url);
 
@@ -53,7 +54,9 @@ function completeurl($url, $scheme) {
 
        return($complete);
 }
+}
 
+if(! function_exists('parseurl_getsiteinfo_cached')) {
 function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = true) {
 
        if ($url == "")
@@ -77,7 +80,9 @@ function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = tr
 
        return $data;
 }
+}
 
+if(! function_exists('parseurl_getsiteinfo')) {
 function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) {
        require_once("include/network.php");
        require_once("include/Photo.php");
@@ -400,11 +405,15 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
 
        return($siteinfo);
 }
+}
 
+if(! function_exists('arr_add_hashes')) {
 function arr_add_hashes(&$item,$k) {
        $item = '#' . $item;
 }
+}
 
+if(! function_exists('parse_url_content')) {
 function parse_url_content(&$a) {
 
        $text = null;
@@ -558,4 +567,5 @@ function parse_url_content(&$a) {
 
        killme();
 }
+}
 ?>
index 4166b4d53949d4f9cb5b1f9467c045b224ef98e0..3baff13db5d7c03592d01bc3b8b73d7a0fa142cd 100644 (file)
@@ -3,6 +3,7 @@
 require_once('include/security.php');
 require_once('include/Photo.php');
 
+if(! function_exists('photo_init')) {
 function photo_init(&$a) {
        global $_SERVER;
 
@@ -209,3 +210,4 @@ function photo_init(&$a) {
        killme();
        // NOTREACHED
 }
+}
index a9dade6a81c8e291f4451985f89d889118a47847..9821918e5e19600b1a94de4a6e1a1d0c94f292e7 100644 (file)
@@ -9,6 +9,7 @@ require_once('include/redir.php');
 require_once('include/tags.php');
 require_once('include/threads.php');
 
+if(! function_exists('photos_init')) {
 function photos_init(&$a) {
 
        if($a->argc > 1)
@@ -121,9 +122,9 @@ function photos_init(&$a) {
 
        return;
 }
+}
 
-
-
+if(! function_exists('photos_post')) {
 function photos_post(&$a) {
 
        logger('mod-photos: photos_post: begin' , LOGGER_DEBUG);
@@ -957,9 +958,9 @@ function photos_post(&$a) {
        goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
        // NOTREACHED
 }
+}
 
-
-
+if(! function_exists('photos_content')) {
 function photos_content(&$a) {
 
        // URLs:
@@ -1328,7 +1329,7 @@ function photos_content(&$a) {
 
        }
 
-       /** 
+       /**
         * Display one photo
         */
 
@@ -1861,7 +1862,7 @@ function photos_content(&$a) {
                        //hide profile photos to others
                        if((! $is_owner) && (! remote_user()) && ($rr['album'] == t('Profile Photos')))
                                        continue;
-                       
+
                        if($twist == 'rotright')
                                $twist = 'rotleft';
                        else
@@ -1906,4 +1907,4 @@ function photos_content(&$a) {
        $o .= paginate($a);
        return $o;
 }
-
+}
index 57728d32949ef64aab036fbd6f8ffd10531366f3..dbc000a8a5095f3ef41a3d9d3ce927e274ef2e7b 100644 (file)
@@ -5,6 +5,7 @@ require_once('include/forums.php');
 require_once('include/group.php');
 require_once("mod/proxy.php");
 
+if(! function_exists('ping_init')) {
 function ping_init(&$a) {
 
        header("Content-type: text/xml");
@@ -338,7 +339,9 @@ function ping_init(&$a) {
 
        killme();
 }
+}
 
+if(! function_exists('ping_get_notifications')) {
 function ping_get_notifications($uid) {
 
        $result = array();
@@ -406,3 +409,4 @@ function ping_get_notifications($uid) {
 
        return($result);
 }
+}
index 0a1b392169b22dbf3e5748bb4ebbbebc8aa65a25..4b04d70138198851e02346ff7d91a45fa1c75bd9 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('poco_init')) {
 function poco_init(&$a) {
        require_once("include/bbcode.php");
 
@@ -324,5 +325,5 @@ function poco_init(&$a) {
        else
                http_status_exit(500);
 
-
+}
 }
index 45a577cda6bfd3764e9ac2d723112eea76df74f2..1af78b68edf2b85c6459ba7d9ec142f42e707ed2 100644 (file)
@@ -4,11 +4,11 @@
  *
  * Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
  * This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
- * other web request. You must be logged in and connected to a profile. 
+ * other web request. You must be logged in and connected to a profile.
  * If the required arguments aren't present, we'll display a simple form to choose a recipient and a verb.
  * parent is a special argument which let's you attach this activity as a comment to an existing conversation, which
  * may have started with somebody else poking (etc.) somebody, but this isn't necessary. This can be used in the more pokes
- * plugin version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.  
+ * plugin version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.
  *
  * private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
  *
@@ -18,7 +18,7 @@ require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
+if(! function_exists('poke_init')) {
 function poke_init(&$a) {
 
        if(! local_user())
@@ -140,9 +140,9 @@ function poke_init(&$a) {
 
        return;
 }
+}
 
-
-
+if(! function_exists('poke_content')) {
 function poke_content(&$a) {
 
        if(! local_user()) {
@@ -201,5 +201,5 @@ function poke_content(&$a) {
        ));
 
        return $o;
-
+}
 }
index c0e783a6aaded3cb6ea126bfd177eb50cb76e4df..631bf0eba63f5d058e813fdd5306730dd021f111 100644 (file)
@@ -9,7 +9,8 @@ require_once('include/salmon.php');
 require_once('include/crypto.php');
 // not yet ready for prime time
 //require_once('include/zot.php');
-       
+
+if(! function_exists('post_post')) {
 function post_post(&$a) {
 
        $bulk_delivery = false;
@@ -19,7 +20,7 @@ function post_post(&$a) {
        }
        else {
                $nickname = $a->argv[2];
-               $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' 
+               $r = q("SELECT * FROM `user` WHERE `nickname` = '%s'
                                AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                        dbesc($nickname)
                );
@@ -48,4 +49,4 @@ function post_post(&$a) {
        http_status_exit(($ret) ? $ret : 200);
        // NOTREACHED
 }
-
+}
index 4584cb29e2564cd31963438d08b295d09c140ecb..5d1c261fcb8dcceebdcf8b5a46e5c5db7e77a5f5 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 
+if(! function_exists('pretheme_init')) {
 function pretheme_init(&$a) {
-       
+
        if($_REQUEST['theme']) {
                $theme = $_REQUEST['theme'];
                $info = get_theme_info($theme);
@@ -20,3 +21,4 @@ function pretheme_init(&$a) {
        }
        killme();
 }
+}
index c95db291b359a8410597ceb08d508826441e00cd..fcf83e76030cb4e2dcdaac90161ea73370433b90 100644 (file)
@@ -2,13 +2,14 @@
 
 require_once('include/Scrape.php');
 
+if(! function_exists('probe_content')) {
 function probe_content(&$a) {
 
        $o .= '<h3>Probe Diagnostic</h3>';
 
        $o .= '<form action="probe" method="get">';
        $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
-       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>';
 
        $o .= '<br /><br />';
 
@@ -22,3 +23,4 @@ function probe_content(&$a) {
        }
        return $o;
 }
+}
index 26bd395230b8d937df35ceb1c5fcb10891116227..b02570d5afcca60960a6f25726225c052bd50167 100644 (file)
@@ -3,7 +3,7 @@
 require_once('include/contact_widgets.php');
 require_once('include/redir.php');
 
-
+if(! function_exists('profile_init')) {
 function profile_init(&$a) {
 
        if(! x($a->page,'aside'))
@@ -65,10 +65,10 @@ function profile_init(&$a) {
        foreach($dfrn_pages as $dfrn)
                $a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
        $a->page['htmlhead'] .= "<link rel=\"dfrn-poco\" href=\"".$a->get_baseurl()."/poco/{$which}\" />\r\n";
-
+}
 }
 
-
+if(! function_exists('profile_content')) {
 function profile_content(&$a, $update = 0) {
 
        $category = $datequery = $datequery2 = '';
@@ -350,3 +350,4 @@ function profile_content(&$a, $update = 0) {
 
        return $o;
 }
+}
index 4e8d279a972b7ce7ec54b03ee12416a8ec627659..e3d6adb4914244dffe5564c64b4553ffb9e6dc34 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once("include/Photo.php");
 
+if(! function_exists('profile_photo_init')) {
 function profile_photo_init(&$a) {
 
        if(! local_user()) {
@@ -9,10 +10,10 @@ function profile_photo_init(&$a) {
        }
 
        profile_load($a,$a->user['nickname']);
-
+}
 }
 
-
+if(! function_exists('profile_photo_post')) {
 function profile_photo_post(&$a) {
 
        if(! local_user()) {
@@ -143,7 +144,7 @@ function profile_photo_post(&$a) {
        $filesize = intval($_FILES['userfile']['size']);
        $filetype = $_FILES['userfile']['type'];
     if ($filetype=="") $filetype=guess_image_type($filename);
-    
+
        $maximagesize = get_config('system','maximagesize');
 
        if(($maximagesize) && ($filesize > $maximagesize)) {
@@ -164,7 +165,7 @@ function profile_photo_post(&$a) {
        $ph->orient($src);
        @unlink($src);
        return profile_photo_crop_ui_head($a, $ph);
-       
+}
 }
 
 
@@ -175,7 +176,7 @@ function profile_photo_content(&$a) {
                notice( t('Permission denied.') . EOL );
                return;
        }
-       
+
        $newuser = false;
 
        if($a->argc == 2 && $a->argv[1] === 'new')
@@ -186,9 +187,9 @@ function profile_photo_content(&$a) {
                        notice( t('Permission denied.') . EOL );
                        return;
                };
-               
+
 //             check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo');
-        
+
                $resource_id = $a->argv[2];
                //die(":".local_user());
                $r=q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' ORDER BY `scale` ASC",
@@ -240,7 +241,7 @@ function profile_photo_content(&$a) {
 
 
        if(! x($a->config,'imagecrop')) {
-       
+
                $tpl = get_markup_template('profile_photo.tpl');
 
                $o .= replace_macros($tpl,array(
@@ -295,11 +296,11 @@ function profile_photo_crop_ui_head(&$a, $ph){
        }
 
        $hash = photo_new_resource();
-       
+
 
        $smallest = 0;
 
-       $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 );   
+       $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 );
 
        if($r)
                info( t('Image uploaded successfully.') . EOL );
@@ -308,8 +309,8 @@ function profile_photo_crop_ui_head(&$a, $ph){
 
        if($width > 640 || $height > 640) {
                $ph->scaleImage(640);
-               $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 );   
-               
+               $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 );
+
                if($r === false)
                        notice( sprintf(t('Image size reduction [%s] failed.'),"640") . EOL );
                else
@@ -323,4 +324,3 @@ function profile_photo_crop_ui_head(&$a, $ph){
        $a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), array());
        return;
 }}
-
index 5c372de8ee9243067c9c5e800a5e464022c573e6..9ce478ba198a375a80d664fcfea4c8935dab4f2c 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 require_once("include/Contact.php");
 
+if(! function_exists('profiles_init')) {
 function profiles_init(&$a) {
 
        nav_set_selected('profiles');
@@ -139,9 +140,10 @@ function profiles_init(&$a) {
        }
 
 
-
+}
 }
 
+if(! function_exists('profile_clean_keywords')) {
 function profile_clean_keywords($keywords) {
        $keywords = str_replace(","," ",$keywords);
        $keywords = explode(" ", $keywords);
@@ -158,7 +160,9 @@ function profile_clean_keywords($keywords) {
 
        return $keywords;
 }
+}
 
+if(! function_exists('profiles_post')) {
 function profiles_post(&$a) {
 
        if(! local_user()) {
@@ -502,8 +506,9 @@ function profiles_post(&$a) {
                }
        }
 }
+}
 
-
+if(! function_exists('profile_activity')) {
 function profile_activity($changed, $value) {
        $a = get_app();
 
@@ -593,8 +598,9 @@ function profile_activity($changed, $value) {
 
        }
 }
+}
 
-
+if(! function_exists('profiles_content')) {
 function profiles_content(&$a) {
 
        if(! local_user()) {
@@ -818,5 +824,5 @@ function profiles_content(&$a) {
                }
                return $o;
        }
-
+}
 }
index 077f695bea14c15be10f592258847bcd6e3d1198..6fb717294994ee0509a19aeef8bea83099c90577 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('profperm_init')) {
 function profperm_init(&$a) {
 
        if(! local_user())
@@ -9,10 +10,10 @@ function profperm_init(&$a) {
        $profile = $a->argv[1];
 
        profile_load($a,$which,$profile);
-
+}
 }
 
-
+if(! function_exists('profperm_content')) {
 function profperm_content(&$a) {
 
        if(! local_user()) {
@@ -108,9 +109,9 @@ function profperm_content(&$a) {
        }
 
        $o .= '<div id="prof-update-wrapper">';
-       if($change) 
+       if($change)
                $o = '';
-       
+
        $o .= '<div id="prof-members-title">';
        $o .= '<h3>' . t('Visible To') . '</h3>';
        $o .= '</div>';
@@ -156,6 +157,5 @@ function profperm_content(&$a) {
        }
        $o .= '</div>';
        return $o;
-
 }
-
+}
index abcaf4912798830546409ef6d16876bea9f3db96..8e2a38925483f2533e81c1f8a9fcd13938f5bdac 100644 (file)
@@ -12,6 +12,7 @@ define("PROXY_SIZE_LARGE", "large");
 require_once('include/security.php');
 require_once("include/Photo.php");
 
+if(! function_exists('proxy_init')) {
 function proxy_init() {
        global $a, $_SERVER;
 
@@ -232,7 +233,9 @@ function proxy_init() {
 
        killme();
 }
+}
 
+if(! function_exists('proxy_url')) {
 function proxy_url($url, $writemode = false, $size = "") {
        global $_SERVER;
 
@@ -294,11 +297,13 @@ function proxy_url($url, $writemode = false, $size = "") {
        else
                return ($proxypath.$size);
 }
+}
 
 /**
  * @param $url string
  * @return boolean
  */
+if(! function_exists('proxy_is_local_image')) {
 function proxy_is_local_image($url) {
        if ($url[0] == '/') return true;
 
@@ -309,7 +314,9 @@ function proxy_is_local_image($url) {
        $url = normalise_link($url);
        return (substr($url, 0, strlen($baseurl)) == $baseurl);
 }
+}
 
+if(! function_exists('proxy_parse_query')) {
 function proxy_parse_query($var) {
         /**
          *  Use this function to parse out the query array element from
@@ -328,7 +335,9 @@ function proxy_parse_query($var) {
         unset($val, $x, $var);
         return $arr;
 }
+}
 
+if(! function_exists('proxy_img_cb')) {
 function proxy_img_cb($matches) {
 
        // if the picture seems to be from another picture cache then take the original source
@@ -342,10 +351,13 @@ function proxy_img_cb($matches) {
 
        return $matches[1].proxy_url(htmlspecialchars_decode($matches[2])).$matches[3];
 }
+}
 
+if(! function_exists('proxy_parse_html')) {
 function proxy_parse_html($html) {
        $a = get_app();
        $html = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $html);
 
        return preg_replace_callback("/(<img [^>]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html);
 }
+}
index beb73b4e2c4ce53a9ed5a6fcaf3ea56108e2040c..15523e637a83da8d1c3e3c1e0d62385ef04317b9 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('hub_return')) {
 function hub_return($valid,$body) {
 
        if($valid) {
@@ -14,18 +15,18 @@ function hub_return($valid,$body) {
 
        // NOTREACHED
 }
+}
 
 // when receiving an XML feed, always return OK
-
+if(! function_exists('hub_post_return')) {
 function hub_post_return() {
-
        header($_SERVER["SERVER_PROTOCOL"] . ' 200 ' . 'OK');
        killme();
-
+}
 }
 
 
-
+if(! function_exists('pubsub_init')) {
 function pubsub_init(&$a) {
 
        $nick       = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
@@ -57,7 +58,7 @@ function pubsub_init(&$a) {
 
                $sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : '');
 
-               $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d 
+               $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d
                        AND `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1",
                        intval($contact_id),
                        intval($owner['uid'])
@@ -75,7 +76,7 @@ function pubsub_init(&$a) {
 
                $contact = $r[0];
 
-               // We must initiate an unsubscribe request with a verify_token. 
+               // We must initiate an unsubscribe request with a verify_token.
                // Don't allow outsiders to unsubscribe us.
 
                if($hub_mode === 'unsubscribe') {
@@ -95,9 +96,11 @@ function pubsub_init(&$a) {
                hub_return(true, $hub_challenge);
        }
 }
+}
 
 require_once('include/security.php');
 
+if(! function_exists('pubsub_post')) {
 function pubsub_post(&$a) {
 
        $xml = file_get_contents('php://input');
@@ -155,8 +158,5 @@ function pubsub_post(&$a) {
        consume_feed($xml,$importer,$contact,$feedhub,1,2);
 
        hub_post_return();
-
 }
-
-
-
+}
index 5d7621cc745fdf648cd1dc79d83342d09ccbe694..b0e3ef30998ec3b891291d7b5392bba1df1aac20 100644 (file)
@@ -1,9 +1,12 @@
 <?php
 
+if(! function_exists('post_var')) {
 function post_var($name) {
        return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
 }
+}
 
+if(! function_exists('pubsubhubbub_init')) {
 function pubsubhubbub_init(&$a) {
        // PuSH subscription must be considered "public" so just block it
        // if public access isn't enabled.
@@ -158,5 +161,5 @@ function pubsubhubbub_init(&$a) {
 
        killme();
 }
-
+}
 ?>
index c35e253b670508c23771013c04187ca482f36a44..cffc3e50ba91256f4a854a03d83887b6a1c178c3 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('qsearch_init')) {
 function qsearch_init(&$a) {
 
        if(! local_user())
@@ -47,4 +48,4 @@ function qsearch_init(&$a) {
        echo json_encode((object) $results);
        killme();
 }
-
+}
index 6713a81d9e4a2efe2f013feb6ceeb2c092a891fe..e9e0a8e7bb1e56e0dbb76f2a305fa960d4db5fe8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('randprof_init')) {
 function randprof_init(&$a) {
        require_once('include/Contact.php');
        $x = random_profile();
@@ -8,3 +8,4 @@ function randprof_init(&$a) {
                goaway(zrl($x));
        goaway($a->get_baseurl() . '/profile');
 }
+}
index 95a51016757da46217f277e4b641799c43b1ec2c..3a30058cdc18fecbe0b30f2025a2fb3d7eadfaeb 100644 (file)
@@ -9,7 +9,7 @@ require_once('include/salmon.php');
 require_once('include/crypto.php');
 require_once('include/diaspora.php');
 
-
+if(! function_exists('receive_post')) {
 function receive_post(&$a) {
 
 
@@ -73,4 +73,4 @@ function receive_post(&$a) {
        http_status_exit(($ret) ? $ret : 200);
        // NOTREACHED
 }
-
+}
index 632c39578696807b3dfd20e6f6658df50656cc99..2dda0571b254c406fbf1a008cd9253fd305576fb 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('redir_init')) {
 function redir_init(&$a) {
 
        $url = ((x($_GET,'url')) ? $_GET['url'] : '');
@@ -57,9 +58,9 @@ function redir_init(&$a) {
                        intval(time() + 45)
                );
 
-               logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG); 
+               logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
                $dest = (($url) ? '&destination_url=' . $url : '');
-               goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id 
+               goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
                        . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet );
        }
 
@@ -75,3 +76,4 @@ function redir_init(&$a) {
 
        goaway(z_root());
 }
+}
index 5a90db1f902d0b0265d26c1da3104bb1b5ce3e70..2e3ca414e3408277425cea9477a2a9000e10b1fd 100644 (file)
@@ -3,6 +3,7 @@
 require_once('include/enotify.php');
 require_once('include/user.php');
 
+if(! function_exists('user_allow')) {
 function user_allow($hash) {
 
        $a = get_app();
@@ -55,14 +56,14 @@ function user_allow($hash) {
                info( t('Account approved.') . EOL );
                return true;
        }
-
+}
 }
 
 
 // This does not have to go through user_remove() and save the nickname
 // permanently against re-registration, as the person was not yet
 // allowed to have friends on this system
-
+if(! function_exists('user_deny')) {
 function user_deny($hash) {
 
        $register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1",
@@ -91,9 +92,10 @@ function user_deny($hash) {
        );
        notice( sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
        return true;
-
+}
 }
 
+if(! function_exists('regmod_content')) {
 function regmod_content(&$a) {
 
        global $lang;
@@ -131,3 +133,4 @@ function regmod_content(&$a) {
                killme();
        }
 }
+}
index 904606fd57cb77b69a1a0b7ef48a9025ff012f25..6c84c41892b9bdb1190cd6a944b53dfffd128ae8 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('removeme_post')) {
 function removeme_post(&$a) {
 
        if(! local_user())
@@ -24,9 +25,10 @@ function removeme_post(&$a) {
                user_remove($a->user['uid']);
                // NOTREACHED
        }
-
+}
 }
 
+if(! function_exists('removeme_content')) {
 function removeme_content(&$a) {
 
        if(! local_user())
@@ -50,5 +52,5 @@ function removeme_content(&$a) {
        ));
 
        return $o;
-
+}
 }
index 2b1224f4233fa6bec55792ad3242278b541a795c..e3956ba8cb4c50eec3f7241c0313ecbb6f62f892 100755 (executable)
@@ -3,6 +3,7 @@
 require_once('include/Scrape.php');
 require_once('include/follow.php');
 
+if(! function_exists('repair_ostatus_content')) {
 function repair_ostatus_content(&$a) {
 
        if(! local_user()) {
@@ -55,3 +56,4 @@ function repair_ostatus_content(&$a) {
 
        return $o;
 }
+}
index f4984f0f0ffd12e8d911c73ae8f4d1b39b65adc7..6f9c209fab5915e8f0f8c4e9dd0786f68f4dd0f3 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 
-
-
+if(! function_exists('rsd_xml_content')) {
 function rsd_xml_content(&$a) {
        header ("Content-Type: text/xml");
        echo '<?xml version="1.0" encoding="UTF-8"?>
@@ -21,4 +20,5 @@ function rsd_xml_content(&$a) {
  </rsd>
        ';
 die();
-}
\ No newline at end of file
+}
+}
index 9c22e42d110b3368a7bf6a950761cec238789530..ee3826d8a8bb37a3c3b734fea775dd12804afeab 100644 (file)
@@ -6,6 +6,7 @@ require_once('include/crypto.php');
 require_once('include/items.php');
 require_once('include/follow.php');
 
+if(! function_exists('salmon_return')) {
 function salmon_return($val) {
 
        if($val >= 400)
@@ -16,9 +17,10 @@ function salmon_return($val) {
        logger('mod-salmon returns ' . $val);
        header($_SERVER["SERVER_PROTOCOL"] . ' ' . $val . ' ' . $err);
        killme();
-
+}
 }
 
+if(! function_exists('salmon_post')) {
 function salmon_post(&$a) {
 
        $xml = file_get_contents('php://input');
@@ -155,7 +157,7 @@ function salmon_post(&$a) {
                if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
                        $result = new_contact($importer['uid'],$author_link);
                        if($result['success']) {
-                               $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s') 
+                               $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
                                        AND `uid` = %d LIMIT 1",
                                        dbesc(NETWORK_OSTATUS),
                                        dbesc($author_link),
@@ -185,3 +187,4 @@ function salmon_post(&$a) {
 
        http_status_exit(200);
 }
+}
index 7c78339c70b1638c271f90dcef86caccfbc0bd3b..431bd821d61478b020afa29f3e828e1c53e3c08c 100644 (file)
@@ -4,6 +4,7 @@ require_once('include/security.php');
 require_once('include/conversation.php');
 require_once('mod/dirfind.php');
 
+if(! function_exists('search_saved_searches')) {
 function search_saved_searches() {
 
        $o = '';
@@ -39,10 +40,10 @@ function search_saved_searches() {
        }
 
        return $o;
-
+}
 }
 
-
+if(! function_exists('search_init')) {
 function search_init(&$a) {
 
        $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
@@ -76,17 +77,18 @@ function search_init(&$a) {
        }
 
 
-
+}
 }
 
 
-
+if(! function_exists('search_post')) {
 function search_post(&$a) {
        if(x($_POST,'search'))
                $a->data['search'] = $_POST['search'];
 }
+}
 
-
+if(! function_exists('search_content')) {
 function search_content(&$a) {
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
@@ -248,4 +250,4 @@ function search_content(&$a) {
 
        return $o;
 }
-
+}
index 22c855edba6dcd0168608e98ff69f1889c2dbc5e..ac3d885b63b9ba4ce81344f714995c08a68cc4b6 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('session_content')) {
 function session_content(&$a) {
-
+}
 }
index 3efdbf6bde68fe192f07f9d458164ce9d783b292..1b62499c2276b40002843db3b704c6005fccda44 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
-
-function get_theme_config_file($theme){
+if(! function_exists('get_theme_config_file')) {
+function get_theme_config_file($theme) {
        $a = get_app();
        $base_theme = $a->theme_info['extends'];
 
@@ -13,7 +13,9 @@ function get_theme_config_file($theme){
        }
        return null;
 }
+}
 
+if(! function_exists('settings_init')) {
 function settings_init(&$a) {
 
        if(! local_user()) {
@@ -110,10 +112,10 @@ function settings_init(&$a) {
                '$class' => 'settings-widget',
                '$items' => $tabs,
        ));
-
+}
 }
 
-
+if(! function_exists('settings_post')) {
 function settings_post(&$a) {
 
        if(! local_user())
@@ -630,8 +632,9 @@ function settings_post(&$a) {
        goaway($a->get_baseurl(true) . '/settings' );
        return; // NOTREACHED
 }
+}
 
-
+if(! function_exists('settings_content')) {
 function settings_content(&$a) {
 
        $o = '';
@@ -1295,6 +1298,5 @@ function settings_content(&$a) {
        $o .= '</form>' . "\r\n";
 
        return $o;
-
 }
-
+}
index 085da4e30d8a8b6f15e343a480d6743f733def15..f3a221eb8ef4c985f9b8ad9e86a523efb8a4fa61 100644 (file)
@@ -1,12 +1,14 @@
 <?php
+
+if(! function_exists('share_init')) {
 function share_init(&$a) {
 
        $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
        if((! $post_id) || (! local_user()))
                killme();
 
-       $r = q("SELECT item.*, contact.network FROM `item` 
-               inner join contact on `item`.`contact-id` = `contact`.`id` 
+       $r = q("SELECT item.*, contact.network FROM `item`
+               inner join contact on `item`.`contact-id` = `contact`.`id`
                WHERE `item`.`id` = %d AND `item`.`uid` = %d LIMIT 1",
 
                intval($post_id),
@@ -40,7 +42,9 @@ function share_init(&$a) {
        echo $o;
        killme();
 }
+}
 
+if(! function_exists('share_header')) {
 function share_header($author, $profile, $avatar, $guid, $posted, $link) {
        $header = "[share author='".str_replace(array("'", "[", "]"), array("&#x27;", "&#x5B;", "&#x5D;"),$author).
                "' profile='".str_replace(array("'", "[", "]"), array("&#x27;", "&#x5B;", "&#x5D;"),$profile).
@@ -56,3 +60,4 @@ function share_header($author, $profile, $avatar, $guid, $posted, $link) {
 
        return $header;
 }
+}
index c47f95da76a5cfc7656aee72dcf7cb667402931d..4d498b674679608cc33e599d0afb9bfbdce0985c 100644 (file)
@@ -1,3 +1,7 @@
 <?php
 
-function smilies_content(&$a) { return smilies('',true); }
+if(! function_exists('smilies_content')) {
+function smilies_content(&$a) {
+  return smilies('',true);
+}
+}
index 2a89ac768bae20cb3150c48b3d5a841347790611..b4cc3267872de06d078f74938046721c895faf98 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('starred_init')) {
 function starred_init(&$a) {
 
        require_once("include/threads.php");
@@ -47,3 +47,4 @@ function starred_init(&$a) {
        echo json_encode($starred);
        killme();
 }
+}
index 21a9a0521c63d395267bfbe60f0431936ab3e071..98cc708d260692355401679e20401232b3c2e5bf 100644 (file)
@@ -5,6 +5,7 @@
 
 require_once("include/plugin.php");
 
+if(! function_exists('statistics_json_init')) {
 function statistics_json_init(&$a) {
 
         if (!get_config("system", "nodeinfo")) {
@@ -57,3 +58,4 @@ function statistics_json_init(&$a) {
        logger("statistics_init: printed ".print_r($statistics, true), LOGGER_DATA);
        killme();
 }
+}
index 1486a33b429bc2de89eee738a246ec08121ee6f8..6cbaa1d2a744be3b466d6fcfba7adcda1b9e50a8 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
+if(! function_exists('subthread_content')) {
 function subthread_content(&$a) {
 
        if(! local_user() && ! remote_user()) {
@@ -47,7 +47,7 @@ function subthread_content(&$a) {
                        $remote_owner = $r[0];
        }
 
-       // this represents the post owner on this system. 
+       // this represents the post owner on this system.
 
        $r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
                WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
@@ -103,7 +103,7 @@ EOT;
        $bodyverb = t('%1$s is following %2$s\'s %3$s');
 
        if(! isset($bodyverb))
-                       return; 
+                       return;
 
        $arr = array();
 
@@ -123,7 +123,7 @@ EOT;
        $arr['author-name'] = $contact['name'];
        $arr['author-link'] = $contact['url'];
        $arr['author-avatar'] = $contact['thumb'];
-       
+
        $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
        $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
        $plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
@@ -154,7 +154,5 @@ EOT;
        call_hooks('post_local_end', $arr);
 
        killme();
-
 }
-
-
+}
index b73c2cd1b61eef34a248ff9e507d92b4182f419b..8f5f4f6a128b05cd20afea3083dc169ead318e5e 100644 (file)
@@ -3,7 +3,7 @@
 require_once('include/socgraph.php');
 require_once('include/contact_widgets.php');
 
-
+if(! function_exists('suggest_init')) {
 function suggest_init(&$a) {
        if(! local_user())
                return;
@@ -42,13 +42,13 @@ function suggest_init(&$a) {
                        );
                }
        }
-
+}
 }
 
 
 
 
-
+if(! function_exists('suggest_content')) {
 function suggest_content(&$a) {
 
        require_once("mod/proxy.php");
@@ -110,8 +110,9 @@ function suggest_content(&$a) {
        $o .= replace_macros($tpl,array(
                '$title' => t('Friend Suggestions'),
                '$contacts' => $entries,
-               
+
        ));
 
        return $o;
 }
+}
index 2c469a58bbf2571cf3924d3fb85ac495fb1bab69..bee37015ea464f3065a50ca32de5ccfe81db85b1 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
+if(! function_exists('tagger_content')) {
 function tagger_content(&$a) {
 
        if(! local_user() && ! remote_user()) {
@@ -95,7 +95,7 @@ EOT;
        $bodyverb = t('%1$s tagged %2$s\'s %3$s with %4$s');
 
        if(! isset($bodyverb))
-                       return; 
+                       return;
 
        $termlink = html_entity_decode('&#x2317;') . '[url=' . $a->get_baseurl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]';
 
@@ -115,7 +115,7 @@ EOT;
        $arr['author-name'] = $contact['name'];
        $arr['author-link'] = $contact['url'];
        $arr['author-avatar'] = $contact['thumb'];
-       
+
        $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
        $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
        $plink = '[url=' . $item['plink'] . ']' . $post_type . '[/url]';
@@ -216,5 +216,5 @@ EOT;
 
        return; // NOTREACHED
 
-
+}
 }
index 176986bc38e23cc195918b60b3f0e995e4b28fab..70b3ef048f1be1bd2041beb4fbe1335ac51cf540 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/bbcode.php');
 
+if(! function_exists('tagrm_post')) {
 function tagrm_post(&$a) {
 
        if(! local_user())
@@ -40,13 +41,13 @@ function tagrm_post(&$a) {
 
        info( t('Tag removed') . EOL );
        goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
-       
-       // NOTREACHED
 
+       // NOTREACHED
+}
 }
 
 
-
+if(! function_exists('tagrm_content')) {
 function tagrm_content(&$a) {
 
        $o = '';
@@ -95,5 +96,5 @@ function tagrm_content(&$a) {
        $o .= '</form>';
 
        return $o;
-       
+}
 }
index 00991e44ca04da87fb8b0c8664dedd55d30cf385..dbf0996bba6766c1b2d0dd5677453f7da97bf9f6 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+if(! function_exists('toggle_mobile_init')) {
 function toggle_mobile_init(&$a) {
 
        if(isset($_GET['off']))
@@ -14,4 +15,4 @@ function toggle_mobile_init(&$a) {
 
        goaway($address);
 }
-
+}
index a44620a97657371691b8512573d066f4ea754632..eacf300f3f514baccffae6cfef0581f35a9144d9 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-function uexport_init(&$a){
+if(! function_exists('uexport_init')) {
+function uexport_init(&$a) {
        if(! local_user())
                killme();
 
@@ -55,8 +56,10 @@ function uexport_init(&$a){
        ));
 */
 }
+}
 
-function uexport_content(&$a){
+if(! function_exists('uexport_content')) {
+function uexport_content(&$a) {
 
     if ($a->argc > 1) {
         header("Content-type: application/json");
@@ -86,9 +89,10 @@ function uexport_content(&$a){
         '$options' => $options
     ));
 
-
+}
 }
 
+if(! function_exists('_uexport_multirow')) {
 function _uexport_multirow($query) {
        $result = array();
        $r = q($query);
@@ -103,7 +107,9 @@ function _uexport_multirow($query) {
        }
     return $result;
 }
+}
 
+if(! function_exists('_uexport_row')) {
 function _uexport_row($query) {
        $result = array();
        $r = q($query);
@@ -115,9 +121,10 @@ function _uexport_row($query) {
        }
     return $result;
 }
+}
 
-
-function uexport_account($a){
+if(! function_exists('uexport_account')) {
+function uexport_account($a) {
 
        $user = _uexport_row(
         sprintf( "SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()) )
@@ -153,9 +160,9 @@ function uexport_account($a){
         'version' => FRIENDICA_VERSION,
         'schema' => DB_UPDATE_VERSION,
         'baseurl' => $a->get_baseurl(),
-        'user' => $user, 
-        'contact' => $contact, 
-        'profile' => $profile, 
+        'user' => $user,
+        'contact' => $contact,
+        'profile' => $profile,
         'photo' => $photo,
         'pconfig' => $pconfig,
         'group' => $group,
@@ -164,14 +171,15 @@ function uexport_account($a){
 
     //echo "<pre>"; var_dump(json_encode($output)); killme();
        echo json_encode($output);
-
+}
 }
 
 /**
  * echoes account data and items as separated json, one per line
  */
+if(! function_exists('uexport_all')) {
 function uexport_all(&$a) {
-    
+
     uexport_account($a);
        echo "\n";
 
@@ -199,5 +207,5 @@ function uexport_all(&$a) {
                $output = array('item' => $r);
                echo json_encode($output)."\n";
        }
-
+}
 }
index 7ed5648d9e2d360de0cef3b85bb885ed9a903d66..942268b0ef0a89ac0cd523a70a74ef92c9658320 100644 (file)
@@ -5,6 +5,7 @@
 \r
 require_once("include/uimport.php");\r
 \r
+if(! function_exists('uimport_post')) {\r
 function uimport_post(&$a) {\r
        switch($a->config['register_policy']) {\r
         case REGISTER_OPEN:\r
@@ -27,16 +28,18 @@ function uimport_post(&$a) {
             $verified = 0;\r
             break;\r
        }\r
-    \r
+\r
     if (x($_FILES,'accountfile')){\r
         /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE\r
         import_account($a, $_FILES['accountfile']);\r
         return;\r
     }\r
 }\r
+}\r
 \r
+if(! function_exists('uimport_content')) {\r
 function uimport_content(&$a) {\r
-       \r
+\r
        if((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {\r
                notice("Permission denied." . EOL);\r
                return;\r
@@ -51,8 +54,8 @@ function uimport_content(&$a) {
                        return;\r
                }\r
        }\r
-       \r
-       \r
+\r
+\r
        if(x($_SESSION,'theme'))\r
                unset($_SESSION['theme']);\r
        if(x($_SESSION,'mobile-theme'))\r
@@ -71,3 +74,4 @@ function uimport_content(&$a) {
         ),\r
     ));\r
 }\r
+}\r
index 512629b0052955fe647aa4b6f8678ee72eadccad..396f4234c01e907761d79dae7a5268b1df7b9e55 100644 (file)
@@ -4,6 +4,7 @@
 
 require_once('mod/community.php');
 
+if(! function_exists('update_community_content')) {
 function update_community_content(&$a) {
 
        header("Content-type: text/html");
@@ -29,5 +30,5 @@ function update_community_content(&$a) {
        echo "</section>";
        echo "</body></html>\r\n";
        killme();
-
-}
\ No newline at end of file
+}
+}
index 25b0f7792663a6cfdb0748c1503253e281ec7e2d..9400cb39a6f02ba01094d6a4f2e5730cca82cbd0 100644 (file)
@@ -5,6 +5,7 @@
 require_once('mod/display.php');
 require_once('include/group.php');
 
+if(! function_exists('update_display_content')) {
 function update_display_content(&$a) {
 
        $profile_uid = intval($_GET['p']);
@@ -34,5 +35,5 @@ function update_display_content(&$a) {
        echo "</section>";
        echo "</body></html>\r\n";
        killme();
-
+}
 }
index 1bf374657573b5785e38622f0b716ff8bfcffd7b..b2e7abc90cccabd23e64c724a7ecd6f70d17a22c 100644 (file)
@@ -5,6 +5,7 @@
 require_once('mod/network.php');
 require_once('include/group.php');
 
+if(! function_exists('update_network_content')) {
 function update_network_content(&$a) {
 
        $profile_uid = intval($_GET['p']);
@@ -37,5 +38,5 @@ function update_network_content(&$a) {
        echo "</section>";
        echo "</body></html>\r\n";
        killme();
-
+}
 }
index 6b8fff5115aa56ba62fbb70b60b330b5b3a70f74..e1e4f1d79550ef7496a01ff63dd38e9aabcd7724 100644 (file)
@@ -9,6 +9,7 @@
 
 require_once('mod/notes.php');
 
+if(! function_exists('update_notes_content')) {
 function update_notes_content(&$a) {
 
        $profile_uid = intval($_GET['p']);
@@ -20,8 +21,8 @@ function update_notes_content(&$a) {
 
        /**
         *
-        * Grab the page inner contents by calling the content function from the profile module directly, 
-        * but move any image src attributes to another attribute name. This is because 
+        * Grab the page inner contents by calling the content function from the profile module directly,
+        * but move any image src attributes to another attribute name. This is because
         * some browsers will prefetch all the images for the page even if we don't need them.
         * The only ones we need to fetch are those for new page additions, which we'll discover
         * on the client side and then swap the image back.
@@ -52,5 +53,5 @@ function update_notes_content(&$a) {
        echo "</section>";
        echo "</body></html>\r\n";
        killme();
-
-}
\ No newline at end of file
+}
+}
index 2492a48ee496d6714ce2513c5a68102fb21f76a4..93a94ae0d8721928ecc9b4bee53ae2727cc4afd0 100644 (file)
@@ -9,6 +9,7 @@
 
 require_once('mod/profile.php');
 
+if(! function_exists('update_profile_content')) {
 function update_profile_content(&$a) {
 
        $profile_uid = intval($_GET['p']);
@@ -24,8 +25,8 @@ function update_profile_content(&$a) {
 
        /**
         *
-        * Grab the page inner contents by calling the content function from the profile module directly, 
-        * but move any image src attributes to another attribute name. This is because 
+        * Grab the page inner contents by calling the content function from the profile module directly,
+        * but move any image src attributes to another attribute name. This is because
         * some browsers will prefetch all the images for the page even if we don't need them.
         * The only ones we need to fetch are those for new page additions, which we'll discover
         * on the client side and then swap the image back.
@@ -56,5 +57,5 @@ function update_profile_content(&$a) {
        echo "</section>";
        echo "</body></html>\r\n";
        killme();
-
-}
\ No newline at end of file
+}
+}
index bf8d696b60f90cceef1b14d825ba70151cde932f..f9db7b05b19fe5e5c526f36e2d7e9e2d9bbfacb7 100644 (file)
@@ -5,7 +5,7 @@ require_once('include/bbcode.php');
 require_once('include/security.php');
 require_once('include/redir.php');
 
-
+if(! function_exists('videos_init')) {
 function videos_init(&$a) {
 
        if($a->argc > 1)
@@ -102,9 +102,9 @@ function videos_init(&$a) {
 
        return;
 }
+}
 
-
-
+if(! function_exists('videos_post')) {
 function videos_post(&$a) {
 
        $owner_uid = $a->data['user']['uid'];
@@ -176,11 +176,11 @@ function videos_post(&$a) {
        }
 
     goaway($a->get_baseurl() . '/videos/' . $a->data['user']['nickname']);
-
+}
 }
 
 
-
+if(! function_exists('videos_content')) {
 function videos_content(&$a) {
 
        // URLs (most aren't currently implemented):
@@ -407,4 +407,4 @@ function videos_content(&$a) {
        $o .= paginate($a);
        return $o;
 }
-
+}
index 15b3733b3fc974f45dcb21d2c2bec7a3728b6ef3..a270baeaa1425f2faa850d1d21c662875412adf6 100644 (file)
@@ -2,16 +2,18 @@
 /**
  * load view/theme/$current_theme/style.php with friendica contex
  */
-function view_init($a){
+
+if(! function_exists('view_init')) {
+function view_init($a) {
        header("Content-Type: text/css");
-               
+
        if ($a->argc == 4){
                $theme = $a->argv[2];
                $THEMEPATH = "view/theme/$theme";
                if(file_exists("view/theme/$theme/style.php"))
                        require_once("view/theme/$theme/style.php");
        }
-       
+
        killme();
 }
+}
index 04520e0d9309cc163ffe86c165625ef0e96233cd..acb51f0cb4c53bf134ce2f0222b59dbb63eca6d8 100644 (file)
@@ -2,6 +2,7 @@
 require_once('include/Contact.php');
 require_once('include/contact_selectors.php');
 
+if(! function_exists('viewcontacts_init')) {
 function viewcontacts_init(&$a) {
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
@@ -26,8 +27,9 @@ function viewcontacts_init(&$a) {
                profile_load($a,$a->argv[1]);
        }
 }
+}
 
-
+if(! function_exists('viewcontacts_content')) {
 function viewcontacts_content(&$a) {
        require_once("mod/proxy.php");
 
@@ -121,3 +123,4 @@ function viewcontacts_content(&$a) {
 
        return $o;
 }
+}
index 3fa4eaed53bad2b53686a59aef0af30acf1f5645..1203d18fc9dc2597bf2c1d6a64ce59e9a35c318c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-
+if(! function_exists('viewsrc_content')) {
 function viewsrc_content(&$a) {
 
        if(! local_user()) {
@@ -16,7 +16,7 @@ function viewsrc_content(&$a) {
                return;
        }
 
-       $r = q("SELECT `item`.`body` FROM `item` 
+       $r = q("SELECT `item`.`body` FROM `item`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                and `item`.`moderated` = 0
                AND `item`.`id` = '%s' LIMIT 1",
@@ -33,4 +33,4 @@ function viewsrc_content(&$a) {
                }
        return $o;
 }
-
+}
index 68752a0e1f659082e51ec6df90add56663d5ba1d..20e646cb9a0f59d0ba10f3fe311996252a056952 100644 (file)
@@ -3,6 +3,7 @@
 require_once('include/attach.php');
 require_once('include/datetime.php');
 
+if(! function_exists('wall_attach_post')) {
 function wall_attach_post(&$a) {
 
        $r_json = (x($_GET,'response') && $_GET['response']=='json');
@@ -190,3 +191,4 @@ function wall_attach_post(&$a) {
        killme();
        // NOTREACHED
 }
+}
index b815348c7010baddd103553dc653f83da416ce86..2851807d572041af980aa64c57e33677fea6ef9e 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/Photo.php');
 
+if(! function_exists('wall_upload_post')) {
 function wall_upload_post(&$a, $desktopmode = true) {
 
        logger("wall upload: starting new upload", LOGGER_DEBUG);
@@ -297,3 +298,4 @@ function wall_upload_post(&$a, $desktopmode = true) {
        killme();
        // NOTREACHED
 }
+}
index b8859badd3d30504f6ea7c57f914e3a9be31ad5d..a01dfd2b9f7fde6f4f518899456be6fe4b8fb10b 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/message.php');
 
+if(! function_exists('wallmessage_post')) {
 function wallmessage_post(&$a) {
 
        $replyto = get_my_url();
@@ -48,7 +49,7 @@ function wallmessage_post(&$a) {
        $body = str_replace("\r\n","\n",$body);
        $body = str_replace("\n\n","\n",$body);
 
-       
+
        $ret = send_wallmessage($user, $body, $subject, $replyto);
 
        switch($ret){
@@ -69,10 +70,10 @@ function wallmessage_post(&$a) {
        }
 
 //     goaway($a->get_baseurl() . '/profile/' . $user['nickname']);
-       
+}
 }
 
-
+if(! function_exists('wallmessage_content')) {
 function wallmessage_content(&$a) {
 
        if(! get_my_url()) {
@@ -134,9 +135,9 @@ function wallmessage_content(&$a) {
                '$nickname' => $user['nickname'],
                '$linkurl' => t('Please enter a link URL:')
        ));
-       
 
-       
+
+
        $tpl = get_markup_template('wallmessage.tpl');
        $o .= replace_macros($tpl,array(
                '$header' => t('Send Private Message'),
@@ -158,3 +159,4 @@ function wallmessage_content(&$a) {
 
        return $o;
 }
+}
index 74bd2c9543c6ceda125719b075f1fe08f7845c08..4024671b02f271c5a31956b58d54bb98afaf2259 100644 (file)
@@ -1,14 +1,13 @@
 <?php
 
-
-
+if(! function_exists('webfinger_content')) {
 function webfinger_content(&$a) {
 
        $o .= '<h3>Webfinger Diagnostic</h3>';
 
        $o .= '<form action="webfinger" method="get">';
        $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
-       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>';
 
        $o .= '<br /><br />';
 
@@ -24,3 +23,4 @@ function webfinger_content(&$a) {
        }
        return $o;
 }
+}
index c23119145ca4d0685f0aab07ed549dd7df997f3d..f8e0a9c4098fdf98d8265b7f9f9733f5a30762af 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once('include/crypto.php');
 
+if(! function_exists('xrd_init')) {
 function xrd_init(&$a) {
 
        $uri = urldecode(notags(trim($_GET['uri'])));
@@ -77,5 +78,5 @@ function xrd_init(&$a) {
 
        echo $arr['xml'];
        killme();
-
+}
 }