예제 #1
0
파일: forum.php 프로젝트: kidaa/ffunivers
		<table class="table">
			<tr>
				<th style="width:30px"></th>
				<th style="width:30px"></th>
				<th>Titre du sujet</th>
				<th style="width:140px">Auteur</th>
				<th style="width:40px">Nb</th>
				<th style="width:120px">Der. msg</th>
			</tr>
			<?php 
foreach ($topics as $topic) {
    ?>
			<tr>
				<td class="notifMP">
					<?php 
    if ($this->input->cookie('topic_' . $topic['id']) != false && $this->input->cookie('topic_' . $topic['id']) < datetime2timestamp($topic['lastDate'])) {
        echo img('notif.png');
    }
    ?>
				</td>
				<td class="infoImg">
				<?php 
    if ($topic['blocked'] == 1) {
        echo img('blocked.png');
    } elseif ($topic['epingled'] == 1) {
        echo img('epingled.png');
    } elseif ($topic['sondage'] == 1) {
        echo img('sondage.png');
    } elseif ($topic['nbPost'] >= 500) {
        echo img('topic4.png');
    } elseif ($topic['nbPost'] >= 100) {
예제 #2
0
                }
            }
            if ($view) {
                $v++;
                print "<TR>";
                // メモ内容
                print "<TD VALIGN=TOP>";
                print "・<A HREF=\"./workflow/result/?p=top&no=" . $row["seqno"] . "\">";
                $subject = mb_strcut($row["subject"], 0, 60, "EUC-JP");
                if (trim($subject) == "") {
                    $subject = "(no subject)";
                }
                print $subject;
                print "</A>";
                print "(" . get_first("users", "name_ryaku", "id='" . $row["user_id"] . "'", "不明または削除") . ")";
                print " <FONT COLOR=#666666>" . date("n/j", datetime2timestamp($row["createstamp"])) . "<BR>";
                print "&nbsp; (" . mb_strcut(preg_replace("/\r\n|\r|\n|\r\n/", " ", $row["body1"]), 0, 60, "EUC-JP") . ")";
                print "</TD></TR>\n";
                if ($i < $cnt - 1) {
                    print "<TR BGCOLOR={$bg_dark}><TD HEIGHT=1><IMG SRC=\"./image/{$borderwidth}.gif\" WIDTH=100% HEIGHT={$borderwidth}></TD></TR>";
                }
            }
        }
        print "</TABLE>";
        if ($v == 0) {
            print "<FONT COLOR=#CCCCCC>未決裁なし</FONT>\n";
        }
        //
    }
    print "</TD></TR></TABLE>";
}
예제 #3
0
function get_last_time($time)
{
    $time_ts = datetime2timestamp($time);
    $time_now = time();
    $time_delta_s = $time_now - $time_ts;
    $str = '';
    $hh = floor($time_delta_s / 3600);
    $ii = floor(($time_delta_s - $hh * 3600) / 60);
    if ($ii < 10) {
        $ii = '0' . $ii;
    }
    $ss = $time_delta_s - $hh * 3600 - $ii * 60;
    if ($ss < 10) {
        $ss = '0' . $ss;
    }
    $str = $hh . ':' . $ii . ':' . $ss;
    return $str;
}
예제 #4
0
                    $t_t = datetime2timestamp($row_reserve["timeto"]);
                    print "・";
                    print "<A HREF=\"./room/add/?p=top&s=" . $row_reserve["seqno"] . "\">";
                    $notes = split("\r\n", $row_reserve["note"]);
                    if (sizeof($notes) > 0) {
                        print $notes[0];
                    }
                    if (sizeof($notes) > 1) {
                        print "...";
                    }
                    print "</A>";
                    print "(" . $user_name . ")";
                    print " <FONT COLOR=#666666>";
                    print "";
                    if (date("Y", datetime2timestamp($row_reserve["date"])) != date("Y", datetime2timestamp($row_reserve["date"]))) {
                        print date("Y/n/j", datetime2timestamp($row_reserve["date"]));
                    } else {
                        print date("n/j", datetime2timestamp($row_reserve["date"]));
                    }
                    print " ";
                    print date("H:i", $t_f) . "-" . date("H:i", $t_t);
                    print "";
                    print "</A><BR>\n";
                    print "</TD></TR>";
                }
            }
        }
        print "</TABLE>";
        print "</TD></TR></TABLE>";
    }
}
예제 #5
0
파일: home.php 프로젝트: kidaa/ffunivers
 function sitemap()
 {
     header("Content-Type: text/xml;charset=utf-8");
     echo '<?xml version="1.0" encoding="UTF-8"?>';
     echo '<urlset xmlns="http://www.google.com/schemas/sitemap/0.9">';
     echo '<url><loc>' . base_url() . '</loc><priority>1.0</priority></url>';
     echo '<url><loc>' . site_url('rechercher') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('forum') . '</loc><priority>0.6</priority></url>';
     echo '<url><loc>' . site_url('live') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('mesSujets') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('articles') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('images') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('contributions') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('listeDesMembres') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('carteDesMembres') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('historiqueChatbox') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('derniersMessages') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('evenements') . '</loc><priority>0.3</priority></url>';
     echo '<url><loc>' . site_url('archivesNews') . '</loc><priority>0.3</priority></url>';
     echo '<url><loc>' . site_url('dons') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('editerContenu') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('monCompte') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('monCompte/gils') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('monCompte/messagerie') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('monCompte/images') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('monCompte/ajouterImages') . '</loc><priority>0.1</priority></url>';
     echo '<url><loc>' . site_url('monCompte/trierImages') . '</loc><priority>0.1</priority></url>';
     // profils
     $profils = $this->db->select('id,username')->where('isAnonymous', 0)->get('users')->result_array();
     foreach ($profils as $user) {
         echo '<url><loc>' . profil_link($user['username'], $user['id']) . '</loc><priority>0.1</priority></url>';
     }
     // contenu
     $contents = $this->db->select('c.url,c.editDate')->join('sites s', 's.id = c.site')->where('c.isCurrent', 1)->where('s.url', base_url())->get('contents c')->result_array();
     foreach ($contents as $content) {
         echo '<url><loc>' . site_url($content['url']) . '</loc><priority>1.0</priority><lastmod>' . date('Y-m-d', datetime2timestamp($content['editDate'])) . '</lastmod></url>';
     }
     // forum
     $topics = $this->db->select('id,title')->get('topics')->result_array();
     foreach ($topics as $topic) {
         echo '<url><loc>' . site_url('forum/' . $topic['id'] . '/' . url_title($topic['title'])) . '</loc><priority>0.6</priority></url>';
     }
     // evenements
     $events = $this->db->select('id,name')->get('events')->result_array();
     foreach ($events as $event) {
         echo '<url><loc>' . site_url('evenement/' . $event['id'] . '/' . url_title($event['name'])) . '</loc><priority>0.3</priority></url>';
     }
     echo '</urlset>';
 }
예제 #6
0
function future_date($datetime)
{
    $days = array('', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche');
    $months = array('', 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre');
    $timestamp = datetime2timestamp($datetime);
    $heure = ' à ' . date('G', $timestamp) . 'H';
    $mn = date('i', $timestamp);
    if ($mn == '00') {
        $mn = '';
    }
    if ($heure == ' à 0H') {
        $heure = '';
        $mn = '';
    }
    if (is_today($timestamp)) {
        return 'aujourd\'hui ' . $heure . $mn;
    } else {
        if (is_tomorrow($timestamp)) {
            return 'demain ' . $heure . $mn;
        } else {
            if (is_tomorrow2($timestamp)) {
                return 'après demain ' . $heure . $mn;
            } else {
                return $days[date('N', $timestamp)] . '  ' . date('j', $timestamp) . ' ' . $months[date('n', $timestamp)] . ' ' . $heure . $mn;
            }
        }
    }
}
예제 #7
0
     }
     print "<IMG SRC=\"" . $imageicon . "\" BORDER=0 ALT=\"" . $filename . "\" WIDTH=26 HEIGHT=26 ALIGN=LEFT>";
     if ($download_sign == "t") {
         print "</A>";
     }
     if ($download_sign == "t") {
         print "<A HREF=\"./folder/files/" . $linkstr . "&p=top\">";
     }
     print "<FONT STYLE=\"font-size:85%\">";
     print $filename;
     print "</FONT>";
     if ($download_sign == "t") {
         print "</A><BR>";
     }
     print "(" . get_first("users", "name_ryaku", "id='" . $row["user_id"] . "'", "") . ")";
     print " <FONT COLOR=#666666>" . date("n/j", datetime2timestamp($row["updatestamp"])) . "";
     if ($i < $cnt - 1) {
         print "<TR BGCOLOR={$bg_dark}><TD HEIGHT=1><IMG SRC=\"./image/{$borderwidth}.gif\" WIDTH=100% HEIGHT={$borderwidth}></TD></TR>";
     }
     #        print "<BR CELAR=ALL>";
     print "</TD></TR>\n";
     $c++;
     if ($c >= $filecount) {
         break;
     }
 }
 //
 print "</TABLE>";
 if ($c == 0) {
     print "<TR><TD><FONT COLOR=#CCCCCC>なし</TD></TR>\n";
 }
예제 #8
0
     print "<A HREF=\"./schedule/add/?p=top&s=" . $row["seqno"] . "\" STYLE=\"font-weight:normal\">";
 } else {
     print "<FONT COLOR=" . $bodyLinkColor . ">";
 }
 if ($backtime != "" && $backtime > $fromtime) {
     // ブッキング時は紫表示
     print "<FONT COLOR=#CC00CC>";
 }
 if ($row["datefrom"] == date("Y-m-d", $viewstamp) and $row["timefrom"] != "") {
     print date("H:i", datetime2timestamp($row["timefrom"]));
 }
 if ($row["datefrom"] == date("Y-m-d", $viewstamp) and $row["timefrom"] != "" or $row["dateto"] == date("Y-m-d", $viewstamp) and $row["timeto"] != "") {
     print "-";
 }
 if ($row["dateto"] == date("Y-m-d", $viewstamp) and $row["timeto"] != "") {
     print date("H:i", datetime2timestamp($row["timeto"]));
 }
 if ($row["timefrom"] != "" or $row["timeto"] != "") {
     print "<BR>";
 }
 if ($view == "on") {
     print mb_strcut(preg_replace("/\r\n|\r|\n|\r\n/", " ", $row["note"]), 0, 100, "EUC-JP");
 } else {
     print "&lt;非表示&gt;";
 }
 if ($view == "on") {
     print "</A>";
 } else {
     print "</FONT>";
 }
 if ($row["datefrom"] != $row["dateto"]) {
예제 #9
0
파일: search.php 프로젝트: kidaa/ffunivers
 function doSearch()
 {
     if (trim($_POST['keywords']) == '' || $_POST['keywords'] == 'Mots clefs de votre recherche') {
         return;
     }
     $keywords = $_POST['keywords'];
     $array_keywords = explode(' ', $keywords);
     $typeSearch = $_POST['typeSearch'];
     $title = $_POST['title'];
     @($cat1 = $_POST['cat1']);
     @($cat2 = $_POST['cat2']);
     $sondage = $_POST['sondage'];
     $sort = $_POST['sort'];
     $author = trim($_POST['author']);
     if ($this->session->userdata('lastSearch') != $keywords) {
         $this->db->insert('search', array('user' => $this->session->userdata('id'), 'site' => $this->contents->getIdSite(), 'keywords' => $keywords, 'date' => date('Y-m-d H:i:s')));
         $this->session->set_userdata('lastSearch', $keywords);
     }
     if (!is_array($cat1)) {
         $cat1 = array();
     }
     // contenu
     if ($_POST['where'] == 1) {
         //requete
         $this->db->select('c.id,c.idCreation,c.title,c.date,c.editDate,c.url,c.content,ct.name')->join('sites s', 's.id = c.site')->join('content_types ct', 'ct.id = c.type')->where('c.isCurrent', 1)->where_in('c.type', $cat1);
         if ($typeSearch == 1) {
             if ($title == 1) {
                 $this->db->like('c.title', $keywords);
             } else {
                 $this->db->like('c.content', $keywords);
             }
         } else {
             if ($title == 1) {
                 foreach ($array_keywords as $keyword) {
                     $this->db->like('c.title', $keyword);
                 }
             } else {
                 foreach ($array_keywords as $keyword) {
                     $this->db->like('c.content', $keyword);
                 }
             }
         }
         $res = $this->db->get('contents c')->result_array();
         foreach ($res as $key => $line) {
             $res[$key]['timestamp'] = datetime2timestamp($line['editDate']);
             $res[$key]['occurence'] = 0;
             if ($typeSearch == 1) {
                 $res[$key]['occurence'] += countWord($keywords, $line['title']);
                 $res[$key]['occurence'] += countWord($keywords, $line['content']);
             } else {
                 foreach ($array_keywords as $keyword) {
                     $res[$key]['occurence'] += countWord($keyword, $line['title']);
                     $res[$key]['occurence'] += countWord($keyword, $line['content']);
                 }
             }
         }
         if ($sort == 1) {
             usort($res, 'sortByOccurence');
         } else {
             usort($res, 'sortByTimestamp');
         }
         //affichage des resultats
         echo '<h1>' . count($res) . ' résultats</h1>';
         echo '<ul class="classic">';
         foreach ($res as $line) {
             echo '<li><a href="' . $line['url'] . '" class="resultContent">[' . $line['name'] . '] ' . htmlspecialchars($line['title']) . '</a>';
             echo '<span>' . $line['occurence'] . ' occurence' . ($line['occurence'] > 1 ? 's' : '') . ' - édité ' . madate($line['editDate']) . '</span>';
             echo '</li>';
         }
         echo '<ul>';
         // var_dump($res);
         // echo $this->db->last_query();
     }
 }
예제 #10
0
 $endstamp = false;
 $goesstamp = false;
 $backstamp = false;
 if ($cnt_duty > 0) {
     $row_duty = pg_fetch_array($res_duty, 0);
     if ($row_duty["startstamp"] != "") {
         $startstamp = datetime2timestamp($row_duty["startstamp"]);
     }
     if ($row_duty["endstamp"] != "") {
         $endstamp = datetime2timestamp($row_duty["endstamp"]);
     }
     if ($row_duty["goesstamp"] != "") {
         $goesstamp = datetime2timestamp($row_duty["goesstamp"]);
     }
     if ($row_duty["backstamp"] != "") {
         $backstamp = datetime2timestamp($row_duty["backstamp"]);
     }
 }
 print "<FORM>";
 print "<TD COLSPAN=2 ALIGN=RIGHT>";
 print "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 BGCOLOR=#CCCCCC>";
 print "<TR BGCOLOR=#FFFFFF>";
 print "<TD ALIGN=CENTER>";
 if ($startstamp == false) {
     print "<INPUT TYPE=BUTTON VALUE=\"出社\" STYLE=\"font-size:80%\" ONCLICK=\"location.href='./?duty_start'\">";
 } else {
     print "<FONT STYLE=\"font-size:80%\">";
     print "出社<BR>";
     print date("H:i", $startstamp);
 }
 print "</TD>";
예제 #11
0
function check_keep_alive($time)
{
    $keep_alive_ts = datetime2timestamp($time);
    $now_ts = time();
    $dif_ts = $now_ts - $keep_alive_ts;
    if ($dif_ts > Config::get('watchdog_timeout') * 2) {
        return 0;
    } else {
        return 1;
    }
}
예제 #12
0
파일: chatbox.php 프로젝트: kidaa/ffunivers
 public function listMsg($page = null)
 {
     $this->load->model('chatboxs');
     if ($page == null) {
         $mgs = $this->chatboxs->getMsg();
         $mgs = array_reverse($mgs, true);
     } else {
         $mgs = $this->chatboxs->getHistory($page);
     }
     $json = array();
     $lastUser = false;
     foreach ($mgs as $msg) {
         //si c'est un message privé
         //qu'on la pas envoyé
         //et qu'on n'est pas le destinataire => continue
         // if($msg['toUser'] != null &&  $msg['user'] != $this->session->userdata('id') && $msg['toUser'] != $this->session->userdata('id'))
         // continue;
         $json[$msg['id']] = '<div style="display:none" class="message" id="msgTchatbox' . $msg['id'] . '">';
         if ($this->session->userdata('group') >= 2 && $page == null) {
             $json[$msg['id']] .= '<a class="deleteMsg" href="' . site_url('deleteMsg/' . $msg['id']) . '">' . img('mini_delete.png') . '</a>';
         }
         if ($msg['isDeleted'] == 1 && $page == null) {
             $json[$msg['id']] .= 'removedByAdmin';
         } else {
             $isMp = false;
             // pseudo du click message privée
             if ($msg['toUser'] == $this->session->userdata('id')) {
                 $mpUsername = $msg['username'];
                 $isMp = true;
             } elseif ($msg['toUser'] != null && $msg['user'] == $this->session->userdata('id')) {
                 $mpUsername = $msg['username2'];
                 $isMp = true;
             } else {
                 $mpUsername = $msg['username'];
             }
             if ($isMp) {
                 $testWith = $msg['username'] . '@' . $msg['username2'];
             } else {
                 $testWith = $msg['username'];
             }
             if ($lastUser != $testWith) {
                 $lastUser = $testWith;
                 $json[$msg['id']] .= '<div class="author">';
                 // bouton MP
                 if ($page == null) {
                     $json[$msg['id']] .= '<a class="mpMsg" username="******" nohref>' . img('mp.png') . '</a>';
                 }
                 // personne qui a envoyé le message
                 $json[$msg['id']] .= profil_url($msg['username'], $msg['user'], $msg['color']);
                 // si c'est un MP, on affiche a qui
                 if ($isMp) {
                     $json[$msg['id']] .= '@' . profil_url($msg['username2'], $msg['toUser'], $msg['color2']);
                 }
                 //date
                 if ($page == null) {
                     $json[$msg['id']] .= ' <span class="time">' . date('G\\hi', datetime2timestamp($msg['date'])) . '</span></div>';
                 } else {
                     $json[$msg['id']] .= ' <span class="time">' . madate($msg['date']) . '</span></div>';
                 }
             }
             // on affiche le message
             if ($isMp) {
                 $style = 'color:#006600';
             } else {
                 $style = '';
             }
             $json[$msg['id']] .= '<span style="' . $style . '"">' . montexte($msg['message'], true, false) . '</span>';
         }
         $json[$msg['id']] .= '</div>';
     }
     echo json_encode($json);
 }
예제 #13
0
파일: rss.php 프로젝트: kidaa/ffunivers
echo $page_description;
?>
</description>


		<?php 
foreach ($news as $new) {
    ?>
			<item>
				<title><?php 
    echo $new['title'];
    ?>
</title> 
				<link><?php 
    echo site_url($new['url']);
    ?>
</link> 
				<description><?php 
    echo htmlspecialchars($new['content']);
    ?>
</description> 
				<pubDate><?php 
    echo date('D, d M Y H:i:s', datetime2timestamp($new['date']));
    ?>
 GMT</pubDate>
			</item>
		<?php 
}
?>
	</channel>
</rss>
예제 #14
0
             if ($cnt_post > 0) {
                 for ($j = 0; $j < $cnt_post; $j++) {
                     print "<TR><TD NOWRAP>";
                     $row_post = pg_fetch_array($res_post, $j);
                     $subject = $row_post["subject"];
                     if ($subject == "") {
                         $subject = "(no subject)";
                     }
                     if (strlen($subject) > 40) {
                         $subject = mb_strcut($subject, 0, 40) . ".";
                     }
                     print "・<A HREF=\"./bulletin/view/?p=top&board={$boardsid}&no=" . $row_post["seqno"] . "\">";
                     print $subject;
                     print "</A>";
                     print "&nbsp;(" . get_first("users", "name_ryaku", "id='" . $row_post["user_id"] . "'", "不明または削除") . ")";
                     print " <FONT COLOR=#666666>" . date("n/j", datetime2timestamp($row_post["stamp"])) . "<BR>";
                     print "&nbsp;&nbsp;(" . mb_strcut(preg_replace("/\r\n|\r|\n|\r\n/", " ", $row_post["body"]), 0, 60, "EUC-JP") . "..)";
                     print "</TD></TR>";
                     if ($j < $cnt_post - 1) {
                         print "<TR BGCOLOR={$bg_dark}><TD HEIGHT=1><IMG SRC=\"./image/{$borderwidth}.gif\" WIDTH=100% HEIGHT={$borderwidth}></TD></TR>";
                     }
                 }
             }
         }
     }
 }
 if (!$boarddraw) {
     print "<TR><TD><FONT COLOR=#CCCCCC>未読なし</TD></TR>\n";
 }
 print "</TABLE>";
 print "</TD></TR></TABLE>";