Browse Source

Merge remote-tracking branch 'upstream/master'

pull/570/head
Michael Vogel 10 years ago
parent
commit
e50c0efcdf
  1. 59
      boot.php
  2. 2
      doc/Home.md
  3. 2
      doc/Quick-Start-andfinally.md
  4. 4
      doc/Quick-Start-groupsandpages.md
  5. 2
      doc/Quick-Start-guide.md
  6. 4
      doc/Quick-Start-makingnewfriends.md
  7. 4
      doc/Quick-Start-network.md
  8. 2
      doc/de/Home.md
  9. 0
      doc/de/Quick-Start-andfinally.md
  10. 4
      doc/de/Quick-Start-groupsandpages.md
  11. 2
      doc/de/Quick-Start-guide.md
  12. 4
      doc/de/Quick-Start-makingnewfriends.md
  13. 4
      doc/de/Quick-Start-network.md
  14. 10
      include/api.php
  15. 20
      include/auth.php
  16. 70
      include/conversation.php
  17. 2
      include/cronhooks.php
  18. 6
      include/delivery.php
  19. 2
      include/diaspora.php
  20. 2
      include/directory.php
  21. 2
      include/enotify.php
  22. 2
      include/expire.php
  23. 2
      include/follow.php
  24. 40
      include/friendica_smarty.php
  25. 2
      include/gprobe.php
  26. 2
      include/html2plain.php
  27. 4
      include/items.php
  28. 6
      include/notifier.php
  29. 1
      include/oauth.php
  30. 5
      include/onepoll.php
  31. 2
      include/poller.php
  32. 6
      include/queue.php
  33. 96
      include/text.php
  34. 6
      index.php
  35. 7
      js/acl.js
  36. 10
      js/main.js
  37. 4
      mod/_well_known.php
  38. 12
      mod/admin.php
  39. 6
      mod/contacts.php
  40. 61
      mod/content.php
  41. 2
      mod/crepair.php
  42. 2
      mod/dfrn_confirm.php
  43. 7
      mod/dfrn_request.php
  44. 15
      mod/directory.php
  45. 2
      mod/display.php
  46. 2
      mod/editpost.php
  47. 11
      mod/events.php
  48. 22
      mod/fbrowser.php
  49. 1
      mod/filer.php
  50. 2
      mod/follow.php
  51. 8
      mod/group.php
  52. 16
      mod/hostxrd.php
  53. 22
      mod/install.php
  54. 58
      mod/message.php
  55. 3
      mod/nogroup.php
  56. 19
      mod/notifications.php
  57. 4
      mod/notify.php
  58. 109
      mod/photos.php
  59. 2
      mod/poco.php
  60. 1
      mod/profile.php
  61. 6
      mod/profile_photo.php
  62. 6
      mod/settings.php
  63. 2
      mod/share.php
  64. 2
      mod/tagrm.php
  65. 6
      mod/uimport.php
  66. 2
      mod/wall_upload.php
  67. 6
      mod/xrd.php
  68. 198
      mods/friendica-to-smarty-tpl.py
  69. 40
      object/Item.php
  70. 2
      util/db_update.php
  71. 1887
      util/messages.po
  72. 2
      view/acl_selector.tpl
  73. 4
      view/admin_site.tpl
  74. 2
      view/admin_users.tpl
  75. 6
      view/api_friends_xml.tpl
  76. 18
      view/ca/smarty3/cmnt_received_eml.tpl
  77. 13
      view/ca/smarty3/follow_notify_eml.tpl
  78. 19
      view/ca/smarty3/friend_complete_eml.tpl
  79. 68
      view/ca/smarty3/htconfig.tpl
  80. 21
      view/ca/smarty3/intro_complete_eml.tpl
  81. 35
      view/ca/smarty3/lostpass_eml.tpl
  82. 24
      view/ca/smarty3/mail_received_html_body_eml.tpl
  83. 9
      view/ca/smarty3/mail_received_text_body_eml.tpl
  84. 19
      view/ca/smarty3/passchanged_eml.tpl
  85. 22
      view/ca/smarty3/register_open_eml.tpl
  86. 23
      view/ca/smarty3/register_verify_eml.tpl
  87. 13
      view/ca/smarty3/request_notify_eml.tpl
  88. 18
      view/ca/smarty3/wall_received_eml.tpl
  89. 4
      view/contacts-template.tpl
  90. 2336
      view/cs/messages.po
  91. 14
      view/cs/smarty3/cmnt_received_eml.tpl
  92. 25
      view/cs/smarty3/cmnt_received_html_body_eml.tpl
  93. 14
      view/cs/smarty3/cmnt_received_text_body_eml.tpl
  94. 14
      view/cs/smarty3/follow_notify_eml.tpl
  95. 17
      view/cs/smarty3/friend_complete_eml.tpl
  96. 73
      view/cs/smarty3/htconfig.tpl
  97. 17
      view/cs/smarty3/intro_complete_eml.tpl
  98. 23
      view/cs/smarty3/lostpass_eml.tpl
  99. 25
      view/cs/smarty3/mail_received_html_body_eml.tpl
  100. 10
      view/cs/smarty3/mail_received_text_body_eml.tpl
  101. Some files were not shown because too many files have changed in this diff Show More

59
boot.php

@ -12,7 +12,7 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.1.1561' );
define ( 'FRIENDICA_VERSION', '3.1.1572' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1157 );
@ -380,9 +380,13 @@ if(! class_exists('App')) {
'videoheight' => 350,
'force_max_items' => 0,
'thread_allow' => true,
'stylesheet' => ''
'stylesheet' => '',
'template_engine' => 'internal',
);
public $smarty3_ldelim = '{{';
public $smarty3_rdelim = '}}';
private $scheme;
private $hostname;
private $baseurl;
@ -613,6 +617,16 @@ if(! class_exists('App')) {
if(!isset($this->page['htmlhead']))
$this->page['htmlhead'] = '';
$tpl = get_markup_template('head.tpl');
// If we're using Smarty, then doing replace_macros() will replace
// any unrecognized variables with a blank string. Since we delay
// replacing $stylesheet until later, we need to replace it now
// with another variable name
if($this->theme['template_engine'] === 'smarty3')
$stylesheet = $this->smarty3_ldelim . '$stylesheet' . $this->smarty3_rdelim;
else
$stylesheet = '$stylesheet';
$this->page['htmlhead'] = replace_macros($tpl,array(
'$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
'$local_user' => local_user(),
@ -621,7 +635,8 @@ if(! class_exists('App')) {
'$comment' => t('Comment'),
'$showmore' => t('show more'),
'$showfewer' => t('show fewer'),
'$update_interval' => $interval
'$update_interval' => $interval,
'$stylesheet' => $stylesheet
)) . $this->page['htmlhead'];
}
@ -954,8 +969,7 @@ if(! function_exists('login')) {
$a->module = 'login';
}
$o .= replace_macros($tpl,array(
$o .= replace_macros($tpl, array(
'$dest_url' => $dest_url,
'$logout' => t('Logout'),
@ -974,6 +988,13 @@ if(! function_exists('login')) {
'$lostpass' => t('Forgot your password?'),
'$lostlink' => t('Password Reset'),
'$tostitle' => t('Website Terms of Service'),
'$toslink' => t('terms of service'),
'$privacytitle' => t('Website Privacy Policy'),
'$privacylink' => t('privacy policy'),
));
call_hooks('login_hook',$o);
@ -1324,11 +1345,20 @@ if(! function_exists('profile_sidebar')) {
$tpl = get_markup_template('profile_vcard.tpl');
$p = array();
foreach($profile as $k => $v) {
$k = str_replace('-','_',$k);
$p[$k] = $v;
}
if($a->theme['template_engine'] === 'internal')
$location = template_escape($location);
$o .= replace_macros($tpl, array(
'$profile' => $profile,
'$profile' => $p,
'$connect' => $connect,
'$wallmessage' => $wallmessage,
'$location' => template_escape($location),
'$location' => $location,
'$gender' => $gender,
'$pdesc' => $pdesc,
'$marital' => $marital,
@ -1914,3 +1944,18 @@ function clear_cache($basepath = "", $path = "") {
closedir($dh);
}
}
function set_template_engine(&$a, $engine = 'internal') {
$a->theme['template_engine'] = 'internal';
if(is_writable('view/smarty3/')) {
switch($engine) {
case 'smarty3':
$a->theme['template_engine'] = 'smarty3';
break;
default:
break;
}
}
}

2
doc/Home.md

@ -5,7 +5,7 @@ Friendica Documentation and Resources
**Contents**
* [Account Basics](help/Account-Basics)
* [New User Quick Start](help/guide)
* [New User Quick Start](help/Quick-Start-guide)
* [Creating posts](help/Text_editor)
* [Comment, sort and delete posts](help/Text_comment)
* [Profiles](help/Profiles)

2
doc/andfinally.md → doc/Quick-Start-andfinally.md

@ -1,5 +1,3 @@
[[!meta title="And Finally..."]]
And that brings the Quick Start to an end.
Here are some more things to help get you started:

4
doc/groupsandpages.md → doc/Quick-Start-groupsandpages.md

@ -1,10 +1,10 @@
This is the global directory. If you get lost, you can <a href = "help/groupsandpages">click this link</a> to bring yourself back here.
This is the global directory. If you get lost, you can <a href = "help/Quick-Start-groupsandpages">click this link</a> to bring yourself back here.
On this page, you'll find a collection of groups, forums and celebrity pages. Groups are not real people. Connecting to them is similar to "liking" something on Facebook, or signing up for a new forum. You don't have to feel awkward about introducing yourself to a new person, because they're not people!
When you connect to a group, all messages to that group will start appearing in your network tab. You can comment on these posts, or post to the group yourself without ever having to add any of the groups members. This is a great way to make friends dynamically - you'll find people you like and add each other naturally instead of adding random strangers. Simply find a group you're interested in, and connect to it the same way you did with people in the last section. There are a lot of groups, and you're likely to get lost. Remember the link at the top of this page will bring you back here.
Once you've added some groups, <a href="help/andfinally">move on to the next section</a>.
Once you've added some groups, <a href="help/Quick-Start-andfinally">move on to the next section</a>.
<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>

2
doc/guide.md → doc/Quick-Start-guide.md

@ -6,7 +6,7 @@ This is a bit like your Facebook wall. It's where all your status messgages are
Once you've finished writing your post, click on the padlock icon to select who can see it. If you do not use the padlock icon, your post will be public. This means it will appear to anybody who views your profile, and in the community tab if your site has it enabled, as well as in the network tab of any of your contacts.
Play around with this a bit, then when you're ready to move on, we'll take a look at the <a href="help/network">Network Tab</a>
Play around with this a bit, then when you're ready to move on, we'll take a look at the <a href="help/Quick-Start-network">Network Tab</a>
<iframe src="login" width="950" height="600"></iframe>

4
doc/makingnewfriends.md → doc/Quick-Start-makingnewfriends.md

@ -1,10 +1,10 @@
This is your Suggested Friends page. If you get lost, you can <a href="help/makenewfriends">click this link</a> to bring yourself back here.
This is your Suggested Friends page. If you get lost, you can <a href="help/Quick-Start-makenewfriends">click this link</a> to bring yourself back here.
This is a bit like the Friend Suggestions page of Facebook. Everybody on this list has agreed that they may be suggested as a friend. This means they're unlikely to refuse an introduction you send, and they want to meet new people too!
See somebody you like the look of? Click the connect button beneath their photograph. This will bring you to the introductions page. Fill in the form as instructed, and add a small note (optional). Now, wait a bit and they'll accept your request - note that these are real people, and it might take a while. Now you've added one, you're probably lost. Click the link at the top of this page to go back to the suggested friends list and add some more.
Feel uncomfortable adding people you don't know? Don't worry - that's where <a href="help/groupsandpages">Groups and Pages</a> come in!
Feel uncomfortable adding people you don't know? Don't worry - that's where <a href="help/Quick-Start-groupsandpages">Groups and Pages</a> come in!
<iframe src="suggest" width="950" height="600"></iframe>

4
doc/network.md → doc/Quick-Start-network.md

@ -1,8 +1,8 @@
This is your Network Tab. If you get lost, you can <a href="help/network">click this link</a> to bring yourself back here.
This is your Network Tab. If you get lost, you can <a href="help/Quick-Start-network">click this link</a> to bring yourself back here.
This is a bit like the Newsfeed at Facebook or the Stream at Diaspora. It's where all the posts from your contacts, groups, and feeds will appear. If you're new, you won't see anything in this page, unless you posted your status in the last step. If you've already added a few friends, you'll be able to see their posts. Here, you can comment, like, or dislike posts, or click on somebody's name to visit their profile page where you can write on their wall.
Now we need to fill it up, the first step, is to <a href="help/makingnewfriends"> make some new friends</a>.
Now we need to fill it up, the first step, is to <a href="help/Quick-Start-makingnewfriends"> make some new friends</a>.
<iframe src="network" width="950" height="600"></iframe>

2
doc/de/Home.md

@ -4,7 +4,7 @@ Friendica - Dokumentation und Ressourcen
**Inhalte**
* [Account - Basics](help/Account-Basics)
* [Schnellstart für neue Benutzer](help/guide)
* [Schnellstart für neue Benutzer](help/Quick-Start-guide)
* [Beiträge erstellen](help/Text_editor)
* [Beiträge kommentieren, einordnen und löschen](help/Text_comment)
* [Profile](help/Profiles)

0
doc/de/andfinally.md → doc/de/Quick-Start-andfinally.md

4
doc/de/groupsandpages.md → doc/de/Quick-Start-groupsandpages.md

@ -3,13 +3,13 @@ Gruppen und Seiten
* [Zur Startseite der Hilfe](help)
Hier siehst du das globale Verzeichnis. Wenn du dich mal verirrt hast, kannst du <a href = "help/groupsandpages">diesen Link klicken</a> und wieder hierher kommen.
Hier siehst du das globale Verzeichnis. Wenn du dich mal verirrt hast, kannst du <a href = "help/Quick-Start-groupsandpages">diesen Link klicken</a> und wieder hierher kommen.
Auf dieser Seite findest du eine Zusammenstellung von Gruppen, Foren und bekannten Seiten. Gruppen sind keine realen Personen. Sich mit diesen zu verbinden ist, als wenn man jemanden auf Facebook "liked" ("gefällt mir") oder wenn man sich in einem Forum anmeldet. Habe keine Sorge, falls du dich unbehaglich fühlst, wenn du dich einer neuen Person vorstellen sollst, da es sich nicht um Personen handelt.
Wenn du dich mit einer Gruppe verbindest, erscheinen alle Nachrichten der Gruppe in deinem "Netzwerk"-Tab. Du kannst diese Beiträge kommentieren oder selbst in der Gruppe schreiben, ohne eine der Gruppenmitglieder persönlich hinzuzufügen. Das ist ein großartiger Weg, dynamisch neue Freunde zu gewinnen. Du findest Personen, die du magst, anstatt Fremde hinzuzufügen. Suche dir einfach eine Gruppe und füge sie so hinzu, wie du auch normale Freunde hinzufügst. Es gibt eine Menge Gruppen und möglicherweise findest du nicht wieder zu dieser Seite zurück. In diesem Fall nutze einfach den Link oben auf dieser Seite.
Wenn du einige Gruppen hinzugefügt hast, gehe <a href="help/andfinally">weiter zum nächsten Schritt</a>.
Wenn du einige Gruppen hinzugefügt hast, gehe <a href="help/Quick-Start-andfinally">weiter zum nächsten Schritt</a>.
<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>

2
doc/de/guide.md → doc/de/Quick-Start-guide.md

@ -11,7 +11,7 @@ Hier sieht es ein wenig wie auf deiner Facebook-Seite aus. Hier findest du alle
Wenn du deinen Beitrag ("Post") geschrieben hast, kannst du auf das "Schloss"-Symbol klicken und festlegen, wer deinen Beitrag sehen kann. Wenn du dieses Symbol nicht anklickst, ist dein Beitrag öffentlich. Das bedeutet, dass jeder, der dein Profil ansieht, der auf dem "Community"-Tab deines Servers oder auf dem "Netzwerk"-Tab ("Beiträge deiner Kontakte") eines befreundeten Kontakts ist, den Beitrag sehen kann.
Probiere es doch einfach mal aus. Wenn du fertg bist, schauen wir uns den <a href="help/network">"Netzwerk"-Tab</a> an.
Probiere es doch einfach mal aus. Wenn du fertg bist, schauen wir uns den <a href="help/Quick-Start-network">"Netzwerk"-Tab</a> an.
<iframe src="login" width="950" height="600"></iframe>

4
doc/de/makingnewfriends.md → doc/de/Quick-Start-makingnewfriends.md

@ -3,13 +3,13 @@ Neue Freunde finden
* [Zur Startseite der Hilfe](help)
Hier siehst du die Kontaktvorschläge. Wenn du dich mal verirrt hast, kannst du <a href="help/makenewfriends">diesen Link klicken</a> und wieder hierher kommen.
Hier siehst du die Kontaktvorschläge. Wenn du dich mal verirrt hast, kannst du <a href="help/Quick-Start-makenewfriends">diesen Link klicken</a> und wieder hierher kommen.
Diese Seite ist ein wenig wie die Kontaktvorschläge in Facebook. Jeder auf dieser Liste hat zugestimmt, als Kontaktvorschlag zu erscheinen. Das bedeutet, das sie Anfragen meist nicht ablehnen, da sie neue Leute kennenlernen wollen.
Siehst du jemanden, dessen Aussehen du magst? Klicke auf den "Verbinden"-Button beim Foto. Als nächstes kommst du zur Seite "Freundschafts-/Kontaktanfrage". Fülle das Formular wie vorgegeben aus und trage optional eine kleine Notiz ein. Nun musst du nur noch auf die Bestätigung warten. Beachte dabei, dass es sich um reale Personen handelt und es somit etwas dauern kann. Jetzt, nachdem du jemanden hinzugefügt hast, weißt du vielleicht nicht mehr, wie du zurückkommst. Klicke einfach auf den Link oben auf dieser Seite und du kommst zurück zur Seite mit den Kontaktvorschlägen, um weitere Personen hinzuzufügen.
Du willst nicht einfach Personen hinzufügen, die du nicht kennst? Kein Problem - an dieser Stelle kommen wir zu den <a href="help/groupsandpages">Gruppen und Seiten</a>.
Du willst nicht einfach Personen hinzufügen, die du nicht kennst? Kein Problem - an dieser Stelle kommen wir zu den <a href="help/Quick-Start-groupsandpages">Gruppen und Seiten</a>.
<iframe src="suggest" width="950" height="600"></iframe>

4
doc/de/network.md → doc/de/Quick-Start-network.md

@ -3,11 +3,11 @@ Deine "Netzwerk"-Seite
* [Zur Startseite der Hilfe](help)
Das ist dein "Netzwerk"-Tab. Wenn du dich mal verirrt hast, kannst du <a href="help/network">diesen Link klicken</a>, um wieder hierher zu kommen.
Das ist dein "Netzwerk"-Tab. Wenn du dich mal verirrt hast, kannst du <a href="help/Quick-Start-network">diesen Link klicken</a>, um wieder hierher zu kommen.
Diese Seite ist ein wenig wie die News-Seite in Facebook oder der Stream in Diaspora. Hier findest du alle Beiträge deiner Kontakte, Gruppen und Feeds, die du eingetragen hast. Wenn du neu bist, siehst du hier noch nichts, falls du deinen Status im letzten Schritt noch nicht eingetragen hast. Wenn du bereits ein paar Freunde eingetragen hast, findest du hier ihre Beiträge. Hier kannst du Beiträge kommentieren, eintragen, dass du den Beitrag magst oder ablehnst oder die Profile durch einen Klick auf deren Namen anschauen und auf deren Seite ("Wall") Nachrichten schreiben.
Nun wollen wir diese Seite mit Inhalt füllen. Der erste Schritt ist es, Leute <a href="help/makingnewfriends">zu deinem Account hinzuzufügen</a>.
Nun wollen wir diese Seite mit Inhalt füllen. Der erste Schritt ist es, Leute <a href="help/Quick-Start-makingnewfriends">zu deinem Account hinzuzufügen</a>.
<iframe src="network" width="950" height="600"></iframe>

10
include/api.php

@ -1,9 +1,9 @@
<?php
require_once("bbcode.php");
require_once("datetime.php");
require_once("conversation.php");
require_once("oauth.php");
require_once("html2plain.php");
require_once("include/bbcode.php");
require_once("include/datetime.php");
require_once("include/conversation.php");
require_once("include/oauth.php");
require_once("include/html2plain.php");
/*
* Twitter-Like API
*

20
include/auth.php

@ -5,6 +5,8 @@ require_once('include/security.php');
require_once('include/datetime.php');
function nuke_session() {
new_cookie(0); // make sure cookie is deleted on browser close, as a security measure
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
unset($_SESSION['visitor_id']);
@ -187,18 +189,10 @@ else {
// (i.e. expire when the browser is closed), even when there's a time expiration
// on the cookie
if($_POST['remember']) {
$old_sid = session_id();
session_set_cookie_params('31449600'); // one year
session_regenerate_id(false);
q("UPDATE session SET sid = '%s' WHERE sid = '%s'", dbesc(session_id()), dbesc($old_sid));
new_cookie(31449600); // one year
}
else {
$old_sid = session_id();
session_set_cookie_params('0');
session_regenerate_id(false);
q("UPDATE session SET sid = '%s' WHERE sid = '%s'", dbesc(session_id()), dbesc($old_sid));
new_cookie(0); // 0 means delete on browser exit
}
// if we haven't failed up this point, log them in.
@ -208,4 +202,10 @@ else {
}
}
function new_cookie($time) {
$old_sid = session_id();
session_set_cookie_params("$time");
session_regenerate_id(false);
q("UPDATE session SET sid = '%s' WHERE sid = '%s'", dbesc(session_id()), dbesc($old_sid));
}

70
include/conversation.php

@ -369,7 +369,7 @@ if(!function_exists('conversation')) {
function conversation(&$a, $items, $mode, $update, $preview = false) {
require_once('bbcode.php');
require_once('include/bbcode.php');
$ssl_state = ((local_user()) ? true : false);
@ -581,33 +581,54 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
list($categories, $folders) = get_cats_and_terms($item);
if($a->theme['template_engine'] === 'internal') {
$profile_name_e = template_escape($profile_name);
$item['title_e'] = template_escape($item['title']);
$body_e = template_escape($body);
$tags_e = template_escape($tags);
$hashtags_e = template_escape($hashtags);
$mentions_e = template_escape($mentions);
$location_e = template_escape($location);
$owner_name_e = template_escape($owner_name);
}
else {
$profile_name_e = $profile_name;
$item['title_e'] = $item['title'];
$body_e = $body;
$tags_e = $tags;
$hashtags_e = $hashtags;
$mentions_e = $mentions;
$location_e = $location;
$owner_name_e = $owner_name;
}
$tmp_item = array(
'template' => $tpl,
'id' => (($preview) ? 'P0' : $item['item_id']),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => template_escape($profile_name),
'name' => $profile_name_e,
'sparkle' => $sparkle,
'lock' => $lock,
'thumb' => $profile_avatar,
'title' => template_escape($item['title']),
'body' => template_escape($body),
'tags' => template_escape($tags),
'hashtags' => template_escape($hashtags),
'mentions' => template_escape($mentions),
'title' => $item['title_e'],
'body' => $body_e,
'tags' => $tags_e,
'hashtags' => $hashtags_e,
'mentions' => $mentions_e,
'txt_cats' => t('Categories:'),
'txt_folders' => t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
'has_folders' => ((count($folders)) ? 'true' : ''),
'categories' => $categories,
'folders' => $folders,
'text' => strip_tags(template_escape($body)),
'text' => strip_tags($body_e),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'location' => template_escape($location),
'location' => $location_e,
'indent' => '',
'owner_name' => template_escape($owner_name),
'owner_name' => $owner_name_e,
'owner_url' => $owner_url,
'owner_photo' => $owner_photo,
'plink' => get_plink($item),
@ -856,12 +877,27 @@ function format_like($cnt,$arr,$type,$id) {
if($cnt == 1)
$o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
else {
$spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
$o .= (($type === 'like') ?
sprintf( t('<span %1$s>%2$d people</span> like this.'), $spanatts, $cnt)
:
sprintf( t('<span %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt) );
$o .= EOL ;
//$spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
switch($type) {
case 'like':
// $phrase = sprintf( t('<span %1$s>%2$d people</span> like this.'), $spanatts, $cnt);
$mood = t('like this');
break;
case 'dislike':
// $phrase = sprintf( t('<span %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt);
$mood = t('don\'t like this');
break;
}
$tpl = get_markup_template("voting_fakelink.tpl");
$phrase = replace_macros($tpl, array(
'$vote_id' => $type . 'list-' . $id,
'$count' => $cnt,
'$people' => t('people'),
'$vote_mood' => $mood
));
$o .= $phrase;
// $o .= EOL ;
$total = count($arr);
if($total >= MAX_LIKERS)
$arr = array_slice($arr, 0, MAX_LIKERS - 1);
@ -885,7 +921,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$o = '';
$geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : '');
$geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
/* $plaintext = false;
if( local_user() && (intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext')) )

2
include/cronhooks.php

@ -12,7 +12,7 @@ function cronhooks_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};

6
include/delivery.php

@ -12,13 +12,13 @@ function delivery_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once("session.php");
require_once("datetime.php");
require_once("include/session.php");
require_once("include/datetime.php");
require_once('include/items.php');
require_once('include/bbcode.php');
require_once('include/diaspora.php');

2
include/diaspora.php

@ -752,7 +752,7 @@ function diaspora_request($importer,$xml) {
}
function diaspora_post_allow($importer,$contact) {
if(($contact['blocked']) || ($contact['readonly']))
if(($contact['blocked']) || ($contact['readonly']) || ($contact['archive']))
return false;
if($contact['rel'] == CONTACT_IS_SHARING || $contact['rel'] == CONTACT_IS_FRIEND)
return true;

2
include/directory.php

@ -10,7 +10,7 @@ function directory_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};

2
include/enotify.php

@ -310,7 +310,7 @@ function notification($params) {
// send email notification if notification preferences permit
require_once('bbcode.php');
require_once('include/bbcode.php');
if((intval($params['notify_flags']) & intval($params['type'])) || $params['type'] == NOTIFY_SYSTEM) {
logger('notification: sending notification email');

2
include/expire.php

@ -11,7 +11,7 @@ function expire_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};

2
include/follow.php

@ -218,7 +218,7 @@ function new_contact($uid,$url,$interactive = false) {
group_add_member($uid,'',$contact_id,$g[0]['def_gid']);
}
require_once("Photo.php");
require_once("include/Photo.php");
$photos = import_profile_photo($ret['photo'],$uid,$contact_id);

40
include/friendica_smarty.php

@ -0,0 +1,40 @@
<?php
require_once("library/Smarty/libs/Smarty.class.php");
class FriendicaSmarty extends Smarty {
public $filename;
function __construct() {
parent::__construct();
$a = get_app();
$theme = current_theme();
// setTemplateDir can be set to an array, which Smarty will parse in order.
// The order is thus very important here
$template_dirs = array('theme' => "view/theme/$theme/smarty3/");
if( x($a->theme_info,"extends") )
$template_dirs = $template_dirs + array('extends' => "view/theme/".$a->theme_info["extends"]."/smarty3/");
$template_dirs = $template_dirs + array('base' => 'view/smarty3/');
$this->setTemplateDir($template_dirs);
$this->setCompileDir('view/smarty3/compiled/');
$this->setConfigDir('view/smarty3/config/');
$this->setCacheDir('view/smarty3/cache/');
$this->left_delimiter = $a->smarty3_ldelim;
$this->right_delimiter = $a->smarty3_rdelim;
}
function parsed($template = '') {
if($template) {
return $this->fetch('string:' . $template);
}
return $this->fetch('file:' . $this->filename);
}
}

2
include/gprobe.php

@ -13,7 +13,7 @@ function gprobe_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};

2
include/html2plain.php

@ -1,5 +1,5 @@
<?php
require_once "html2bbcode.php";
require_once("include/html2bbcode.php");
function breaklines($line, $level, $wraplength = 75)
{

4
include/items.php

@ -1607,7 +1607,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if((is_array($contact)) && ($photo_timestamp) && (strlen($photo_url)) && ($photo_timestamp > $contact['avatar-date'])) {
logger('consume_feed: Updating photo for ' . $contact['name']);
require_once("Photo.php");
require_once("include/Photo.php");
$photo_failure = false;
$have_photo = false;
@ -2240,7 +2240,7 @@ function local_delivery($importer,$data) {
if(($photo_timestamp) && (strlen($photo_url)) && ($photo_timestamp > $importer['avatar-date'])) {
logger('local_delivery: Updating photo for ' . $importer['name']);
require_once("Photo.php");
require_once("include/Photo.php");
$photo_failure = false;
$have_photo = false;

6
include/notifier.php

@ -51,13 +51,13 @@ function notifier_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once("session.php");
require_once("datetime.php");
require_once("include/session.php");
require_once("include/datetime.php");
require_once('include/items.php');
require_once('include/bbcode.php');
require_once('include/email.php');

1
include/oauth.php

@ -150,6 +150,7 @@ class FKOAuth1 extends OAuthServer {
$_SESSION['page_flags'] = $record['page-flags'];
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $record['nickname'];
$_SESSION['addr'] = $_SERVER['REMOTE_ADDR'];
$_SESSION["allow_api"] = true;
//notice( t("Welcome back ") . $record['username'] . EOL);
$a->user = $record;

5
include/onepoll.php

@ -18,7 +18,7 @@ function onepoll_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};
@ -252,6 +252,9 @@ function onepoll_run(&$argv, &$argc){
$stat_writeable = ((($contact['notify']) && ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['rel'] == CONTACT_IS_FRIEND)) ? 1 : 0);
if($contact['network'] === NETWORK_OSTATUS && get_pconfig($importer_uid,'system','ostatus_autofriend'))
$stat_writeable = 1;
if($stat_writeable != $contact['writable']) {
q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1",
intval($stat_writeable),

2
include/poller.php

@ -12,7 +12,7 @@ function poller_run(&$argv, &$argc){
if(is_null($db)) {
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};

6
include/queue.php

@ -11,14 +11,14 @@ function queue_run(&$argv, &$argc){
if(is_null($db)){
@include(".htconfig.php");
require_once("dba.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
};
require_once("session.php");
require_once("datetime.php");
require_once("include/session.php");
require_once("include/datetime.php");
require_once('include/items.php');
require_once('include/bbcode.php');

96
include/text.php

@ -9,19 +9,39 @@
// depending on the order in which they were declared in the array.
require_once("include/template_processor.php");
require_once("include/friendica_smarty.php");
if(! function_exists('replace_macros')) {
function replace_macros($s,$r) {
global $t;
//$ts = microtime();
$r = $t->replace($s,$r);
//$tt = microtime() - $ts;
//$a = get_app();
//$a->page['debug'] .= "$tt <br>\n";
return template_unescape($r);
// $ts = microtime();
$a = get_app();
if($a->theme['template_engine'] === 'smarty3') {
$template = '';
if(gettype($s) === 'string') {
$template = $s;
$s = new FriendicaSmarty();
$s->error_reporting = E_ALL & ~E_NOTICE;
}
foreach($r as $key=>$value) {
if($key[0] === '$') {
$key = substr($key, 1);
}
$s->assign($key, $value);
}
$output = $s->parsed($template);
}
else {
$r = $t->replace($s,$r);
$output = template_unescape($r);
}
// $tt = microtime() - $ts;
// $a = get_app();
// $a->page['debug'] .= "$tt <br>\n";
return $output;
}}
@ -421,29 +441,63 @@ if(! function_exists('get_intltext_template')) {
function get_intltext_template($s) {
global $lang;
$a = get_app();
$engine = '';
if($a->theme['template_engine'] === 'smarty3')
$engine = "/smarty3";
if(! isset($lang))
$lang = 'en';
if(file_exists("view/$lang/$s"))
return file_get_contents("view/$lang/$s");
elseif(file_exists("view/en/$s"))
return file_get_contents("view/en/$s");
if(file_exists("view/$lang$engine/$s"))
return file_get_contents("view/$lang$engine/$s");
elseif(file_exists("view/en$engine/$s"))
return file_get_contents("view/en$engine/$s");
else
return file_get_contents("view/$s");
return file_get_contents("view$engine/$s");
}}
if(! function_exists('get_markup_template')) {
function get_markup_template($s) {
$a=get_app();
function get_markup_template($s, $root = '') {
// $ts = microtime();
$a = get_app();
if($a->theme['template_engine'] === 'smarty3') {
$template_file = get_template_file($a, 'smarty3/' . $s, $root);
$template = new FriendicaSmarty();
$template->filename = $template_file;
// $tt = microtime() - $ts;
// $a->page['debug'] .= "$tt <br>\n";
return $template;
}
else {
$template_file = get_template_file($a, $s, $root);
// $file_contents = file_get_contents($template_file);
// $tt = microtime() - $ts;
// $a->page['debug'] .= "$tt <br>\n";
// return $file_contents;
return file_get_contents($template_file);
}
}}
if(! function_exists("get_template_file")) {
function get_template_file($a, $filename, $root = '') {
$theme = current_theme();
if(file_exists("view/theme/$theme/$s"))
return file_get_contents("view/theme/$theme/$s");
elseif (x($a->theme_info,"extends") && file_exists("view/theme/".$a->theme_info["extends"]."/$s"))
return file_get_contents("view/theme/".$a->theme_info["extends"]."/$s");
// Make sure $root ends with a slash /
if($root !== '' && $root[strlen($root)-1] !== '/')
$root = $root . '/';
if(file_exists($root . "view/theme/$theme/$filename"))
$template_file = $root . "view/theme/$theme/$filename";
elseif (x($a->theme_info,"extends") && file_exists($root . "view/theme/".$a->theme_info["extends"]."/$filename"))
$template_file = $root . "view/theme/".$a->theme_info["extends"]."/$filename";
else
return file_get_contents("view/$s");
$template_file = $root . "view/$filename";
return $template_file;
}}

6
index.php

@ -41,7 +41,7 @@ load_translation_table($lang);
*
*/
require_once("dba.php");
require_once("include/dba.php");
if(! $install) {
$db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
@ -54,7 +54,7 @@ if(! $install) {
load_config('config');
load_config('system');
require_once("session.php");
require_once("include/session.php");
load_hooks();
call_hooks('init_1');
}
@ -109,7 +109,7 @@ if((x($_GET,'zrl')) && (! $install)) {
// header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";');
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
require("auth.php");
require("include/auth.php");
if(! x($_SESSION,'authenticated'))
header('X-Account-Management-Status: none');

7
js/acl.js

@ -248,11 +248,16 @@ ACL.prototype.populate = function(data){
that.list_content.height(height);
$(data.items).each(function(){
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
html = html.format(this.photo, this.name, this.type, this.id, '', this.network, this.link);
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
//console.log(html);
that.list_content.append(html);
});
$(".acl-list-item img[data-src]").each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
that.update_view();
}

10
js/main.js

@ -181,7 +181,14 @@
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html);
});
$("img[data-src]", nnm).each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
}
notif = eNotif.attr('count');
if (notif>0){
$("#nav-notifications-linkmenu").addClass("on");
@ -202,8 +209,7 @@
});
});
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) {

4
mod/_well_known.php

@ -1,5 +1,5 @@
<?php
require_once("hostxrd.php");
require_once("mod/hostxrd.php");
function _well_known_init(&$a){
if ($a->argc > 1) {
@ -11,4 +11,4 @@ function _well_known_init(&$a){
}
http_status_exit(404);
killme();
}
}

12
mod/admin.php

@ -710,6 +710,16 @@ function admin_page_users(&$a){
$users = array_map("_setup_users", $users);
// Get rid of dashes in key names, Smarty3 can't handle them
foreach($users as $key => $user) {
$new_user = array();
foreach($user as $k => $v) {
$k = str_replace('-','_',$k);
$new_user[$k] = $v;
}
$users[$key] = $new_user;
}
$t = get_markup_template("admin_users.tpl");
$o = replace_macros($t, array(
// strings //
@ -1207,7 +1217,7 @@ function admin_page_remoteupdate(&$a) {
'$ftppath' => array('ftppath', t("FTP Path"), '/',''),
'$ftpuser' => array('ftpuser', t("FTP User"), '',''),
'$ftppwd' => array('ftppwd', t("FTP Password"), '',''),
'$remotefile'=>array('remotefile','', $u['2'],'')
'$remotefile'=>array('remotefile','', $u['2'],''),
));
}

6
mod/contacts.php

@ -346,7 +346,7 @@ function contacts_content(&$a) {
$lost_contact = (($contact['archive'] && $contact['term-date'] != '0000-00-00 00:00:00' && $contact['term-date'] < datetime_convert('','','now')) ? t('Communications lost with this contact!') : '');
$o .= replace_macros($tpl,array(
$o .= replace_macros($tpl, array(
'$header' => t('Contact Editor'),
'$tab_str' => $tab_str,
'$submit' => t('Submit'),
@ -388,7 +388,7 @@ function contacts_content(&$a) {
'$dir_icon' => $dir_icon,
'$alt_text' => $alt_text,
'$sparkle' => $sparkle,
'$url' => $url
'$url' => $url,
));
@ -571,7 +571,7 @@ function contacts_content(&$a) {
}
$tpl = get_markup_template("contacts-template.tpl");
$o .= replace_macros($tpl,array(
$o .= replace_macros($tpl, array(
'$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''),
'$tabs' => $t,
'$total' => $total,

61
mod/content.php

@ -309,7 +309,7 @@ function content_content(&$a, $update = 0) {
function render_content(&$a, $items, $mode, $update, $preview = false) {
require_once('bbcode.php');
require_once('include/bbcode.php');
$ssl_state = ((local_user()) ? true : false);
@ -447,6 +447,23 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
$shareable = false;
$body = prepare_body($item,true);
if($a->theme['template_engine'] === 'internal') {
$name_e = template_escape($profile_name);
$title_e = template_escape($item['title']);
$body_e = template_escape($body);
$text_e = strip_tags(template_escape($body));
$location_e = template_escape($location);
$owner_name_e = template_escape($owner_name);
}
else {
$name_e = $profile_name;
$title_e = $item['title'];
$body_e = $body;
$text_e = strip_tags($body);
$location_e = $location;
$owner_name_e = $owner_name;
}
//$tmp_item = replace_macros($tpl,array(
$tmp_item = array(
@ -455,17 +472,17 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => template_escape($profile_name),
'name' => $name_e,
'sparkle' => $sparkle,
'lock' => $lock,
'thumb' => $profile_avatar,
'title' => template_escape($item['title']),
'body' => template_escape($body),
'text' => strip_tags(template_escape($body)),
'title' => $title_e,
'body' => $body_e,
'text' => $text_e,
'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'location' => template_escape($location),
'location' => $location_e,
'indent' => '',
'owner_name' => template_escape($owner_name),
'owner_name' => $owner_name_e,
'owner_url' => $owner_url,
'owner_photo' => $owner_photo,
'plink' => get_plink($item),
@ -802,6 +819,24 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
$body = prepare_body($item,true);
//$tmp_item = replace_macros($template,
if($a->theme['template_engine'] === 'internal') {
$body_e = template_escape($body);
$text_e = strip_tags(template_escape($body));
$name_e = template_escape($profile_name);
$title_e = template_escape($item['title']);
$location_e = template_escape($location);
$owner_name_e = template_escape($owner_name);
}
else {
$body_e = $body;
$text_e = strip_tags($body);
$name_e = $profile_name;
$title_e = $item['title'];
$location_e = $location;
$owner_name_e = $owner_name;
}
$tmp_item = array(
// collapse comments in template. I don't like this much...
'comment_firstcollapsed' => $comment_firstcollapsed,
@ -811,8 +846,8 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'tags' => $tags,
'body' => template_escape($body),
'text' => strip_tags(template_escape($body)),
'body' => $body_e,
'text' => $text_e,
'id' => $item['item_id'],
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
@ -821,19 +856,19 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
'vwall' => t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => template_escape($profile_name),
'name' => $name_e,
'thumb' => $profile_avatar,
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => template_escape($item['title']),
'title' => $title_e,
'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'lock' => $lock,
'location' => template_escape($location),
'location' => $location_e,
'indent' => $indent,
'shiny' => $shiny,
'owner_url' => $owner_url,
'owner_photo' => $owner_photo,
'owner_name' => template_escape($owner_name),
'owner_name' => $owner_name_e,
'plink' => get_plink($item),
'edpost' => $edpost,
'isstarred' => $isstarred,

2
mod/crepair.php

@ -76,7 +76,7 @@ function crepair_post(&$a) {
if($photo) {
logger('mod-crepair: updating photo from ' . $photo);
require_once("Photo.php");
require_once("include/Photo.php");
$photos = import_profile_photo($photo,local_user(),$contact['id']);

2
mod/dfrn_confirm.php

@ -671,7 +671,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
else
$photo = $a->get_baseurl() . '/images/person-175.jpg';
require_once("Photo.php");
require_once("include/Photo.php");
$photos = import_profile_photo($photo,$local_uid,$dfrn_record);

7
mod/dfrn_request.php

@ -110,7 +110,7 @@ function dfrn_request_post(&$a) {
* Scrape the other site's profile page to pick up the dfrn links, key, fn, and photo
*/
require_once('Scrape.php');
require_once('include/Scrape.php');
$parms = scrape_dfrn($dfrn_url);
@ -358,6 +358,7 @@ function dfrn_request_post(&$a) {
intval($uid)
);
if(! count($r)) {
notice( t('This account has not been configured for email. Request failed.') . EOL);
return;
}
@ -504,7 +505,7 @@ function dfrn_request_post(&$a) {
}
require_once('Scrape.php');
require_once('include/Scrape.php');
$parms = scrape_dfrn(($hcard) ? $hcard : $url);
@ -616,7 +617,7 @@ function dfrn_request_post(&$a) {
*
*/
$url = str_replace('{uri}', $a->get_baseurl() . '/dfrn_poll/' . $nickname, $url);
$url = str_replace('{uri}', $a->get_baseurl() . '/profile/' . $nickname, $url);
goaway($url);
// NOTREACHED
// END $network === NETWORK_OSTATUS

15
mod/directory.php

@ -143,16 +143,23 @@ function directory_content(&$a) {
$tpl = get_markup_template('directory_item.tpl');
if($a->theme['template_engine'] === 'internal') {
$location_e = template_escape($location);
}
else {
$location_e = $location;
}
$entry = replace_macros($tpl,array(
'$id' => $rr['id'],
'$profile-link' => $profile_link,
'$profile_link' => $profile_link,
'$photo' => $a->get_cached_avatar_image($rr[$photo]),
'$alt-text' => $rr['name'],
'$alt_text' => $rr['name'],
'$name' => $rr['name'],
'$details' => $pdesc . $details,
'$page-type' => $page_type,
'$page_type' => $page_type,
'$profile' => $profile,
'$location' => template_escape($location),
'$location' => $location_e,
'$gender' => $gender,
'$pdesc' => $pdesc,
'$marital' => $marital,

2
mod/display.php

@ -16,7 +16,7 @@ function display_content(&$a, $update = 0) {
$o = '';
$a->page['htmlhead'] .= get_markup_template('display-head.tpl');
$a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'), array());
if($update) {

2
mod/editpost.php

@ -1,6 +1,6 @@
<?php
require_once('acl_selectors.php');
require_once('include/acl_selectors.php');
function editpost_content(&$a) {

11
mod/events.php

@ -341,6 +341,17 @@ function events_content(&$a) {
// $tpl = get_markup_template("events.tpl");
// }
}
// Get rid of dashes in key names, Smarty3 can't handle them
foreach($events as $key => $event) {
$event_item = array();
foreach($event['item'] as $k => $v) {
$k = str_replace('-','_',$k);
$event_item[$k] = $v;
}
$events[$key]['item'] = $event_item;
}
$o = replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$tabs' => $tabs,

22
mod/fbrowser.php

@ -55,9 +55,17 @@ function fbrowser_content($a){
global $a;
$types = Photo::supportedTypes();
$ext = $types[$rr['type']];
if($a->theme['template_engine'] === 'internal') {
$filename_e = template_escape($rr['filename']);
}
else {
$filename_e = $rr['filename'];
}
return array(
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['hiq'] . '.' .$ext,
template_escape($rr['filename']),
$filename_e,
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['loq'] . '.'. $ext
);
}
@ -70,6 +78,7 @@ function fbrowser_content($a){
'$path' => $path,
'$folders' => $albums,
'$files' =>$files,
'$cancel' => t('Cancel'),
));
@ -83,7 +92,15 @@ function fbrowser_content($a){
function files2($rr){ global $a;
list($m1,$m2) = explode("/",$rr['filetype']);
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
return array( $a->get_baseurl() . '/attach/' . $rr['id'], template_escape($rr['filename']), $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png');
if($a->theme['template_engine'] === 'internal') {
$filename_e = template_escape($rr['filename']);
}
else {
$filename_e = $rr['filename'];
}
return array( $a->get_baseurl() . '/attach/' . $rr['id'], $filename_e, $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png');
}
$files = array_map("files2", $files);
//echo "<pre>"; var_dump($files); killme();
@ -96,6 +113,7 @@ function fbrowser_content($a){
'$path' => array( array($a->get_baseurl()."/fbrowser/image/", t("Files")) ),
'$folders' => false,
'$files' =>$files,
'$cancel' => t('Cancel'),
));
}

1
mod/filer.php

@ -24,6 +24,7 @@ function filer_content(&$a) {
$filetags = get_pconfig(local_user(),'system','filetags');
$filetags = file_tag_file_to_list($filetags,'file');
$filetags = explode(",", $filetags);
$tpl = get_markup_template("filer_dialog.tpl");
$o = replace_macros($tpl, array(
<