Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 11:20:51 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155556 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: RSS style feed for updates on site  (Read 537 times)
lordasb

Offline Offline

Posts: 13


« on: November 15, 2011, 11:20:32 PM »

ok heres the crack, i manually update a page which lists all the changes i make.

check here http://www.deepingstnicholas.org.uk/pages/dsn-site-news.php
but i want it to be automatic, is that an option ?

i am a tech but not a coder so go easy on me wink
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #1 on: November 15, 2011, 11:39:51 PM »

What do you mean by "automatic"? Is it like "I change a site" and it automatically sends a entry to this page? I guess it would need to be programmed. The data is available in the Database, there is also a snippet which can be used on a single page called "LastUpdateInfo" ... but it only displays it for the current page. But that would not incorporate the changes that you did. It is just a timestamp in the DB that it reads. WebsiteBaker by default does not keep a Version History. For that one though there is a WYSIWYG Module with Versionhistory.

To "just" make the handling a bit easier you could use the news module on that page, but you would still need to update your changes manually.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

lordasb

Offline Offline

Posts: 13


« Reply #2 on: November 15, 2011, 11:56:11 PM »

ok yep i or an editor would update a page and it adds an entry.

but from what you detail i am still better off just editing that, but can i do it better, have a rss on the site which i just drop my update into a site and it comes up / out as a rss feed?
Logged
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #3 on: November 16, 2011, 10:38:21 AM »

It will never add the comments you put on the page now.

A sitemap-alike solution that displays the pagename and the timestamp could be done using a droplet.

Code: (lastmodified droplet)
<?php
global $database;
if (!isset(
$limit)) $limit=15;
$returnValue "<ul>";
// query database
$result $database->query("SELECT * FROM " TABLE_PREFIX "pages WHERE visibility = 'public' ORDER BY modified_when DESC LIMIT 0 , $limit");
if (
$result && $result->numRows() > 0) {
while($page $result->fetchRow()){
$ptitle $page['page_title'];
$lastchange date("d-m-y, H:i"$page['modified_when']);
$url WB_URL.PAGES_DIRECTORY.$page['link'].PAGE_EXTENSION;
$returnValue .= '<li><a href="'.$url.'">'.$ptitle.'</a> ('.$lastchange.')</li>';
}
}
$returnValue .= '</ul>';
return 
$returnValue;

Put that code in a new created droplet and call it something like "lastmodified".
In a normal (WYSIWYG) page just add [[lastmodified?limit=25]]
It should show the last 25 modified pages.
Logged

Professional WebsiteBaker Solutions
lordasb

Offline Offline

Posts: 13


« Reply #4 on: November 16, 2011, 06:40:34 PM »

It will never add the comments you put on the page now.

A sitemap-alike solution that displays the pagename and the timestamp could be done using a droplet.

Code: (lastmodified droplet)
<?php
global $database;
if (!isset(
$limit)) $limit=15;
$returnValue "<ul>";
// query database
$result $database->query("SELECT * FROM " TABLE_PREFIX "pages WHERE visibility = 'public' ORDER BY modified_when DESC LIMIT 0 , $limit");
if (
$result && $result->numRows() > 0) {
while($page $result->fetchRow()){
$ptitle $page['page_title'];
$lastchange date("d-m-y, H:i"$page['modified_when']);
$url WB_URL.PAGES_DIRECTORY.$page['link'].PAGE_EXTENSION;
$returnValue .= '<li><a href="'.$url.'">'.$ptitle.'</a> ('.$lastchange.')</li>';
}
}
$returnValue .= '</ul>';
return 
$returnValue;

Put that code in a new created droplet and call it something like "lastmodified".
In a normal (WYSIWYG) page just add [[lastmodified?limit=25]]
It should show the last 25 modified pages.


many thanks looks very good!!! love it
Logged
lordasb

Offline Offline

Posts: 13


« Reply #5 on: November 16, 2011, 10:57:42 PM »

question can i ask

would it also show who edited it ?

andy
Logged
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #6 on: November 17, 2011, 10:26:50 AM »

Sure  cool

Code: (lastmodified2 droplet)
<?php
global $database;
if (!isset(
$limit)) $limit=15;
$returnValue "<ul>";
// query database
$result $database->query("SELECT * FROM " TABLE_PREFIX "pages WHERE visibility = 'public' ORDER BY modified_when DESC LIMIT 0 , $limit");
if (
$result && $result->numRows() > 0) {
while($page $result->fetchRow()){
$ptitle $page['page_title'];
$lastchange date("d-m-y, H:i"$page['modified_when']);
$url WB_URL.PAGES_DIRECTORY.$page['link'].PAGE_EXTENSION;
$by $database->get_one("SELECT `display_name` FROM " TABLE_PREFIX "users WHERE `user_id` = ".$page['modified_by']);
$returnValue .= '<li><a href="'.$url.'">'.$ptitle.'</a> ('.$lastchange.' by '.$by.')</li>';
}
}
$returnValue .= '</ul>';
return 
$returnValue;

I included a quick call to the database to get the name of the "modified_by" value in the database.
Logged

Professional WebsiteBaker Solutions
lordasb

Offline Offline

Posts: 13


« Reply #7 on: November 17, 2011, 08:06:55 PM »

many thanks ruud -  grin
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!