当前位置: 首页>>代码示例>>PHP>>正文


PHP inc_lib函数代码示例

本文整理汇总了PHP中inc_lib函数的典型用法代码示例。如果您正苦于以下问题:PHP inc_lib函数的具体用法?PHP inc_lib怎么用?PHP inc_lib使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了inc_lib函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: main

 protected function main()
 {
     if (!is_logged_in()) {
         redir(Nw::$lang['common']['need_login'], false, 'users-10.html');
     }
     // Si le paramètre ID manque
     if (empty($_GET['id']) || !is_numeric($_GET['id']) || empty($_GET['id2']) || !is_numeric($_GET['id2'])) {
         header('Location: ./');
     }
     // Cette news existe vraiment ?
     inc_lib('news/news_exists');
     if (news_exists($_GET['id']) == false) {
         redir(Nw::$lang['news']['news_not_exist'], false, './');
     }
     inc_lib('news/vrs_exists');
     if (vrs_exists($_GET['id'], $_GET['id2']) == false) {
         redir(Nw::$lang['news']['version_not_exist'], false, 'news-16-' . $_GET['id'] . '.html');
     }
     inc_lib('news/get_info_news');
     $donnees_news = get_info_news($_GET['id']);
     // Le membre a le droit de restaurer une version de news
     if (Nw::$droits['can_change_version_my_news'] && $donnees_news['n_id_auteur'] == Nw::$dn_mbr['u_id'] || Nw::$droits['can_change_version_all_news']) {
         // La version actuelle n'est pas la même que celle que l'on veut restaurer..
         if ($donnees_news['n_last_version'] != $_GET['id2']) {
             inc_lib('news/restore_vrs');
             restore_vrs($_GET['id'], $_GET['id2']);
             redir(Nw::$lang['news']['vrs_restored'], true, 'news-16-' . $_GET['id'] . '.html');
         } else {
             redir(Nw::$lang['news']['error_already_restored'], false, 'news-16-' . $_GET['id'] . '.html');
         }
     } else {
         redir(Nw::$lang['news']['error_restore_vrs'], false, 'news-16-' . $_GET['id'] . '.html');
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:34,代码来源:17-restore_vrs.php

示例2: main

 /**
  *  Activation du compte.
  *  @author Cam
  *  @return tpl
  */
 protected function main()
 {
     if (empty($_GET['mid']) || empty($_GET['ca'])) {
         header('Location: ./');
     }
     if (is_logged_in()) {
         redir(Nw::$lang['common']['already_connected'], false, './');
     }
     $return_valid = false;
     inc_lib('users/mbr_act_exists');
     if (mbr_act_exists($_GET['mid'], $_GET['ca'])) {
         inc_lib('users/get_info_mbr');
         $donnees_compte = get_info_mbr($_GET['mid']);
         if ($donnees_compte['u_active'] == 0) {
             inc_lib('users/valid_account');
             inc_lib('admin/gen_cachefile_nb_members');
             valid_account($_GET['mid']);
             gen_cachefile_nb_members();
             generate_members_sitemap();
             redir(Nw::$lang['users']['compte_valide'], true, './');
             $return_valid = true;
         }
     }
     if (!$return_valid) {
         redir(Nw::$lang['users']['compte_valid_error'], false, './');
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:32,代码来源:32-activation.php

示例3: main

 protected function main()
 {
     //Si on a bien envoyé un article à supprimer
     if (!empty($_GET['id']) && is_numeric($_GET['id'])) {
         inc_lib('press/get_info_article');
         $dn_article = get_info_article($_GET['id']);
         if (empty($dn_article)) {
             redir(Nw::$lang['press']['error_dont_exist'], false, 'press.html');
         }
         //Si on a soumis le formulaire
         if (isset($_POST['submit'])) {
             inc_lib('press/delete_article');
             delete_article($dn_article['p_id']);
             redir(Nw::$lang['press']['redir_article_deleted'], true, 'press.html');
         } elseif (isset($_POST['cancel'])) {
             header('Location: press.html?article=' . $dn_article['p_id']);
         }
         $this->set_title($dn_article['p_ressource_name']);
         $this->set_tpl('press/delete.html');
         $this->add_css('forms.css');
         // Fil ariane
         $this->set_filAriane(array(Nw::$lang['press']['mod_title'] => array('press.html'), $dn_article['p_ressource_name'] => array('press.html?article=' . $dn_article['p_id']), Nw::$lang['press']['art_delete'] => array('')));
         Nw::$tpl->set(array('ID' => $dn_article['p_id'], 'RESSOURCE' => $dn_article['p_ressource_name'], 'TEXT_CONFIRM' => sprintf(Nw::$lang['press']['confirm_delete'], $dn_article['p_id'], $dn_article['p_ressource_name'])));
     } else {
         redir(Nw::$lang['press']['error_dont_exist'], false, 'press.html');
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:27,代码来源:3-delete.php

示例4: main

 protected function main()
 {
     //Si on a posté un article à voir
     if (!empty($_GET['article']) && is_numeric($_GET['article'])) {
         inc_lib('press/get_info_article');
         $dn_article = get_info_article($_GET['article']);
         if (empty($dn_article)) {
             redir(Nw::$lang['press']['error_dont_exist'], false, 'press.html');
         }
         $this->set_title($dn_article['p_ressource_name']);
         // Fil ariane
         $this->set_filAriane(array(Nw::$lang['press']['mod_title'] => array('press.html'), $dn_article['p_ressource_name'] => array('press.html?article=' . $dn_article['p_id']), Nw::$lang['press']['art_details'] => array('')));
         Nw::$tpl->set(array('DISPLAY_ARTICLE' => true, 'ID' => $dn_article['p_id'], 'TITRE' => sprintf(Nw::$lang['press']['apparition_in'], $dn_article['p_ressource_name']), 'RESSOURCE' => $dn_article['p_ressource_name'], 'DATE' => $dn_article['date'], 'LIEN' => $dn_article['p_link'], 'CONTENU' => $dn_article['p_description'], 'PAYS' => Nw::$lang['common']['countries'][$dn_article['p_lang']], 'NUMERO' => $dn_article['p_num'], 'ID_ADMIN' => $dn_article['u_id'], 'PSEUDO_ADMIN' => $dn_article['u_pseudo']));
     } else {
         $this->set_title(Nw::$lang['press']['mod_title']);
         // Fil ariane
         $this->set_filAriane(array(Nw::$lang['press']['mod_title'] => array('press.html'), Nw::$lang['press']['art_list'] => array('')));
         Nw::$tpl->set('DISPLAY_ARTICLE', false);
     }
     $this->set_tpl('press/list.html');
     $this->add_css('code.css');
     //Récupération de la liste des articles
     inc_lib('press/get_list_articles');
     $list_articles = get_list_articles();
     foreach ($list_articles as $art) {
         Nw::$tpl->setBlock('art', array('ID' => $art['p_id'], 'TITRE' => $art['p_ressource_name'] . ' (' . $art['date'] . ')'));
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:28,代码来源:0-list.php

示例5: getResult

 function getResult()
 {
     $this->updateData();
     $q = $this->tables['questions']->getItem(CUtils::_postVar('vote_question', true, 0) ? CUtils::_postVar('vote_question', true, 0) : "publish='on' AND date_beg<'" . date('Y-m-d H:i:s') . "' AND date_end>'" . date('Y-m-d H:i:s') . "'");
     if ($q) {
         $a = $this->tables['answers']->getArraysWhere('question_id=' . $q['id'] . " AND publish='on'");
         $rows = array();
         foreach ($a as $k => $v) {
             $a[$k]['percent'] = round($v['quantity'] ? intval($v['quantity']) / intval($q['quantity']) * 100 : 0, 2);
             if ($a[$k]['quantity']) {
                 $rows[] = array(intval(360 * $a[$k]['percent'] / 100), $a[$k]['color']);
             }
         }
         if ($q['is_dia']) {
             inc_lib('tools/CDiagram.php');
             $dia = new CDiagram();
             $dia->bgcolor = 'EAEAEA';
             if ($dia->draw($rows)) {
                 $this->smarty->assign('vote_dia', '<img src="' . $dia->fname . '" width="' . $dia->width . '" height="' . $dia->height . '">');
             }
         }
         $this->smarty->assign('a', $a);
         $this->smarty->assign('q', $q);
         return $this->smarty->fetch('service/' . $this->props['lang'] . '/vote.result.tpl');
     } else {
         return '';
     }
 }
开发者ID:rawork,项目名称:colors-life,代码行数:28,代码来源:VoteUnit.php

示例6: main

 protected function main()
 {
     //Si on a bien envoyé un article à éditer
     if (!empty($_GET['id']) && is_numeric($_GET['id'])) {
         inc_lib('press/get_info_article');
         $dn_article = get_info_article($_GET['id']);
         if (empty($dn_article)) {
             redir(Nw::$lang['press']['error_dont_exist'], false, 'press.html');
         }
         //Si on a soumis le formulaire
         if (isset($_POST['submit'])) {
             inc_lib('press/edit_article');
             edit_article($dn_article['p_id'], $_POST['paper'], $_POST['link'], $_POST['numero'], $_POST['country'], $_POST['contenu'], $_POST['date_pub']);
             redir(Nw::$lang['press']['redir_article_edited'], true, 'press.html?article=' . $dn_article['p_id']);
         }
         $this->set_title($dn_article['p_ressource_name']);
         $this->set_tpl('press/edit.html');
         $this->add_css('code.css');
         $this->add_css('forms.css');
         // Fil ariane
         $this->set_filAriane(array(Nw::$lang['press']['mod_title'] => array('press.html'), $dn_article['p_ressource_name'] => array('press.html?article=' . $dn_article['p_id']), Nw::$lang['press']['art_edit'] => array('')));
         inc_lib('bbcode/unparse');
         Nw::$tpl->set(array('ID' => $dn_article['p_id'], 'RESSOURCE' => $dn_article['p_ressource_name'], 'DATE' => $dn_article['date'], 'LIEN' => $dn_article['p_link'], 'CONTENU' => unparse($dn_article['p_description']), 'PAYS' => $dn_article['p_lang'], 'NUMERO' => $dn_article['p_num']));
     } else {
         redir(Nw::$lang['press']['error_dont_exist'], false, 'press.html');
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:27,代码来源:2-edit.php

示例7: main

 protected function main()
 {
     $this->set_tpl('mobile/news/une.html');
     $this->load_lang_file('news');
     // On compte le nbr de news publiées
     inc_lib('news/count_news');
     $nombre_news = count_news('n_etat = 3');
     $ids_all_news = array();
     // Pagination
     $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
     $nombreDePages = ceil($nombre_news / Nw::$pref['nb_news_homepage']);
     // On vérifie que la page existe bien
     if ($nombreDePages > 0 && $page > $nombreDePages) {
         redir(Nw::$lang['common']['pg_not_exist'], false, './');
     }
     // On recherche toutes les news publiées
     inc_lib('news/get_list_news');
     $list_dn_news = get_list_news('n_etat = 3', 'n_date DESC', $page, Nw::$pref['nb_news_homepage']);
     $cours_news = 0;
     foreach ($list_dn_news as $donnees_news) {
         Nw::$tpl->setBlock('news', array('ID' => $donnees_news['n_id'], 'CAT_ID' => $donnees_news['c_id'], 'CAT_TITRE' => $donnees_news['c_nom'], 'CAT_REWRITE' => rewrite($donnees_news['c_nom']), 'IMAGE_ID' => $donnees_news['i_id'], 'IMAGE_NOM' => $donnees_news['i_nom'], 'TITRE' => $donnees_news['n_titre'], 'RESUME' => $donnees_news['n_resume'], 'REWRITE' => rewrite($donnees_news['n_titre']), 'AUTEUR' => $donnees_news['u_pseudo'], 'AUTEUR_ID' => $donnees_news['u_id'], 'AUTEUR_ALIAS' => $donnees_news['u_alias'], 'AUTEUR_AVATAR' => $donnees_news['u_avatar'], 'DATE' => date_sql($donnees_news['date_news'], $donnees_news['heures_date_news'], $donnees_news['jours_date_news']), 'NBR_VOTES' => $donnees_news['n_nb_votes'], 'NBR_COMS' => sprintf(Nw::$lang['news']['nbr_comments_news'], $donnees_news['n_nbr_coms'], $donnees_news['n_nbr_coms'] > 1 ? Nw::$lang['news']['add_s_comments'] : '')));
         ++$cours_news;
     }
     Nw::$tpl->set(array('LIST_PG' => list_pg($nombreDePages, $page, 'mobile-2%s.html'), 'NB_NEWS' => $cours_news, 'INC_HEAD' => empty($_SERVER['HTTP_AJAX'])));
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:25,代码来源:2-une.php

示例8: main

 protected function main()
 {
     // Il y a bien tous les paramètres nécessaires à l'éxécution du script
     if (!is_logged_in() && !empty($_GET['idm']) && is_numeric($_GET['idm']) && !empty($_GET['ca'])) {
         // Fil ariane
         $this->set_filAriane(Nw::$lang['users']['title_redef_pass']);
         $this->set_title(Nw::$lang['users']['title_redef_pass']);
         $this->set_tpl('membres/redefine_mdp.html');
         $this->add_css('forms.css');
         // Ce code existe bien avec ce code d'activation
         inc_lib('users/mbr_act_exists');
         if (!mbr_act_exists($_GET['idm'], $_GET['ca'])) {
             redir(Nw::$lang['users']['redef_mdp_echoue'], false, './');
         }
         //Si on redéfinit
         if (isset($_POST['submit']) && !multi_empty(trim($_POST['nw_pass1']), trim($_POST['nw_pass2']))) {
             if ($_POST['nw_pass1'] == $_POST['nw_pass2']) {
                 inc_lib('users/chg_password');
                 chg_password($_POST['nw_pass1'], $_GET['idm'], $_GET['ca']);
                 redir(Nw::$lang['users']['new_redef_pwd'], true, './');
             } else {
                 redir(Nw::$lang['users']['sames_password'], false, $_SERVER['REQUEST_URI']);
             }
         }
     } else {
         header('Location: ./');
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:28,代码来源:13-lost_pwd2.php

示例9: add_alert_news

function add_alert_news($id_user, $id_news, $texte, $motif)
{
    inc_lib('bbcode/parse');
    $texte = Nw::$DB->real_escape_string(parse(htmlspecialchars(trim($texte))));
    Nw::$DB->query("INSERT INTO " . Nw::$prefix_table . "news_alerts(a_id_news, a_auteur,\n        a_ip, a_date, a_texte, a_motif)\n        VALUES(" . intval($id_news) . ", " . intval($id_user) . ", " . get_ip() . ", NOW(), \n        '" . $texte . "', " . intval($motif) . ")") or Nw::$DB->trigger(__LINE__, __FILE__);
    return Nw::$DB->insert_id;
}
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:7,代码来源:add_alert_news.php

示例10: main

 protected function main()
 {
     if (!is_logged_in() && !check_auth('view_histo_all_news')) {
         header('Location: ./');
     }
     $this->set_title(Nw::$lang['news']['historiques_news']);
     $this->set_tpl('news/log_admin.html');
     $this->add_css('code.css');
     $this->set_filAriane(array(Nw::$lang['news']['news_section'] => array('news-70.html'), Nw::$lang['news']['historiques_news'] => array('')));
     $get_param = '';
     $param_tpl = '';
     if (!empty($_GET['t'])) {
         $get_param = 'l_titre LIKE "%' . insertBD(urldecode($_GET['t'])) . '%" OR l_texte LIKE "%' . insertBD(urldecode($_GET['t'])) . '%"';
         $param_tpl = htmlspecialchars($_GET['t']);
     }
     inc_lib('news/count_news_logs');
     $nombre_logs = count_news_logs($get_param);
     // Pagination
     $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     $nombreDePages = ceil($nombre_logs / Nw::$pref['nb_logs_admin']);
     // On vérifie que la page existe bien
     if ($nombreDePages > 0 && $page > $nombreDePages) {
         redir(Nw::$lang['common']['pg_not_exist'], false, 'news-21.html?t=' . $param_tpl);
     }
     /**
      *   Affichage du logo
      **/
     inc_lib('news/get_news_logs');
     $donnees_logs = get_news_logs($get_param, 'l_date DESC', $page, Nw::$pref['nb_logs_admin']);
     foreach ($donnees_logs as $donnees) {
         Nw::$tpl->setBlock('log', array('ACTION' => $donnees['l_action'], 'ACTION_LOG' => isset(Nw::$lang['news']['log_news_' . $donnees['l_action']]) ? Nw::$lang['news']['log_news_' . $donnees['l_action']] : '', 'TEXTE' => nl2br($donnees['l_texte']), 'DATE' => date_sql($donnees['date'], $donnees['heures_date'], $donnees['jours_date']), 'AUTEUR' => $donnees['u_pseudo'], 'AUTEUR_ID' => $donnees['u_id'], 'AUTEUR_AVATAR' => $donnees['u_avatar'], 'AUTEUR_ALIAS' => $donnees['u_alias'], 'NEWS_ID' => $donnees['l_id_news'], 'NEWS_TITRE' => $donnees['n_titre'], 'TITRE_ACTU' => $donnees['l_titre'], 'IP' => long2ip($donnees['l_ip'])));
     }
     Nw::$tpl->set(array('TITRE' => urldecode($param_tpl), 'LIST_PG' => list_pg($nombreDePages, $page, 'news-21%s.html?t=' . $param_tpl)));
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:34,代码来源:21-logs_admin.php

示例11: add_ban_ip

function add_ban_ip($ip, $id_modo, $duree, $motif, $motif_admin)
{
    inc_lib('bbcode/parse');
    $motif_admin = parse(insertBD(trim($motif_admin)));
    $motif = insertBD(trim($motif_admin));
    Nw::$DB->query("INSERT INTO " . Nw::$prefix_table . "ban_ip(ban_ip, ban_id_modo,\n        ban_date, ban_date_end, ban_is_end, ban_motif, ban_motif_admin)\n        VALUES(" . ip2long($ip) . ", " . intval($id_modo) . ", NOW(),\n        NOW() + " . intval($duree) . " DAY, 0, '" . $motif . "', '" . $motif_admin . "'");
}
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:7,代码来源:add_ban_ip.php

示例12: main

 protected function main()
 {
     // Seuls les membres peuvent créer des brouillons
     if (!is_logged_in()) {
         redir(Nw::$lang['common']['need_login'], false, 'users-10.html');
     }
     // Si le paramètre ID manque
     if (empty($_GET['id']) || !is_numeric($_GET['id'])) {
         header('Location: ./');
     }
     // Le commentaire n'existe pas
     inc_lib('news/cmt_news_exists');
     if (cmt_news_exists($_GET['id']) == false) {
         redir(Nw::$lang['news']['cmt_not_exist'], false, './');
     }
     inc_lib('news/get_info_cmt_news');
     inc_lib('news/add_vote_cmt');
     $donnees_cmt = get_info_cmt_news($_GET['id']);
     $response = add_vote_cmt($_GET['id']);
     inc_lib('news/get_info_news');
     $donnees_news = get_info_news($donnees_cmt['c_id_news']);
     $rewrite_news = $donnees_news['c_rewrite'] . '/' . rewrite($donnees_news['n_titre']) . '-' . $donnees_news['n_id'] . '/';
     // Pour rediriger le visiteur d'où il est venu
     if (!empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], Nw::$site_url) !== false && strpos($_SERVER['HTTP_REFERER'], Nw::$site_url . $rewrite_news) === false) {
         $_SESSION['nw_referer_edit'] = $_SERVER['HTTP_REFERER'];
     }
     // Vote bien ajouté
     if ($response) {
         $text_redir = Nw::$lang['news']['vote_cmt_ok'];
     } else {
         $text_redir = Nw::$lang['news']['vote_cmt_pasok'];
     }
     $link_redir = !empty($_SESSION['nw_referer_edit']) ? $_SESSION['nw_referer_edit'] : $rewrite_news;
     redir($text_redir, true, $link_redir);
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:35,代码来源:34-vote_cmt.php

示例13: add_mbr

function add_mbr($pseudo, $password, $email, $identifier = '', $valide = 0)
{
    $bf_token = 'jJ_=éZAç1l';
    $ft_token = 'ù%*àè1ç0°dezf';
    $key_alea_code_activate = md5(uniqid(mt_rand()));
    // Enregistrement de l'utilisateur dans la base de données
    Nw::$DB->query('INSERT INTO ' . Nw::$prefix_table . 'members (u_pseudo, u_alias, u_identifier, u_password, u_email, u_group, u_date_register, u_active, u_code_act, u_ip)
    VALUES(\'' . insertBD(trim($pseudo)) . '\', \'' . rewrite(trim($pseudo)) . '\', \'' . insertBD(trim($identifier)) . '\', \'' . insertBD(sha1($bf_token . trim($password) . $ft_token)) . '\', \'' . insertBD(trim($email)) . '\',
    4, NOW(), ' . intval($valide) . ', \'' . insertBD($key_alea_code_activate) . '\', \'' . get_ip() . '\')') or Nw::$DB->trigger(__LINE__, __FILE__);
    $id_new_membre = Nw::$DB->insert_id;
    $identifiant_unique = md5($id_new_membre . uniqid(rand(), true));
    $lien_activation = Nw::$site_url . 'users-32.html?mid=' . $id_new_membre . '&ca=' . $key_alea_code_activate;
    Nw::$DB->query('UPDATE ' . Nw::$prefix_table . 'members SET u_ident_unique = \'' . Nw::$DB->real_escape_string($identifiant_unique) . '\' WHERE u_id = ' . intval($id_new_membre)) or Nw::$DB->trigger(__LINE__, __FILE__);
    Nw::$DB->query('INSERT INTO ' . Nw::$prefix_table . 'members_stats (s_id_membre) VALUES(' . intval($id_new_membre) . ')') or Nw::$DB->trigger(__LINE__, __FILE__);
    inc_lib('users/mail2gd');
    mail2gd($identifiant_unique, trim($email));
    inc_lib('newsletter/add_abonnement');
    add_abonnement(trim($email), $id_new_membre);
    // Envoie d'email de validation
    if ($valide == 0) {
        $txt_mail = sprintf(Nw::$lang['users']['mail_confirm_insc'], $pseudo, Nw::$site_url, Nw::$site_name, $lien_activation, $lien_activation, $lien_activation);
        @envoi_mail(trim($email), sprintf(Nw::$lang['users']['confirm_inscription'], Nw::$site_name), $txt_mail);
    } else {
        // Le compte est confirmé, on met à jour le nbr de membres
        inc_lib('admin/gen_cachefile_nb_members');
        gen_cachefile_nb_members();
        generate_members_sitemap();
    }
    return $id_new_membre;
}
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:30,代码来源:add_mbr.php

示例14: main

 protected function main()
 {
     if (!is_logged_in()) {
         redir(Nw::$lang['common']['need_login'], false, 'users-10.html');
     }
     $this->set_title(Nw::$lang['users']['item_mdp']);
     $this->set_tpl('membres/options_pass.html');
     $this->add_css('forms.css');
     $this->set_filAriane(array(Nw::$lang['users']['mes_options_title'] => array('users-60.html'), Nw::$lang['users']['item_mdp'] => array('')));
     if (isset($_POST['submit']) && !multi_empty(trim($_POST['old']), trim($_POST['nw_pass1']), trim($_POST['nw_pass2']))) {
         $bf_token = 'jJ_=éZAç1l';
         $ft_token = 'ù%*àè1ç0°dezf';
         $pass_membre = insertBD(sha1($bf_token . trim($_POST['old']) . $ft_token));
         if ($_POST['nw_pass1'] == $_POST['nw_pass2']) {
             if (Nw::$dn_mbr['u_password'] == $pass_membre) {
                 inc_lib('users/chg_password');
                 chg_password($_POST['nw_pass1'], Nw::$dn_mbr['u_id']);
                 if (!empty($_COOKIE['nw_pass'])) {
                     $time_expire = time() + 10 * 365 * 24 * 3600;
                     setcookie('nw_ident', Nw::$dn_mbr['u_id'], $time_expire);
                     setcookie('nw_pass', $pass_membre, $time_expire);
                 }
                 redir(Nw::$lang['users']['mdp_change'], true, 'users-60.html');
             } else {
                 redir(Nw::$lang['users']['not_root_password'], false, 'users-63.html');
             }
         } else {
             redir(Nw::$lang['users']['sames_password'], false, 'users-63.html');
         }
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:31,代码来源:63-options_pass.php

示例15: main

 protected function main()
 {
     // Si le paramètre ID manque
     if (empty($_GET['id']) || !is_numeric($_GET['id'])) {
         header('Location: news-70.html');
     }
     inc_lib('news/news_exists');
     if (news_exists($_GET['id']) == false) {
         redir(Nw::$lang['news']['news_not_exist'], false, 'news-70.html');
     }
     inc_lib('news/get_info_news');
     $donnees_news = get_info_news($_GET['id']);
     // Ce membre a le droit d'éditer la news ?
     if ($donnees_news['n_etat'] != 3 && !is_logged_in()) {
         redir(Nw::$lang['news']['not_view_news_perm'], false, './');
     }
     $this->set_tpl('mobile/news/view_news.html');
     $this->load_lang_file('news');
     inc_lib('news/has_voted_news');
     Nw::$tpl->set(array('ID' => $_GET['id'], 'ETAT' => $donnees_news['n_etat'], 'CAT_ID' => $donnees_news['c_id'], 'CAT_TITRE' => $donnees_news['c_nom'], 'AUTEUR' => $donnees_news['u_pseudo'], 'AUTEUR_ALIAS' => $donnees_news['u_alias'], 'AUTEUR_AVATAR' => $donnees_news['u_avatar'], 'DATE' => date_sql($donnees_news['date_news'], $donnees_news['heures_date_news'], $donnees_news['jours_date_news']), 'NBR_COMS' => sprintf(Nw::$lang['news']['nbr_comments_news'], $donnees_news['n_nbr_coms'], $donnees_news['n_nbr_coms'] > 1 ? Nw::$lang['news']['add_s_comments'] : ''), 'COMS' => $donnees_news['n_nbr_coms'], 'NB_VOT_VALID' => Nw::$pref['nb_votes_valid_news'], 'VOTES' => $donnees_news['n_nb_votes'], 'VOTES_NEG' => $donnees_news['n_nb_votes_neg'], 'IMAGE_ID' => $donnees_news['i_id'], 'IMAGE_NOM' => $donnees_news['i_nom'], 'SOURCE' => !empty($donnees_news['n_src_url']) ? $donnees_news['n_src_url'] : '', 'SOURCE_NOM' => !empty($donnees_news['n_src_nom']) ? $donnees_news['n_src_nom'] : '', 'TITRE' => $donnees_news['n_titre'], 'REWRITE' => rewrite($donnees_news['n_titre']), 'CONTENU' => $donnees_news['v_texte'], 'HAS_VOTED' => is_logged_in() ? $donnees_news['v_id_membre'] : 0));
     // Màj du nombre de visualisations
     inc_lib('news/update_pg_vues');
     update_pg_vues($_GET['id']);
     Nw::$tpl->set('INC_HEAD', empty($_SERVER['HTTP_AJAX']));
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:25,代码来源:10-view_news.php


注:本文中的inc_lib函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。