echo "<td id='mne'>";
        if (strlen($row['name']) < 26) {
            echo "$row[name]";
        } else {
            if (strlen($row['name']) > 39) {
                echo "<span style=\"font-size: xx-small\">$row[name]</span>";
            } else {
                echo "<span style=\"font-size: x-small\">$row[name]</span>";
            }
        }
        echo "</td>";
        echo "<td id='seen'>";
        echo humanReadable($row['seen']) . " times\n";
        echo "</td>";
        echo "<td id='lastseen'>";
        echo getRelativeTime($row['lastseen']) . "\n";
        echo "</td>";
        echo "</tr>";
            $i++; 
        } 
        echo "</tbody>";
        echo "</table>";
} else { 
    echo "<b><u>No Mnemonics</u></b><br>";
    echo "Either wait for caches to update, or restart your syslog daemon.\n<br>";
} 
?>

<!-- BEGIN Mnemonics Selector Modal -->
<div class="dialog_hide">
    <div id="mne_dialog" title="Mnemonic Selector">
예제 #2
0
        ?>
edit"><span<?php 
        echo ($firstTime ? ' class="first"' : '') . '>' . $bin['url'];
        ?>
/</span><?php 
        echo $bin['revision'];
        ?>
/</a></td>
    <td class="created"><a pubdate="<?php 
        echo $bin['created'];
        ?>
" href="<?php 
        echo $url;
        ?>
edit"><?php 
        echo getRelativeTime($bin['created']);
        ?>
</a></td>
    <td class="title"><a href="<?php 
        echo $url;
        ?>
edit"><?php 
        echo substr($title, 0, 200);
        ?>
</a></td>
  </tr>
<?php 
        $last = $bin['url'];
    }
}
?>
예제 #3
0
 protected function _formatNews($item)
 {
     if ($this->name == 'SYSTEM.rss') {
         $stitle = htmlspecialchars($item->title, ENT_QUOTES);
         $sdescription = htmlspecialchars($item->description, ENT_QUOTES);
         $ssummary = htmlspecialchars($item->summary, ENT_QUOTES);
     } else {
         $stitle = $item->title;
         $sdescription = $item->description;
         $ssummary = $item->summary;
     }
     $slink = $item->link;
     $this->_buffer = str_replace('{itemid}', $item->id, $this->_buffer);
     $this->_buffer = str_replace('{link}', $slink, $this->_buffer);
     $this->_buffer = str_replace('{link_encoded}', rawurlencode(str_replace('&amp;', '&', $slink)), $this->_buffer);
     if ($item->pubdate != -1) {
         if ($this->name == 'SYSTEM.rss') {
             $pubdate = date('r', $item->pubdate);
         } else {
             $pubdate = zf_transcode(strftime(ZF_PUBDATEFORMAT, date($item->pubdate)));
         }
     } else {
         $pubdate = $item->pubdate;
     }
     $this->_buffer = str_replace('{pubdate}', $pubdate, $this->_buffer);
     $this->_buffer = str_replace('{relativedate}', getRelativeTime($item->pubdate), $this->_buffer);
     $this->_buffer = str_replace('{title}', $stitle, $this->_buffer);
     $newvalue = $item->isNew ? ZF_ISNEW_STRING : '';
     $this->_buffer = str_replace('{isnew}', $newvalue, $this->_buffer);
     /* description */
     $this->_buffer = str_replace('{description}', $sdescription, $this->_buffer);
     $this->_formatEnclosures($item);
     $hasSummary = strpos($this->_buffer, '{summary}');
     $this->_buffer = str_replace('{summary}', $ssummary, $this->_buffer);
     $zfarticleurl = '?q=item&zftemplate=' . $this->name . '&itemid=' . $item->id;
     $this->_buffer = str_replace('{articleurl}', htmlentities($zfarticleurl), $this->_buffer);
     $zfdownloadcontent = '?q=download-item&zftemplate=' . $this->name . '&itemid=' . $item->id;
     $this->_buffer = str_replace('{download}', htmlentities($zfdownloadcontent), $this->_buffer);
     // for RSS feeds only
     $this->_buffer = str_replace('{guid}', md5($slink), $this->_buffer);
 }
예제 #4
0
        </a>
    </div>
    
    <em class="date" data-timestamp="<?php 
    echo strtotime($s['lastvote']) != null ? strtotime($s['lastvote']) : 0;
    ?>
"></em>
    
    <p><?php 
    echo $s['cnt'];
    ?>
 vote<?php 
    echo $s['cnt'] > 1 ? 's' : '';
    ?>
  &bull; Créé <?php 
    echo getRelativeTime($s['creation']);
    ?>
</p>
  </div>
  <?php 
}
?>
</div>

<div id="droite">
  <p class="survolez"></p>
</div>

<script>
  $(function() {
    // Add a new choice
예제 #5
0
 switch ($act) {
     // init
     case "getArticles":
         $smarty->assign('articles', $database->getArticles());
         $smarty->display(DOCUMENT_ROOT . '/view/templates/admin/commandListArticles.tpl');
         break;
     case "getGroupes":
         $smarty->assign('articles', $database->getArticles());
         $smarty->assign('groupes', $database->getGroupesArticles());
         $smarty->display(DOCUMENT_ROOT . '/view/templates/admin/commandListGroupes.tpl');
         break;
     case "getCommandes":
         $commandes = $database->getCommandes();
         foreach ($commandes as $kc => $commande) {
             $commandes[$kc]['joueur'] = $database->getJoueur($commande['id_joueur']);
             $commandes[$kc]['date'] = getRelativeTime($commande['date']);
             $commandes[$kc]['commande'] = $database->getCommande($commande['id_commande']);
         }
         $smarty->assign('commandes', $commandes);
         $smarty->display(DOCUMENT_ROOT . '/view/templates/admin/commandListCommandes.tpl');
         break;
         // commandes
     // commandes
     case "isPaye":
         if (isset($_POST['idCommande'])) {
             $database->setCommandeAsPaye($_POST['idCommande']);
         }
         break;
     case "isCommanded":
         if (isset($_POST['idCommande'])) {
             $database->setCommandeAsCommanded($_POST['idCommande']);
예제 #6
0
파일: index.php 프로젝트: hubgit/6music
  a {
    color: #C34402;
    font-weight: bold;
  }
  </style>

</head>
<body>
  <p id="song"><a href="<?php 
echo htmlspecialchars($mp3s[0]['info']);
?>
"><?php 
echo htmlspecialchars($song);
?>
</a></p>
  <p>played <?php 
echo htmlspecialchars(getRelativeTime($songs[0]->get_date('U')));
?>
 by</p>
  <p id="show"><a href="http://www.bbc.co.uk/programmes/<?php 
echo htmlspecialchars(preg_replace('/[^a-z0-9 ]/i', '', $showtitle));
?>
"><?php 
echo htmlspecialchars($showtitle);
?>
</a></p>
  <p id="about"><a href="about.html">about</a></p>
</body>
</html>

예제 #7
0
        $url = formatURL($bin['url'], $bin['revision']);
        $title = getTitleFromCode($bin);
        $firstTime = $bin['url'] != $last;
        // attempt to get the modified panels - note that this won't detect
        // if they're using their own template
        $args = array('?live');
        $js = trim($bin['javascript']);
        $html = trim($bin['html']);
        $css = trim($bin['css']);
        if ($js && $js !== $defjs) {
            $args[] = 'javascript';
        }
        if ($html && $html !== $defhtml) {
            $args[] = 'html';
        }
        if ($css && $css !== $defcss) {
            $args[] = 'css';
        }
        // show the console instead of the live render if there's no HTML
        if ($js && !$html) {
            $args[0] = '?console';
        }
        // TODO decide whether I need the root here...
        $editurl = $url . 'edit' . implode(',', $args);
        array_push($template_bin, array('title' => substr($title, 0, 100), 'code' => $bin['url'], 'revision' => $bin['revision'], 'url' => $url, 'edit_url' => $editurl, 'created' => $bin['created'], 'pretty_created' => getRelativeTime($bin['created']), 'is_first' => count($template_bin) === 0));
    }
    array_push($formatted, $template_bin);
}
$view = file_get_contents('../views/history.html');
$mustache = new Mustache();
echo $mustache->render($view, array('bins' => $formatted));
예제 #8
0
<thead>
<tr>
<th class="header"><a href="logviewer.php?sort=player">Player</a></th>
<th class="header"><a href="logviewer.php?sort=message">Message</a></th>
<th class="header"><a href="logviewer.php?sort=source">Source</a></th>
<th class="header"><a href="logviewer.php?sort=date">Date</a></th>
</tr>
</thead>
<?php 
$i = 0;
while ($arr = mysql_fetch_assoc($query)) {
    if ($i % 2) {
        //this means if there is a remainder
        echo "<tr class='odd'>";
    } else {
        //if there isn't a remainder we will do the else
        echo "<tr>";
    }
    echo "<td>" . $arr['player'] . "</td><td>" . $arr['message'] . "</td><td>" . $arr['source'] . "</td><td>" . getRelativeTime($arr['date']) . "</td></tr>";
    $i++;
}
?>
</table>
<center><p><?php 
echo $num;
?>
 rows</p></center>
</body>
</html>

예제 #9
0
        <?php 
    echo __("Pending validation");
    ?>
      <?php 
}
?>
    </td>
  </tr>
  <tr>
    <td>
      <img src="/images/icones/16x16/travel.png" />
      Inscription
    </td>
    <td>
      <?php 
echo ucfirst(getRelativeTime($mbr['created_at']));
?>
    </td>
  </tr>
  <tr>
    <td>
      <img src="/images/icones/16x16/cup.png" />
      <?php 
echo __("Last visit");
?>
    </td>
    <td>
      <?php 
if ($mbr->getLastvisit() == null) {
    ?>
        <em><?php 
예제 #10
0
<?php

require_once '../common/head.php';
$notifs = '';
if (isset($_GET['id_notif']) && isset($_GET['type'])) {
    $idj = $_SESSION['id_joueur'];
    $type = $_GET['type'];
    $idn = $_GET['id_notif'];
    if ($type == "set") {
        $database->setNotifAsSeen($idj, $idn);
    } elseif ($type == "del") {
        $database->delNotifJoueur($idj, $idn);
    }
} elseif (isset($_GET['lastUpdate'])) {
    $dateConverted = date("Y-m-d h:i:s", $_GET['lastUpdate'] / 1000);
    $notifs = $database->getNotificationsJoueurFrom($_SESSION['id_joueur'], $dateConverted);
} else {
    $notifs = $database->getNotificationsJoueur($_SESSION['id_joueur']);
}
// Applying Template
if (!empty($notifs)) {
    foreach ($notifs as $k => $v) {
        $notifs[$k]['date'] = getRelativeTime($v['date']);
    }
    $smarty->assign('notifications', $notifs);
    $smarty->display('default/notif.tpl');
}