diff options
author | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-15 10:01:25 +0200 |
---|---|---|
committer | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-15 10:01:25 +0200 |
commit | 4f793069bf4aafcfe77d50e47690173104ef23c7 (patch) | |
tree | 7fe1bfcb18672300bf14967338690ea4fa51e640 | |
parent | ed7f3001c1c1deec5076ae12114e5c42865b6251 (diff) | |
parent | 58aad83e5cb0edaf1ccc543147030e782c5e7ba9 (diff) | |
download | volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.tar.gz volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.tar.bz2 volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.zip |
Merge branch 'master' of https://github.com/friendica/red
33 files changed, 667 insertions, 640 deletions
@@ -73,7 +73,6 @@ $DIRECTORY_FALLBACK_SERVERS = array( 'https://zotid.net', 'https://redmatrix.nl', 'https://whogotzot.com', - 'https://red.mariovavti.com', 'https://red.zottel.red', 'https://red.pixelbits.de' ); @@ -217,8 +216,9 @@ define ( 'PAGE_DIRECTORY_CHANNEL', 0x0008 ); // system channel used for director define ( 'PAGE_PREMIUM', 0x0010 ); define ( 'PAGE_ADULT', 0x0020 ); define ( 'PAGE_CENSORED', 0x0040 ); // Site admin has blocked this channel from appearing in casual search results and site feeds - define ( 'PAGE_SYSTEM', 0x1000 ); +define ( 'PAGE_HUBADMIN', 0x2000 ); // set this to indicate a preferred admin channel rather than the + // default channel of any accounts with the admin role. define ( 'PAGE_REMOVED', 0x8000 ); @@ -2042,4 +2042,4 @@ function get_directory_realm() { if($x = get_config('system','directory_realm')) return $x; return DIRECTORY_REALM; -}
\ No newline at end of file +} diff --git a/doc/Install.md b/doc/Install.md deleted file mode 100644 index 1ff6e69e7..000000000 --- a/doc/Install.md +++ /dev/null @@ -1,111 +0,0 @@ - -Red Installation -=============== - -Red should run on commodity hosting platforms - such as those used to host Wordpress blogs and Drupal websites. But be aware that Red is more than a simple web application. The kind of functionality offered by Red requires a bit more of the host system than the typical blog. Not every PHP/MySQL hosting provider will be able to support Red. Many will. But **please** review the requirements and confirm these with your hosting provider prior to installation. - -Also if you encounter installation issues, please let us know via the Github issue tracker (https://github.com/friendica/red/issues). Please be as clear as you can about your operating environment and provide as much detail as possible about any error messages you may see, so that we can prevent it from happening in the future. Due to the large variety of operating systems and PHP platforms in existence we may have only limited ability to debug your PHP installation or acquire any missing modules - but we will do our best to solve any general code issues. - -Before you begin: Choose a domain name or subdomain name for your server. Put some thought into this - because changing it is currently not-supported. Things will break, and some of your friends may have difficulty communicating with you. We plan to address this limitation in a future release. - -Decide if you will use SSL and obtain an SSL certificate before software installation. You SHOULD use SSL. If you use SSL, you MUST use a "browser-valid" certificate. You MUST NOT use self-signed certificates! - -Please test your certificate prior to installation. A web tool for testing your certificate is available at "http://www.digicert.com/help/". When visiting your site for the first time, please use the SSL ("https://") URL if SSL is available. This will avoid problems later. The installation routine will not allow you to use a non browser-valid certificate. - -This restriction is incorporated because public posts from you may for example contain references to images on your own hub. If your certificate is not known by the internet browser of users they get a warning message complaining about some security issues. Although these complains are not the real truth - there are no security issues with your encryption! - the users may be confused, nerved or even worse may become scared about Red Matrix having security issues. Use one of the free certification instances! - -1. Requirements - - Apache with mod-rewrite enabled and "Options All" so you can use a -local .htaccess file - - - PHP 5.3 or later - - PHP *command line* access with register_argc_argv set to true in the -php.ini file - - curl, gd, mysql, and openssl extensions - - some form of email server or email gateway such that PHP mail() works - - mcrypt (optional; used for server-to-server message encryption) - - - Mysql 5.x - - - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks -(Windows) [Note: other options are presented in Section 7 of this document] - - - Installation into a top-level domain or sub-domain (without a -directory/path component in the URL) is preferred. Directory paths will -not be as convenient to use and have not been thoroughly tested. - - - [Dreamhost.com offers all of the necessary hosting features at a -reasonable price. If your hosting provider doesn't allow Unix shell access, -you might have trouble getting everything to work.] - -2. Unpack the Red files into the root of your web server document area. - - - If you are able to do so, we recommend using git to clone the source repository rather than to use a packaged tar or zip file. This makes the software much easier to update. The Linux command to clone the repository into a directory "mywebsite" would be - - `git clone https://github.com/friendica/red.git mywebsite` - - - and then you can pick up the latest changes at any time with - - `git pull` - - - make sure folder *store/[data]/smarty3* exists and is writable by webserver - - `mkdir -p "store/\[data\]/smarty3"` - - `chmod 777 "store/\[data\]/smarty3"` - - - For installing addons - - - First you should be **on** your website folder - - `cd mywebsite` - - - Then you should clone the addon repository (separtely) - - `git clone https://github.com/friendica/red-addons.git addon` - - - For keeping the addon tree updated, you should be on you addon tree and issue a git pull - - `cd mywebsite/addon` - - `git pull` - - - If you copy the directory tree to your webserver, make sure - that you also copy .htaccess - as "dot" files are often hidden - and aren't normally copied. - - -3. Create an empty database and note the access details (hostname, username, password, database name). - -4. Visit your website with a web browser and follow the instructions. Please note any error messages and correct these before continuing. - -5. *If* the automated installation fails for any reason, check the following: - - - ".htconfig.php" exists ... If not, edit htconfig.php and change system settings. Rename -to .htconfig.php - - Database is populated. ... If not, import the contents of "database.sql" with phpmyadmin -or mysql command line - -6. At this point visit your website again, and register your personal account. -Registration errors should all be recoverable automatically. -If you get any *critical* failure at this point, it generally indicates the -database was not installed correctly. You might wish to move/rename -.htconfig.php to another name and empty (called 'dropping') the database -tables, so that you can start fresh. - -7. Set up a cron job or scheduled task to run the poller once every 15 -minutes in order to perform background processing. Example: - - `cd /base/directory; /path/to/php include/poller.php` - -Change "/base/directory", and "/path/to/php" as appropriate for your situation. - -If you are using a Linux server, run "crontab -e" and add a line like the -one shown, substituting for your unique paths and settings: - -`*/15 * * * * cd /home/myname/mywebsite; /usr/bin/php include/poller.php` - -You can generally find the location of PHP by executing "which php". If you -have troubles with this section please contact your hosting provider for -assistance. Red will not work correctly if you cannot perform this step. diff --git a/doc/Intro-for-Developers.md b/doc/Intro-for-Developers.md deleted file mode 100644 index bf74cb7c1..000000000 --- a/doc/Intro-for-Developers.md +++ /dev/null @@ -1,105 +0,0 @@ -File system layout: -=================== - -[addon] optional addons/plugins - -[boot.php] Every process uses this to bootstrap the application structure - -[doc] Help Files - -[images] core required images - -[include] The "model" in MVC - (back-end functions), also contains PHP "executables" for background processing - -[index.php] The front-end controller for web access - -[install] Installation and upgrade files and DB schema - -[js] core required javascript - -[library] Third party modules (must be license compatible) - -[mod] Controller modules based on URL pathname (e.g. http://sitename/foo loads mod/foo.php) - -[spec] protocol specifications - -[util] translation tools, main English string database and other miscellaneous utilities - -[version.inc] contains current version (auto-updated via cron for the master repository and distributed via git) - -[view] theming and language files - - -[view/(css,js,img,php,tpl)] default theme files - -[view/(en,it,es ...)] language strings and resources - -[view/theme/] individual named themes containing (css,js,img,php,tpl) over-rides - - -The Database: -============= - -* abook - contact table, replaces Friendica 'contact' -* account - service provider account -* addon - registered plugins -* attach - file attachments -* auth_codes - OAuth usage -* cache - TBD -* challenge - old DFRN structure, may re-use or may deprecate -* channel - replaces Friendica 'user' -* clients - OAuth usage -* config - main configuration storage -* event - Events -* fcontact - friend suggestion stuff -* ffinder - friend suggestion stuff -* fserver - obsolete -* fsuggest - friend suggestion stuff -* gcign - ignored friend suggestions -* gcontact - social graph storage, obsolete -* glink - social graph storage - obsolete -* group - privacy groups -* group_member - privacy groups -* hook - plugin hook registry -* hubloc - Red location storage, ties a location to an xchan -* intro - DFRN introductions, may be obsolete -* item - posts -* item_id - other identifiers on other services for posts -* mail - private messages -* manage - may be unused in Red, table of accounts that can "su" each other -* notify - notifications -* notify-threads - need to factor this out and use item thread info on notifications -* outq - Red output queue -* pconfig - personal (per channel) configuration storage -* photo - photo storage -* profile - channel profiles -* profile_check - DFRN remote auth use, may be obsolete -* queue - old Friendica queue, obsolete -* register - registrations requiring admin approval -* session - web session storage -* site - site table to find directory peers -* spam - unfinished -* term - item taxonomy (categories, tags, etc.) table -* tokens - OAuth usage -* verify - general purpose verification structure -* xchan - replaces 'gcontact', list of known channels in the universe -* xlink - "friends of friends" linkages derived from poco -* xprof - if this hub is a directory server, contains basic public profile info of everybody in the network -* xtag - if this hub is a directory server, contains tags or interests of everybody in the network - - -How to theme Red - by Olivier Migeot -==================================== - -This is a short documentation on what I found while trying to modify Red's appearance. - -First, you'll need to create a new theme. This is in /view/theme, and I chose to copy 'redbasic' since it's the only available for now. Let's assume I named it <theme>. - -Oh, and don't forget to rename the _init function in <theme>/php/theme.php to be <theme>_init() instead of redbasic_init(). - -At that point, if you need to add javascript or css files, add them to <theme>/js or <theme>/css, and then "register" them in <theme>_init() through head_add_js('file.js') and head_add_css('file.css'). - -Now you'll probably want to alter a template. These can be found in in /view/tpl OR view/<theme>/tpl. All you should have to do is copy whatever you want to tweak from the first place to your theme's own tpl directory. - - - diff --git a/doc/html/service__limits_8php.html b/doc/html/service__limits_8php.html new file mode 100644 index 000000000..808e3ca9a --- /dev/null +++ b/doc/html/service__limits_8php.html @@ -0,0 +1,137 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<meta http-equiv="X-UA-Compatible" content="IE=9"/> +<meta name="generator" content="Doxygen 1.8.3.1"/> +<title>The Red Matrix: mod/service_limits.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="jquery.js"></script> +<script type="text/javascript" src="dynsections.js"></script> +<link href="navtree.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="resize.js"></script> +<script type="text/javascript" src="navtree.js"></script> +<script type="text/javascript"> + $(document).ready(initResizable); + $(window).load(resizeHeight); +</script> +<link href="search/search.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="search/search.js"></script> +<script type="text/javascript"> + $(document).ready(function() { searchBox.OnSelectItem(0); }); +</script> +<link href="doxygen.css" rel="stylesheet" type="text/css" /> +</head> +<body> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> +<div id="titlearea"> +<table cellspacing="0" cellpadding="0"> + <tbody> + <tr style="height: 56px;"> + <td id="projectlogo"><img alt="Logo" src="rm-64.png"/></td> + <td style="padding-left: 0.5em;"> + <div id="projectname">The Red Matrix + </div> + </td> + </tr> + </tbody> +</table> +</div> +<!-- end header part --> +<!-- Generated by Doxygen 1.8.3.1 --> +<script type="text/javascript"> +var searchBox = new SearchBox("searchBox", "search",false,'Search'); +</script> + <div id="navrow1" class="tabs"> + <ul class="tablist"> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + <li><a href="namespaces.html"><span>Namespaces</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + <li> + <div id="MSearchBox" class="MSearchBoxInactive"> + <span class="left"> + <img id="MSearchSelect" src="search/mag_sel.png" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + alt=""/> + <input type="text" id="MSearchField" value="Search" accesskey="S" + onfocus="searchBox.OnSearchFieldFocus(true)" + onblur="searchBox.OnSearchFieldFocus(false)" + onkeyup="searchBox.OnSearchFieldChange(event)"/> + </span><span class="right"> + <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> + </span> + </div> + </li> + </ul> + </div> + <div id="navrow2" class="tabs2"> + <ul class="tablist"> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div><!-- top --> +<div id="side-nav" class="ui-resizable side-nav-resizable"> + <div id="nav-tree"> + <div id="nav-tree-contents"> + <div id="nav-sync" class="sync"></div> + </div> + </div> + <div id="splitbar" style="-moz-user-select:none;" + class="ui-resizable-handle"> + </div> +</div> +<script type="text/javascript"> +$(document).ready(function(){initNavTree('service__limits_8php.html','');}); +</script> +<div id="doc-content"> +<!-- window showing the filter options --> +<div id="MSearchSelectWindow" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + onkeydown="return searchBox.OnSearchSelectKey(event)"> +<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Pages</a></div> + +<!-- iframe showing the search results (closed by default) --> +<div id="MSearchResultsWindow"> +<iframe src="javascript:void(0)" frameborder="0" + name="MSearchResults" id="MSearchResults"> +</iframe> +</div> + +<div class="header"> + <div class="summary"> +<a href="#func-members">Functions</a> </div> + <div class="headertitle"> +<div class="title">service_limits.php File Reference</div> </div> +</div><!--header--> +<div class="contents"> +<table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> +Functions</h2></td></tr> +<tr class="memitem:a653424aac63c5cd05ba70c3c77bf7f8a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="service__limits_8php.html#a653424aac63c5cd05ba70c3c77bf7f8a">service_limits_content</a> (&$a)</td></tr> +<tr class="separator:a653424aac63c5cd05ba70c3c77bf7f8a"><td class="memSeparator" colspan="2"> </td></tr> +</table> +<h2 class="groupheader">Function Documentation</h2> +<a class="anchor" id="a653424aac63c5cd05ba70c3c77bf7f8a"></a> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">service_limits_content </td> + <td>(</td> + <td class="paramtype">& </td> + <td class="paramname"><em>$a</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +</div> +</div> +</div><!-- contents --> +</div><!-- doc-content --> + diff --git a/doc/html/service__limits_8php.js b/doc/html/service__limits_8php.js new file mode 100644 index 000000000..4ab8d3a33 --- /dev/null +++ b/doc/html/service__limits_8php.js @@ -0,0 +1,4 @@ +var service__limits_8php = +[ + [ "service_limits_content", "service__limits_8php.html#a653424aac63c5cd05ba70c3c77bf7f8a", null ] +];
\ No newline at end of file diff --git a/doc/install.bb b/doc/install.bb index 16e3730ee..1a35537aa 100644 --- a/doc/install.bb +++ b/doc/install.bb @@ -1,105 +1 @@ -[b]Red Installation[/b]
-
-Red should run on commodity hosting platforms - such as those used to host Wordpress blogs and Drupal websites. But be aware that Red is more than a simple web application. The kind of functionality offered by Red requires a bit more of the host system than the typical blog. Not every PHP/MySQL hosting provider will be able to support Red. Many will. But **please** review the requirements and confirm these with your hosting provider prior to installation.
-
-Also if you encounter installation issues, please let us know via the Github issue tracker (#^[url=https://github.com/friendica/red/issues]https://github.com/friendica/red/issues[/url]). Please be as clear as you can about your operating environment and provide as much detail as possible about any error messages you may see, so that we can prevent it from happening in the future. Due to the large variety of operating systems and PHP platforms in existence we may have only limited ability to debug your PHP installation or acquire any missing modules - but we will do our best to solve any general code issues.
-
-Before you begin: Choose a domain name or subdomain name for your server.
-
-1. Requirements
- - Apache with mod-rewrite enabled and "AllowOverride All" so you can use a
-local .htaccess file
-
- - PHP 5.3 or later
- - PHP *command line* access with register_argc_argv set to true in the
-php.ini file
- - curl, gd, mysql, and openssl extensions
- - some form of email server or email gateway such that PHP mail() works
- - mcrypt
-
- - Mysql 5.x
-
- - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks
-(Windows) [Note: other options are presented in Section 7 of this document]
-
- - Installation into a top-level domain or sub-domain (without a
-directory/path component in the URL) is preferred. Directory paths will
-not be as convenient to use and have not been thoroughly tested.
-
-
- [Dreamhost.com offers all of the necessary hosting features at a
-reasonable price. If your hosting provider doesn't allow Unix shell access,
-you might have trouble getting everything to work.]
-
-2. Unpack the Red files into the root of your web server document area.
-
- - If you are able to do so, we recommend using git to clone the source repository rather than to use a packaged tar or zip file. This makes the software much easier to update. The Linux command to clone the repository into a directory "mywebsite" would be
-
- `git clone #^[url=https://github.com/friendica/red.git]https://github.com/friendica/red.git[/url] mywebsite`
-
- - and then you can pick up the latest changes at any time with
-
- `git pull`
-
- - make sure folder *store/[data]/smarty3* exists and is writable by webserver
-
- `mkdir -p "store/\[data\]/smarty3"`
-
- `chmod 777 "store/\[data\]/smarty3"`
-
- - For installing addons
-
- - First you should be **on** your website folder
-
- `cd mywebsite`
-
- - Then you should clone the addon repository (separtely)
-
- `git clone #^[url=https://github.com/friendica/red-addons.git]https://github.com/friendica/red-addons.git[/url] addon`
-
- - For keeping the addon tree updated, you should be on you addon tree and issue a git pull
-
- `cd mywebsite/addon`
-
- `git pull`
-
- - If you copy the directory tree to your webserver, make sure
- that you also copy .htaccess - as "dot" files are often hidden
- and aren't normally copied.
-
-
-3. Create an empty database and note the access details (hostname, username, password, database name).
-
-4. Visit your website with a web browser and follow the instructions. Please note any error messages and correct these before continuing.
-
-5. *If* the automated installation fails for any reason, check the following:
-
- - ".htconfig.php" exists ... If not, edit htconfig.php and change system settings. Rename
-to .htconfig.php
- - Database is populated. ... If not, import the contents of "database.sql" with phpmyadmin
-or mysql command line
-
-6. At this point visit your website again, and register your personal account.
-Registration errors should all be recoverable automatically.
-If you get any *critical* failure at this point, it generally indicates the
-database was not installed correctly. You might wish to move/rename
-.htconfig.php to another name and empty (called 'dropping') the database
-tables, so that you can start fresh.
-
-7. Set up a cron job or scheduled task to run the poller once every 15
-minutes in order to perform background processing. Example:
-
- `cd /base/directory; /path/to/php include/poller.php`
-
-Change "/base/directory", and "/path/to/php" as appropriate for your situation.
-
-If you are using a Linux server, run "crontab -e" and add a line like the
-one shown, substituting for your unique paths and settings:
-
-`*/15 * * * * cd /home/myname/mywebsite; /usr/bin/php include/poller.php`
-
-You can generally find the location of PHP by executing "which php". If you
-have troubles with this section please contact your hosting provider for
-assistance. Red will not work correctly if you cannot perform this step.
-
-Return to the [url=[baseurl]/help/main]Main documentation page[/url]
+#include install/INSTALL.txt;
diff --git a/doc/intro_for_developers.bb b/doc/intro_for_developers.bb index 086d3c681..2f498e6fb 100644 --- a/doc/intro_for_developers.bb +++ b/doc/intro_for_developers.bb @@ -41,46 +41,63 @@ [li]abook - contact table, replaces Friendica 'contact'[/li]
[li]account - service provider account[/li]
[li]addon - registered plugins[/li]
+ [li]app - peronal app data[/li]
[li]attach - file attachments[/li]
[li]auth_codes - OAuth usage[/li]
[li]cache - TBD[/li]
[li]challenge - old DFRN structure, may re-use or may deprecate[/li]
[li]channel - replaces Friendica 'user'[/li]
+ [li]chat - chat room content[/li]
+ [li]chatpresence - channel presence information for chat[/li]
+ [li]chatroom - data for the actual chat room[/li]
[li]clients - OAuth usage[/li]
[li]config - main configuration storage[/li]
+ [li]conv - [/li]
[li]event - Events[/li]
[li]fcontact - friend suggestion stuff[/li]
[li]ffinder - friend suggestion stuff[/li]
[li]fserver - obsolete[/li]
[li]fsuggest - friend suggestion stuff[/li]
- [li]gcign - ignored friend suggestions[/li]
- [li]gcontact - social graph storage, obsolete[/li]
- [li]glink - social graph storage - obsolete[/li]
- [li]group - privacy groups[/li]
+ [li]groups - privacy groups[/li]
[li]group_member - privacy groups[/li]
[li]hook - plugin hook registry[/li]
[li]hubloc - Red location storage, ties a location to an xchan[/li]
[li]intro - DFRN introductions, may be obsolete[/li]
[li]item - posts[/li]
[li]item_id - other identifiers on other services for posts[/li]
+ [li]likes - likes of 'things'[/li]
[li]mail - private messages[/li]
[li]manage - may be unused in Red, table of accounts that can "su" each other[/li]
+ [li]menu - channel menu data[/li]
+ [li]menu_item - items uses by channel menus[/li]
[li]notify - notifications[/li]
[li]notify-threads - need to factor this out and use item thread info on notifications[/li]
+ [li]obj - object data for things (x has y)[/li]
[li]outq - Red output queue[/li]
[li]pconfig - personal (per channel) configuration storage[/li]
[li]photo - photo storage[/li]
+ [li]poll - data for polls[/li]
+ [li]poll_elm - data for poll elements[/li]
+ [li]profdef - custom profile field definitions[/li]
+ [li]profext - custom profile field data[/li]
[li]profile - channel profiles[/li]
[li]profile_check - DFRN remote auth use, may be obsolete[/li]
- [li]queue - old Friendica queue, obsolete[/li]
[li]register - registrations requiring admin approval[/li]
[li]session - web session storage[/li]
+ [li]shares - shared item information[/li]
+ [li[sign - Diaspora signatures. To be phased out.[/li]
[li]site - site table to find directory peers[/li]
+ [li]source - channel sources data[/li]
[li]spam - unfinished[/li]
+ [li]sys_perms - extensible permissions for the sys channel[/li]
[li]term - item taxonomy (categories, tags, etc.) table[/li]
[li]tokens - OAuth usage[/li]
+ [li]updates - directory sync updates[/li]
[li]verify - general purpose verification structure[/li]
+ [li]vote - vote data for polls[/li]
[li]xchan - replaces 'gcontact', list of known channels in the universe[/li]
+ [li]xchat - bookmarked chat rooms[/li]
+ [li]xconfig - as pconfig but for channels with no local account[/li]
[li]xlink - "friends of friends" linkages derived from poco[/li]
[li]xprof - if this hub is a directory server, contains basic public profile info of everybody in the network[/li]
[li]xtag - if this hub is a directory server, contains tags or interests of everybody in the network[/li]
diff --git a/doc/main.bb b/doc/main.bb index 137ea93a8..e0cca3d31 100644 --- a/doc/main.bb +++ b/doc/main.bb @@ -49,6 +49,9 @@ Zot is the great new communicaton protocol invented especially for the Red Matri [zrl=[baseurl]/help/faq_admins]FAQ For Admins[/zrl]
[size=large][b]Technical Documentation[/b][/size]
+[zrl=[baseurl]/help/Zot---A-High-Level-Overview.md[/zrl]A high level overview of Zot[/zrl]
+[zrl=[baseurl]/help/zot]An introduction to Zot/zrl]
+[zrl=[baseurl]/help/zot_structures]Zot Stuctures[/zrl]
[zrl=[baseurl]/help/comanche]Comanche Page Descriptions[/zrl]
[zrl=[baseurl]/help/Creating-Templates]Creating Comanche Templates[/zrl]
[zrl=[baseurl]/help/Widgets]Core Widgets[/zrl]
diff --git a/include/ItemObject.php b/include/ItemObject.php index 451e369b0..96abe4df6 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -250,6 +250,7 @@ class Item extends BaseObject { 'osparkle' => $osparkle, 'sparkle' => $sparkle, 'title' => $item['title'], + 'title_tosource' => get_pconfig($conv->get_profile_owner(),'system','title_tosource'), 'ago' => relative_date($item['created']), 'app' => $item['app'], 'str_app' => sprintf( t(' from %s'), $item['app']), diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 9c884926a..846725639 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -266,6 +266,10 @@ function bb2dmention_callback($match) { function bb2diaspora_itemwallwall(&$item) { if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author']))) { + logger('bb2diaspora_itemwallwall: author: ' . print_r($item['author'],true), LOGGER_DEBUG); + } + + if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author'])) && $item['author']['url'] && $item['author']['name'] && $item['author']['photo']['src']) { logger('bb2diaspora_itemwallwall: wall to wall post',LOGGER_DEBUG); // post will come across with the owner's identity. Throw a preamble onto the post to indicate the true author. $item['body'] = "\n\n" @@ -292,7 +296,8 @@ function bb2diaspora_itembody($item) { logger('bb2diaspora_itembody: cached '); $newitem = $item; $newitem['body'] = $meta['body']; - bb2diaspora_itemwallwall($newitem); +// this won't work - the post is now in markdown +// bb2diaspora_itemwallwall($newitem); return $newitem['body']; } } diff --git a/include/diaspora.php b/include/diaspora.php index 8a3eaf873..ea3c78bfe 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -142,6 +142,7 @@ function diaspora_process_outbound($arr) { 'cmd' => $cmd, 'expire' => $expire, 'mail' => $mail, + 'location' => $location, 'fsuggest' => $fsuggest, 'normal_mode' => $normal_mode, 'packet_type' => $packet_type, @@ -150,6 +151,10 @@ function diaspora_process_outbound($arr) { */ + if($arr['location']) + return; + + $target_item = $arr['target_item']; if($target_item && array_key_exists('item_flags',$target_item) && ($target_item['item_flags'] & ITEM_OBSCURED)) { @@ -161,6 +166,7 @@ function diaspora_process_outbound($arr) { } + if($arr['env_recips']) { $hashes = array(); @@ -1966,19 +1972,16 @@ function diaspora_retraction($importer,$xml) { if($type === 'Person') { require_once('include/Contact.php'); - contact_remove($contact['id']); + contact_remove($importer['channel_id'],$contact['abook_id']); } elseif($type === 'Post') { - $r = q("select * from item where guid = '%s' and uid = %d and not file like '%%[%%' limit 1", + $r = q("select * from item where mid = '%s' and uid = %d limit 1", dbesc('guid'), intval($importer['channel_id']) ); if(count($r)) { - if(link_compare($r[0]['author-link'],$contact['url'])) { - q("update item set `deleted` = 1, `changed` = '%s' where `id` = %d", - dbesc(datetime_convert()), - intval($r[0]['id']) - ); + if(link_compare($r[0]['author_xchan'],$contact['xchan_hash'])) { + drop_item($r[0]['id'],false); } } } diff --git a/include/hubloc.php b/include/hubloc.php index 566875ce9..cdc9de4af 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -42,4 +42,75 @@ function prune_hub_reinstalls() { } } } -}
\ No newline at end of file +} + +function remove_obsolete_hublocs() { + + logger('remove_obsolete_hublocs',LOGGER_DEBUG); + + // Get rid of any hublocs which are ours but aren't valid anymore - + // e.g. they point to a different and perhaps transient URL that we aren't using. + + // I need to stress that this shouldn't happen. fix_system_urls() fixes hublocs + // when it discovers the URL has changed. So it's unclear how we could end up + // with URLs pointing to the old site name. But it happens. This may be an artifact + // of an old bug or maybe a regression in some newer code. In any event, they + // mess up communications and we have to take action if we find any. + + // First make sure we have any hublocs (at all) with this URL and sitekey. + // We don't want to perform this operation while somebody is in the process + // of renaming their hub or installing certs. + + $r = q("select hubloc_id from hubloc where hubloc_url = '%s' and hubloc_sitekey = '%s'", + dbesc(z_root()), + dbesc(get_config('system','pubkey')) + ); + if((! $r) || (! count($r))) + return; + + $channels = array(); + + // Good. We have at least one *valid* hubloc. + + // Do we have any invalid ones? + + $r = q("select hubloc_id from hubloc where hubloc_sitekey = '%s' and hubloc_url != '%s'", + dbesc(get_config('system','pubkey')), + dbesc(z_root()) + ); + $p = q("select hubloc_id from hubloc where hubloc_sitekey != '%s' and hubloc_url = '%s'", + dbesc(get_config('system','pubkey')), + dbesc(z_root()) + ); + if(is_array($r) && is_array($p)) + $r = array_merge($r,$p); + + if(! $r) + return; + + // We've got invalid hublocs. Get rid of them. + + logger('remove_obsolete_hublocs: removing ' . count($r) . ' hublocs.'); + + $interval = ((get_config('system','delivery_interval') !== false) + ? intval(get_config('system','delivery_interval')) : 2 ); + + foreach($r as $rr) { + q("update hubloc set hubloc_flags = (hubloc_flags | %d) where hubloc_id = %d limit 1", + intval(HUBLOC_FLAGS_DELETED), + intval($rr['hubloc_id']) + ); + + $x = q("select channel_id from channel where channel_hash = '%s' limit 1", + dbesc($rr['hubloc_hash']) + ); + if($x) { +// proc_run('php','include/notifier.php','location',$x[0]['channel_id']); +// if($interval) +// @time_sleep_until(microtime(true) + (float) $interval); + } + } +} + + +
\ No newline at end of file diff --git a/include/items.php b/include/items.php index 166303cac..beec65d8a 100755 --- a/include/items.php +++ b/include/items.php @@ -68,13 +68,31 @@ function collect_recipients($item,&$private_envelope) { $private_envelope = false; if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') { - $r = q("select abook_xchan from abook where abook_channel = %d and not (abook_flags & %d) ", + $r = q("select abook_xchan, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d) ", intval($item['uid']), intval(ABOOK_FLAG_SELF|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED) ); if($r) { + + // filter out restrictive public_policy settings from remote networks + // which don't have this concept and will treat them as public. + + $policy = substr($item['public_policy'],0,3); foreach($r as $rr) { - $recipients[] = $rr['abook_xchan']; + switch($policy) { + case 'net': + case 'aut': + case 'sit': + case 'any': + case 'con': + if($rr['xchan_network'] != 'zot') + break; + case 'pub': + case '': + default: + $recipients[] = $rr['abook_xchan']; + break; + } } } } diff --git a/include/notifier.php b/include/notifier.php index 88bb9a0cb..ae781bcf8 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -57,6 +57,7 @@ require_once('include/html2plain.php'); * purge_all channel_id * expire channel_id * relay item_id (item was relayed to owner, we will deliver it as owner) + * location channel_id * */ @@ -144,6 +145,7 @@ function notifier_run($argv, $argc){ $mail = false; $fsuggest = false; $top_level = false; + $location = false; $recipients = array(); $url_recipients = array(); $normal_mode = true; @@ -230,6 +232,30 @@ function notifier_run($argv, $argc){ $private = false; $packet_type = 'refresh'; } + elseif($cmd === 'location') { + logger('notifier: location: ' . $item_id); + $s = q("select * from channel where channel_id = %d limit 1", + intval($item_id) + ); + if($s) + $channel = $s[0]; + $uid = $item_id; + $recipients = array(); + $r = q("select abook_xchan from abook where abook_channel = %d", + intval($item_id) + ); + if($r) { + foreach($r as $rr) { + $recipients[] = $rr['abook_xchan']; + } + } + + $encoded_item = array('locations' => zot_encode_locations($channel),'type' => 'location', 'encoding' => 'zot'); + $target_item = array('aid' => $channel['channel_account_id'],'uid' => $channel['channel_id']); + $private = false; + $packet_type = 'location'; + $location = true; + } elseif($cmd === 'purge_all') { logger('notifier: purge_all: ' . $item_id); $s = q("select * from channel where channel_id = %d limit 1", @@ -432,6 +458,8 @@ function notifier_run($argv, $argc){ $sql_extra = (($private) ? "" : " or hubloc_url = '" . dbesc(z_root()) . "' "); + logger('notifier: hub choice: ' . intval($relay_to_owner) . ' ' . intval($private) . ' ' . $cmd, LOGGER_DEBUG); + if($relay_to_owner && (! $private) && ($cmd !== 'relay')) { // If sending a followup to the post owner, only send it to one channel clone - to avoid race conditions. @@ -514,6 +542,7 @@ function notifier_run($argv, $argc){ 'cmd' => $cmd, 'expire' => $expire, 'mail' => $mail, + 'location' => $location, 'fsuggest' => $fsuggest, 'normal_mode' => $normal_mode, 'packet_type' => $packet_type, diff --git a/include/poller.php b/include/poller.php index c90e48d6b..f689059b9 100644 --- a/include/poller.php +++ b/include/poller.php @@ -171,6 +171,9 @@ function poller_run($argv, $argc){ proc_run('php','include/expire.php'); proc_run('php','include/cli_suggest.php'); + require_once('include/hubloc.php'); + remove_obsolete_hublocs(); + /** * End Cron Daily */ diff --git a/include/zot.php b/include/zot.php index 644d20ec2..f6732037a 100644 --- a/include/zot.php +++ b/include/zot.php @@ -661,6 +661,8 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { } $xchan_hash = make_xchan_hash($arr['guid'],$arr['guid_sig']); + $arr['hash'] = $xchan_hash; + $import_photos = false; if(! rsa_verify($arr['guid'],base64url_decode($arr['guid_sig']),$arr['key'])) { @@ -843,174 +845,16 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { // what we are missing for true hub independence is for any changes in the primary hub to // get reflected not only in the hublocs, but also to update the URLs and addr in the appropriate xchan - if($arr['locations']) { - - $xisting = q("select hubloc_id, hubloc_url, hubloc_sitekey from hubloc where hubloc_hash = '%s'", - dbesc($xchan_hash) - ); - - // See if a primary is specified - - $has_primary = false; - foreach($arr['locations'] as $location) { - if($location['primary']) { - $has_primary = true; - break; - } - } - - foreach($arr['locations'] as $location) { - if(! rsa_verify($location['url'],base64url_decode($location['url_sig']),$arr['key'])) { - logger('import_xchan: Unable to verify site signature for ' . $location['url']); - $ret['message'] .= sprintf( t('Unable to verify site signature for %s'), $location['url']) . EOL; - continue; - } - - // Ensure that they have one primary hub - - if(! $has_primary) - $location['primary'] = true; - - - for($x = 0; $x < count($xisting); $x ++) { - if(($xisting[$x]['hubloc_url'] === $location['url']) && ($xisting[$x]['hubloc_sitekey'] === $location['sitekey'])) { - $xisting[$x]['updated'] = true; - } - } - - if(! $location['sitekey']) { - logger('import_xchan: empty hubloc sitekey. ' . print_r($location,true)); - continue; - } - - // Catch some malformed entries from the past which still exist - - if(strpos($location['address'],'/') !== false) - $location['address'] = substr($location['address'],0,strpos($location['address'],'/')); - - // match as many fields as possible in case anything at all changed. - - $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", - dbesc($xchan_hash), - dbesc($arr['guid']), - dbesc($arr['guid_sig']), - dbesc($location['url']), - dbesc($location['url_sig']), - dbesc($location['host']), - dbesc($location['address']), - dbesc($location['callback']), - dbesc($location['sitekey']) - ); - if($r) { - logger('import_xchan: hub exists: ' . $location['url']); - // update connection timestamp if this is the site we're talking to - if($location['url'] == $arr['site']['url']) { - q("update hubloc set hubloc_connected = '%s', hubloc_updated = '%s' where hubloc_id = %d limit 1", - dbesc(datetime_convert()), - dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) - ); - } - if($r[0]['hubloc_status'] & HUBLOC_OFFLINE) { - q("update hubloc set hubloc_status = (hubloc_status ^ %d) where hubloc_id = %d limit 1", - intval(HUBLOC_OFFLINE), - intval($r[0]['hubloc_id']) - ); - if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) { - q("update hubloc set hubloc_flags = (hubloc_flags ^ %d) where hubloc_id = %d limit 1", - intval(HUBLOC_FLAGS_ORPHANCHECK), - intval($r[0]['hubloc_id']) - ); - } - q("update xchan set xchan_flags = (xchan_flags ^ %d) where (xchan_flags & %d) and xchan_hash = '%s' limit 1", - intval(XCHAN_FLAGS_ORPHAN), - intval(XCHAN_FLAGS_ORPHAN), - dbesc($xchan_hash) - ); - - } - - // Remove pure duplicates - if(count($r) > 1) { - for($h = 1; $h < count($r); $h ++) { - q("delete from hubloc where hubloc_id = %d limit 1", - intval($r[$h]['hubloc_id']) - ); - } - } - - if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) && (! $location['primary'])) - || ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY)) && ($location['primary']))) { - $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1", - intval(HUBLOC_FLAGS_PRIMARY), - dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) - ); - $what = 'primary_hub '; - $changed = true; - } - if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_DELETED) && (! $location['deleted'])) - || ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_DELETED)) && ($location['deleted']))) { - $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1", - intval(HUBLOC_FLAGS_DELETED), - dbesc(datetime_convert()), - intval($r[0]['hubloc_id']) - ); - $what = 'delete_hub '; - $changed = true; - } - continue; - } - // new hub claiming to be primary. Make it so. - - if(intval($location['primary'])) { - $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_hash = '%s' and (hubloc_flags & %d )", - intval(HUBLOC_FLAGS_PRIMARY), - dbesc(datetime_convert()), - dbesc($xchan_hash), - intval(HUBLOC_FLAGS_PRIMARY) - ); - } - logger('import_xchan: new hub: ' . $location['url']); - $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_flags, hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_updated, hubloc_connected) - values ( '%s','%s','%s','%s', '%s', %d ,'%s','%s','%s','%s','%s','%s','%s')", - dbesc($arr['guid']), - dbesc($arr['guid_sig']), - dbesc($xchan_hash), - dbesc($location['address']), - dbesc('zot'), - intval((intval($location['primary'])) ? HUBLOC_FLAGS_PRIMARY : 0), - dbesc($location['url']), - dbesc($location['url_sig']), - dbesc($location['host']), - dbesc($location['callback']), - dbesc($location['sitekey']), - dbesc(datetime_convert()), - dbesc(datetime_convert()) - ); - $what .= 'newhub '; - $changed = true; - - } - - // get rid of any hubs we have for this channel which weren't reported. - // This was needed at one time to resolve complicated cross-site inconsistencies, but can cause sync conflict. - // currently disabled. - -// if($xisting) { -// foreach($xisting as $x) { -// if(! array_key_exists('updated',$x)) { -// logger('import_xchan: removing unreferenced hub location ' . $x['hubloc_url']); -// $r = q("delete from hubloc where hubloc_id = %d limit 1", -// intval($x['hubloc_id']) -// ); -// $what .= 'removed_hub'; -// $changed = true; -// } -// } -// } + $s = sync_locations($arr,$arr); + if($s) { + if($s['change_message']) + $what .= $s['change_message']; + if($s['changed']) + $changed = $s['changed']; + if($s['message']) + $ret['message'] .= $s['message']; } // Which entries in the update table are we interested in updating? @@ -1189,7 +1033,8 @@ function zot_fetch($arr) { * we will verify the sender and url in each returned message structure and also verify * that all the messages returned match the site url that we are currently processing. * - * The message types handled here are 'activity' (e.g. posts), 'mail' , 'profile', and 'channel_sync' + * The message types handled here are 'activity' (e.g. posts), 'mail' , 'profile', 'location', + * and 'channel_sync' * * @returns array => array ( [0] => string $channel_hash, [1] => string $delivery_status, [2] => string $address ) * suitable for logging remotely, enumerating the processing results of each message/recipient combination. @@ -1276,6 +1121,11 @@ function zot_import($arr, $sender_url) { $deliveries = allowed_public_recips($i); + if($i['message'] && array_key_exists('type',$i['message']) && $i['message']['type'] === 'location') { + $sys = get_sys_channel(); + $deliveries = array(array('hash' => $sys['xchan_hash'])); + } + // if the scope is anything but 'public' we're going to store it as private regardless // of the private flag on the post. @@ -1348,7 +1198,7 @@ function zot_import($arr, $sender_url) { } elseif($i['message']['type'] === 'channel_sync') { -// $arr = get_channelsync_elements($i['message']); + // $arr = get_channelsync_elements($i['message']); $arr = $i['message']; @@ -1357,6 +1207,15 @@ function zot_import($arr, $sender_url) { $result = process_channel_sync_delivery($i['notify']['sender'],$arr,$deliveries); } + elseif($i['message']['type'] === 'location') { + $arr = $i['message']; + + logger('Location message received: ' . print_r($arr,true), LOGGER_DATA); + logger('Location message recipients: ' . print_r($deliveries,true), LOGGER_DATA); + + $result = process_location_delivery($i['notify']['sender'],$arr,$deliveries); + } + } if($result){ $return = array_merge($return,$result); @@ -1800,6 +1659,236 @@ function process_profile_delivery($sender,$arr,$deliveries) { import_directory_profile($sender['hash'],$arr,$r[0]['xchan_addr'], UPDATE_FLAGS_UPDATED, 0); } +function process_location_delivery($sender,$arr,$deliveries) { + + // deliveries is irrelevant + logger('process_location_delivery', LOGGER_DEBUG); + + $r = q("select xchan_pubkey from xchan where xchan_hash = '%s' limit 1", + dbesc($sender['hash']) + ); + if($r) + $sender['key'] = $r[0]['xchan_pubkey']; + + $x = sync_locations($sender,$arr,true); + logger('process_location_delivery: results: ' . print_r($x,true), LOGGER_DATA); +} + +// We need to merge this code with that in the import_xchan function so as to make it +// easier to maintain changes. + +function sync_locations($sender,$arr,$absolute = false) { + + $ret = array(); + + if($arr['locations']) { + + $xisting = q("select hubloc_id, hubloc_url, hubloc_sitekey from hubloc where hubloc_hash = '%s'", + dbesc($sender['hash']) + ); + + // See if a primary is specified + + $has_primary = false; + foreach($arr['locations'] as $location) { + if($location['primary']) { + $has_primary = true; + break; + } + } + + foreach($arr['locations'] as $location) { + if(! rsa_verify($location['url'],base64url_decode($location['url_sig']),$sender['key'])) { + logger('sync_locations: Unable to verify site signature for ' . $location['url']); + $ret['message'] .= sprintf( t('Unable to verify site signature for %s'), $location['url']) . EOL; + continue; + } + + // Ensure that they have one primary hub + + if(! $has_primary) + $location['primary'] = true; + + for($x = 0; $x < count($xisting); $x ++) { + if(($xisting[$x]['hubloc_url'] === $location['url']) + && ($xisting[$x]['hubloc_sitekey'] === $location['sitekey'])) { + $xisting[$x]['updated'] = true; + } + } + + if(! $location['sitekey']) { + logger('sync_locations: empty hubloc sitekey. ' . print_r($location,true)); + continue; + } + + // Catch some malformed entries from the past which still exist + + if(strpos($location['address'],'/') !== false) + $location['address'] = substr($location['address'],0,strpos($location['address'],'/')); + + // match as many fields as possible in case anything at all changed. + + $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", + dbesc($sender['hash']), + dbesc($sender['guid']), + dbesc($sender['guid_sig']), + dbesc($location['url']), + dbesc($location['url_sig']), + dbesc($location['host']), + dbesc($location['address']), + dbesc($location['callback']), + dbesc($location['sitekey']) + ); + if($r) { + logger('sync_locations: hub exists: ' . $location['url'], LOGGER_DEBUG); + + // update connection timestamp if this is the site we're talking to + // This only happens when called from import_xchan + + if(array_key_exists('site',$arr) && $location['url'] == $arr['site']['url']) { + q("update hubloc set hubloc_connected = '%s', hubloc_updated = '%s' where hubloc_id = %d limit 1", + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($r[0]['hubloc_id']) + ); + } + + // if it's marked offline/dead, bring it back + // Should we do this? It's basically saying that the channel knows better than + // the directory server if the site is alive. + + if($r[0]['hubloc_status'] & HUBLOC_OFFLINE) { + q("update hubloc set hubloc_status = (hubloc_status ^ %d) where hubloc_id = %d limit 1", + intval(HUBLOC_OFFLINE), + intval($r[0]['hubloc_id']) + ); + if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) { + q("update hubloc set hubloc_flags = (hubloc_flags ^ %d) where hubloc_id = %d limit 1", + intval(HUBLOC_FLAGS_ORPHANCHECK), + intval($r[0]['hubloc_id']) + ); + } + q("update xchan set xchan_flags = (xchan_flags ^ %d) where (xchan_flags & %d) and xchan_hash = '%s' limit 1", + intval(XCHAN_FLAGS_ORPHAN), + intval(XCHAN_FLAGS_ORPHAN), + dbesc($sender['hash']) + ); + } + + // Remove pure duplicates + if(count($r) > 1) { + for($h = 1; $h < count($r); $h ++) { + q("delete from hubloc where hubloc_id = %d limit 1", + intval($r[$h]['hubloc_id']) + ); + } + } + + if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) && (! $location['primary'])) + || ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY)) && ($location['primary']))) { + $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1", + intval(HUBLOC_FLAGS_PRIMARY), + dbesc(datetime_convert()), + intval($r[0]['hubloc_id']) + ); + $what .= 'primary_hub '; + $changed = true; + } + if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_DELETED) && (! $location['deleted'])) + || ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_DELETED)) && ($location['deleted']))) { + $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1", + intval(HUBLOC_FLAGS_DELETED), + dbesc(datetime_convert()), + intval($r[0]['hubloc_id']) + ); + $what .= 'delete_hub '; + $changed = true; + } + continue; + } + + // new hub claiming to be primary. Make it so. + + if(intval($location['primary'])) { + $r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_hash = '%s' and (hubloc_flags & %d )", + intval(HUBLOC_FLAGS_PRIMARY), + dbesc(datetime_convert()), + dbesc($sender['hash']), + intval(HUBLOC_FLAGS_PRIMARY) + ); + } + logger('sync_locations: new hub: ' . $location['url']); + $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_flags, hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_updated, hubloc_connected) + values ( '%s','%s','%s','%s', '%s', %d ,'%s','%s','%s','%s','%s','%s','%s')", + dbesc($sender['guid']), + dbesc($sender['guid_sig']), + dbesc($sender['hash']), + dbesc($location['address']), + dbesc('zot'), + intval((intval($location['primary'])) ? HUBLOC_FLAGS_PRIMARY : 0), + dbesc($location['url']), + dbesc($location['url_sig']), + dbesc($location['host']), + dbesc($location['callback']), + dbesc($location['sitekey']), + dbesc(datetime_convert()), + dbesc(datetime_convert()) + ); + $what .= 'newhub '; + $changed = true; + + } + + // get rid of any hubs we have for this channel which weren't reported. + + if($absolute && $xisting) { + foreach($xisting as $x) { + if(! array_key_exists('updated',$x)) { + logger('sync_locations: removing unreferenced hub location ' . $x['hubloc_url']); + $r = q("delete from hubloc where hubloc_id = %d limit 1", + intval($x['hubloc_id']) + ); + $what .= 'removed_hub'; + $changed = true; + } + } + } + } + + $ret['change_message'] = $what; + $ret['changed'] = $changed; + + return $ret; + +} + + +function zot_encode_locations($channel) { + $ret = array(); + + $x = zot_get_hublocs($channel['channel_hash']); + if($x && count($x)) { + foreach($x as $hub) { + if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_UNVERIFIED)) { + $ret[] = array( + 'host' => $hub['hubloc_host'], + 'address' => $hub['hubloc_addr'], + 'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false), + 'url' => $hub['hubloc_url'], + 'url_sig' => $hub['hubloc_url_sig'], + 'callback' => $hub['hubloc_callback'], + 'sitekey' => $hub['hubloc_sitekey'], + 'deleted' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_DELETED) ? true : false) + ); + } + } + } + return $ret; +} + + + + /* * @function import_directory_profile diff --git a/library/justifiedGallery/dist/js/jquery.justifiedGallery.js b/library/justifiedGallery/dist/js/jquery.justifiedGallery.js index 2c3eee11b..9b5c66081 100644 --- a/library/justifiedGallery/dist/js/jquery.justifiedGallery.js +++ b/library/justifiedGallery/dist/js/jquery.justifiedGallery.js @@ -444,6 +444,7 @@ } return this.each(function (index, gallery) { + var $gallery = $(gallery); $gallery.addClass('justified-gallery'); @@ -492,14 +493,13 @@ } else if (arg === 'norewind') { // In this case we don't rewind, and analyze all the images } else { - //redmatrix - this makes the gallery jump back to top after new content is loaded context.settings = $.extend({}, context.settings, arg); rewind(context); } checkSettings(context); - context.entries = $gallery.find('> a').toArray(); + context.entries = $gallery.find('> a, > div').toArray(); if (context.entries.length === 0) return; // Randomize @@ -533,6 +533,7 @@ //DEBUG// console.log('listed ' + $image.attr('alt')); imagesToLoad = true; + // Spinner start if (context.spinner.active === false) { context.spinner.active = true; diff --git a/mod/admin.php b/mod/admin.php index 5bb97d158..836b12281 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -239,7 +239,7 @@ function admin_page_site_post(&$a){ $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : ''); $theme_accessibility = ((x($_POST,'theme_accessibility')) ? notags(trim($_POST['theme_accessibility'])) : ''); - $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : ''); +// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : ''); $maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0); @@ -304,7 +304,7 @@ function admin_page_site_post(&$a){ set_config('system','accessibility_theme', $theme_accessibility); } - set_config('system','site_channel', $site_channel); +// set_config('system','site_channel', $site_channel); set_config('system','maximagesize', $maximagesize); set_config('system','register_policy', $register_policy); @@ -426,7 +426,7 @@ function admin_page_site(&$a) { '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$theme_accessibility' => array('theme_accessibility', t("Accessibility system theme"), get_config('system','accessibility_theme'), t("Accessibility theme"), $theme_choices_accessibility), - '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), +// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), '$diaspora_enabled' => array('diaspora_enabled',t('Enable Diaspora Protocol'), get_config('system','diaspora_enabled'), t('Communicate with Diaspora and Friendica - experimental')), '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), diff --git a/mod/home.php b/mod/home.php index bc352976d..576213e06 100644 --- a/mod/home.php +++ b/mod/home.php @@ -39,10 +39,29 @@ function home_content(&$a) { if(x($_SESSION,'mobile_theme')) unset($_SESSION['mobile_theme']); - $channel_address = get_config("system", "site_channel" ); - if ($channel_address){ - // We can do better, but until we figure out auto-linkification, let's keep things simple + if(get_config('system','projecthome')) { + $o .= file_get_contents('assets/home.html'); + $a->page['template'] = 'full'; + $a->page['title'] = t('Red Matrix - "The Network"'); + return $o; + } + + +// Deprecated + $channel_address = get_config("system", "site_channel" ); + +// See if the sys channel set a homepage + if (! $channel_address) { + $u = get_sys_channel(); + if ($u) { + $u = array($u); + // change to channel_id when below deprecated and skip the $u=... + $channel_address = $u[0]['channel_address']; + } + } + + if ($channel_address){ $page_id = 'home'; @@ -50,11 +69,6 @@ function home_content(&$a) { dbesc($channel_address) ); - if(! $u) { - notice( t('Channel not found.') . EOL); - return; - } - $r = q("select item.* from item left join item_id on item.id = item_id.iid where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and item_restrict = %d limit 1", @@ -63,31 +77,24 @@ function home_content(&$a) { intval(ITEM_WEBPAGE) ); - if(! $r) { - notice( t('Item not found.') . EOL); - return; - } - + if($r) { xchan_query($r); $r = fetch_post_tags($r,true); $a->profile = array('profile_uid' => $u[0]['channel_id']); $o .= prepare_page($r[0]); return $o; - } + } - if(get_config('system','projecthome')) { - $o .= file_get_contents('assets/home.html'); - $a->page['template'] = 'full'; - $a->page['title'] = t('Red Matrix - "The Network"'); - return $o; } +// Nope, we didn't find an item. Let's see if there's any html + if(file_exists('home.html')) { $o .= file_get_contents('home.html'); } else { - // If there's no site channel or home contents configured, fallback to the old behaviour + // If there's nothing special happening, just spit out a login box $sitename = get_config('system','sitename'); if($sitename) diff --git a/mod/post.php b/mod/post.php index 3b4f66baf..d62233ca1 100644 --- a/mod/post.php +++ b/mod/post.php @@ -415,8 +415,8 @@ function post_init(&$a) { * } *} * - * Currently defined message types are 'activity', 'mail', 'profile' and 'channel_sync', which each have - * different content schemas. + * Currently defined message types are 'activity', 'mail', 'profile', 'location' and 'channel_sync', + * which each have different content schemas. * * Ping packet: * A ping packet does not require any parameters except the type. It may or may not be encrypted. diff --git a/mod/settings.php b/mod/settings.php index 5038a63c4..f9568feb3 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -136,7 +136,8 @@ function settings_post(&$a) { $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->channel['channel_theme']); $mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : ''); $user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0); - $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0); $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; if($browser_update < 10000) @@ -156,6 +157,7 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','update_interval', $browser_update); set_pconfig(local_user(),'system','itemspage', $itemspage); set_pconfig(local_user(),'system','no_smilies',$nosmile); + set_pconfig(local_user(),'system','title_tosource',$title_tosource); // set_pconfig(local_user(),'system','chanview_full',$chanview_full); @@ -589,10 +591,9 @@ function settings_content(&$a) { if((argc() > 1) && (argv(1) === 'featured')) { $settings_addons = ""; - $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' "); - // FIXME: This is always 0, even if there are plugin settings on this page - // if(! count($r)) - // $settings_addons = t('No feature settings configured'); + $r = q("SELECT * FROM `hook` WHERE `hook` = 'feature_settings' "); + if(! count($r)) + $settings_addons = t('No feature settings configured'); call_hooks('feature_settings', $settings_addons); @@ -743,6 +744,9 @@ function settings_content(&$a) { $nosmile = get_pconfig(local_user(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 + $title_tosource = get_pconfig(local_user(),'system','title_tosource'); + $title_tosource = (($title_tosource===false)? '0': $title_tosource); // default if not set: 0 + $theme_config = ""; if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){ require_once($themeconfigfile); @@ -763,6 +767,7 @@ function settings_content(&$a) { '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), '$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')), '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''), + '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, ''), '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, '$expert' => feature_enabled(local_user(),'expert'), diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 061989413..01355a51d 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -13,7 +13,13 @@ function siteinfo_init(&$a) { if($r) { $admin = array(); foreach($r as $rr) { - $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + if($rr['channel_pageflags'] & PAGE_HUBADMIN) + $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + } + if(! $admin) { + foreach($r as $rr) { + $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + } } } else { diff --git a/mod/webpages.php b/mod/webpages.php index 1b906a97f..efaf3c4bf 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -46,7 +46,7 @@ function webpages_content(&$a) { // } - if(feature_enabled($owner,'expert_mode')) { + if(feature_enabled($owner,'expert')) { $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); if(! $mimetype) $mimetype = 'choose'; diff --git a/mod/xchan.php b/mod/xchan.php index 9d4cdcc22..e51cc53cc 100644 --- a/mod/xchan.php +++ b/mod/xchan.php @@ -15,16 +15,28 @@ function xchan_content(&$a) { if(x($_GET,'addr')) { $addr = trim($_GET['addr']); - $r = q("select xchan_name from xchan where xchan_hash like '%s%%'", + $r = q("select * from xchan where xchan_hash like '%s%%'", dbesc($addr) ); if($r) { foreach($r as $rr) - $o .= $rr['xchan_name'] . EOL; + $o .= str_replace("\n","<br />",print_r($rr,true)) . EOL; } else notice( t('Not found.') . EOL); + + $r = q("select * from hubloc where hubloc_hash like '%s%%'", + dbesc($addr) + ); + + if($r) { + foreach($r as $rr) + $o .= str_replace("\n","<br />",print_r($rr,true)) . EOL; + + } + + } return $o; } diff --git a/mod/zfinger.php b/mod/zfinger.php index 1226f74fe..666f141ec 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -208,28 +208,11 @@ function zfinger_init(&$a) { if($permissions['view_profile']) $ret['profile'] = $profile; - // array of (verified) hubs this channel uses - $ret['locations'] = array(); - - $x = zot_get_hublocs($e['channel_hash']); - if($x && count($x)) { - foreach($x as $hub) { - if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_UNVERIFIED)) { - $ret['locations'][] = array( - 'host' => $hub['hubloc_host'], - 'address' => $hub['hubloc_addr'], - 'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false), - 'url' => $hub['hubloc_url'], - 'url_sig' => $hub['hubloc_url_sig'], - 'callback' => $hub['hubloc_callback'], - 'sitekey' => $hub['hubloc_sitekey'], - 'deleted' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_DELETED) ? true : false) - ); - } - } - } + $x = zot_encode_locations($e); + if($x) + $ret['locations'] = $x; $ret['site'] = array(); $ret['site']['url'] = z_root(); diff --git a/version.inc b/version.inc index aa1814513..82ede1be5 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-09-12.796 +2014-09-14.798 diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css index b81145cd5..0c4c25bae 100644 --- a/view/css/mod_photos.css +++ b/view/css/mod_photos.css @@ -1,11 +1,3 @@ - - -.photo-top-photo, .photo-album-photo { - padding: 10px; - max-width: 300px; -} - - .photos-end { clear: both; margin-bottom: 25px; @@ -30,51 +22,11 @@ clear: both; } -.photo-album-image-wrapper { - float: left; - margin-top: 15px; - margin-right: 15px; - margin-left: 15px; -} -.photo-album-image-wrapper .caption { - display: none; - width: 100%; - bottom: 0px; - padding: 0.5em 0.5em 0px 0.5em; - margin: 0px; -} -.photo-album-image-wrapper a:hover .caption { - display:block; -} - #photo-album-end { clear: both; margin-bottom: 25px; } -.photo-top-image-wrapper { - float: left; - margin-top: 15px; - margin-right: 15px; - margin-left: 15px; - margin-bottom: 15px; -} -.photo-top-album-name { - width: 100%; - min-height: 2em; - bottom: 0px; - padding: 0px 3px; - padding-top: 0.5em; -} -#photo-top-end { - clear: both; -} - -#photo-top-links { - margin-bottom: 30px; - margin-left: 30px; -} - #photos-upload-newalbum-div { float: left; width: 175px; @@ -83,6 +35,7 @@ #photos-upload-noshare { margin-bottom: 10px; } + #photos-upload-existing-album-text { float: left; width: 175px; diff --git a/view/js/main.js b/view/js/main.js index e263fd116..d6b405258 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -705,20 +705,19 @@ function updateConvItems(mode,data) { } function justifyPhotos(bParam_page) { + justifiedGalleryActive = true; $('#photo-album-contents-' + bParam_page).justifiedGallery({ lastRow : 'nojustify', - captions: true, margins: 3, - rowHeight : 150, sizeRangeSuffixes : { - 'lt100': '', - 'lt240': '', - 'lt320': '', - 'lt500': '', - 'lt640': '', - 'lt1024': '' + 'lt100': '-2', + 'lt240': '-2', + 'lt320': '-2', + 'lt500': '-1', + 'lt640': '-1', + 'lt1024': '-0' } - }); + }).on('jg.complete', function(e){ justifiedGalleryActive = false; }); } function notify_popup_loader(notifyType) { @@ -1134,9 +1133,9 @@ $(window).scroll(function () { $('#more').css("top","400"); $('#more').show(); } - + if($(window).scrollTop() + $(window).height() == $(document).height()) { - if((pageHasMoreContent) && (! loadingPage)) { + if((pageHasMoreContent) && (! loadingPage) && (! justifiedGalleryActive)) { $('#more').hide(); $('#no-more').hide(); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 4062c259c..bb11ddbb9 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -675,10 +675,6 @@ aside li { margin: auto; } -.photo-top-image-wrapper, .photo-album-image-wrapper { - width: 240px; -} - .photo-top-photo-link, .photo-album-photo-link { display: block; width: 100%; @@ -688,15 +684,6 @@ aside li { overflow: hidden; } -.photo-album-image-wrapper .caption { - background-color: $acpopup_bgcolour; - border-bottom: 2px solid $acpopup_bordercolour; -} - -.photo-top-album-name { - background-color: $acpopup_bgcolour; -} - #photos-upload-perms-menu, #photos-upload-perms-menu:visited, #photos-upload-perms-menu:link { color: #8888FF; text-decoration: none; @@ -2268,6 +2255,18 @@ blockquote { font-size: 1em; } +h1, h2 { + font-size: 1.15rem; +} + +h3, h4 { + font-size: $font_size; +} + +h5, h6 { + font-size: $body_font_size; +} + .dropdown-menu { font-size: $body_font_size; border-radius: $radiuspx; diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index 788fef457..56485dff6 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -47,7 +47,6 @@ {{include file="field_select.tpl" field=$theme}} {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$theme_accessibility}} - {{include file="field_input.tpl" field=$site_channel}} {{include file="field_checkbox.tpl" field=$no_login_on_homepage}} diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index bfa62f1b7..ff69fd379 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -15,7 +15,9 @@ <div class="wall-item-photo-end" style="clear:both"></div> </div> {{if $item.title}} - <div class="wall-item-title" id="wall-item-title-{{$item.id}}"><h3>{{$item.title}}</h3></div> + <div class="wall-item-title" id="wall-item-title-{{$item.id}}"> + <h3>{{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}}</h3> + </div> {{/if}} {{if $item.lock}} <div class="wall-item-lock dropdown"> diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl index 703b08547..9c9e7b970 100755 --- a/view/tpl/head.tpl +++ b/view/tpl/head.tpl @@ -25,6 +25,7 @@ var updateInterval = {{$update_interval}}; var localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}}; var zid = {{if $zid}}'{{$zid}}'{{else}}null{{/if}}; + var justifiedGalleryActive = false; </script> diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl index 6eda6a6ec..f10f2e1c2 100755 --- a/view/tpl/settings_display.tpl +++ b/view/tpl/settings_display.tpl @@ -12,7 +12,7 @@ {{include file="field_input.tpl" field=$ajaxint}} {{include file="field_input.tpl" field=$itemspage}} {{include file="field_checkbox.tpl" field=$nosmile}} - +{{include file="field_checkbox.tpl" field=$title_tosource}} <div class="settings-submit-wrapper" > <input type="submit" name="submit" class="settings-submit" value="{{$submit}}" /> |