-
Url rewriting on Postnuke 0.8
(News)
-
Main principles of the mod rewrite
For information, the URL rewriting is a module that you can activated in your apache to rewrite the links of a site in order to simplify their reading.
The idea is that the Pn Team also thought that the mod rewrite was not necessarily available / activated on all types of servers (particularly on Windows servers). Indeed, the Postnuke team offers rewritings based on tips already heavily used in management systems like blogs.
Before you begin, here is the format of a link without rewriting.
without rewriting
index.php?module=Users&func=logout Index.php? Users & module = func = logout
URL rewriting without mod rewrite
This rewriting reproduced a "virtual" Folders system on your site, links look like this
URL rewriting without mod rewrite
index.php/Users/logout
In terms of mechanism, it is very simple, when your Web server receives a request for a link, it loads instinctively page "index.html". In this index.php, the parameters of the request are recovered via the header (you can look in "phpInfo" there is a field $ _SERVER [ 'REQUEST_URI'] which corresponds to this information).Then these parameters are interpreted , between the first two "/" is the name of the module, between the two others, the function name. Now Postnuke know the name of the module and function to launch.
You can pass parameters too, for instance, if you want to load a forum with id=2, the links will look like this
URL rewriting without mod rewrite
index.php/Forum/viewforum/forum:2
Note that the url rewriting uses ":" to represent the parameters in a url. So you can't pass variables like this "index.php?variable=filter:3". (be carefull if you are using Pagesetter and his filters system).
URL rewriting with mod rewrite
Optimizing the previous version
In the previous example, all links contained index.php ... but it's ugly, and functionally this file contains no
information useful to load the asked module.This trick is useful when you have no mod rewrite, but if one has an "mod rewrite enabled" server,you can use a "lighter" version of the previous rewriting without an "index.html"
Here is an example
URL rewriting with mod rewrite :Optimizing the previous version
/Users/logout
Be careful, if one of your pictures is written this way
and you load the page /MyModule/main/. "/MyModule/main/test.png" which will be searched. Note that you can make a rewriting that redirect all links of the form "/*/*/*.(jpg | png | gif)" to "$ 3. (Jpg | png | gif)." (but it's ugly).
Mode file
This url rewriting is the classical version already used in previous versions of the cms, The rewrited links are lists of words (module name, the name of function) separated by dashes. Note that this version uses a large number of regular expressions rules to do the rewriting compared to the other one, which may increase the load of your server Web.
One example here ...
URL rewriting with mod rewrite : Mode file
module-Forum-viewtopic-topic-2903-start-0.html
Note that the "module" which one would have thought there's no point in it, is made for the support of the "old style" loading of modules.
URL rewriting customized
So here is the coolest feature, which allows you to customize the URL rewriting depending on the module you want to load. Just create a "encodeurl" function in your API module (pnuserapi) that takes as parameters, the information needed to create for output a fully customized rewrited link.
After, the loading of each page of the CMS, a "decodeurl" function in the API part of the module takes care to reformat the encoded url in a form understandable by the CMS.
You can find an example of the use of this method in the module "Pages" of values addons
Format of a encode and decode url
function pages_userapi_encodeurl($args)
function pages_userapi_decodeurl($args)
This feature is interesting because it allows us to have the hands on your url, not only before loading the page, but after loading this page, allowing you post-processing actions rather interessant.
This method allow you to
- put keywords in the url: (see Pages module)
- have a single version of your rewrited url : Indeed, through the post treatment you can recalculate the url and it does not conform to your requirements, you can redirect to the good link via a redirect 301 "Moved Permanently headers.
Use case of a url rewriting "no duplicate"
Notes: A small problem nevertheless for the use of this rewriting, which is limited to the type url "user". (more details here)
This article is a translation from this "how to" released on Postnuke-France
Generated on February 25, 2008.
-
What's going on?
(News)
-
know the Core team released RC2 of Postnuke .8 - the Steering Committee's report we are just working on will deal with the details.
2. Jørn Wildt released a first version of his "Content" module:
"Finaly I have finished the first version of my new Content module. With this little goodie you get HTML editing, YouTube video, Google maps and more features out of the box. This module was inspired by Typo3 and the never-finished PostNuke module Publish!" -- elfisk.dk
Content is a module that you can use to create static pages. It supports several predefined layouts (1 column, 2colums + header aso) and you can also add your own templates. In the editor you then can drag and drop content items like texts, images, youTube videos or Google Maps around and place them anywhere you like within the layout.
3. Together with "Content 1.0.0" a new version of Jørn's Mediashare gallery is available. Yet it still needs an installed Topics module to run under .8.
4. pnForum 2.7(.1) is finally released. A test version served the German Postnuke community for months and now he fixed the last bugs and made a public release.
5. Sven Schomaker is about to release Scribite 2.0 - It includes openWYSIWYG v1.4.6c as new editor and new versions of Xinha (v0.94), TinyMCE (v2.1.2), FCKeditor (v2.4.3), a lot of new module plugins and languages.
6. Axel Guckelsberger finished his diploma thesis that discussed the use of model-driven software development (MDSD) for Postnuke and resulted in his "ModuleStudio". Although ModuleStudio is far from complete it is way ahead in terms of modern software development. And if it turns out right MDSD is one of the next big things after object orientation (OO).
7. User ftree started work on a new gallery (pnAlbum) some months back and now published an article about his work. In preparation of the gallery he programmed some basic functions which turned out to be suitable for everyone who wants to program a module. If you want to you can take a look at his work.
8. There's a new pnCommerce team in formation: Rüdiger Hahn, Jim Hatfield, Chris Candreva, Bernd Plagge and some others are long time pnCommerce users and all maintained their own fork of the module. Now they are trying to put all their code together and a new version out for public use.
9. Marco Kundert is still working on his .8 follow-up for Pagesetter called Pagemaster. His first release will be 100% compatible to the latest version of Pagesetter so that you can simply import all you Pagesetter content into Pagemaster. Pagesetter introduced many ideas into Postnuke that have now become part of the core: Postnuke .8 has Workflows system and the idea of Pagesetter's form framework (Guppy) can now be found as Forms API in .8 and the WYSIWYG-Editor is now in Scribite generally available - Pagemaster uses all these features and thus can be much leaner.
10. Robert Gasch is working on a commercial shop module. He allowed me to take a look at it and it looks really great. Robert made his living for the last few years by setting up shop solutions for customers and now uses this experience for his new module.
11. Mateo Tibaquirá released a first version of his port of the standalone Relay AJAX directory management application. Includes drag-n-drop files and folders, a dynamic loading file structure, thumbnail views, multiple users & accounts, batch uploads, shopping-cart/batch downloads.
I am sure I forgot some people and I know there's a lot more going on in Postnuke land. But I'd like to leave some news for further articles.
If you are working on a news-worthy Postnuke project please contact me via personal message
Generated on December 22, 2007.
-
A quick module 'til the end of 07 ?
(News)
-
The idea behind it is simple: with the help of graphical editors one creates a model describing a module so far that all necessary information is contained which is needed to generate it. Different validations call attention to incorrect or missing elements, so that always runnable modules are produced.
The module is completely separated from its technical realisation, the whole development cycle can happen on an abstract level. When new versions are released, pressing a button is sufficient to update a module.
This preview version only provides necessary means and should really be taken for a preview. There is much planned and there are also some messy bugs, but with some excercise one can do work of weeks in ten minutes already :-)
Download
Examples
You can find further information on the project homepage as well as in the application itself.
Have fun and a nice Christmas!
Generated on December 21, 2007.
-
pnMeeting 2007: The Videos are Online
(News)
-
informative videos. But maybe you can nevertheless gather some information from it or at least feel the atmosphere of this years meeting.
Mark West's Keynote
Jørn Wildt explains pnForms
Robert Gasch on CategoryUtil
Robert Gasch on DBUtil and the Object Model in .8
Mark West: Porting an Open Source Template to PostNuke .8
Jørn Wildt Proposes New Content Module
Albert Perez Monfort introduces the "Intraweb" project
Mark West talks about .8/.9
Axel Guckelsberger on EasyDist, EasyInstaller & the ModuleStudio
Joseph on Beat Boxing
We hope you enjoy the presentations anyway ;-
Generated on September 18, 2007.
-
pnMeeting 2007: Robert Gasch on DBUtil and the Object Model in .8
(News)
-
Only few have heard about DBUtil, even fewer have used it themselves. Robert Gasch aimed at changing this.
DBUtil frees the programmer from the need of writing SQL. You rather work with objects and all your selects will be checked for permissions. So if you fetch a set of 10 articles you will only receive that 10 articles that the users is allowed to see. This alone is a major enhancement and saves lots of code lines.
Robert presented the object library as a powerful yet quite easy to use system for the handling of objects. After the initialization of an object you can select, edit, delete aso the object. For a more detailed look into the ObjectLib you should watch the recorded presentation which we will publish within the next few days. Or watch the other presentations live.
Do you want to see how our location looks like? Look here!
Generated on September 8, 2007.
-
PHP Projects Join Forces To Go PHP 5
(News)
-
The Symfony, Typo3, phpMyAdmin, Drupal, Propel, and Doctrine projects have all announced
that their next release after February 5, 2008 will require PHP version 5.2 as part of a
coordinated effort at GoPHP5.org, and have issued an open invitation to any other PHP
projects and applications, both open source and proprietary, that want to participate in the
effort.
Most PHP-based web applications today run in both PHP version 4 and PHP version 5. PHP
4 was released in 2000, and quickly cemented itself as one of the dominant web development
languages. Version 5 was released in 2004 with dramatic improvements in functionality, but
adoption has been slow due mostly to the "chicken and egg" problem that accompanies many
new platform releases.
"Most of the PHP developers I talk to want to use PHP 5 but can't because so many web
hosts offer PHP 4 by default," said Larry Garfield, a Drupal developer and one of
GoPHP5.org's founders. "The hosts won't upgrade until projects do, but projects won't
upgrade until the hosts do. That has made a lot of projects reluctant to be the first to drop
support for PHP 4, so we've decided that we will all be first."
By pre-announcing plans to require PHP 5.2 in upcoming software versions in 2008, GoPHP5
hopes to provide web hosts with the incentive to upgrade their servers to newer, more stable,
more feature-rich versions of PHP as well as sufficient time to do so. Users that are already
using current versions of participating projects won't be left out in the cold, either. All involved
projects will continue to support current releases on PHP 4 for their normal life cycle, giving
both users and hosts time to plan and implement an upgrade.
"The phpMyAdmin project is very enthusiastic to join the GoPHP5 initiative," added
phpMyAdmin's project lead, Marc Delisle. "We see GoPHP5 as a way both to improve our
product's new versions — not always having to add workarounds to remain PHP4compatible
— and improve the experience of our users — by projecting the correct message about the
PHP system itself and its evolution."
PHP 5 offers developers a wide array of features designed to make developing fast, modern
web applications faster and easier. That includes vastly improved XML handling for Web
services, an integrated SQL database called SQLite, better handling of time zones,
dramatically improved security tools, stronger object-oriented functionality, and more.
Many PHP projects already require PHP 5. Encouraging a larger installed base of PHP 5 will broaden the market for those projects as well. PHP is a widely-used general purpose scripting language that is especially suited for Web development. PHP is one of the leading web development languages in the world, running on a third of the world's web servers. It is the platform of choice for companies from Yahoo to Facebook as well as the most widely available development platform on shared hosting,
which powers millions of web sites world wide.
For more information:
http://gophp5.org/
http://www.phpmyadmin.net/home_page/gophp5.php
http://drupal.org/gophp5
Press Contact:
larry.garfield@gophp5.org
Generated on July 10, 2007.
-
Using PostNuke and MySQL in Unicode (UTF-8)
(News)
-
MySql and UTF-8
by: Bernd Plagge
www.choicenet.ne.jp
MySql introduced support for different character sets and collating rules in version 4.1. While this has many advantages databases sometimes need to be migrated and then we have to ensure that the correct character code is set for the new database. We are mainly using UTF-8 and hence you may have to adapt this information to your situation!
What is the problem?
MySql uses as default Latin1, swedish flavour.
How do we check this?
run mysql.
mysql> show variables;
How to check the character set for a particular database?
run mysql.
mysql> show create table
The character code can be set in various places - so where is the best place for this?
We always use UTF-8
------------------------
In this case it makes sense to set the character code for the whole server to UTF-8. MySql actually sets the character code at different levels:
server
client
database connection
database
The character encoding for server, client and the connection work hand in hand to ensure that the data is interpreted correctly. It seems that MySql makes no effort to determine the correct character set but will convert data in accordance with it's configuration. This leads to problems for old databases if the database character code differes from the one configured.
The easiest way to configure MySql for UTF-8 is to put the configuration inot the main configuration file (/etc/mysql/my.cnf).
In my.cnf there are different file sections. So you can't put it just anywhere.
[mysqld]
character-set-server=utf8
[client]
default-character-set=utf8
Setting UTF-8 for one Database
--------------------------------------
You can check the default character code for a database either by dumping the data and then changing the schema file or you can do this online.
You use the 'alter table' statement to change the database using mysql.
run mysql
alter database
default character set utf-8
default collotion_name utf8-general_ci;
note: you may omit the word 'default'.
It is also worth noting that e.g. mysqldump silently adds the default character code when exporting data!
This can causes problems if the character code defined and the database content are different. In such cases MySqldump will try to convert data to it's default character code!
However, you can disable that by adding the character code option when using MySqldump.
e.g. mysqldump --set-charset.
In the same way you may explicitely set the character set.
mysqlimport --default-character-set = utf8
mysqladmin --defautl-character-set = utf8 create
Setting the character code at server start
-----------------------------------------------------
You can start the server with:
character-set-server
collation-server
The current values can be determined with the command
run MySql:
mysql> show variables;
Values may be changed with commands like:
set character_set_server = utf8;
set collation_server = utf8_unicode_ci
Setting the character code within Applications
----------------------------------------------------------
You want ensure that the correct character code is set when connecting to a particular database.
Connect to the database and issue the following SQL command:
mysql>SET NAMES utf8;
SET NAMES is equivalent to the 3 commands:
character_set_client
character_set_connection
character_set_results
How to run PostNuke in UTF-8
-----------------------------------
Several things have to fall into place for this to work correctly.
1) the database encoding needs to be set to UTF-8
2) the application language needs to be encoded in UTF-8
3) PostNuke needs to be told to use UTF-8
ad 1)
see above for details!
ad 2)
The character code for a given language is set in language//global.php (PN 0.76x) or in language//core.php (PN 0.8). Search and adjust the following 3 define strings:
define('_CHARSET','UTF-8');
define('_LOCALE','en_US');
define('_LOCALEWIN','eng');
Of course it is not sufficient just to change the _CHARSET to UTF-8. The text strings themselves need to be encoded in UTF-8. This can be done in a number of ways:
a) use 'recode' or 'iconv' on every language file
b) use the pnlwb (PN Language Workbench) to extract and convert all language files
ad 3)
Following the database initialization you need to issue a "set names to 'UTF-8'" command. As this is done in includes/pnAPI.php we need to patch that file.
PN 0.76x
----------
// load security functions.
include 'includes/pnSecurity.php';
// Load our language files
include 'includes/pnLang.php';
pnLangLoad();
//bplagge 2006-01-31 - charset fix for new MySql version
$dbconn =& pnDBGetConn(true);
$info=$dbconn->ServerInfo();
if ($dbconn->ErrorNo() != 0) {
echo "Error: "; echo $dbconn->ErrorNo();
}
// print_r($info);
$c = _CHARSET;
// Mysql uses non-standard name for UTF-8!
if ($c == 'UTF-8')
$c = 'UTF8';
$query = sprintf('SET NAMES \'%s\'', $c);
$dbconn->Execute($query);
if ($dbconn->ErrorNo()!=0) {
echo "Error: "; echo $dbconn->ErrorMsg();
echo "check pnAPI.php";
}
}
// end bplagge - mysql charset adjustment
PN 0.8
-------
if ($stages & PN_CORE_LANGS) {
// Load our language files
pnLangLoad();
}
# bp 2007-06-01
# need to "set names '' " to ensure correct data handling
$query = sprintf('SET NAMES \'%s\'', 'UTF8');
$result = DBUtil::executeSQL($query, -1, -1, true, true);
Please note that the MySQL character code names are NON STANDARD!
How to check?
----------------
I always found that phpMyAdmin is an excellent tool for MySQL databases. If the data entered in PostNuke is also correctly displayed in phpMyAdmin table browse mode I'm quite confident that everything is fine.
Generated on June 6, 2007.
-
First supported version of CoType released
(News)
-
A document consists of nested sections, so you always end up with a
structure like this:
Document
+- Section 1
| +- Section 1.1
| | + Section 1.1.1
| +- Section 1.2
+- Section 2
You can also add "boxes" to your sections. These boxes contains images
(references to multimedia files from Mediashare), program examples, or simply
some text. Boxes can be positioned in various places of their containing
sections - top left, top right, above and bottom.
CoType is designed to cover the grounds between a Wiki and a single document.
Wiki elements:
- With CoType you can collaborate on document creation since every person can edit their own sections (can also be open to anonymous users).
- With CoType you can easily link different sections and boxes (there is a toolbar button for this in the editor).
- CoType has a complete revision history for each section and you can see who edited what, when and from where.
- Everything is instantly online.
Single document elements:
- All sections in a CoType document can be printed, exported or downloaded as
one single document for off-line use (not feature complete yet).
- You get a nice structured table of content.
- You can read the text linearly from section one and forward.
Features:
- Create unlimited number of documents
- Add unlimited number of sections to documents
- Add floating figures with images and text
- Organize sections hierarchically by drag-and-drop
- Automatic table of contents
- HTML WYSIWYG editing using FCKEditor
- Insert cross references
- Support for PostNuke .8 search API
- Complete revision history
- Only one person at a time are allowed to edit the same section. No more
overwriting of other peoples work (depends on PostNuke .8's PageLock
mechanism).
Download here.
Support site: www.elfisk.dk.
Enjoy, Jørn
Generated on May 24, 2007.
-
Demo version of CoType module
(News)
-
| + Section 1.1.1 | +- Section 1.2 +- Section 2CoType is designed to cover the grounds between a Wiki and a single document.
Wiki elements:
With CoType you can collaborate on document creation since every person can edit their own sections (can also be open to anonymous users).With CoType you can easily link different sections (there is a toolbar button for this in the editor).CoType has a complete revision history for each section and you can see who edited what, when and from where.Everything is instantly online.
Single document elements
All sections in a CoType document can be printed, exported or downloaded as one single document for off-line use (not feature complete yet).You get a nice structured table of content.You can read the text linearly from section one and forward.
Features:
Create unlimited number of documentsAdd unlimited number of sections to documentsOrganization sections hierarchically by drag-and-dropAutomatic table of contentsHTML WYSIWYG editing using FCKEditorInsert cross referencesSupport for PostNuke search APIComplete revision historyOnly one person at a time are allowed to edit the same section. No more overwriting of other peoples work.
Future features/ideas:
Working with images and figures using MediashareFootnotes/end notesBibliographyExport to DocBook/Html/LaTeX/PDF/Word
You might ask "why a new wanna-be Book module - there's already one (and many other content modules)?". Well, there's a couple
Generated on March 18, 2007.
-
ElementBB moves houses
(News)
-
"Element BB is a forum for postnuke heavily inspired by Vanilla forum.
The goals of this project was to create a very simple, very easy to use, easy to impliment, web standards compliant, accessible and usable forum. I felt that Vanilla meets and often exceeds these requirements which is why I chose it as the model to develop from. Please note: this application was built from scratch, it has no relation to Vanilla aside from its appearance and some of its available features." -- invalidresponse.com
ElementBB will be released under the GPL at version 1.0 has now been moved to the NOC. So download the module, test it, create translations and give feedback in the project trackers.
Links
Element BB Project
invalidresponse.com
Generated on March 8, 2007.