Digest for phpBB Forum without plugin   November 13th, 2010

I am very glad for the hosted apps that Sourceforge provides. It is excellent to have only one login, and not to need to worry about updating the apps.

The problem with the phpBB forum is that the notification emails, when you watch a forum, do not include the message. On Sourceforge you are also not able to install a digest modification, eg. http://phpbbservices.com/digests/
Therefore I thought it would be good to have an external script, that regularly checks for new posts and sends an email with the contents.
In the end, it was not too hard.
This only works for a public forum, where all posts are accessible by non-registered users.
There is the page search.php (eg.http://sourceforge.net/apps/phpbb/openpetraorg/search.php?&sr=topics&search_id=newposts) that shows all new posts.
I store each post that has been sent as an email with the post number in a text file.
Then the script fetches the page of the new posts, and checks each post if it has been sent already.
The script sends HTML emails, and even quoting blocks appear quite alright in my email client (google mail).
The script is also able to parse the posts of a thread that spreads across several pages.
You also might find the functions interesting to get the HTML code and to parse for code between the beginning and the end tag.
Feel free to use the script and to modify it.

The advantage of KnowledgeTree is that it keeps versions of each document that you upload. Unfortunately, this does not seem to work in version 3.7.0.2, when uploading a new version of an existing file via WebDAV. The file is overwritten with the new version, but there is no version history.

There might be good reasons for that behaviour, which are explained in this issue?

Here is a solution that works for me, but of course, I do not know the interna of Knowledge Tree, therefore please use it at your own risk…
In file ktwebdav/lib/KTWebDAVServer.inc.php, find the lines:
// Modified – 25/10/07 – changed add to overwrite
// $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions);
$oDocument =& KTDocumentUtil::overwrite($oDocument, $name, $sTempFilename, $oUser, $aOptions);
It seems, with the add method a new file would be created, with a unique filename. So uploading a new version of test.txt would result in two files, test.txt would stay, and the new file would be test(1).txt. This is not really what you want.
To get real versioning, comment that line with “overwrite”, and add these lines:
$aOptions[‘newfilename’] = $name;
$oDocument =& KTDocumentUtil::checkin($oDocument, $sTempFilename, ‘WebDAV upload’, $oUser, $aOptions);
This should do the trick. You will only have one file in your folder, and when you click on “Version History” in your webinterface, you will see the old versions and the current version. The file you download via WebDAV is always the latest version. This makes sense to me…

Reports with Symfony   November 17th, 2007

I wondered what the easiest way was to create reports.
I looked into PM Report 4.1 by Zeke Walker, but did not think it would be what I needed.

So this is what I did:
edit the Peer class of your table, and add a function that will return the data that you will need in the report:
lib/model/MyTablePeer.php

static function getAllRowsWithBlabla()
{
$con = Propel::getConnection(self::DATABASE_NAME);
$sql = 'SELECT * FROM '.self::TABLE_NAME.' WHERE a=1 ORDER BY nachname, vorname';
$stmt = $con->prepareStatement($sql);
$rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
return BasePatePeer::populateObjects($rs);
}

Then in apps/myapp/modules/mytable/actions/actions.class.php add an action for the report:

public function executeReportVereinsmitglieder()
{
$this->items = MyTablePeer::getAllRowsWithBlabla();
}

Finally, create a success page:
apps/myapp/modules/mytable/templates/reportBlablaSuccess.php



Date created:




My blabla report







if ($item->getSomeCondition())
{
if ($first)
{
$first = false;
}
else
{
echo ', ';
}
echo $item->getMyValue();
}

?>

To disable some items for printing, I changed the css styles
in file apps/myapp/templates/layout.php:

Symfony I18N   November 17th, 2007

see http://www.symfony-project.com/book/1_0/13-I18n-and-L10n

I have changed the default_culture in myapp/config/i18n.yml

Based on this blog entry with german translations I have created my own version:
save it as apps/mybackend/messages.de.xml

Tags: , ,
Posted in Software Development | Comments Closed

Symfony Project   November 17th, 2007

I enjoy using the symfony Web PHP Framework for a database/web application.

To make it run on a Debian Virtual Private Server:
add to file /etc/apt/sources.list this line:

deb http://www.symfony-project.com/get debian/

Then install the required packages:

apt-get install php-pear php5-symfony php5-mysql php5-xsl

See the “My First Project”-Tutorial for initialising your project.

Tags: ,
Posted in Software Development | Comments Closed

The goal is, that users are only registered on phpNuke, and can use the same username on MediaWiki, without logging in twice.

Readme.txt, Download, Auth_phpnuke.php, authphpnuke.php, modules/MediaWiki/index.php.