aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/contact_widgets.php3
-rw-r--r--include/expire.php6
-rw-r--r--include/text.php6
3 files changed, 13 insertions, 2 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index 42d3afdee..ce1cdbad5 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -183,7 +183,8 @@ function common_friends_visitor_widget($profile_uid) {
'$desc' => sprintf( tt("%d contact in common", "%d contacts in common", $t), $t),
'$base' => $a->get_baseurl(),
'$uid' => $profile_uid,
- '$cid' => $cid,
+ '$cid' => (($cid) ? $cid : '0'),
+ '$linkmore' => (($t > 5) ? 'true' : ''),
'$more' => t('show more'),
'$items' => $r
));
diff --git a/include/expire.php b/include/expire.php
index 5fa0ec758..755cd2494 100644
--- a/include/expire.php
+++ b/include/expire.php
@@ -32,7 +32,11 @@ function expire_run($argv, $argc){
// physically remove anything that has been deleted for more than two months
$r = q("delete from item where deleted = 1 and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY");
- q("optimize table item");
+
+ // make this optional as it could have a performance impact on large sites
+
+ if(intval(get_config('system','optimize_items')))
+ q("optimize table item");
logger('expire: start');
diff --git a/include/text.php b/include/text.php
index 1b5b0afd4..e3c683338 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1524,3 +1524,9 @@ function fix_mce_lf($s) {
$s = str_replace("\n\n","\n",$s);
return $s;
}
+
+
+function protect_sprintf($s) {
+ return(str_replace('%','%%',$s));
+}
+