Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct('tag_ml_submit', 'Submit ML Paper Entries', 'diag/tag_ml_submit.php');
     if ($this->loginError) {
         return;
     }
     $this->loadHttpVars();
     $pubs_tagged = array();
     foreach ($this->pub_tag as $pub_id => $tag) {
         if ($tag != 'yes') {
             continue;
         }
         $pub = new pdPublication();
         $pub->dbLoad($this->db, $pub_id);
         if (strpos(strtolower($pub->keywords), 'machine learning' !== false)) {
             echo 'Error: paper titled<br/>', $pub->title, '<br/>is already a machine learning paper.<br/>';
             continue;
         }
         $pub->keywordAdd('machine learning');
         $pub->dbSave($this->db);
         $pubs_tagged[$pub_id] = $pub;
     }
     pdTagMlHistory::dbSave($this->db, array_keys($pubs_tagged));
     if (count($pubs_tagged) == 0) {
         echo 'No publication entries tagged<br>/';
         return;
     }
     echo 'The following publication entries are now tagged as ' . '<i>machine learning</i>:<ul>';
     foreach ($pubs_tagged as $pub_id => $pub) {
         echo '<li>', $pub->title, '</li>';
     }
     echo '</ul>';
 }
Exemplo n.º 2
0
 public function testBibtexPages()
 {
     $pub = new pdPublication();
     $pub->title = uniqid('pub_title_');
     $pub->addCategory($this->db, 1);
     $pub->info['Editor'] = 'test';
     $pub->info['Pages'] = '22-23';
     $pub->dbSave($this->db);
     //var_dump($pub);
     var_dump($pub->getBibtex());
 }