Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • osian/sucs-site
  • kais58/sucs-site
  • imranh/sucs-site
  • foshjedi2004/sucs-site
  • gigosaurus/sucs-site
  • matstn/sucs-site
  • ripp_/sucs-site
  • eggnog/sucs-site
  • sucssite/sucs-site
  • elbows/sucs-site
  • realitykiller/sucs-site
  • crox/sucs-site
  • vectre/sucs-site
  • welshbyte/sucs-site
  • paperclipman/sucs-site
15 results
Show changes
Showing
with 4049 additions and 1707 deletions
<?php
$smarty->assign("title", "Planet SUCS");
$smarty->assign("rss_url", "http://planet.sucs.org/rss20.xml");
$smarty->assign("atom_url", "http://planet.sucs.org/atom.xml");
// Read planet output from where (we hope) Planet wrote it
$body = file_get_contents($base."static/Community/Planet.txt");
$smarty->assign("body", $body);
?>
<?php
// component to dynamically generate a configuration file for the Planet feed aggregator
global $base;
// where to put the generated config file?
$outputfile = $base."lib/venus/sucs/generatedconfig.ini";
// Where Planet should output its generated files to
$planetoutputdir = $base."htdocs/planet";
$sucsdbname = "sucs";
$hackergotchipath = "/var/www/sucssite/htdocs/pictures/people/";
// open connection to sucs database
$sucsDB = NewADOConnection('postgres8');
$sucsDB->Connect('dbname='.$sucsdbname.' user=apache');
$sucsDB->SetFetchMode(ADODB_FETCH_ASSOC);
// fetch blogroll
$blogroll = $sucsDB->GetAll("SELECT username, blogfeed AS feeduri FROM members WHERE syndicateblog=TRUE");
// figure out whether each user has a hackergotchi picture
foreach($blogroll as &$blog) {
if (is_file($hackergotchipath.$blog['username'].".png")) {
$blog['hackergotchi'] = TRUE;
} else {
$blog['hackergotchi'] = FALSE;
}
}
$smarty->assign("blogroll", $blogroll);
$smarty->assign("planetoutputdir", $planetoutputdir);
$config = $smarty->fetch("planetconfig.tpl");
file_put_contents($outputfile, $config);
?>
<?php
// number of recent planet entries we want to return
$num_entries = 5;
unset($result);
$planetposts = array();
$xmldata = @file_get_contents("../htdocs/planet/atom.xml");
if (!$xmldata) {
trigger_error("No planet atom.xml data loaded", E_USER_WARNING);
return;
}
$simplexml = simplexml_load_string($xmldata);
$xml = $simplexml->children('http://www.w3.org/2005/Atom');
foreach ($xml->entry as $entry) {
$planetposts[] = array(
"post" => $entry->title,
"post_uri" => $entry->link->attributes()->href,
"user" => $entry->author->name,
"user_uri" => $entry->author->uri
);
}
$planetposts = array_slice($planetposts, 0, $num_entries);
$smarty->assign('planetposts', $planetposts);
$result = $smarty->fetch('planetposts.tpl');
?>
<?
include("adodb/adodb.inc.php");
$sucsDB = NewADOConnection('postgres8');
$sucsDB->Connect('dbname=sucs user=apache');
$sucsDB->SetFetchMode(ADODB_FETCH_ASSOC);
<?php
$res = $sucsDB->Execute("select username, sum(pages) as pages from printer where username != 'old' group by username order by sum(pages) desc");
$num = $res->RecordCount();
for ($i=0;$i<$num;$i++) {
$row[$i] = $res->FetchRow();
if ($i < 12)
{
$item[]=$row[$i]['username'];
$slice[]=$row[$i]['pages'];
}
else {
$otherSize += $row[$i]['pages'];
}
}
for ($i = 0; $i < $num; $i++) {
$row[$i] = $res->FetchRow();
if ($i < 12) {
$item[] = $row[$i]['username'];
$slice[] = $row[$i]['pages'];
} else {
$otherSize += $row[$i]['pages'];
}
}
// $itemName[]="Other";
// $sliceSize[]=$otherSize;
$slice = array_merge(array($otherSize),$slice);
$item = array_merge(array("Other"), $item);
$slice = array_merge(array($otherSize), $slice);
$item = array_merge(array("Other"), $item);
/* echo "<pre>";
print_r($slice);
print_r($item);*/
include("../../lib/pieChart.php");
piechart("Top 12, Users of Printing", $slice, $item,0)
?>
include("../../lib/pieChart.php");
piechart("Top 12, Users of Printing", $slice, $item, 0)
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,24 +10,24 @@ $conn = ldap_connect(_LDAP_SERVER);
$search = ldap_search($conn, _BASE_DN, 'uid=*', array('uid', 'cn', 'homedirectory'));
// Sort By Username
ldap_sort($conn, $search, 'uid');
// Produce an array of usernames
$usernames = array();
$entryHandler = ldap_first_entry($conn, $search);
while($entryHandler) {
$username = ldap_get_values($conn, $entryHandler, 'uid');
$fullname = ldap_get_values($conn, $entryHandler, 'cn');
$homedir = ldap_get_values($conn, $entryHandler, 'homedirectory');
$homedir = $homedir[0];
$homedirArray = explode('/', $homedir);
if (($homedirArray[2]=="society") && file_exists( "$homedir/public_html")) {
$usernames[] = array( "username" => $username[0], "fullname" => $fullname[0]);
}
$entryHandler = ldap_next_entry($conn, $entryHandler);
}
// Sort By Username
ldap_sort($conn, $search, 'uid');
// Produce an array of usernames
$usernames = array();
$entryHandler = ldap_first_entry($conn, $search);
while ($entryHandler) {
$username = ldap_get_values($conn, $entryHandler, 'uid');
$fullname = ldap_get_values($conn, $entryHandler, 'cn');
$homedir = ldap_get_values($conn, $entryHandler, 'homedirectory');
$homedir = $homedir[0];
$homedirArray = explode('/', $homedir);
if (($homedirArray[2] == "society") && file_exists("$homedir/public_html")) {
$usernames[] = array("username" => $username[0], "fullname" => $fullname[0]);
}
$entryHandler = ldap_next_entry($conn, $entryHandler);
}
$smarty->assign("societies", $usernames);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
DELETE FROM session;
ALTER TABLE session DROP COLUMN time;
ALTER TABLE session ADD COLUMN logintime timestamp(0) without time zone;
ALTER TABLE session ADD COLUMN lastseen timestamp(0) without time zone;
DELETE FROM menu WHERE title='Bananas';
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.