yacs 7.6: pretty urls, tag cloud, Google maps, Digg, invitations
Posted by Bernard on Jul. 6 2007, commented by Simplify3 on Jul. 7 2007, (popular)
At the beginning of 2007 we promised you to move towards web 2.0, and it took only about three months to deliver a comprehensive implementation of this. YACS automatically build a cloud of tags like del.icio.us, features Google maps, and order pages after ranking, like Digg. Integration with Wikipedia and with popular RSS aggregators has been improved as well. YACS also extends collaboration capability to any recipient of a mail message, which will help to leverage your community. And URL rewriting will help to better match SEO standards and to achieve high ranking for your site. Enjoy!
451 files have been modified or added since the previous release.
The new release is available for
immediate download. If you are already running a YACS server we highly recommend you to
upgrade your server.
Here is a list of new or updated features coming with this release:

A brand new function
normalize_url() has been introduced to support the pretty rewriting of links built by YACS. Depending of the setting of the global parameter
with_friendly_urls, generated links will, or not, be optimized to human surfers and to search engines as well. Calls to
normalize_url() have been implemented in most modules, such as
actions/actions.php, etc.

An updated
.htaccess has been provided for the proper implementation of pretty URL rewriting. Key statements are commented out, for safety, and you have to activate them manually. Change file content with any text editor, and remove comments to activate rewriting at the Apache level. Save the file, then ensure that your server is working as usual. If you are experiencing some 500 Internal Server Errors, then revert to the previous version of the file and forget about rewriting. Else activate rewriting within YACS, using the system configuration panel.

Links built by YACS are not referencing
index.php anymore. For example,
files/ is generated instead of
files/index.php. This reduces the number of references for the same page, and simplifies URLs as well.

References to articles and sections almost always nick names, to ensure smarter processing by search engines on links generated by YACS.

The standard rendering library
skins/page.php is even able to generate smart links to special pages (about and privacy) when rewriting has been activated.

After the implementation of URL rewriting in YACS we had to create a new variable,
$context['script_url'] for self-referencing in forms, instead of
$context['self_script'].

Also, rewriting has had a great impact on
shared/global.php, because a number of global variables are not set the same way anymore.

The
base href=... meta attributes we used to have in templates have been completely removed, to further reinforce SEO best practices. As a result, usage of
$context['self_script'] has been deprecated.

YACS is now able to build a cloud of tags used in articles. This has been made available as a separate page (in
categories/cloud.php), or as a new code,
[cloud], to integrate a cloud exactly at the place you want. The actual layout is in
categories/layout_categories_as_cloud.php.

YACS can now capture a Google API key in the configuration panel for web services, at
services/configure.php.

When a Google API key is available, YACS automatically uses it to create mashup with Google Maps. Any location item added to a page or to a user profile is turned to a nice and interactive AJAX map (in
codes/codes.php). To include a Google Maps mashup anywhere you can use code
[locations=all] to list newest locations, or
[locations=users] to only visualize member locations.

A separate map is available for every location (in
locations/view.php). A global map is also available to locate all community members (at
locations/map_on_google.php). The hard work, which is the integration of proper Javascript in YACS pages, is done in
locations/locations.php, in function
Locations::map_on_google().

The Google API is also used to encode new locations. The form featured by YACS has a button to turn any address to related latitude and longitude. See
locations/edit.php
YACS now supports a Digg-like approach, whereby articles are ordered depending on their ratings. Two layouts have been provided, one for articles displayed at the front page (
skins/layout_home_articles_as_digg.php), and another one for articles listed in sections (
articles/layout_articles_as_digg.php).

The Digg layout for the front page can be activated from
skins/configure.php.

Ratings have been implemented in cookies, with a life of 100 days. The idea is to have a scalable system (storage is done by browsers), while avoiding multiple ratings by average surfers (cookies prevent additional votes). See
articles/rate.php
Page rating has been enforced in the
manual layout, meaning it is easier for end-users to locate most appealing pages in a complex electronic document. See
articles/layout_articles_as_manual.php.

The
Layout interface has been extended to allow for a default ordering of items (new member function
items_order() in
shared/layout.php). For example, a Digg-like layout aiming to list articles by rate will not expect the same ordering than a slashdot-like layout. YACS will use this additional information to appropriately query the database before submitting records to the layout instance. Of course, if some ordering has been defined with an option, this one is used instead of the default one.

This also applies to various layouts used at sections index pages (
sections/layout_sections.php, ...)

An option
articles_by_rating has been added to depart from usual ordering scheme in ordinary layouts if necessary.

To better take page order into account, and to streamline the script, the construction of SQL queries has been centralised in a couple of multi-purpose functions in
articles/articles.php. Size of this file has been reduced by more than 10%, while providing more features...

Wiki codes have been added to YACS, including headings (various number of '##=##' signs),
[wikipedia=foo_bar] to link to wikipedia. See
codes/codes.php
Another new code you may find useful is
[collections], to display a live list of available collections at your site.

A new help page has been introduced to document live codes, in
codes.live.php. A link to this page has been added to the main help index,
help.php.

Configuration of the front page has been streamlined, and options to add a gadget box for collections or for tags have been removed (
skins/configure.php). To implement these, you know have to manually create gadget boxes, and to add related YACS code. This does not add so much complexity, but allows for other levels of flexibility in the setup of the front page. Alternatively, use the new Content Assistant to create sample gadget boxes featuring these codes.

The
jive layout for sections now exposes up to 5 sub-boards, to save on clicks when brosing complex collaborative spaces. See
sections/layout_sections_as_jive.php
A new style name has been introduced for the jive layout. As a result, web designers can shape style
.jive to refine related rendered pages.

The slashdot layout has been available for a long time for the front page. With this release we have added this layout to section index pages as well. See
articles/layout_articles_as_slashdot.php.

A new layout has been added to achieve a minimal rendering of sub-sections, featuring only titles and thumbnail images. See
sections/layout_sections_as_titles.php.

Localization has been extended to categories used to archive articles every week and month, and also to the category for articles featured at the front page. See
categories/categories.php, modified after
GnapZ patch.

E-mail authentication has been added to a number of operations, meaning YACS is now generating special links, transmitted in mail messages, jointly to drive people and to authenticate them through one single click from their mailbox. This is used to allow for query tracking, in
query.php. This is also used to notify page authors of changes, in
articles/article.php. Most new authentication code has been moved to
users/login.php, which has been entirely re-engineered.

One use case of e-mail authentication is the ability to invite people to collaborate. The script
articles/mail.php has been entirely revisited, since it now accepts a list of e-mail recipients to invite. Invited people just have to click on the provided link from within their mailbox to visit the new page, and to be authorized to modify it as well. Because the mechanism is purely based on e-mail addresses, invited people do not even have to register to contribute to your community.

Another usage of e-mail authentication is password recovery. When a member does not remember its password, it only has to activate
users/password.php to receive in his mail box a clickable link to authenticate.

For people authenticated by e-mail, YACS maintains a list of page handles in session context. This allows for the proper management of several credentials during the same web session, if any. See
Surfer::add_handle() and
Surfer::may_handle() in
shared/surfer.php
Several functions, named
Surfer::empower() and
Surfer::is_empowered(), have been introduced to ease access management for users assigned as editors. Previously we had a
$capability parameter cascaded in function calls, and this change has translated to simpler code in many scripts.

Tests aiming to decide if new items are allowed or not have become so complex that dedicated functions have been added to YACS. For example,
Actions::are_allowed() in
actions/actions.php,
Articles::are_allowed() in
articles/articles.php,
Categories::are_allowed() in
categories/categories.php, etc.

The search page,
search.php, now lists only top-levels of the content tree to limit the scope of requests. Thanks to Justin for this handy idea.

HTTP status codes have been added to common pages when the provided id is not found in the database (404), and when access is forbidden (403). This should help search engines to crawl only valid and published pages.

Status codes returned by YACS are now fully based on
Status: pseudo-attribute, instead of direct generation of HTTP 1.0 responses. This allows for streamlined integration into the HTTP server engine.

A new script has been added to centralize functions related to anchors, in
shared/anchors.php. For example,
Anchors::stat_related_to() list all items related to one anchor in a nice table. Also, the function
Anchors::delete_related_to() has been added to cascade anchors deletions to their content. Similarly, a
Anchors::duplicate_related_to() function has been added to allow for easy duplication of one anchor and its content. For these functions the actual job is done in related database modules, e.g.,
actions/actions.php for actions, etc. For duplication, some transcoding capability has been added, to ensure proper ids are used in copies

Most forms now support the change of the editor to use (textarea, FCKEditor, TinyMCE) on-the-fly, through a simple selection in a drop list. A useful contribution from
Tof and
GnapZ. See
Surfer::get_editor() in
shared/surfer.php
An option has been added to the configuration panel for users to change editors (FCKEditor, TinyMCE, or text area) of all members in a single operation. Previously only the default value for future members could be changed.

A little check has been added to
agents/browsers.php to avoid silly notifications when the user agent string is not set properly.

Most static images have been moved to the
skins/images directory, to ease the job of web designers. Directory
agents/user-agents is now
skins/images/user-agents, and
comments/images has been turned to
skins/images/comments, etc. Many thanks to
GnapZ for this contribution.

The demo flag has been moved with other parameter files, as
parameters/demo.flag, after the suggestion from
GnapZ.

YACS has been able to create navigation links for images for a long time, but this was restricted to elements mentioned in the description field. Now this has been extended to images placed in the introduction field as well. The same principe appies to locations attached to articles. See
articles/article.php.

When an image is attached to a page as thumbnail, either the reduced image, or the plain version, is used, depending if image size exceeds the threshold or not. See
articles/article.php
Access restrictions are now cascaded from anchors downwards. This allows for easy setup of sophisticated access schemes. Also, complex security checks in the database have been replaced by simple statements, meaning improved response times of data queries. Look at function
Anchors::cascade() in
shared/anchors.php
The selection of a target section for a new page has been enhanced. The list of assigned sections is displayed first, as shortcuts to editors. Then, more levels of the content tree are displayed than before, to allow members to post deeply. See
articles/edit.php and
sections/layout_sections_as_select.php.

When articles are laid out as boxes, their nick names are used as CSS ids. This allows for easy mapping of content and presentation for web designers. An example of usage is the home page of
zaniroli.com, where every gadget box has a different nick name, and is rendered separately. See
articles/layout_articles_as_boxes.php
Some rationalization effort has been made in strings used for root scripts and for some modules. This should reduce a little the pain put on translators, since the number of strings to translate has been reduced by 3%.

The structure of an article page has been changed, and lines of commands are now placed below related elements. For example, commands to add a comment come after the list of posted comments. Previously lines of command were coming first, which has proven less handy. See
articles/view.php
To ease the update of collections an upload facility has been added for associates. When an archive is uploaded it is automatically split into individual files. This can be used for example to create simple slideshows, through transmission of archives of photos. See
collections/upload.php
The configuration panel for collections now displays the current path to files, as a useful tip to remote webmasters. See
collections/configure.php
New file extensions are supported by YACS:
3gp are small videos captured in mobile phones,
cer,
p12 and
pfx are related to digital certificates,
gg are Google gadgets,
mmap are mind maps created with Mindjet Mindmanager,
pcap are captures of network traffic,
pcast are podcasts in Apple format.

The system configuration panel now allows for 8-bit encoding of mail messages, as an addition to the base64 encoding that was available previously. The intent is to ease direct reading of messages where possible. See
control/configure.php and
shared/mailer.php
A couple of javascript errors have been fixed in the Content Assistant (
control/populate.php).

YACS does not notify surfers on creation of
.bak files anymore. We have improved the signal over noise ratio...

During purge, the deletion of
.bak files has been extended from
.php.bak to
.css.bak,
.html.bak,
.js.bak,
.mo.bak,
.po.bak,
.txt.bak and
.xml.bak as well. See
control/purge.php
New code has been added to
dates/dates.php to allow for calendars limited to one section. Previously, the concept was to have one calendar per site, with all events in it.

The feed of new articles with full content, and the feed of newest comments, have been added to the OPML feed, at
feeds/describe.php
A new fonction
Skin::build_subscribers() has been added to
skins/skin_skeleton.php to ease the external subscription to a feed provided by a YACS server.

Configuration panels now ask for authentication on anonymous visits. Previously they were just providing an error message.

The download of files is now implemented as a pass-through of
files/fetch.php, meaning a better access control to actual files. Previously YACS redirected to the web server for actual transfers. Aside security improvement, this change also allows for right-click saving of files, which was not possible before.

Some WebDav code has been added to
files/fetch.php, but this is not enough at the moment to allow for in-place edition. Keep posted...

YACS now supports more kinds of URI schemes, and it becomes even possible to had
notes:link_to_a_Lotus_Notes_database links in a page. See
links/click.php
A script
scripts/upload.php has been added, to streamline the application of a patch to any server. The script has a web form to upload an archive, which is just exploded afterwards. For community associates, this approach may be less simple than FTP upload. On the long run we will share a library of patches for the whole community.

A new function
Scripts::hdiff() has been added to
scripts/scripts.php to compare two HTML snippets. This is used by the new member function
diff() of the anchor interface (
shared/anchor.php), which is invoked while viewing a version, to check differences with current page, in
versions/view.php.

A new script
sections/bulk.php has been added to support bulk operations, such as: duplicate a section and all pages it contains, publish all articles at once, move all pages to another section in a single operation, or delete all pages in one click.

Internal cache has been added to many fragments prepared in
sections/view.php, with the obvious aim to speed rendering of stable index pages.

The library
shared/safe.php has been extended with a new member function
Safe::fstat(), and most functions handling files are now able to process correctly absolute paths, and path relative to YACS installation directory, thanks to internal calls to
Safe::realpath().

The SQL library is now able to call
mysql_real_escape_string() instead of
mysql_escape_string(), when possible. Look at
shared/sql.php.

A new function
Surfer::personal_sections() has been added to
shared/surfer.php, to make more sense of the global limit set on personal sections. Previously we used
Surfer::assigned_sections(), but this one takes into account all sections assigned to a member.

The configuration panel for users (
users/configure.php) now allows for permanent session, which means you don't have to authenticate again. This is a very nice feature for most users, but because of security weaknesses we highly recommend to use this only on intranet web sites. Session is actually saved in a cookie, which would mean potential replay attacks on the public Internet.

Another new parameter of the configuration panel for users allows for the display of avatars on the members index (
users/index.php). A cool suggestion from GnapZ

Date of last login is now displayed in usr profiles, but only to associates. And member preferences are shown only to other members. See
users/view.php
The set of
$_SERVER attributes exposed to surfers has been reduced if not associate, in
control/test.php. Can you feel the paranoia growing these days?

When
$_SERVER['PATH_INFO'] does not exist YACS now attempts to use
$HTTP_SERVER_VARS['ORIG_PATH_INFO'] instead.

YACS now supports virtual host, meaning you can have one single instance of the software, and several configuration files to take care separately of each virtual host. A bare implementation in
shared/global.php, and you have to prepare all configuration files by hand. But at least it works...

Visited pages are now shaped as a standard compact list, to fully enforce skin settings. See
skins/page.php