|
|
Indonesie actie
de eindstand...
Eind vorig jaar hielden wij een actie om geld in te zamelen voor de oprichting van een Engelse school in Indonesië.
Het heeft even op zich laten wachten omdat we met het definitieve bericht wilden wachten op de ontvangsbevestiging van Ursula in Indonesië. Gisteren was het zover. Een enthousiast mailtje uit Indonesie:
Dear Harold and Corine,
Greetings from Indonesia. Thank you very much for the funds. I received the news from Yohanes Lelan today that the money already arrieved with the total amount 20, 499, 388 IDR. John is now helping me to provide school equipments with that money.
With regard to the school, I have already started with 6 kinder students, 8 elementary students, 13 secondary students, and 10 high school students since the begining of January, though there are still some problems regarding the building and school facilities.
In relation to the building, the owner of the building just canceled the agreement to use and renovate the building. In fact, We have made an agreement that I could just renovate the building.
So now I have to look for the new building to rent it. John will help me in this matter after he arrives from Java next month. He is now in Java to fix some papers since he resigned as an English Teacher and School Counselor in one of the International Shool in Jakarta.
I will give you the detail of this matter after I fix everything. Once again, thank you very much for the funds.
Please extend our kind regards to our donors.
Kind regards,
Ursula
De totale opbrengst van de actie was uiteindelijk maar liefst 2145 euro. Omdat het veel meer was dan het bedrag waar Ursula om heeft gevraagd (1300 euro), hebben we in overleg met mijn moeder en Corines zus besloten om 400 euro van dat totaal (een deel van onze eigen en hun giften) over te maken naar een andere Nederlands-Indonesische stichting die met een kleine staf en vrijwilligers onvoorstelbaar goed werk verrichten in de sloppenwijken van Jakarta. Corine en ik hebben die stichting ( www.stichtinglestari.nl) vorig jaar bezocht. Een kort verslag met foto´s van dat project is hier te zien. Alle fondsen die bij de Nederlandse stichting binnenkomen gaan volledig door naar Indonesië. De stichting draait in Nederland helemaal met vrijwilligers.
Er is dus 1745 euro overgemaakt naar Ursula. Met dat geld kan ze ruimschoots alle leermiddelen en inventaris aanschaffen die ze nodig heeft voor haar school.
Namens Ursula heel hartelijk dank aan de donateurs voor de onvoorstelbare steun aan dit project. De donateurs mogen bij ons de financiën komen inkijken om te controleren of het geld inderdaad allemaal is doorgestuurd.
© Harold Makaske 1 februari 2007
/*
History:
v1.1
- add getTableList
v1.2
- use sql_table
- Added silent mode (configure via option) to support NP_MostViews
- Added Cleanup upon uninstall option
- Added "just number" minimalist mode
- Added supportsFeature
V1.2a
- Added min version support
V1.3
- Replaced doSkinVar with DoTemplateVar
V1.3a
- Added repeat views ignore function aka repeat F5s from those bored and lonely one
V1.3b
- Fixed counting off by 1 bug
V1.3c
- Added <%Views(skipCount)%> to allow skipping count when used in template (ie to not count on click in main page)
V1.4
- Fixed ignoe same IP count problem
V1.5
- Added views_log table and changed plugin performance to check for unique visits by IP address. [gRegor]
- Added option to set the length of time before re-counting hits from the same IP address (default: 2 hours) [gRegor]
V1.6
- Added plugin menu to display all view count, w/ counter reset function
- Delete view counter and log for deleted item
V1.7
- use sql_query
V1.8
- Admin page enhancement to preserve order and sort info
v1.9
- Added item title in admin menu
v1.9.1
- ignore draft in admin menu
*/
class NP_Views extends NucleusPlugin {
// Note: I never run this plugin on 2.0 and have no idea whether it
// wil work on <2.5. A user can simply chnage it to return
// '200' and see if it works (likely will). I will gladly
// change the min version to 2.0 and add the sql_table fix
// upon such report. 8)
function getMinNucleusVersion() {
return '250';
}
function getName() {
return 'Views';
}
function getAuthor() {
return 'Rodrigo Moraes | Edmond Hui (admun) | gRegor Morrill';
}
function getURL() {
return 'http://www.tipos.com.br';
}
function getVersion() {
return '1.9.1';
}
function getDescription() {
return 'This plugin counts how many times an entry has been displayed.';
}
function getEventList() {
return array('PostAddItem', 'QuickMenu', 'PostDeleteItem');
}
function supportsFeature($what) {
switch($what) {
case 'SqlTablePrefix':
return 1;
default:
return 0;
}
}
function getTableList() {
return array( sql_table('plugin_views'), sql_table('plugin_views_log') );
}
function install() {
sql_query('CREATE TABLE IF NOT EXISTS ' . sql_table('plugin_views') . ' (id int(11) NOT NULL default "0", views int(15) NOT NULL default "0")');
sql_query('CREATE TABLE IF NOT EXISTS ' . sql_table('plugin_views_log') . ' (id int(11) NOT NULL auto_increment, ip varchar(20) NOT NULL default "", itemid int(11) NOT NULL default "0", viewtime varchar(32) NOT NULL default "", PRIMARY KEY (id)
)');
$this->createOption('silent','Silent mode - No #Display shown in Item (still need to add the skinVar, for use with MostViewed)','yesno','no');
$this->createOption('deletetables','Delete this plugin\'s table and data when uninstalling?','yesno','yes');
$this->createOption('timespan', 'Hours to wait before re-counting visitors', 'text', '2');
}
function unInstall() {
if ($this->getOption('deletetables') == 'yes') {
sql_query('DROP TABLE ' . sql_table('plugin_views') );
sql_query('DROP TABLE ' . sql_table('plugin_views_log') );
}
}
function hasAdminArea() {
return 1;
}
/**
* Adds an entry to the 'Quick Menu' on the Nucleus administration pages.
* The entry will link to the commentcontrol admin page
*/
function event_QuickMenu(&$data) {
global $member;
if (!($member->isLoggedIn() && $member->isAdmin())) return;
array_push(
$data['options'],
array(
'title' => 'View Counts',
'url' => $this->getAdminURL(),
'tooltip' => 'See the view count of all items'
)
);
}
function doTemplateVar(&$item, $input) {
$itemid = $item->itemid;
$remote_ip = ServerVar('REMOTE_ADDR');
$timespan = $this->getOption('timespan') * 3600;
$now = time();
// get the current Views count
$query = "SELECT views FROM " . sql_table('plugin_views') . " WHERE id=" . $itemid;
$result = sql_query($query);
$row = mysql_fetch_object($result);
$views = intval($row->views);
// Only do count updates if "skipcount" is not set
if ($input != 'skipcount')
{
// This takes care of previous items
if (mysql_num_rows($result) == 0)
{
$query = "INSERT INTO " . sql_table('plugin_views') . " (id, views) VALUES('$itemid', '1')";
sql_query($query);
//$views = 0;
} // end if
// Check the views_log table to see if this IP has a viewtime for this item
$query = "SELECT viewtime FROM " . sql_table('plugin_views_log') . " WHERE ip='" . $remote_ip . "' AND itemid=" . $itemid;
$result = sql_query($query);
// No views from this IP in the past X hours, so update the Views count
if (mysql_num_rows($result) == 0)
{
$views++;
$this->_updateViewsCount($itemid, $views);
$this->_addViewsLog($itemid, $remote_ip, $now);
} // end if
else
{
$viewtime = mysql_result($result, 0, 'viewtime');
// It's been longer than X hours, so recount
if (($now - $timespan) > $viewtime)
{
$views++;
$this->_updateViewsCount($itemid, $views);
$this->_updateViewsLog($itemid, $remote_ip, $now);
}
} // end else
} // end if
// Clear logs that are more than X hours old
$time = $now - $timespan;
$query = "DELETE FROM " . sql_table('plugin_views_log') . " WHERE (viewtime < $time)";
sql_query($query);
if ($this->getOption('silent') == 'no') {
echo $views;
} // end if
}
function event_PostAddItem($data) {
$itemid = $data['itemid'];
$query = "INSERT INTO " . sql_table('plugin_views') . " (id, views) VALUES('$itemid', '0')";
sql_query($query);
}
function event_PostDeleteItem($data) {
$itemid = $data['itemid'];
$query = "DELETE FROM " . sql_table('plugin_views') . " WHERE id=". $itemid;
sql_query($query);
$query = "DELETE FROM " . sql_table('plugin_views_log') . " WHERE itemid=". $itemid;
sql_query($query);
}
function _updateViewsCount($itemid, $views) {
// update the Views table with the new count
$query = "UPDATE " . sql_table('plugin_views') . " SET views='$views' WHERE id=$itemid";
sql_query($query);
}
function _addViewsLog($itemid, $ip, $time) {
// add IP and itemid to views_log table so it won't be recounted for X hours
$query = "INSERT INTO " . sql_table('plugin_views_log') . " (ip, itemid, viewtime) VALUES ('$ip', '$itemid', '$time')";
sql_query($query);
}
function _updateViewsLog($itemid, $ip, $time) {
// update the views_log viewtime so it won't be recounted for X hours
$query = "UPDATE " . sql_table('plugin_views_log') . " SET viewtime='$time' WHERE ip='$ip'";
sql_query($query);
}
function doAction($actionType) {
global $CONF, $member;
if (!($member->isLoggedIn() && $member->isAdmin())) return 'Sorry. not allowed';
if ($actionType == 'resetview'){
$id = requestVar('id');
$query = "UPDATE " . sql_table('plugin_views') . " SET views=0 WHERE id=$id";
sql_query($query);
} else if ($actionType == 'resetallview') {
$query = "UPDATE " . sql_table('plugin_views') . " SET views=0";
sql_query($query);
}
$order = requestVar('order');
$sort = requestVar('sort');
header('Location: ' . $CONF['PluginURL'] . 'views/index.php?sort=' . $sort . '&order='.$order);
}
}
?>
-
Hoofdstuk: 1. Belevenissen
|