This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add all plugins.

  • Loading branch information...
felixplesoianu committed May 25, 2017
1 parent 6d209c6 commit cc80ad5eb7d71422fa379bd657431d2bece97585
Showing with 141 additions and 0 deletions.
  1. +31 −0 plugins/adbox.php
  2. +16 −0 plugins/google-search.php
  3. +16 −0 plugins/piwik-code.php5
  4. +56 −0 plugins/rss.php
  5. +22 −0 plugins/wanted.php
View
@@ -0,0 +1,31 @@
<?php
$tpl_vars['footer'] .= <<<ADBOX
<div style="Position: absolute; Top: 8px; Right: 8px;">
<!-- Project Wonderful Ad Box Loader -->
<!-- Put this after the <body> tag at the top of your page -->
<script type="text/javascript">
(function(){function pw_load(){
if(arguments.callee.z)return;else arguments.callee.z=true;
var d=document;var s=d.createElement('script');
var x=d.getElementsByTagName('script')[0];
s.type='text/javascript';s.async=true;
s.src='//www.projectwonderful.com/pwa.js';
x.parentNode.insertBefore(s,x);}
if (window.attachEvent){
window.attachEvent('DOMContentLoaded',pw_load);
window.attachEvent('onload',pw_load);}
else{
window.addEventListener('DOMContentLoaded',pw_load,false);
window.addEventListener('load',pw_load,false);}})();
</script>
<!-- End Project Wonderful Ad Box Loader -->
<!-- Project Wonderful Ad Box Code -->
<div id="pw_adbox_48846_1_0"></div>
<script type="text/javascript"></script>
<noscript><map name="admap48846" id="admap48846"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&c=0&id=48846&type=1" shape="rect" coords="0,0,468,60" title="" alt="" target="_top" rel="nofollow" /></map>
<table cellpadding="0" cellspacing="0" style="width:468px;border-style:none;background-color:#ffffff;"><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=48846&type=1" style="width:468px;height:60px;border-style:none;" usemap="#admap48846" alt="" /></td></tr><tr><td style="background-color:#ffffff;" colspan="1"><center><a style="font-size:10px;color:#0099ff;text-decoration:none;line-height:1.2;font-weight:bold;font-family:Tahoma, verdana,arial,helvetica,sans-serif;text-transform: none;letter-spacing:normal;text-shadow:none;white-space:normal;word-spacing:normal;" href="http://www.projectwonderful.com/advertisehere.php?id=48846&type=1&tag=43058" target="_blank">Ads by Project Wonderful! Your ad here, right now: $0</a></center></td></tr></table>
</noscript>
<!-- End Project Wonderful Ad Box Code -->
</div>
ADBOX;
?>
View
@@ -0,0 +1,16 @@
<?php
$tpl_vars['footer'] .= <<<SEARCH
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1');
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('001887539766011560593:qyujjso27_i');
customSearchControl.setResultSetSize(google.search.Search.SMALL_RESULTSET);
var options = new google.search.DrawOptions();
options.setAutoComplete(true);
customSearchControl.draw('cse', options);
}, true);
</script>
SEARCH;
?>
View
@@ -0,0 +1,16 @@
<?php
$tpl_vars['footer'] .= <<<TRACKCODE
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.plesoianu.ro/" : "http://stats.plesoianu.ro/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 6);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://stats.plesoianu.ro/piwik.php?idsite=6" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
TRACKCODE;
?>
View
@@ -0,0 +1,56 @@
<?php
// Change this if you know better.
$tpl_vars['site_link'] = 'http://' . $_SERVER['SERVER_NAME']
. dirname($_SERVER['SCRIPT_NAME']);
// Set to any text you like.
$tpl_vars['site_desc'] = 'Home of the WabiSabi wiki engine';
$tpl_vars['head'] .= '<link rel="alternate" type="application/rss+xml"
href="' . $tpl_vars['site_link'] . '?action=rss">';
$tpl_vars['actions'] .= ' | <a href="?action=rss" class="rss">RSS</a> ';
$wiki_rss_template = <<<NEWSFEED
<rss version="2.0">
<channel>
<title>WabiSabi</title>
<link>\$site_link</link>
<description>\$site_desc</description>
\$items
</channel>
</rss>
NEWSFEED;
$wiki_rss_item_template = <<<NEWSITEM
<item>
<title>\$page_title</title>
<pubDate>\$last_mod</pubDate>
<link>\$site_link?\$page_name</link>
</item>
NEWSITEM;
function wiki_action_rss(&$tpl_vars) {
global $wiki_rss_template, $wiki_rss_item_template;
$pagemtimes = page_list('*.txt');
arsort($pagemtimes);
$pagemtimes = array_slice($pagemtimes, 0, 15);
$feed_vars = array(
'site_link' => $tpl_vars['site_link'],
'site_desc' => $tpl_vars['site_desc'],
'items' => '');
$item_vars = array('site_link' => $tpl_vars['site_link']);
foreach ($pagemtimes as $fname => $mtime) {
$item_vars['page_name'] = substr($fname, 0, -4);
$item_vars['page_title'] =
strtr($item_vars['page_name'], '_', ' ');
$item_vars['last_mod'] = date('D, F d Y H:i:s T', $mtime);
$feed_vars['items'] .=
tpl_render($wiki_rss_item_template, $item_vars);
}
header('Content-type: application/rss+xml');
print '<?xml version="1.0" encoding="utf-8"?>' . "\n";
print tpl_render($wiki_rss_template, $feed_vars);
exit;
}
?>
View
@@ -0,0 +1,22 @@
<?php
// Compile a list of links to non-existent pages from the wiki content.
function wiki_action_wanted(&$tpl_vars) {
$pagemtimes = page_list('*.txt');
//asort($pagemtimes);
//$pagemtimes = array_slice($pagemtimes, 0, 50);
$wanted = array();
foreach ($pagemtimes as $fname => $mtime) {
$page_text = @file_get_contents(PAGE_DIR . '/' . $fname);
preg_match_all('/' . WIKIWORD . '/', $page_text, $matches);
foreach ($matches[0] as $page_name) {
$wfname = "$page_name.txt";
if (!file_exists(PAGE_DIR . '/' . $wfname))
$wanted[$wfname] = $mtime;
}
}
asort($wanted);
$tpl_vars['page_title'] = 'Wanted pages';
$tpl_vars['page_text'] = page_list_format($wanted);
}
$tpl_vars['actions'] .= ' | <a href="?action=wanted">Wanted pages</a> ';
?>

0 comments on commit cc80ad5

Please sign in to comment.