• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP generer_url_entite函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: bandeau_rubrique

function bandeau_rubrique($id_rubrique, $titre_rubrique, $zdecal)
{
    static $zmax = 6;
    $nav = "<a href='" . generer_url_entite($id_rubrique, 'rubrique', '', '', false) . "'>" . supprimer_tags(preg_replace(',[\\x00-\\x1f]+,', ' ', $titre_rubrique)) . "</a>\n";
    // Limiter volontairement le nombre de sous-menus
    if (!--$zmax) {
        $zmax++;
        return "\n<li>{$nav}</li>";
    }
    $arr_rub = extraire_article($id_rubrique, $GLOBALS['db_art_cache']);
    $i = sizeof($arr_rub);
    if (!$i) {
        $zmax++;
        return "\n<li>{$nav}</li>";
    }
    $nb_col = 1;
    if ($nb_rub = count($arr_rub)) {
        $nb_col = min(10, max(1, ceil($nb_rub / 10)));
    }
    $ret = "<li class='haschild'>{$nav}<ul class='cols_{$nb_col}'>";
    foreach ($arr_rub as $id_rub => $titre_rub) {
        if (autoriser('voir', 'rubrique', $id_rub)) {
            $titre = supprimer_numero(typo($titre_rub));
            $ret .= bandeau_rubrique($id_rub, $titre, $zdecal + $i);
            $i++;
        }
    }
    $ret .= "</ul></li>\n";
    $zmax++;
    return $ret;
}
开发者ID:nursit,项目名称:SPIP,代码行数:31,代码来源:menu_rubriques.php


示例2: afficher_diff_jointure_dist

/**
 * Afficher le diff d'un champ texte generique
 * @param string $champ
 * @param string $old
 * @param string $new
 * @param string $format
 *   apercu, diff ou complet
 * @return string
 */
function afficher_diff_jointure_dist($champ, $old, $new, $format = 'diff')
{
    $join = substr($champ, 9);
    $objet = objet_type($join);
    $old = explode(',', $old);
    $new = explode(',', $new);
    $liste = array();
    // les communs
    $intersection = array_intersect($new, $old);
    foreach ($intersection as $id) {
        if ($id = intval(trim($id))) {
            $liste[$id] = "<a href='" . generer_url_entite($id, $objet) . "' title='" . _T(objet_info($objet, 'texte_objet')) . " {$id}'>" . generer_info_entite($id, $objet, 'titre') . "</a>";
        }
    }
    // les supprimes
    $old = array_diff($old, $intersection);
    foreach ($old as $id) {
        if ($id = intval(trim($id))) {
            $liste[$id] = "<span class='diff-supprime'>" . "<a href='" . generer_url_entite($id, $objet) . "' title='" . _T(objet_info($objet, 'texte_objet')) . " {$id}'>" . generer_info_entite($id, $objet, 'titre') . "</a>" . "</span>";
        }
    }
    // les ajoutes
    $new = array_diff($new, $intersection);
    foreach ($new as $id) {
        if ($id = intval(trim($id))) {
            $liste[$id] = "<span class='diff-ajoute'>" . "<a href='" . generer_url_entite($id, $objet) . "' title='" . _T(objet_info($objet, 'texte_objet')) . " {$id}'>" . generer_info_entite($id, $objet, 'titre') . "</a>" . "</span>";
        }
    }
    ksort($liste);
    $liste = implode(', ', $liste);
    return $liste;
}
开发者ID:genma,项目名称:spip_ynh,代码行数:41,代码来源:jointure.php


示例3: BOUCLE_documenthtml_b8a8020987dd01f8087ad24f961857eb

function BOUCLE_documenthtml_b8a8020987dd01f8087ad24f961857eb(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $in = array();
    if (!is_array($a = @$Pile[0]['mode'])) {
        $in[] = $a;
    } else {
        $in = array_merge($in, $a);
    }
    if (!isset($command['table'])) {
        $command['table'] = 'documents';
        $command['id'] = '_document';
        $command['from'] = array('documents' => 'spip_documents', 'L1' => 'spip_types_documents');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("documents.id_document", "L1.titre AS type_document", "documents.taille", "documents.mode", "documents.largeur", "documents.hauteur", "documents.titre", "L1.mime_type");
        $command['orderby'] = array();
        $command['join'] = array('L1' => array('documents', 'extension'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(array('(documents.taille > 0 OR documents.distant=\'oui\')'), array('=', 'documents.id_document', sql_quote(@$Pile[0]['id_document'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')), !(is_array(@$Pile[0]['mode']) ? count(@$Pile[0]['mode']) : strlen(@$Pile[0]['mode'])) ? '' : (is_array(@$Pile[0]['mode']) ? sql_in('documents.mode', sql_quote($in)) : array('=', 'documents.mode', sql_quote(@$Pile[0]['mode'], '', 'varchar(10) NOT NULL DEFAULT \'document\''))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('plugins-dist/medias/modeles/img.html', 'html_b8a8020987dd01f8087ad24f961857eb', '_document', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= '

' . vide($Pile['vars'][$_zzz = (string) 'image'] = interdire_scripts(($a = match(entites_html(sinon(table_valeur(@$Pile[0], (string) 'mode_force', null), interdire_scripts($Pile[$SP]['mode'])), true), 'image|vignette') or is_string($a) and strlen($a)) ? $a : interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'embed', null), true)) ? ' ' : '')) . (($t1 = strval(table_valeur($Pile["vars"], (string) 'image', null))) !== '' ? $t1 . ('
<span class=\'spip_document_' . $Pile[$SP]['id_document'] . ' spip_documents' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true)))) !== '' ? ' spip_documents_' . $t2 : '') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t2 : '') . ' spip_lien_ok\'' . (($t2 = strval(interdire_scripts(match(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true), 'left|right')))) !== '' ? '
 style=\'float:' . $t2 . ';\'' : '') . '>
' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true)))) !== '' ? '<a href="' . $t2 . ('"' . (($t3 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien_class', null), true)))) !== '' ? ' class="' . $t3 . '"' : '') . '>') : '') . '<img src=\'' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true))) . '\'' . (($t2 = strval(interdire_scripts($Pile[$SP]['largeur']))) !== '' ? ' width="' . $t2 . '"' : '') . (($t2 = strval(interdire_scripts($Pile[$SP]['hauteur']))) !== '' ? ' height="' . $t2 . '"' : '') . ' alt="' . interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '"' . (($t2 = strval(interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? ' title="' . $t2 . '"' : '') . ' />' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) ? '</a>' : '') . '</span>
') : '') . (!table_valeur($Pile["vars"], (string) 'image', null) ? ' ' . ('
	' . vide($Pile['vars'][$_zzz = (string) 'fichier'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'src')) . '
	' . vide($Pile['vars'][$_zzz = (string) 'width'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'width')) . '
	' . vide($Pile['vars'][$_zzz = (string) 'height'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'height')) . '
<span class=\'spip_document_' . $Pile[$SP]['id_document'] . ' spip_documents' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true)))) !== '' ? ' spip_documents_' . $t2 : '') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t2 : '') . ' spip_lien_ok\'' . (($t2 = strval(interdire_scripts(match(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true), 'left|right')))) !== '' ? '
 style=\'float:' . $t2 . (';' . (($t3 = strval(table_valeur($Pile["vars"], (string) 'width', null))) !== '' ? ' width:' . $t3 . 'px;' : '') . '\'') : '') . '><a href="' . interdire_scripts(($a = entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) or is_string($a) and strlen($a)) ? $a : vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true)))) . '"' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) ? '' : 'type="' . interdire_scripts($Pile[$SP]['mime_type']) . '"'))) !== '' ? '
 ' . $t2 : '') . (($t2 = strval(interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? ' title="' . $t2 . '"' : '') . '><img src=\'' . table_valeur($Pile["vars"], (string) 'fichier', null) . '\' width=\'' . table_valeur($Pile["vars"], (string) 'width', null) . '\' height=\'' . table_valeur($Pile["vars"], (string) 'height', null) . '\' alt=\'' . interdire_scripts(attribut_html(strlen(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])) ? interdire_scripts(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])) . ' {' . interdire_scripts($Pile[$SP]['type_document']) . '}' : interdire_scripts($Pile[$SP]['type_document']))) . '\' /></a></span>
') : '');
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_document @ plugins-dist/medias/modeles/img.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:56,代码来源:html_b8a8020987dd01f8087ad24f961857eb.php


示例4: urls_generer_url_forum_dist

/**
 * Duplicata de la fonction disponible dans _core_/forum/urls
 * pour permettre l'utilisation du plugin urls_etendues avec spip 2.0
 * A retirer a la release 2.1
 *
 * @param <type> $id_forum
 * @param <type> $args
 * @param <type> $ancre
 * @return <type>
 */
function urls_generer_url_forum_dist($id_forum, $args='', $ancre='') {
	if ($id_forum = intval($id_forum)) {
		include_spip('inc/forum');
		list($type, $id,) = racine_forum($id_forum);
		if ($type) {
			if (!$ancre) $ancre = "forum$id_forum";
			return generer_url_entite($id, $type, $args, $ancre, true);
		}
	}
	return '';
}
开发者ID:rhertzog,项目名称:lcs,代码行数:21,代码来源:generer_url_forum.php


示例5: quete_calendrier_interval_forums

function quete_calendrier_interval_forums($limites, &$evenements)
{
    list($avant, $apres) = $limites;
    $result = sql_select("DISTINCT titre, date_heure, id_forum", "spip_forum", "date_heure >= {$avant} AND date_heure < {$apres}", '', "date_heure");
    while ($row = sql_fetch($result)) {
        $amj = date_anneemoisjour($row['date_heure']);
        $id = $row['id_forum'];
        if (autoriser('voir', 'forum', $id)) {
            $evenements[$amj][] = array('URL' => generer_url_entite($id, 'forum'), 'CATEGORIES' => 'calendrier-couleur7', 'SUMMARY' => $row['titre'], 'DTSTART' => date_ical($row['date_heure']));
        }
    }
}
开发者ID:genma,项目名称:spip_ynh,代码行数:12,代码来源:quete_calendrier.php


示例6: inc_profil_decrire

/**
 * Decrire un profil
 * renvoie un tableau de ses infos
 *
 * @param int $id_auteur
 * @param bool $url
 * @return array
 */
function inc_profil_decrire($id_auteur, $url = false)
{
    static $profils = array();
    if (!isset($profils[$id_auteur]) or $url && !isset($profils[$id_auteur][$url])) {
        $profils[$id_auteur] = sql_fetsel('nom,prenom,email,bio,pgp', 'spip_auteurs', 'id_auteur=' . intval($id_auteur));
        if ($url) {
            $profils[$id_auteur]['url'] = url_absolue(generer_url_entite($id_auteur, 'auteur', '', '', false));
            $profils[$id_auteur]['nom_lien'] = "<a href='" . generer_url_entite($id_auteur, 'auteur', '', '', false) . "'>" . ($profils[$id_auteur]['prenom'] ? $profils[$id_auteur]['prenom'] : $profils[$id_auteur]['nom']) . "</a>";
        }
    }
    return $profils[$id_auteur];
}
开发者ID:rougerose,项目名称:fraap_candidatures,代码行数:20,代码来源:fraap_candidatures_options.php


示例7: lien_objet

function lien_objet($id, $type, $longueur = 80, $connect = NULL)
{
    include_spip('inc/liens');
    $titre = traiter_raccourci_titre($id, $type, $connect);
    // lorsque l'objet n'est plus declare (plugin desactive par exemple)
    // le raccourcis n'est plus valide
    $titre = isset($titre['titre']) ? typo($titre['titre']) : '';
    if (!strlen($titre)) {
        $titre = _T('info_sans_titre');
    }
    $url = generer_url_entite($id, $type);
    return "<a href='{$url}' class='{$type}'>" . couper($titre, $longueur) . "</a>";
}
开发者ID:loorenzooo,项目名称:aslfc,代码行数:13,代码来源:medias_fonctions.php


示例8: inc_tourner_dist

function inc_tourner_dist($id_document, $document, $script, $flag, $type)
{
	global $spip_lang_right;

	if (!$document) {
		// retour d'Ajax
		$document = sql_fetsel("*", "spip_documents", "id_document = " . intval($id_document));
	}

	$prim = 'id_' . $type;
	// si pas de doc le hash sera inutilisable
	$id = intval(sql_getfetsel('id_objet', 'spip_documents_liens', "objet=".sql_quote($type)." AND id_document = " . intval($id_document)));

	$titre = $document['titre'];
	$id_vignette = $document['id_vignette'];
	$fichier = entites_html($document['fichier']);

	if (isset($document['url']))
		$url = $document['url'];
	else {
		$url = generer_url_entite($id_document, 'document');
	}

	$res = '';

	// Indiquer les documents manquants avec un panneau de warning

	if ($document['distant'] != 'oui') {
		if (!@file_exists(get_spip_doc($document['fichier']))){
			$c = _T('fichier_introuvable',
					array('fichier'=>basename($document['fichier'])));
			$res = "<img src='" . chemin_image('warning-24.gif')
				."'\n\tstyle='float: right;'\n\talt=\"$c\"\n\ttitle=\"$c\" />";
		} else {
			if ($flag AND !$id_vignette) 
				$res = boutons_rotateurs($document, $type, $id, $id_document,$script);
		}
	} else {
		$res = "\n<div class='verdana1' style='float: $spip_lang_right; text-align: $spip_lang_right;'>";
		
		// Signaler les documents distants par une icone de trombone
		$res .= "<img src='" . chemin_image('attachment.gif') . "'\n\t \n\talt=\"$fichier\"\n\ttitle=\"$fichier\" />\n";
		// Bouton permettant de copier en local le fichier
		$res .= bouton_copier_local($document, $type, $id, $id_document, $script);
		
		$res .= "</div>\n";
	}
	return tourner_greffe($id_document, $document, $url, $res);
}
开发者ID:rhertzog,项目名称:lcs,代码行数:49,代码来源:tourner.php


示例9: action_urls_actualiser_dist

function action_urls_actualiser_dist()
{
    $securiser_action = charger_fonction('securiser_action', 'inc');
    $arg = $securiser_action();
    if (!defined('_VAR_URLS')) {
        define('_VAR_URLS', true);
    }
    $type = $id = "";
    $res = sql_select("type,id_objet", "spip_urls", "", "", "type,id_objet");
    while ($row = sql_fetch($res)) {
        if ($row['id_objet'] !== $id or $row['type'] !== $type) {
            $id = $row['id_objet'];
            $type = $row['type'];
            generer_url_entite($id, $type, "", "", true);
        }
    }
}
开发者ID:genma,项目名称:spip_ynh,代码行数:17,代码来源:urls_actualiser.php


示例10: BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a

function BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_art_agenda';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.date_redac", "articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '0,5';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L2.titre', "'Agenda'"), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-menu-agenda.html', 'html_78503d8cb0bd66f2d97f4b9c0f7d329a', '_art_agenda', 4, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
				<li>' . (($t1 = strval(affdate(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? '<span>' . $t1 . (' ' . (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t3 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t3 . ':' : '') . minutes(normaliser_date($Pile[$SP]['date_redac'])) : '')) !== '' ? '- ' . $t2 : '') . '</span>') : '') . '
					<a class="lien' . interdire_scripts(@$Pile[0]['exposer']) . ' article" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>

				</li>
		';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_art_agenda @ squelettes/inc/inc-menu-agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:46,代码来源:html_78503d8cb0bd66f2d97f4b9c0f7d329a.php


示例11: BOUCLE_breves_rubriqueshtml_11157eacea3e766769d2031f1e2eed04

function BOUCLE_breves_rubriqueshtml_11157eacea3e766769d2031f1e2eed04(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'breves';
        $command['id'] = '_breves_rubriques';
        $command['from'] = array('breves' => 'spip_breves');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("breves.date_heure", "breves.date_heure AS date", "breves.id_breve", "breves.texte", "breves.titre", "breves.lang");
        $command['orderby'] = array('breves.date_heure DESC');
        $command['join'] = array();
        $command['limit'] = '0,10';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('breves.statut', 'publie,prop', 'publie', ''), array('=', 'breves.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'breves.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-breves.html', 'html_11157eacea3e766769d2031f1e2eed04', '_breves_rubriques', 2, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
          	<li>' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span>' . $t1 . '</span>' : '') . '
              <a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_breve'], 'breve', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist('', $Pile[$SP]['texte'], 300, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>
          	</li>
            ';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_breves_rubriques @ squelettes/inc/inc-breves.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:45,代码来源:html_11157eacea3e766769d2031f1e2eed04.php


示例12: BOUCLE_auteurshtml_bc3326b3fba39516fdcfa67a49c7ff7f

function BOUCLE_auteurshtml_bc3326b3fba39516fdcfa67a49c7ff7f(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'auteurs';
        $command['id'] = '_auteurs';
        $command['from'] = array('auteurs' => 'spip_auteurs', 'L1' => 'spip_auteurs_liens');
        $command['type'] = array();
        $command['groupby'] = array("auteurs.id_auteur");
        $command['select'] = array("auteurs.nom", "auteurs.id_auteur");
        $command['orderby'] = array('auteurs.nom');
        $command['join'] = array('L1' => array('auteurs', 'id_auteur'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('auteurs.statut', '!5poubelle', '!5poubelle', ''), array('=', 'L1.id_objet', sql_quote(@$Pile[0]['id_objet'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'L1.objet', sql_quote(@$Pile[0]['objet'], '', 'varchar(25) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes-dist/modeles/lesauteurs.html', 'html_bc3326b3fba39516fdcfa67a49c7ff7f', '_auteurs', 9, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t1 = '
<span class="vcard author"><a class="url fn spip_in" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_auteur'], 'auteur', '', '', true))) . '">' . interdire_scripts(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0])) . '</a></span>';
            $t0 .= (strlen($t1) && strlen($t0) ? ', ' : '') . $t1;
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_auteurs @ squelettes-dist/modeles/lesauteurs.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:39,代码来源:html_bc3326b3fba39516fdcfa67a49c7ff7f.php


示例13: balise_LANGUE_PREFEREE_SECTEUR_REDIRECTION_dyn

function balise_LANGUE_PREFEREE_SECTEUR_REDIRECTION_dyn($liste_rub_exclues="")
{
	include_spip('inc/meta');

	// Recuperation des langues des secteurs
	$langues_secteurs = array();
	include_spip('base/abstract_sql');
	$query = 'SELECT DISTINCT(lang) FROM spip_rubriques WHERE id_parent=0 AND statut="publie" GROUP BY lang';
	if ($res = sql_query($query)) { // was spip_query($query)) {
		while($row = sql_fetch($res)) { // was spip_fetch_array
			$langues_secteurs[] = $row['lang'];
		}
	}
	// Détection de la langue preferee
	if (isset($_GET['lang']) && in_array($_GET['lang'], $langues_secteurs)) {
		// Soit passee dans l'url, auquel cas c'est un choix qu'on conserve pour la suite
		$langue_preferee = $_GET['lang'];
		include_spip('inc/cookie');
		// On pose un cookie d'un an de duree de vie
		spip_setcookie('spip_langue_preferee', $langue_preferee, time() + 3660*24*365, chemin_cookie());
	} elseif(isset($_COOKIE['spip_lang']) && in_array($_COOKIE['spip_lang'], $langues_secteurs)){
		//Soit un cookie lang est présent
		$langue_preferee = $_COOKIE['spip_lang'];
		include_spip('inc/cookie');
		// On pose un cookie d'un an de duree de vie
		spip_setcookie('spip_langue_preferee', $langue_preferee, time() + 3660*24*365, chemin_cookie());
	}elseif (isset($_COOKIE['spip_langue_preferee']) && in_array($_COOKIE['spip_langue_preferee'], $langues_secteurs)) {
		// Soit deja enregistree dans un cookie
		$langue_preferee = $_COOKIE['spip_langue_preferee'];
	} else {
		// Soit indeterminee
		$langues_navigateur = getenv('HTTP_ACCEPT_LANGUAGE');
		// On supprime les taux de pertinence des langues acceptees
		$langues_navigateur = preg_replace("/;q=[.0-9]+(,)?/", "$1", $langues_navigateur);
		$langues_navigateur = explode(',', $langues_navigateur);
		// Quelles sont les langues acceptees disponibles dans les secteurs
		$langues_possibles = array_intersect($langues_navigateur, $langues_secteurs);
		if (count($langues_possibles)) {
			list(, $langue_preferee) = each($langues_possibles);
		} else {
			// fr-ca -> fr
			$langues_navigateur_reduites = array();
			foreach($langues_navigateur as $langue) {
				$langue_reduite = substr($langue, 0, 2);
				if (!in_array($langue_reduite, $langues_navigateur_reduites)) {
					$langues_navigateur_reduites[] = $langue_reduite;
				}
			}
			// Quelles sont les langues acceptees reduites disponibles dans les secteurs
			$langues_reduites_possibles = array_intersect($langues_navigateur_reduites, $langues_secteurs);
			if (count($langues_reduites_possibles)) {
				list(, $langue_preferee) = each($langues_reduites_possibles);
			} elseif (in_array(lire_meta('langue_site'), $langues_secteurs)) {
				// Quelle est alors la langue par defaut du site
				$langue_preferee = lire_meta('langue_site');
			} else {
				// Tant pis, on prend le premier secteur qui vient...
				list(, $langue_preferee) = each($langues_secteurs);
			}
		}
	}

	// On recupere l'id du premier secteur trouve correspondant a la langue preferee (tant pis s'il y en a plusieurs)
	if (!empty($liste_rub_exclues)) {
		$query='SELECT id_rubrique FROM spip_rubriques WHERE id_parent=0 AND lang='._q($langue_preferee).' AND id_rubrique NOT IN ('.$liste_rub_exclues.') LIMIT 0,1';
	} else {
		$query = 'SELECT id_rubrique FROM spip_rubriques WHERE id_parent=0 AND lang='._q($langue_preferee).' LIMIT 0,1';
	}
	$res = sql_query($query) ; // was spip_query($query);
	if ($row = sql_fetch($res)) { // was spip_fetch_array
		$id_rubrique = $row['id_rubrique'];
		if ( $GLOBALS['spip_version_code']<1.93) { // spip 1.9.x
			if (!function_exists('generer_url_rubrique')) { include_spip('urls/'.$GLOBALS['type_urls']); }
			$url_rubrique = generer_url_rubrique($id_rubrique);
		} else { // spip 2.x
			if (!function_exists('generer_url_entite')) { include_spip('inc/utils'); }
			$url_rubrique = generer_url_entite($id_rubrique,'rubrique');
		}
		spip_log('Redirection vers '.$url_rubrique);
		header('Location: '.$url_rubrique);
		exit;
	}
}
开发者ID:samszo,项目名称:open-edition,代码行数:83,代码来源:langue_preferee_secteur_redirection.php


示例14: vignette_logo_document

/**
 * Retourne la vignette explicitement attachee a un document
 * le resutat est un fichier local existant, ou une URL
 * ou vide si pas de vignette
 *
 * @param array $row
 * @param string $connect
 * @return string
 */
function vignette_logo_document($row, $connect = '')
{
    if (!$row['id_vignette']) {
        return '';
    }
    $fichier = quete_fichier($row['id_vignette'], $connect);
    if ($connect) {
        $site = quete_meta('adresse_site', $connect);
        $dir = quete_meta('dir_img', $connect);
        return "{$site}/{$dir}{$fichier}";
    }
    $f = get_spip_doc($fichier);
    if ($f and @file_exists($f)) {
        return $f;
    }
    if ($row['mode'] !== 'vignette') {
        return '';
    }
    return generer_url_entite($row['id_document'], 'document', '', '', $connect);
}
开发者ID:RadioCanut,项目名称:site-radiocanut,代码行数:29,代码来源:quete.php


示例15: BOUCLE_auteurshtml_ce97d1249b67fffb20134bd49b8a9e29

function BOUCLE_auteurshtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'auteurs';
        $command['id'] = '_auteurs';
        $command['from'] = array('auteurs' => 'spip_auteurs', 'L1' => 'spip_auteurs_liens', 'L2' => 'spip_articles');
        $command['type'] = array();
        $command['groupby'] = array("auteurs.id_auteur");
        $command['select'] = array("auteurs.nom", "auteurs.id_auteur");
        $command['orderby'] = array('auteurs.nom');
        $command['where'] = array(quete_condition_statut('L2.statut', '!', 'publie', ''), quete_condition_statut('auteurs.statut', '!5poubelle', '!5poubelle', ''));
        $command['join'] = array('L1' => array('auteurs', 'id_auteur'), 'L2' => array('L1', 'id_article', 'id_objet', 'L1.objet=' . sql_quote('article')));
        $command['limit'] = '';
        $command['having'] = array();
    }
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_auteurs', 55, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= '
						<ul>
							<li>
								<a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_auteur'], 'auteur', '', '', true))) . '">' . interdire_scripts(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0])) . '</a>	
							</li>
						</ul>
						';
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_auteurs @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:43,代码来源:html_ce97d1249b67fffb20134bd49b8a9e29.php


示例16: inc_email_notification_forum_dist

/**
 * Construitre l'email personalise de notification d'un forum
 *
 * @param array $t
 * @param string $email
 * @param array $contexte
 * @return string
 */
function inc_email_notification_forum_dist($t, $email, $contexte = array())
{
    static $contextes_store = array();
    if (!isset($contextes_store[$t['id_forum']])) {
        $url = '';
        $id_forum = $t['id_forum'];
        if ($t['statut'] == 'prive') {
            if ($t['id_objet']) {
                $url = generer_url_entite($t['id_objet'], $t['objet'], '', 'forum' . $id_forum, false);
            }
        } else {
            if ($t['statut'] == 'privrac') {
                $url = generer_url_ecrire('forum') . '#forum' . $id_forum;
            } else {
                if ($t['statut'] == 'privadm') {
                    $url = generer_url_ecrire('forum', 'quoi=admin') . '#forum' . $id_forum;
                } else {
                    if ($t['statut'] == 'publie') {
                        $url = generer_url_entite($id_forum, 'forum');
                    } else {
                        $url = generer_url_ecrire('controler_forum', "debut_id_forum=" . $id_forum);
                    }
                }
            }
        }
        if (!$url) {
            spip_log("forum {$id_forum} sans referent", 'notifications');
            $url = './';
        }
        if ($t['id_objet']) {
            include_spip('inc/filtres');
            $t['titre_source'] = generer_info_entite($t['id_objet'], $t['objet'], 'titre');
        }
        $t['url'] = $url;
        // detecter les url des liens du forum
        // pour la moderation (permet de reperer les SPAMS avec des liens caches)
        // il faut appliquer le traitement de raccourci car sinon on rate des liens sous forme [->..] utilises par les spammeurs !
        include_spip("public/interfaces");
        $table_objet = "forum";
        $links = array();
        foreach ($t as $champ => $v) {
            $champ = strtoupper($champ);
            $traitement = isset($GLOBALS['table_des_traitements'][$champ]) ? $GLOBALS['table_des_traitements'][$champ] : null;
            if (is_array($traitement) and (isset($traitement[$table_objet]) or isset($traitement[0]))) {
                $traitement = $traitement[isset($traitement[$table_objet]) ? $table_objet : 0];
                $traitement = str_replace('%s', "'" . texte_script($v) . "'", $traitement);
                eval("\$v = {$traitement};");
            }
            $links = $links + extraire_balises($v, 'a');
        }
        $links = extraire_attribut($links, 'href');
        $links = implode("\n", $links);
        $t['liens'] = $links;
        $contextes_store[$t['id_forum']] = $t;
    }
    $fond = "notifications/forum_poste";
    if (isset($contexte['fond'])) {
        $fond = $contexte['fond'];
        unset($contexte['fond']);
    }
    $t = array_merge($contextes_store[$t['id_forum']], $contexte);
    // Rechercher eventuellement la langue du destinataire
    if (null !== ($l = sql_getfetsel('lang', 'spip_auteurs', "email=" . sql_quote($email)))) {
        $l = lang_select($l);
    }
    $parauteur = strlen($t['auteur']) <= 2 ? '' : " " . _T('forum_par_auteur', array('auteur' => $t['auteur'])) . ($t['email_auteur'] ? ' <' . $t['email_auteur'] . '>' : '');
    $titre = textebrut(typo($t['titre_source']));
    if ($titre) {
        $forum_poste_par = _T($t['objet'] == 'article' ? 'forum:forum_poste_par' : 'forum:forum_poste_par_generique', array('parauteur' => $parauteur, 'titre' => $titre, 'objet' => $t['objet']));
    } else {
        $forum_poste_par = _T('forum:forum_poste_par_court', array('parauteur' => $parauteur));
    }
    $t['par_auteur'] = $forum_poste_par;
    $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
    // pour nettoyer_titre_email
    $corps = recuperer_fond($fond, $t);
    if ($l) {
        lang_select();
    }
    return $corps;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:89,代码来源:email_notification_forum.php


示例17: email_notification_forum

/**
 * Construitre l'email personalise de notification d'un forum
 *
 * @param array $t
 * @param string $email
 * @return string
 */
function email_notification_forum ($t, $email) {
	static $contexte = array();

	if(!isset($contexte[$t['id_forum']])){
		$url = '';
		$id_forum = $t['id_forum'];

		if ($t['statut'] == 'prive') # forum prive
		{
			if ($t['id_article'])
				$url = generer_url_ecrire('articles', 'id_article='.$t['id_article']).'#id'.$id_forum;
			else if ($t['id_breve'])
				$url = generer_url_ecrire('breves_voir', 'id_breve='.$t['id_breve']).'#id'.$id_forum;
			else if ($t['id_syndic'])
				$url = generer_url_ecrire('sites', 'id_syndic='.$t['id_syndic']).'#id'.$id_forum;
		}
		else if ($t['statut'] == 'privrac') # forum general
		{
			$url = generer_url_ecrire('forum').'#id'.$id_forum;
		}
		else if ($t['statut'] == 'privadm') # forum des admins
		{
			$url = generer_url_ecrire('forum_admin').'#id'.$id_forum;
		}
		else if ($t['statut'] == 'publie') # forum publie
		{
			$url = generer_url_entite($id_forum, 'forum');
		}
		else #  forum modere, spam, poubelle direct ....
		{
			$url = generer_url_ecrire('controle_forum', "debut_id_forum=".$id_forum);
		}

		if (!$url) {
			spip_log("forum $id_forum sans referent",'notifications');
			$url = './';
		}
		if ($t['id_article']) {
			$titre = sql_getfetsel("titre", "spip_articles", "id_article=".sql_quote($t['id_article']));
		}
		if ($t['id_message']) {
			$titre = sql_getfetsel("titre", "spip_messages", "id_message=".sql_quote($t['id_message']));
		}

		$t['titre_source'] = $titre;
		$t['url'] = $url;

		// detecter les url des liens du forum
		// pour la moderation (permet de reperer les SPAMS avec des liens caches)
		$links = array();
		foreach ($t as $champ)
			$links = $links + extraire_balises($champ,'a');
		$links = extraire_attribut($links,'href');
		$links = implode("\n",$links);
		$t['liens'] = $links;

		$contexte[$t['id_forum']] = $t;
	}

	$t = $contexte[$t['id_forum']];
		// Rechercher eventuellement la langue du destinataire
	if (NULL !== ($l = sql_getfetsel('lang', 'spip_auteurs', "email=" . sql_quote($email))))
		$l = lang_select($l);

	$parauteur = (strlen($t['auteur']) <= 2) ? '' :
		(" " ._T('forum_par_auteur', array(
			'auteur' => $t['auteur'])
		) .
		 ($t['email_auteur'] ? ' <' . $t['email_auteur'] . '>' : ''));

	$titre = textebrut(typo($t['titre_source']));
	$forum_poste_par = ($t['id_article']
		? _T('forum_poste_par', array(
			'parauteur' => $parauteur, 'titre' => $titre))
		: $parauteur . ' (' . $titre . ')');

	$t['par_auteur'] = $forum_poste_par;

	$envoyer_mail = charger_fonction('envoyer_mail','inc'); // pour nettoyer_titre_email
	$corps = recuperer_fond("notifications/forum_poste",$t);

	if ($l)
		lang_select();

	return $corps;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:93,代码来源:notifications.php


示例18: urls_propres_dist

function urls_propres_dist($i, $entite, $args = '', $ancre = '')
{
    if (is_numeric($i)) {
        return _generer_url_propre($entite, $i, $args, $ancre);
    }
    $url = $i;
    $id_objet = $type = 0;
    $url_redirect = null;
    // recuperer les &debut_xx;
    if (is_array($args)) {
        $contexte = $args;
    } else {
        parse_str($args, $contexte);
    }
    // Migration depuis anciennes URLs ?
    // traiter les injections domain.tld/spip.php/n/importe/quoi/rubrique23
    if ($GLOBALS['profondeur_url'] <= 0 and $_SERVER['REQUEST_METHOD'] != 'POST') {
        include_spip('inc/urls');
        $r = nettoyer_url_page($i, $contexte);
        if ($r) {
       

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP genericAssertion函数代码示例发布时间:2022-05-15
下一篇:
PHP generer_url_ecrire函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap