// //''Name:'' Blog\n// //''Version:'' 0.1\n// //''Author:'' [[Anshul Nigham|http://yavin4.anshul.info]] (adapted from an earlier plugin by [[ClintChecketts|http://www.checkettsweb.com/]]) \n// //''Type:'' Plugin\n// //''Description:'' Posts the most recently edited tiddlers when the TiddlyWiki is opened, similar to a blog.\n// //''Syntax:'' Change the daysOrPosts and numOfDaysOrPosts variables below\n// // If daysOrPosts variable is "days", tiddlers from the past numOfDaysOrPosts dates will be displayed\n// // If daysOrPosts variable is "posts", the past numOfDaysOrPosts tiddlers will be displayed \n\n// // ''Tested against:'' Tiddlywiki 2.1.3\n\n// // ''HOWTO:'' Simply copy this entire tiddler and paste it into a new tiddler in your own tiddlywiki.\n// // Tag it with systemConfig, and also with systemTiddlers if you don't want it to appear within the blog views. Name it anything you like\n\nvar daysOrPosts = "posts";\nvar numOfDaysOrPosts = "10";\n\nfunction displayTopTiddlers()\n{\n if(window.location.hash) daysOrPosts = "";\n if(daysOrPosts == "posts")\n {\n var tiddlerNames = store.reverseLookup("tags","systemTiddlers",false,"modified");\n if (tiddlerNames.length < numOfDaysOrPosts)\n numOfDaysOrPosts = tiddlerNames.length;\n for(var t = tiddlerNames.length-numOfDaysOrPosts;t<=tiddlerNames.length-1;t++)\n story.displayTiddler("top",tiddlerNames[t].title,DEFAULT_VIEW_TEMPLATE,false,false);\n }\n if (daysOrPosts == "days"){\n var lastDay = "";\n var tiddlerNames = store.reverseLookup("tags","systemTiddlers",false,"modified");\n var t = tiddlerNames.length -1;\n var tFollower = 0;\n for(t;t>=0;t--) if(numOfDaysOrPosts >= 0){\n var theDay = tiddlerNames[t].modified.convertToYYYYMMDDHHMM().substr(0,8);\n if(theDay != lastDay){\n numOfDaysOrPosts = numOfDaysOrPosts -1;\n lastDay = theDay;\n tFollower = t;\n }\n }\n\n for(tFollower = tFollower+1; tFollower < tiddlerNames.length;tFollower++){\n displayTiddler("top",tiddlerNames[tFollower].title,DEFAULT_VIEW_TEMPLATE,false,false);\n }\n\n }\n}\n\nwindow.original_restart = window.restart;\nwindow.restart = function()\n{\n window.original_restart();\n displayTopTiddlers();\n}\n
// //''Name:'' Blog\n// //''Version:'' 0.1.1\n// //''Author:'' [[Anshul Nigham|http://yavin4.anshul.info]] (adapted from an earlier plugin by [[ClintChecketts|http://www.checkettsweb.com/]]) \n// //Tag support given by [[Emmanuel Frécon|http://www.sics.se/~emmanuel/]]\n// //''Type:'' Plugin\n// //''Description:'' Posts the most recently edited tiddlers when the TiddlyWiki is opened, similar to a blog.\n// //''Syntax:'' Change the daysOrPosts and numOfDaysOrPosts variables below\n// // If daysOrPosts variable is "days", tiddlers from the past numOfDaysOrPosts dates will be displayed\n// // If daysOrPosts variable is "posts", the past numOfDaysOrPosts tiddlers will be displayed \n// // The restrictTag variable contains the tag that all entries should contain\n// // for appearing as blog entries. Other entries will not appear, except for\n// // those coming from the the defaultTiddlers. If the variable is an empty\n// // string, then the behaviour is the same version 0.1 (below).\n\n// // ''Tested against:'' Tiddlywiki 2.1.3\n\n// // ''HOWTO:'' Simply copy this entire tiddler and paste it into a new tiddler in your own tiddlywiki.\n// // Tag it with systemConfig, and also with systemTiddlers if you don't want it to appear within the blog views. Name it anything you like\n\nvar daysOrPosts = "days";\nvar numOfDaysOrPosts = "7";\nvar restrictTag = "";\n\nfunction displayTopTiddlers()\n{\n if(window.location.hash) daysOrPosts = "";\n if(daysOrPosts == "posts")\n {\n var tiddlerNames = store.reverseLookup("tags","systemTiddlers",false,"modified");\n if (tiddlerNames.length < numOfDaysOrPosts)\n numOfDaysOrPosts = tiddlerNames.length;\n for(var t = tiddlerNames.length-numOfDaysOrPosts;t<=tiddlerNames.length-1;t++)\n if (restrictTag == "" || tiddlerNames[t].isTagged(restrictTag))\n story.displayTiddler("top",tiddlerNames[t].title,DEFAULT_VIEW_TEMPLATE,false,false);\n }\n if (daysOrPosts == "days"){\n var lastDay = "";\n var tiddlerNames = store.reverseLookup("tags","systemTiddlers",false,"modified");\n var t = tiddlerNames.length -1;\n var tFollower = 0;\n for(t;t>=0;t--) if(numOfDaysOrPosts >= 0){\n var theDay = tiddlerNames[t].modified.convertToYYYYMMDDHHMM().substr(0,8);\n if(theDay != lastDay){\n numOfDaysOrPosts = numOfDaysOrPosts -1;\n lastDay = theDay;\n tFollower = t;\n }\n }\n\n for(tFollower = tFollower+1; tFollower < tiddlerNames.length;tFollower++){\n if (restrictTag == "" || tiddlerNames[tFollower].isTagged(restrictTag))\n displayTiddler("top",tiddlerNames[tFollower].title,DEFAULT_VIEW_TEMPLATE,false,false);\n }\n\n }\n}\n\nwindow.original_restart = window.restart;\nwindow.restart = function()\n{\n window.original_restart();\n displayTopTiddlers();\n}\n
Blog plugin for tiddlywiki 2.1.3
Blog Wiki