public function __construct() { parent::__construct('duplicatePubs', 'Duplicate Publications', 'diag/duplicatePubs.php'); if ($this->loginError) { return; } echo '<h1>Publications with same title</h1>', 'Note that some publications may exist both in a conference ', 'and later in time in a journal.'; $all_pubs = pdPubList::create($this->db); $titles = array(); foreach ($all_pubs as $pub) { $titles[] = array($pub, preg_replace('/\\s\\s+/', ' ', strtolower($pub->title))); } //$this->debugVar('titles', $titles); $count = 1; for ($i = 0, $n = count($titles); $i < $n - 1; ++$i) { for ($j = $i + 1; $j < $n; ++$j) { if ($titles[$i][1] == $titles[$j][1]) { echo '<h2>Match ', $count, '</h2>'; $titles[$i][0]->dbLoad($this->db, $titles[$i][0]->pub_id); $titles[$j][0]->dbLoad($this->db, $titles[$j][0]->pub_id); echo $this->citationGet($titles[$i][0]), '<br/>', $this->citationGet($titles[$j][0]); ++$count; } } } }
public function __construct() { parent::__construct('check_attachments', 'Check Attachments', 'diag/check_attachments.php'); if ($this->loginError) { return; } $pub_list = pdPubList::create($this->db); foreach ($pub_list as $pub) { $pub->dbLoad($this->db, $pub->pub_id); $paper_arr = split('paper_', $pub->paper); if (isset($paper_arr[1])) { if ($paper_arr[1] == '') { continue; } $this->checkAtt($pub->pub_id, $pub->paper, $paper_arr[1], 0); } if (count($pub->additional_info) > 0) { foreach ($pub->additional_info as $att) { $paper_arr = split('additional_', $att->location); $this->checkAtt($pub->pub_id, $att->location, $paper_arr[1], 1); } } unset($pub); } }
public function __construct() { parent::__construct('cv', null, false); if ($this->loginError) { return; } $this->loadHttpVars(); if (!isset($this->pub_ids)) { $this->pageError = true; return; } $pubs = explode(',', $this->pub_ids); if (!is_array($pubs) || count($pubs) == 0) { $this->pageError = true; return; } $pub_list = pdPubList::create($this->db, array('pub_ids' => $pubs)); if (empty($pub_list) || count($pub_list) == 0) { $this->pageError = true; return; } $pub_count = 0; foreach ($pub_list as $pub) { $pub_count++; $result = $pub->dbLoad($this->db, $pub->pub_id); if ($result === false) { $this->pageError = true; return; } echo '<b>[', $pub_count, ']</b> ', $pub->getCitationText(), '<p/>'; } }
public function __construct() { parent::__construct('delete_author', 'Delete Author', 'Admin/delete_author.php'); if ($this->loginError) { return; } $this->loadHttpVars(); if (!isset($this->author_id) || !is_numeric($this->author_id)) { $this->pageError = true; return; } $author = new pdAuthor(); $result = $author->dbLoad($this->db, $this->author_id); if (!$result) { $this->pageError = true; return; } $pub_list = pdPubList::create($this->db, array('author_id' => $this->author_id)); if (isset($pub_list) && count($pub_list) > 0) { echo 'Cannot delete Author <b>', $author->name, '</b>.<p/>', 'The author has the following publications in the database:', displayPubList($this->db, $pub_list, true, -1, null, null, '../'); return; } $form =& $this->confirmForm('deleter'); $form->addElement('hidden', 'author_id', $this->author_id); if ($form->validate()) { $values = $form->exportValues(); // This is where the actual deletion happens. $name = $author->name; $author->dbDelete($this->db); echo 'You have successfully removed the following author from the database:', '<p/><b>', $name, '</b>'; } else { if (!isset($this->author_id) || !is_numeric($this->author_id)) { $this->pageError = true; return; } $renderer = new HTML_QuickForm_Renderer_QuickHtml(); $form->accept($renderer); $table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0')); $table->addRow(array('Name:', $author->name)); if (isset($author->title) && trim($author->title != '')) { $table->addRow(array('Title:', $author->title)); } $table->addRow(array('Email:', $author->email)); $table->addRow(array('Organization:', $author->organization)); $cell = ''; if (isset($author->webpage) && trim($author->webpage != '')) { $cell = '<a href="' . $author->webpage . '">' . $author->webpage . '</a>'; } else { $cell = "none"; } $table->addRow(array('Web page:', $cell)); $table->updateColAttributes(0, array('class' => 'emph', 'width' => '25%')); echo '<h3>Delete Author</h3><p/>Delete the following author?'; $this->form =& $form; $this->renderer =& $renderer; $this->table =& $table; } }
private function pubByYears() { $pub_years = pdPubList::create($this->db, array('year_list' => true)); if (empty($pub_years) || count($pub_years) == 0) { return; } $table = new HTML_Table(array('class' => 'nomargins', 'width' => '60%')); $text = ''; foreach (array_values($pub_years) as $item) { $text .= '<a href="list_publication.php?year=' . $item['year'] . '">' . $item['year'] . '</a> '; } $table->addRow(array($text)); echo '<h2>Publications by Year:</h2>', $table->toHtml(); }
public function __construct() { parent::__construct('publist_citations', 'Publication List Citations', 'diag/publist_citations.php', pdNavMenuItem::MENU_NEVER); if ($this->loginError) { return; } $pub_ids = array(736, 737, 807, 828, 842, 858, 870, 871, 874, 875, 876, 877, 879, 894, 895, 896, 898, 900, 901, 906, 907, 908, 910, 911, 912, 914, 915, 916, 917, 921, 922, 923, 925, 926, 927, 928, 929, 930, 936, 941); $additional = array(); foreach ($pub_ids as $pub_id) { $additional[$pub_id] = $pub_id; } $pub_list = pdPubList::create($this->db, array('pub_ids' => $pub_ids, 'sort' => false)); uasort($pub_list, array('pdPublication', 'pubsDateSortDesc')); echo displayPubList($this->db, $pub_list, true, -1, $additional); }
public function renderForm() { $sp =& $_SESSION['search_params']; $renderer =& $this->form->defaultRenderer(); $this->form->accept($renderer); $pubs = pdPubList::create($this->db, array('cat_pub_ids' => $_SESSION['search_results'])); if ($pubs == null) { return; } echo $renderer->toHtml(); echo displayPubList($this->db, $pubs, true, -1, null, array('show_internal_info' => $sp->show_internal_info == 'yes')); $searchLinkTable = new HTML_Table(array('id' => 'searchlink', 'border' => '0', 'cellpadding' => '0', 'cellspacing' => '0')); $search_url =& $_SESSION['search_url']; $searchLinkTable->addRow(array('<a href="' . $search_url . '">' . '<img src="images/link.gif" title="view" alt="view" ' . 'height="16" width="16" border="0" align="top" />' . ' Link to this search</a></div><br/>')); echo '<hr/>', $searchLinkTable->toHtml(); }
public function __construct() { parent::__construct('bibtex', null, false); if ($this->loginError) { return; } $this->loadHttpVars(); if (!isset($this->pub_ids)) { $this->pageError = true; return; } $pubs = explode(',', $this->pub_ids); if (!is_array($pubs) || count($pubs) == 0) { $this->pageError = true; return; } $pub_list = pdPubList::create($this->db, array('pub_ids' => $pubs)); if (!is_array($pub_list) || count($pub_list) == 0) { $this->pageError = true; return; } $table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '0', 'cellspacing' => '0')); $table->setAutoGrow(true); $pub_count = 0; foreach ($pub_list as $pub) { $pub_count++; $result = $pub->dbLoad($this->db, $pub->pub_id); if ($result === false) { $this->pageError = true; return; } $table->addRow(array('<pre>' . $pub->getBibtex() . '</pre>')); } // now assign table attributes including highlighting for even and odd // rows for ($i = 0; $i < $table->getRowCount(); $i++) { if ($i & 1) { $table->updateRowAttributes($i, array('class' => 'even'), true); } else { $table->updateRowAttributes($i, array('class' => 'odd'), true); } } $table->updateColAttributes(0, array('class' => 'publist'), true); echo $table->toHtml(); }
public function __construct() { parent::__construct('delete_category', 'Delete Category', 'Admin/delete_category.php'); if ($this->loginError) { return; } $this->loadHttpVars(); if (!isset($this->cat_id)) { echo 'No category id defined'; $this->pageError = true; return; } else { if (!is_numeric($this->cat_id)) { $this->pageError = true; return; } } $category = new pdCategory(); $result = $category->dbLoad($this->db, $this->cat_id); if (!$result) { $this->pageError = true; return; } $pub_list = pdPubList::create($this->db, array('cat_id' => $this->cat_id)); if (isset($pub_list) && count($pub_list) > 0) { echo 'Cannot delete category <b>', $category->category, '</b>.<p/>', 'The category is used by the following publications:', "\n", displayPubList($this->db, $pub_list); return; } $form =& $this->confirmForm('deleter'); $form->addElement('hidden', 'cat_id', $this->cat_id); $renderer =& $form->defaultRenderer(); $form->accept($renderer); if ($form->validate()) { $values = $form->exportValues(); // This is where the actual deletion happens. $category->dbDelete($this->db); echo 'Category <b>', $category->category, '</b> removed from the database.'; } else { echo '<h3>Confirm</h3>Delete category <b>', $category->category, '</b>?<p/>'; $this->form =& $form; $this->renderer =& $renderer; } }
public function __construct() { parent::__construct('delete_venue', 'Delete Venue', 'Admin/delete_venue.php'); if ($this->loginError) { return; } $this->loadHttpVars(); if (!isset($this->venue_id) || !is_numeric($this->venue_id)) { $this->pageError = true; return; } $venue = new pdVenue(); $result = $venue->dbLoad($this->db, $this->venue_id); if (!$result) { $this->pageError = true; return; } $pub_list = pdPubList::create($this->db, array('venue_id' => $this->venue_id)); if (isset($pub_list) && count($pub_list) > 0) { echo 'Cannot delete venue <b>', $venue->nameGet(), '</b>.<p/>', 'The venue is used by the following ', 'publications:', "\n", displayPubList($this->db, $pub_list, true, -1, null, null, '../'); return; } $form =& $this->confirmForm('deleter'); $form->addElement('hidden', 'venue_id', $venue->venue_id); if ($form->validate()) { $venue->dbDelete($this->db); echo 'Venue <b>', $venue->title, '</b> successfully removed from database.'; } else { $renderer =& $form->defaultRenderer(); $form->accept($renderer); if ($venue->title != '') { $disp_name = $venue->title; } else { $disp_name = $venue->nameGet(); } echo '<h3>Confirm</h3><p/>', 'Delete Venue <b>', $disp_name, '</b> from the database?'; $this->form =& $form; $this->renderer =& $renderer; } }
public function __construct() { parent::__construct('validate_publications'); if ($this->loginError) { return; } $pub_ids = array(); $q = $this->db->select('pub_pending', 'pub_id'); if (count($q) == 0) { echo 'There are no publicaiton entries requiring validation.'; return; } foreach ($q as $r) { $pub = new pdPublication($r); $pub_ids[] = $r->pub_id; } $pub_list = pdPubList::create($this->db, array('pub_ids' => $pub_ids, 'sort' => false)); uasort($pub_list, array('pdPublication', 'pubsDateSortDesc')); echo "<h3>The following publications requrie validation</h3>\n", "Please view or edit each entry separately.<br/>\n"; // add additional parameter to the view icon echo preg_replace('/pub_id=(\\d+)/', 'pub_id=${1}&submit_pending=true', displayPubList($this->db, $pub_list, true, -1, null, null, '../')); }
protected function getAllAicmlAuthoredPapers() { $pubs = array(); // first get publications by PIs foreach (self::$aicml_authors['pi'] as $name) { $author_pubs = pdPubList::create($this->db, array('author_name' => $name, 'date_start' => self::$author_dates[$name][0], 'date_end' => self::$author_dates[$name][1], 'pub_id_keys' => true, 'keyword' => 'machine learning')); $pubs = $this->pubsArrayMerge($pubs, $author_pubs); } // now get publications by AICML PDFs, students and staff members $this->getPdfStudentsAndStaff(); foreach ($this->aicml_pdf_students_staff_authors as $author) { $author_pubs = pdPubList::create($this->db, array('author_name' => $author, 'date_start' => self::$fiscal_years[4][0], 'date_end' => self::$fiscal_years[0][1], 'pub_id_keys' => true)); $pubs = $this->pubsArrayMerge($pubs, $author_pubs); } return $pubs; }
public function __construct() { parent::__construct('list_venues'); if ($this->loginError) { return; } $this->loadHttpVars(true, false); if (!isset($this->tab)) { $this->tab = 'A'; } else { if (strlen($this->tab) != 1 || ord($this->tab) < ord('A') || ord($this->tab) > ord('Z')) { $this->pageError = true; return; } } $venue_list = pdVenueList::create($this->db, array('starting_with' => $this->tab, 'cat_id' => $this->cat_id)); $this->category = new pdCategory(); $this->category->dbLoad($this->db, $this->cat_id); $form = new HTML_QuickForm('cat_selection', 'get', 'list_venues.php'); $form->addElement('hidden', 'tab', $this->tab); $form->addElement('select', 'cat_id', 'Category:', array('' => '-- All Categories --') + pdCatList::create($this->db), array('onchange' => 'update();')); $renderer =& $form->defaultRenderer(); $form->accept($renderer); $form->setDefaults(array('cat_id' => '')); $alpha_menu = $this->alphaSelMenu($this->tab, get_class($this) . '.php'); // put category id in the alpha menu if (!empty($this->cat_id)) { $alpha_menu = preg_replace('/tab=(\\w)/', "tab=\\1&cat_id={$this->cat_id}", $alpha_menu); } $this->javascript(); echo $alpha_menu; echo '<h2>Publication Venues</h2>'; echo $renderer->toHtml(); if (empty($venue_list) || count($venue_list) == 0) { echo 'No venues with name starting with ', $this->tab, '<br/>'; return; } foreach ($venue_list as $venue) { // only show global venues if ($venue->v_usage == 'single') { continue; } $venue->dbLoad($this->db, $venue->venue_id); $table = new HTML_Table(array('class' => 'publist')); $cells = array(); $text = ''; if ($venue->title != '') { $text .= '<b>' . $venue->title . '</b><br/>'; } $v_cat = $venue->categoryGet(); if (!empty($v_cat)) { $text .= '<b>' . ucfirst($v_cat) . '</b>: '; } $url = $venue->urlGet(); if ($url != null) { $text .= '<a href="' . $url . '" target="_blank">'; } $text .= $venue->nameGet(); if ($url != null) { $text .= '</a>'; } if (!empty($venue->options)) { $vopt_names = $venue->voptsGet(); foreach ($venue->options as $vopt_id => $value) { if (!empty($value)) { $text .= '<br/><b>' . $vopt_names[$vopt_id] . '</b>: ' . $value; } } } if ($venue->editor != '') { $text .= "<br/><b>Editor: </b>" . $venue->editor; } if (isset($venue->ranking)) { $text .= '<br/><b>Ranking</b>: ' . $venue->ranking; } // display occurrences if (count($venue->occurrences) > 0) { foreach ($venue->occurrences as $occ) { $text .= '<br/>'; $date = explode('-', $occ->date); if ($occ->url != '') { $text .= '<a href="' . $occ->url . '" target="_blank">'; } $text .= $date[0]; if ($occ->url != '') { $text .= '</a>'; } if ($occ->location != '') { $text .= ', ' . $occ->location; } } } else { if ($venue->date != '' && $venue->date != '0000-00-00') { $date = explode('-', $venue->date); $text .= "<br/><b>Date: </b>" . $date[0] . '-' . $date[1]; } } $pub_count = pdPubList::create($this->db, array('venue_id_count' => $venue->venue_id)); $text .= '<a href="list_publication.php?venue_id=' . $venue->venue_id . '&menu=0"><span class="small" style="color:#000;font-weight:normal;">' . '<br/>Publication entries: ' . $pub_count . '</span></a>'; $cells[] = $text; if ($this->access_level > 0) { $cells[] = $this->getVenueIcons($venue); } $table->addRow($cells); $table->updateColAttributes(1, array('class' => 'icons'), NULL); echo $table->toHtml(); unset($table); } }
public function duplicateTitleCheck($db) { assert('is_object($db)'); $myTitleLower = preg_replace('/\\s\\s+/', ' ', strtolower($this->title)); $all_pubs = pdPubList::create($db); $similarPubs = array(); if (empty($all_pubs) || count($all_pubs) == 0) { return $similarPubs; } foreach ($all_pubs as $pub) { $pubTitleLower = preg_replace('/\\s\\s+/', ' ', strtolower($pub->title)); if (isset($this->pub_id) && $this->pub_id == $pub->pub_id) { continue; } if ($myTitleLower == $pubTitleLower) { $similarPubs[] = $pub->pub_id; } } return $similarPubs; }
/** * */ public function publicationsDbLoad(&$db) { assert('is_object($db)'); assert('isset($this->author_id)'); assert('$this->dbLoadFlags & (self::DB_LOAD_PUBS_MIN | self::DB_LOAD_PUBS_ALL)'); $this->totalPublications = pdPubList::authorNumPublications($db, $this->author_id); // if self::DB_LOAD_PUBS_MIN flag is set and the author has // published more than 6 papers, then load nothing $numToLoad = 0; if ($this->dbLoadFlags & self::DB_LOAD_PUBS_MIN && $this->totalPublications <= 6) { $numToLoad = $this->totalPublications; } if ($this->dbLoadFlags & self::DB_LOAD_PUBS_ALL) { $numToLoad = $this->totalPublications; } if ($numToLoad > 0) { $this->pub_list = pdPubList::create($db, array('author_id' => $this->author_id, 'num_to_load' => $numToLoad)); } }
<?php //#!/usr/bin/env php require_once '../includes/defines.php'; require_once 'includes/functions.php'; require_once 'includes/pdDb.php'; require_once 'includes/pdPubList.php'; $rankings = array('1' => array('AAAI', 'ACL', 'AIJ', 'ALT', 'Bioinformatics', 'CCR', 'COLT', 'ComputingSurveys', 'IJCAI', 'ICML', 'IUI', 'J.LogicProgramming', 'JAIR', 'JMLR', 'KR', 'MLJ', 'NIPS', 'NAR', 'PODS', 'UAI', 'UM', 'WWW'), '2' => array('AIIA', 'ANZIIS', 'ANZCIIS', 'AustralianAI', 'CAI', 'CCAI', 'CIBCB', 'ECCV', 'ECML', 'FG', 'ICGI', 'ICMLA', 'IEEE-SMC(B)', 'ICPR', 'ICRA', 'ICTAI', 'IVCNZ', 'JCP', 'PKDD', 'Proceedings of Third UNB Artificial Intelligence Workshop'), '3' => array('AMFG2005', 'CHI2003 Workshop', 'CISGM', 'CLNL', 'Conference on Information Sciences and Systems', 'Continuum-ICML2003', 'IUI-BeyondPersonalization', 'ICCV-CVBIA', 'L&PinMP', 'MTNS', 'NIPS-BMforNL', 'PSB', 'RTDS', 'SARA', 'SRL2004', 'UBDM', 'VOI-NIPS'), '4' => array('ACB Annual Meeting', 'ISMB', 'MetabolomicsSymposium2006', 'Metabolomics Society Meeting', 'NYU-CRM', 'TSC2007')); $db = new pdDb(array('name' => 'pubDB')); $pubs = pdPubList::create($db); if (count($pubs) == 0) { echo 'No publications in database'; $db->close(); exit; } foreach ($pubs as $pub) { $pub->dbLoad($db, $pub->pub_id); foreach ($rankings as $rank => $venues) { if (!isset($pub->venue->title)) { continue; } if (in_array($pub->venue->title, $venues)) { if ($pub->rank_id != $rank) { echo 'pub ' . $pub->pub_id, ' old rank: ', $pub->rank_id, ' new rank: ', $rank, '<br/>'; $pub->rank_id = $rank; $pub->dbSave($db); } } } //echo $pub->getCitationText(), "\n"; }
public function formRelatedPubs() { $form =& $this->form; $num_related_pubs = count($this->pub->related_pubs); $form->addElement('header', 'related_pubs_hdr', 'Related Publication(s)', null); $tooltip = 'Pub Link::Creates a relationship between this publication and another publication that already has an entry in the database.'; if (count($this->pub->related_pubs) > 0) { $c = 0; foreach ($this->pub->related_pubs as $pub_id) { $intPub = new pdPublication(); $result = $intPub->dbLoad($this->db, $pub_id); if (!$result) { continue; } $form->addGroup(array(HTML_QuickForm::createElement('static', 'curr_related_pub' . $c, null, $intPub->title), HTML_QuickForm::createElement('submit', 'remove_related_pub' . $c, 'Remove'), HTML_QuickForm::createElement('hidden', 'related_pub_id' . $c, $intPub->pub_id)), 'curr_related_pubs_group', "<span class=\"Tips1\" title=\"{$tooltip}\">Pub " . ($c + 1) . '</span>:', ' ', false); $label = ''; $c++; } } $pub_list = pdPubList::create($this->db); if (!empty($pub_list) && count($pub_list) > 0) { $options[''] = '--- select publication --'; foreach ($pub_list as $p) { if (strlen($p->title) > 70) { $options[$p->pub_id] = substr($p->title, 0, 67) . '...'; } else { $options[$p->pub_id] = $p->title; } } $form->addElement('select', 'new_related_pub', "<span class=\"Tips1\" title=\"{$tooltip}\">New Pub </span>:", $options); } $form->addElement('submit', 'add_related_pubs', 'Add Related Publication'); $form->addElement('hidden', 'num_related_pubs', $num_related_pubs); }
public function pubSelect($viewCat = null) { assert('is_object($this->db)'); echo $this->pubSelMenu($viewCat), '<br/>'; $text = ''; switch ($viewCat) { case "year": $pub_years = pdPubList::create($this->db, array('year_list' => true)); echo '<h2>Publications by Year:</h2>'; if (count($pub_years) > 0) { $table = new HTML_Table(array('class' => 'nomargins', 'width' => '100%')); $table->addRow(array('Year', 'Num. Publications'), array('class' => 'emph')); foreach (array_values($pub_years) as $item) { $cells = array(); $cells[] = '<a href="list_publication.php?year=' . $item['year'] . '">' . $item['year'] . '</a>'; $cells[] = $item['count']; $table->addRow($cells); } echo $table->toHtml(); } else { echo 'No publication entries.'; } break; case 'author': echo '<h2>Publications by Author:</h2>'; $al = pdAuthorList::create($this->db); for ($c = 65; $c <= 90; ++$c) { $table = new HTML_Table(array('class' => 'publist')); $text = ''; foreach ($al as $auth_id => $name) { if (substr($name, 0, 1) == chr($c)) { $text .= '<a href="list_publication.php?author_id=' . $auth_id . '">' . $name . '</a> '; } } $table->addRow(array(chr($c), $text)); $table->updateColAttributes(0, array('class' => 'item'), NULL); echo $table->toHtml(); } break; case 'venue': // publications by keyword unset($table); $vl = pdVenueList::create($this->db); echo '<h2>Publications by Venue:</h2>'; for ($c = 65; $c <= 90; ++$c) { $table = new HTML_Table(array('class' => 'publist')); $text = ''; foreach ($vl as $vid => $v) { if (substr($v, 0, 1) == chr($c)) { $text .= '<a href="list_publication.php?venue_id=' . $vid . '">' . $v . '</a> '; } } $table->addRow(array(chr($c), $text)); $table->updateColAttributes(0, array('class' => 'item'), NULL); echo $table->toHtml(); } break; case 'category': $table = new HTML_Table(array('class' => 'nomargins', 'width' => '100%')); $cl = pdCatList::create($this->db); $table->addRow(array('Category', 'Num. Publications'), array('class' => 'emph')); foreach ($cl as $cat_id => $category) { $cells = array(); $cells[] = '<a href="list_publication.php?cat_id=' . $cat_id . '">' . $category . '</a><br/>'; $cells[] = pdCatList::catNumPubs($this->db, $cat_id); $table->addRow($cells); } echo '<h2>Publications by Category:</h2>', $table->toHtml(); break; case 'keywords': // publications by keyword unset($table); $kl = pdPubList::create($this->db, array('keywords_list' => true)); echo '<h2>Publications by Keyword:</h2>'; for ($c = 65; $c <= 90; ++$c) { $table = new HTML_Table(array('class' => 'publist')); $text = ''; foreach ($kl as $kw) { if (substr($kw, 0, 1) == chr($c)) { $text .= '<a href="list_publication.php?keyword=' . $kw . '">' . $kw . '</a> '; } } $table->addRow(array(chr($c), $text)); $table->updateColAttributes(0, array('class' => 'item'), NULL); echo $table->toHtml(); } break; default: $this->pageError = true; } }
/** * */ public function publicationsDbLoad(&$db) { assert('is_object($db)'); assert('isset($this->staff_id)'); assert('$this->dbLoadFlags & (self::DB_LOAD_PUBS_MIN | self::DB_LOAD_PUBS_ALL)'); if ($this->dbLoadFlags & self::DB_LOAD_PUBS_MIN) { if (!empty($this->end_date)) { $between = '\'' . $this->start_date . '\' AND \'' . $this->end_date . '\''; $q = $db->select(array('publication', 'pub_author'), 'publication.pub_id', array('pub_author.author_id' => $this->author_id, 'publication.pub_id=pub_author.pub_id', "publication.published BETWEEN {$between}"), "pdPubList::datePubsDBLoad", array('ORDER BY' => 'published DESC')); } else { $q = $db->select(array('publication', 'pub_author'), 'publication.pub_id', array('pub_author.author_id' => $this->author_id, 'publication.pub_id=pub_author.pub_id', "publication.published >= '{$this->start_date}'"), "pdPubList::datePubsDBLoad", array('ORDER BY' => 'published DESC')); } if (!$q) { return false; } $this->pub_ids = array(); foreach ($q as $r) { $this->pub_ids[] = $r->pub_id; } if (($this->dbLoadFlags & self::DB_LOAD_PUBS_ALL) == 0) { // exit if user does not want to load the actual publications return; } } $this->publications = pdPubList::create($this->db, array('pub_ids' => $this->pub_ids, 'sort' => true)); }
public function nonML() { foreach ($this->pi_authors as $name => &$dates) { $all_pubs = pdPubList::create($this->db, array('author_name' => $name, 'date_start' => $dates[0], 'date_end' => date('Y-m-d'))); if (count($all_pubs) == 0) { continue; } $non_ml = array(); foreach ($all_pubs as &$pub) { $keywords = strtolower($pub->keywords); if (strpos($keywords, 'machine learning') === false) { $non_ml[] = $pub->pub_id; } } echo '<h2>Non Machine Learning papers for ', $name, '</h1>'; $pub_list = pdPubList::create($this->db, array('pub_ids' => $non_ml)); echo displayPubList($this->db, $pub_list, true, -1, null, null, '../'); unset($all_pubs); } }
function displayPubListByCategory(&$db, &$pub_list, $enumerate = true, $max = -1, $options = null, $url_prefix = '') { assert('is_object($db)'); assert('is_array($pub_list)'); $result = ''; $count = 0; $col_desciptions = pdPublication::collaborationsGet($db); foreach (pdPubList::catDisplayOrder() as $category) { $pubs =& $pub_list[$category]; if (empty($pubs)) { continue; } if ($category == 'Other') { $result .= "<h3>Other Categories</h3>\n"; } else { $result .= '<h3>' . $category . "</h3>\n"; } foreach ($pubs as $pub) { ++$count; $pub->dbLoad($db, $pub->pub_id); $cells = array(); $table = new HTML_Table(array('class' => 'publist', 'cellpadding' => '0', 'cellspacing' => '0')); $table->setAutoGrow(true); $citation = $pub->getCitationHtml($url_prefix) . ' ' . getPubIcons($db, $pub, 0xf, $url_prefix); if (is_array($options) && !empty($options['show_internal_info']) && $options['show_internal_info'] || isset($_SESSION['user']) && $_SESSION['user']->showInternalInfo()) { $citation .= '<br/><span style="font-size:80%">'; if (isset($pub->ranking)) { $citation .= 'Ranking: ' . $pub->ranking; } if (is_array($pub->collaborations) && count($pub->collaborations) > 0) { $values = array(); foreach ($pub->collaborations as $col_id) { $values[] = $col_desciptions[$col_id]; } $citation .= '<br/>Collaboration:' . implode(', ', $values); } if (isset($_SESSION['user']) && $_SESSION['user']->showUserInfo()) { $citation .= "<br/>User Info: {$pub->user}"; } $citation .= '</span>'; } if ($enumerate) { $cells[] = $count . '.'; } $cells[] = $citation; $table->addRow($cells); if ($enumerate) { $table->updateColAttributes(0, array('class' => 'item'), NULL); } $result .= $table->toHtml(); unset($table); if ($max > 0 && $count >= $max) { break; } } } return $result; }