diff -uNrbB antville-1.1/code/Root/renderFunctions.js apps/antville/Root/renderFunctions.js --- antville-1.1/code/Root/renderFunctions.js Wed Aug 4 13:29:30 2004 +++ apps/antville/Root/renderFunctions.js Mon Nov 22 09:27:09 2004 @@ -32,7 +32,7 @@ res.push(); while (cnt < limit && idx < size) { var s = collection.get(idx++); - if (!s.blocked && s.online) { + if (!s.blocked && !s.hidden && s.online) { s.renderSkin("preview"); cnt++; } diff -uNrbB antville-1.1/code/Root/robots.txt.hac apps/antville/Root/robots.txt.hac --- antville-1.1/code/Root/robots.txt.hac Thu Jan 1 01:00:00 1970 +++ apps/antville/Root/robots.txt.hac Wed Apr 13 09:38:25 2005 @@ -0,0 +1,24 @@ +/* robots.txt support for Helma/Antville + + Based on http://blogs.23.nu/c0re/stories/213/ + --md@hudora.de 2004 +*/ + +res.contentType = "text/plain"; + +var param = new Object(); + +param = new Object(); +res.write("User-agent: *\n"); + +var size = root.size(); +for (var i=0;i<% site.online as="editor" %> + +Public sites can be accessed by everyone, non-public +sites can be accessed only by registered subscribers of this site. + +<% site.hiding %> + Allow comments: <% site.hasdiscussions as="editor" %> diff -uNrbB antville-1.1/code/Site/hiding.skin apps/antville/Site/hiding.skin --- antville-1.1/code/Site/hiding.skin Thu Jan 1 01:00:00 1970 +++ apps/antville/Site/hiding.skin Mon Nov 22 10:18:04 2004 @@ -0,0 +1,8 @@ + +Hide site: +<% site.hide as="editor" %> + + + +Hidden sites do not appear on the global index and are added to the robots.txt files to bar searchengines from accessing it. + diff -uNrbB antville-1.1/code/Site/macros.js apps/antville/Site/macros.js --- antville-1.1/code/Site/macros.js Wed Aug 4 13:29:30 2004 +++ apps/antville/Site/macros.js Mon Nov 22 10:09:30 2004 @@ -569,6 +569,34 @@ /** + * macro rendering hiding + */ +function hide_macro(param) { + if (param.as == "editor") { + var inputParam = this.createCheckBoxParam("hidden", param); + if (req.data.save && !req.data.hidden) + delete inputParam.checked; + Html.checkBox(inputParam); + } else if (this.hidden) + res.write(param.yes ? param.yes : getMessage("generic.yes")); + else + res.write(param.no ? param.no : getMessage("generic.no")); + return; +} + + + +/** + * macro rendering hiding settings if enabled + */ +function hiding_macro(param) { + if (this.isHidingEnabled()) + this.renderSkin("hiding"); + return; +} + + +/** * render generic preference editor or value */ function preferences_macro(param) { diff -uNrbB antville-1.1/code/Site/objectFunctions.js apps/antville/Site/objectFunctions.js --- antville-1.1/code/Site/objectFunctions.js Wed Aug 4 13:29:30 2004 +++ apps/antville/Site/objectFunctions.js Mon Nov 29 01:24:56 2004 @@ -10,10 +10,11 @@ this.creator = creator; this.createtime = this.lastoffline = new Date(); this.email = creator.email; - this.online = 0; + this.online = 1; this.blocked = 0; + this.hidden = 0; this.trusted = creator.trusted; - this.enableping = 0; + this.enableping = 1; // create initial preferences var prefs = new HopObject(); @@ -21,14 +22,14 @@ prefs.discussions = 1; prefs.usercontrib = 0; prefs.archive = 1; - prefs.days = 3; + prefs.days = 5; // retrieve locale-object from root var loc = root.getLocale(); prefs.language = loc.getLanguage(); prefs.country = loc.getCountry(); prefs.timezone = root.getTimeZone().getID(); prefs.longdateformat = "EEEE, dd. MMMM yyyy, h:mm a"; - prefs.shortdateformat = "yyyy.MM.dd, HH:mm"; + prefs.shortdateformat = "yyyy-MM-dd, HH:mm"; this.preferences_xml = Xml.writeToString(prefs); return this; } @@ -61,6 +62,7 @@ prefs.usercontrib = param.preferences_usercontrib ? 1 : 0; prefs.archive = param.preferences_archive ? 1 : 0; // store selected locale + app.debug(param.locale); if (param.locale) { var loc = param.locale.split("_"); prefs.language = loc[0]; @@ -169,11 +171,28 @@ */ function ping() { + // see http://elliottback.com/wp/archives/2004/11/21/a-list-of-rpc-and-rpc2-to-ping/ + var pingers = [ + "http://rpc.pingomatic.com/", // http://pingomatic.com/about/ + "http://ping.blo.gs/", // http://blo.gs/ping.php + // "http://rpc.technorati.com/rpc/ping", // http://www.technorati.com/developers/ping.html + "http://rpc.weblogs.com/RPC2", // http://www.xmlrpc.com/weblogsCom + // "http://api.my.yahoo.com/RPC2", // http://my.yahoo.com/s/publishers.html#latepost + // "http://xping.pubsub.com/ping/", + // "http://rpc.blogrolling.com/pinger/", // http://www.blogrolling.com/docs_ping.phtml + // "http://xmlrpc.blogg.de/", // http://blogg.de/extras.php + // "http://ping.syndic8.com/xmlrpc.php", // http://www.syndic8.com/~jeff/blog/index.php?p=5 + // "http://www.snipsnap.org/RPC2", + // "http://api.feedster.com/ping", // http://developers.feedster.com/index.php/FeedsterPingServer + ]; + var title = this.title ? this.title : this.alias; + for (var i in pingers) { // we're doing it the xml-rpc way // (specs at http://newhome.weblogs.com/directory/11) - var xr = new Remote("http://rpc.weblogs.com/RPC2"); + app.log("Pinging " + pingers[i] + " with " + title + ", " + this.href()); + var xr = new Remote(pingers[i]); var ping = xr.weblogUpdates.ping(title, this.href()); if (!ping.result) return; @@ -182,11 +201,14 @@ result.message = ping.result.message; if (result.error) - app.log("Error when notifying weblogs.com for updated site \"" + this.alias + "\": " + result.message); + app.log("Error when notifying " + pingers[i] + " for updated site \"" + this.alias + "\": " + result.message); // lastping is always set to now to prevent blogs // hanging in the scheduler if a fatal error occurs this.lastping = new Date(); + } + + // we return the result of the last pinged service - somewhat cruel but ... return result; } @@ -211,6 +233,17 @@ */ function isNotificationEnabled() { if (root.sys_allowEmails == 1 || root.sys_allowEmails == 2 && this.trusted) + return true; + return false; +} + +/** + * basic check if hiding is enabled for a site + * @param Obj site object + * @return Boolean true if notification is enabled, false otherwise + */ +function isHidingEnabled() { + if (root.sys_allowHiding == 1 && this.trusted) return true; return false; } diff -uNrbB antville-1.1/code/Site/page.skin apps/antville/Site/page.skin --- antville-1.1/code/Site/page.skin Wed Aug 4 13:29:30 2004 +++ apps/antville/Site/page.skin Sun Nov 21 20:31:15 2004 @@ -8,6 +8,7 @@ + diff -uNrbB antville-1.1/code/Site/rsd.xml.hac apps/antville/Site/rsd.xml.hac --- antville-1.1/code/Site/rsd.xml.hac Thu Jan 1 01:00:00 1970 +++ apps/antville/Site/rsd.xml.hac Sun Nov 21 20:26:00 2004 @@ -0,0 +1,21 @@ +/* This is a first attempt at implementing RSD for Antville. + See http://archipelago.phrasewise.com/rsd for further + enlightenment. + + There are still is a difficult Problem: how do I find out if + XML-RPC is enabled and where it is running? + + --md@hudora.de + +*/ + +res.contentType = "text/xml"; + +// try to get hostname from the root +param = new Object(); +pattern = "http://([^:/]+).*"; +exp = new RegExp(pattern, "i"); +param.host = root.getUrl().replace(exp, "$1"); + +this.renderSkin("rsd.xml", param); + diff -uNrbB antville-1.1/code/Site/rsd.xml.skin apps/antville/Site/rsd.xml.skin --- antville-1.1/code/Site/rsd.xml.skin Thu Jan 1 01:00:00 1970 +++ apps/antville/Site/rsd.xml.skin Sun Nov 21 20:28:18 2004 @@ -0,0 +1,13 @@ + + + + Antville / Helma Object Publisher + http://project.antville.org/ + <% site.url %> + + + + + + + diff -uNrbB antville-1.1/code/Site/rss10.skin apps/antville/Site/rss10.skin --- antville-1.1/code/Site/rss10.skin Thu Jan 1 01:00:00 1970 +++ apps/antville/Site/rss10.skin Wed Nov 24 12:29:17 2004 @@ -0,0 +1,37 @@ + + + + + + <% site.title encoding="xml" %><% param.subtitle prefix=" (" suffix=")" %> + <% site.url %> + <% site.tagline encoding="xml" %> + <% param.title encoding="xml" %> + <% param.creator encoding="xml" %><% param.email encoding="xml" prefix=" (mailto:" suffix=")" %> + <% param.lastupdate %> + en + hourly + 1 + 2000-01-01T00:00:00Z + + +<% param.resources %> + + + + + +<% param.items %> + + + find + Search this site: + q + <% site.url action="search" %> + + diff -uNrbB antville-1.1/code/Site/sysmgr_macros.js apps/antville/Site/sysmgr_macros.js --- antville-1.1/code/Site/sysmgr_macros.js Wed Aug 4 13:29:30 2004 +++ apps/antville/Site/sysmgr_macros.js Mon Nov 22 10:29:17 2004 @@ -31,6 +31,8 @@ return; if (this.trusted) res.write("TRUSTED"); + if (this.hidden) + res.write("HIDDEN"); if (!this.online) res.write("PRIVATE"); else diff -uNrbB antville-1.1/code/Site/type.properties apps/antville/Site/type.properties --- antville-1.1/code/Site/type.properties Wed Aug 4 13:29:30 2004 +++ apps/antville/Site/type.properties Mon Nov 22 09:16:26 2004 @@ -19,6 +19,7 @@ diskusage = SITE_DISKUSAGE blocked = SITE_ISBLOCKED trusted = SITE_ISTRUSTED +hidden = SITE_ISHIDDEN createtime = SITE_CREATETIME modifytime = SITE_MODIFYTIME diff -uNrbB antville-1.1/code/Story/securityFunctions.js apps/antville/Story/securityFunctions.js --- antville-1.1/code/Story/securityFunctions.js Wed Aug 4 13:29:31 2004 +++ apps/antville/Story/securityFunctions.js Tue Dec 7 11:20:42 2004 @@ -10,6 +10,8 @@ try { switch (action) { case "main" : + // temporary fix! + // return; this.checkView(usr, level); break; case "edit" : diff -uNrbB antville-1.1/code/SysMgr/objectFunctions.js apps/antville/SysMgr/objectFunctions.js --- antville-1.1/code/SysMgr/objectFunctions.js Wed Aug 4 13:29:31 2004 +++ apps/antville/SysMgr/objectFunctions.js Mon Nov 22 09:54:58 2004 @@ -228,6 +228,8 @@ root.longdateformat = param.longdateformat ? param.longdateformat : null; // short dateformat root.shortdateformat = param.shortdateformat ? param.shortdateformat : null; + // allow hiding + root.sys_allowHiding = param.sys_allowHiding ? true : false; // allow file root.sys_allowFiles = param.sys_allowFiles ? true : false; // disk quota diff -uNrbB antville-1.1/code/SysMgr/setup.skin apps/antville/SysMgr/setup.skin --- antville-1.1/code/SysMgr/setup.skin Wed Aug 4 13:29:31 2004 +++ apps/antville/SysMgr/setup.skin Mon Nov 22 10:12:16 2004 @@ -44,6 +44,10 @@ <% root.shortdateformat as="chooser" width="20" %> +Allow hidden sites: +<% root.sys_allowHiding as="editor" %>
This allows trusted sites to be set to 'hidden'. Hidden sites don't appear in the list of sites on the startpage and adds them to a robots.txt file. + + Allow files: <% root.sys_allowFiles as="editor" %>
Enabling this means that users can upload files.