aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php4
-rw-r--r--mod/channel.php4
-rw-r--r--mod/dirsearch.php10
-rw-r--r--mod/mail.php50
-rw-r--r--mod/message.php4
-rw-r--r--mod/rate.php5
-rw-r--r--mod/ratingsearch.php5
-rw-r--r--mod/regdir.php5
-rw-r--r--mod/sitelist.php8
9 files changed, 57 insertions, 38 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 7d7c50dcf..aaf00b14f 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -332,10 +332,10 @@ function admin_page_site(&$a) {
/* Installed langs */
$lang_choices = array();
- $langs = glob('view/*/strings.php');
+ $langs = glob('view/*/hstrings.php');
if(is_array($langs) && count($langs)) {
- if(! in_array('view/en/strings.php',$langs))
+ if(! in_array('view/en/hstrings.php',$langs))
$langs[] = 'view/en/';
asort($langs);
foreach($langs as $l) {
diff --git a/mod/channel.php b/mod/channel.php
index d1064e939..f1b74136e 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -153,7 +153,6 @@ function channel_content(&$a, $update = 0, $load = false) {
else
$page_mode = 'client';
-
$abook_uids = " and abook.abook_channel = " . intval($a->profile['profile_uid']) . " ";
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
@@ -260,9 +259,6 @@ function channel_content(&$a, $update = 0, $load = false) {
}
-
-
-
if((! $update) && (! $load)) {
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 132ed252b..ec730b28d 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -398,13 +398,15 @@ function list_public_sites() {
$rand = db_getfunc('rand');
$realm = get_directory_realm();
if($realm == DIRECTORY_REALM) {
- $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') order by $rand",
- dbesc($realm)
+ $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') and site_type = %d order by $rand",
+ dbesc($realm),
+ intval(SITE_TYPE_ZOT)
);
}
else {
- $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' order by $rand",
- dbesc($realm)
+ $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' and site_type = %d order by $rand",
+ dbesc($realm),
+ intval(SITE_TYPE_ZOT)
);
}
diff --git a/mod/mail.php b/mod/mail.php
index 2e7e3699a..e4a5ebafd 100644
--- a/mod/mail.php
+++ b/mod/mail.php
@@ -128,33 +128,45 @@ function mail_content(&$a) {
'$header' => t('Messages'),
));
- if((argc() == 3) && (argv(1) === 'drop')) {
- if(! intval(argv(2)))
+ if((argc() == 4) && (argv(2) === 'drop')) {
+ if(! intval(argv(3)))
return;
- $cmd = argv(1);
-
- $r = private_messages_drop(local_channel(), argv(2));
+ $cmd = argv(2);
+ $mailbox = argv(1);
+ $r = private_messages_drop(local_channel(), argv(3));
if($r) {
- info( t('Message deleted.') . EOL );
+ //info( t('Message deleted.') . EOL );
}
- goaway($a->get_baseurl(true) . '/mail/combined' );
+ goaway($a->get_baseurl(true) . '/mail/' . $mailbox);
}
- if((argc() == 3) && (argv(1) === 'recall')) {
- if(! intval(argv(2)))
+ if((argc() == 4) && (argv(2) === 'recall')) {
+ if(! intval(argv(3)))
return;
- $cmd = argv(1);
+ $cmd = argv(2);
+ $mailbox = argv(1);
$r = q("update mail set mail_recalled = 1 where id = %d and channel_id = %d",
- intval(argv(2)),
+ intval(argv(3)),
intval(local_channel())
);
- proc_run('php','include/notifier.php','mail',intval(argv(2)));
+ proc_run('php','include/notifier.php','mail',intval(argv(3)));
if($r) {
info( t('Message recalled.') . EOL );
}
- goaway($a->get_baseurl(true) . '/mail/combined' );
+ goaway($a->get_baseurl(true) . '/mail/' . $mailbox . '/' . argv(3));
+
+ }
+ if((argc() == 4) && (argv(2) === 'dropconv')) {
+ if(! intval(argv(3)))
+ return;
+ $cmd = argv(2);
+ $mailbox = argv(1);
+ $r = private_messages_drop(local_channel(), argv(3), true);
+ if($r)
+ info( t('Conversation removed.') . EOL );
+ goaway($a->get_baseurl(true) . '/mail/' . $mailbox);
}
if((argc() > 1) && (argv(1) === 'new')) {
@@ -266,7 +278,7 @@ function mail_content(&$a) {
$last_message = private_messages_list(local_channel(), $mailbox, 0, 1);
- $mid = ((argc() > 1) && (intval(argv(1)))) ? argv(1) : $last_message[0]['id'];
+ $mid = ((argc() > 2) && (intval(argv(2)))) ? argv(2) : $last_message[0]['id'];
$plaintext = true;
@@ -310,13 +322,14 @@ function mail_content(&$a) {
$s = theme_attachments($message);
$mails[] = array(
+ 'mailbox' => $mailbox,
'id' => $message['id'],
'from_name' => $message['from']['xchan_name'],
'from_url' => chanlink_hash($message['from_xchan']),
- 'from_photo' => $message['from']['xchan_photo_m'],
+ 'from_photo' => $message['from']['xchan_photo_s'],
'to_name' => $message['to']['xchan_name'],
'to_url' => chanlink_hash($message['to_xchan']),
- 'to_photo' => $message['to']['xchan_photo_m'],
+ 'to_photo' => $message['to']['xchan_photo_s'],
'subject' => $message['title'],
'body' => smilies(bbcode($message['body']) . $s),
'delete' => t('Delete message'),
@@ -338,7 +351,8 @@ function mail_content(&$a) {
$parent = '<input type="hidden" name="replyto" value="' . $message['parent_mid'] . '" />';
$tpl = get_markup_template('mail_display.tpl');
$o = replace_macros($tpl, array(
- '$prvmsg_header' => t('Subject:') . ' ' . $message['title'],
+ '$mailbox' => $mailbox,
+ '$prvmsg_header' => $message['title'],
'$thread_id' => $mid,
'$thread_subject' => $message['title'],
'$thread_seen' => $seen,
@@ -353,7 +367,7 @@ function mail_content(&$a) {
'$showinputs' => '',
'$subject' => t('Subject:'),
'$subjtxt' => $message['title'],
- '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
+ '$readonly' => 'readonly="readonly"',
'$yourmessage' => t('Your message:'),
'$text' => '',
'$select' => $select,
diff --git a/mod/message.php b/mod/message.php
index f8d71aa44..73239d2cb 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -24,7 +24,7 @@ function message_content(&$a) {
if(! $cipher)
$cipher = 'aes256';
-
+/*
if((argc() == 3) && (argv(1) === 'dropconv')) {
if(! intval(argv(2)))
return;
@@ -34,7 +34,7 @@ function message_content(&$a) {
info( t('Conversation removed.') . EOL );
goaway($a->get_baseurl(true) . '/mail/combined' );
}
-/*
+
if(argc() == 2) {
switch(argv(1)) {
diff --git a/mod/rate.php b/mod/rate.php
index a3a36b4a9..f30afed64 100644
--- a/mod/rate.php
+++ b/mod/rate.php
@@ -22,8 +22,9 @@ function rate_init(&$a) {
$a->poi = $r[0];
}
else {
- $r = q("select * from site where site_url like '%s' ",
- dbesc('%' . $target)
+ $r = q("select * from site where site_url like '%s' and site_type = %d",
+ dbesc('%' . $target),
+ intval(SITE_TYPE_ZOT)
);
if($r) {
$a->data['site'] = $r[0];
diff --git a/mod/ratingsearch.php b/mod/ratingsearch.php
index 9c4f2f827..173dd39ff 100644
--- a/mod/ratingsearch.php
+++ b/mod/ratingsearch.php
@@ -35,8 +35,9 @@ function ratingsearch_init(&$a) {
if($p)
$target = $p[0]['xchan_hash'];
else {
- $p = q("select * from site where site_url like '%s' ",
- dbesc('%' . $hash)
+ $p = q("select * from site where site_url like '%s' and site_type = %d ",
+ dbesc('%' . $hash),
+ intval(SITE_TYPE_ZOT)
);
if($p) {
$target = strtolower($hash);
diff --git a/mod/regdir.php b/mod/regdir.php
index dce50e76a..7168c3373 100644
--- a/mod/regdir.php
+++ b/mod/regdir.php
@@ -86,8 +86,9 @@ function regdir_init(&$a) {
if ($dirmode == DIRECTORY_MODE_STANDALONE) {
$r = array(array('site_url' => z_root()));
} else {
- $r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s' $sql_extra ",
- dbesc(get_directory_realm())
+ $r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s' and site_type = %d $sql_extra ",
+ dbesc(get_directory_realm()),
+ intval(SITE_TYPE_ZOT)
);
}
if ($r) {
diff --git a/mod/sitelist.php b/mod/sitelist.php
index 12911cbd4..30b2359ac 100644
--- a/mod/sitelist.php
+++ b/mod/sitelist.php
@@ -28,7 +28,9 @@ function sitelist_init(&$a) {
$result = array('success' => false);
- $r = q("select count(site_url) as total from site where true $sql_extra ");
+ $r = q("select count(site_url) as total from site where site_type = %d $sql_extra ",
+ intval(SITE_TYPE_ZOT)
+ );
if($r)
$result['total'] = intval($r[0]['total']);
@@ -36,7 +38,9 @@ function sitelist_init(&$a) {
$result['start'] = $start;
$result['limit'] = $limit;
- $r = q("select * from site where true $sql_extra $sql_order $sql_limit");
+ $r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit",
+ intval(SITE_TYPE_ZOT)
+ );
$result['results'] = 0;
$result['entries'] = array();