本文整理汇总了PHP中image_reduire函数的典型用法代码示例。如果您正苦于以下问题:PHP image_reduire函数的具体用法?PHP image_reduire怎么用?PHP image_reduire使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了image_reduire函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: icone_visiter_header_prive
function icone_visiter_header_prive($flux) {
global $spip_lang_left,$spip_lang_right;
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($r = $chercher_logo(0, 'id_syndic', 'on')) {
list($fid, $dir, $nom, $format) = $r;
// pour javascript...
include_spip('inc/filtres_images');
if(defined('_SPIP19300')) {
include_spip('inc/filtres_images_mini'); // pour SPIP 2.1
$r = image_reduire("<img src='$fid' alt='' style='margin:0;' />", 46, 46);
$r = "<span style='height:48px; margin:0;'>$r</span>";
$q = 'span.icon_fond:last';
} else {
$r = image_reduire("<img src='$fid' alt='' style='margin:0;' />", 48, 48);
$r = addslashes("<span style='height:48px; margin:4px;'>$r</span>");
$q = 'img[@src*=visiter]';
}
} else return $flux;
$r = str_replace('/', '\/', $r);
return $flux. <<<JAVASCRIPT
<script type="text/javascript"><!--
// des que le DOM est pret...
if (window.jQuery) jQuery(document).ready(function(){
jQuery("$q").hide()
.after("$r");
});
//--></script>
JAVASCRIPT;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:29,代码来源:icone_visiter.php
示例2: inc_informer_dist
function inc_informer_dist($id, $col, $exclus, $rac, $type, $do = 'aff')
{
include_spip('inc/texte');
if ($type == "rubrique") {
$row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = {$id}");
if ($row) {
$titre = typo($row["titre"]);
$descriptif = propre($row["descriptif"]);
} else {
$titre = _T('info_racine_site');
}
} else {
$titre = '';
}
$res = '';
if ($type == "rubrique" and $GLOBALS['spip_display'] != 1 and isset($GLOBALS['meta']['image_process'])) {
if ($GLOBALS['meta']['image_process'] != "non") {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($res = $chercher_logo($id, 'id_rubrique', 'on')) {
list($fid, $dir, $nom, $format) = $res;
include_spip('inc/filtres_images_mini');
$res = image_reduire("<img src='{$fid}' alt='' />", 100, 48);
if ($res) {
$res = "<div style='float: " . $GLOBALS['spip_lang_right'] . "; margin-" . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>{$res}</div>";
}
}
}
}
$rac = spip_htmlentities($rac);
# ce lien provoque la selection (directe) de la rubrique cliquee
# et l'affichage de son titre dans le bandeau
$titre = strtr(str_replace("'", "’", str_replace('"', """, textebrut($titre))), "\n\r", " ");
$js_func = $do . '_selection_titre';
return "<div style='display: none;'>" . "<input type='text' id='" . $rac . "_sel' value='{$id}' />" . "<input type='text' id='" . $rac . "_sel2' value=\"" . entites_html($titre) . "\" />" . "</div>" . "<div class='informer' style='padding: 5px; border-top: 0px;'>" . (!$res ? '' : $res) . "<p><b>" . safehtml($titre) . "</b></p>" . (!$descriptif ? '' : "<div>" . safehtml($descriptif) . "</div>") . "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" . "<input type='submit' class='fondo' value='" . _T('bouton_choisir') . "'\nonclick=\"{$js_func}('{$titre}',{$id},'selection_rubrique','id_parent'); return false;\" />" . "</div>" . "</div>";
}
开发者ID:JLuc,项目名称:SPIP,代码行数:35,代码来源:informer.php
示例3: inc_informer_auteur_dist
function inc_informer_auteur_dist($id)
{
global $spip_display,$spip_lang_right ;
include_spip('inc/presentation');
include_spip('inc/formater_auteur');
$row = sql_fetsel("*", "spip_auteurs", "id_auteur = $id");
if ($row) {
$nom = typo($row["nom"]);
$bio = propre($row["bio"]);
$mail = formater_auteur_mail($row, $id);
$nb = sql_countsel("spip_auteurs_articles", "id_auteur=$id");
if ($nb > 1)
$nb = $nb . " " . _T('info_article_2');
else if($nb == 1)
$nb = "1 " . _T('info_article');
else $nb = " ";
} else {
$nom = "<span style='color:red'>"
. _T('texte_vide')
. '</span>';
$bio = $mail = $nb = '';
}
$res = '';
if ($spip_display != 1 AND $spip_display!=4 AND $GLOBALS['meta']['image_process'] != "non") {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($res = $chercher_logo($id, 'id_auteur', 'on')) {
list($fid, $dir, $n, $format) = $res;
include_spip('inc/filtres_images_mini');
$res = image_reduire("<img src='$fid' alt='' />", 100, 48);
if ($res)
$res = "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>";
}
}
return "<div class='informer-auteur'>"
. (!$res ? '' : $res)
. "<div><a href='"
. generer_url_ecrire('auteur_infos', "id_auteur=$id")
. "'>"
. bonhomme_statut($row)
. "</a> "
. $mail
. " <b>"
. $nom
. "</b><br />"
. $nb
. "</div><br />"
. "<div>$bio</div>"
. "</div>";
}
开发者ID:rhertzog,项目名称:lcs,代码行数:52,代码来源:informer_auteur.php
示例4: skeleditor_afficher_dir_skel
/**
* Afficher l'arborescence du dossier squelette
*
* @param string $path_base
* @param string $current_file
* @return string
*/
function skeleditor_afficher_dir_skel($path_base,$current_file) {
include_spip('inc/skeleditor');
include_spip('inc/presentation');
$file_list = skeleditor_files_editables($path_base);
$current_file = substr($current_file,strlen($path_base));
$output = "<div id='arbo'><div class='dir'>\n";
$init_dir = $current_dir = "";
foreach($file_list as $file){
$dir = substr(dirname($file),strlen($path_base));
$file = substr($file,strlen($path_base));
if ($dir != $current_dir)
$output .= skeleditor_tree_open_close_dir($current_dir,$dir,$current_file);
$class="fichier";
$readonly = false;
if (!is_writable($path_base.$dir) OR !is_writable($path_base.$file)) {
$readonly = true;
$class .= " readonly";
}
$class .= ($file==$current_file?" on":'');
$icon = "file";
if (preg_match(',('._SE_EXTENSIONS_IMG.')$,',$file))
$icon = "image";
include_spip('inc/filtres_images_mini');
$cadenas = ($readonly) ? " ".inserer_attribut(image_reduire(chemin_image('cadenas-16.png'),12),'title',attribut_html(_T('texte_inc_meta_2'))) : "";
$output .= "<a href='".generer_url_ecrire('skeleditor','f='.urlencode($f=$path_base.$file))."' class='$class'
onclick=\"jQuery('#contenu > :first').ajaxReload({history:true,args:{f:'$f'}});return false;\">"
. "<img src='"._DIR_PLUGIN_SKELEDITOR."images/se-$icon-16.png' alt='$icon' /> "
.basename($file)
.$cadenas
. "</a>"
;
}
$output .= skeleditor_tree_open_close_dir($current_dir,$init_dir,$current_file);
$output .= "</div></div>\n";
return $output;
}
开发者ID:samszo,项目名称:open-edition,代码行数:50,代码来源:skeleditor_fonctions.php
示例5: enfant_rub
/**
* Crée l'affichage des listes de rubriques dans le privé
*
* @param int $collection
* L'identifiant numérique de la rubrique à lister
* @param int $debut
* Le numéro de la pagination si paginé (> 500)
* @param int $limite
* Le pas de pagination si paginé (> 500)
* @return array $res
* Un tableau des sous rubriques
*/
function enfant_rub($collection, $debut = 0, $limite = 500)
{
$voir_logo = (isset($GLOBALS['meta']['image_process']) and $GLOBALS['meta']['image_process'] != "non");
$logo = "";
if ($voir_logo) {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
include_spip('inc/filtres_images_mini');
}
$res = array();
$result = sql_select("id_rubrique, id_parent, titre, descriptif, lang ", "spip_rubriques", "id_parent={$collection}", '', '0+titre,titre', "{$debut},{$limite}");
while ($row = sql_fetch($result)) {
$id_rubrique = $row['id_rubrique'];
$id_parent = $row['id_parent'];
$titre = generer_info_entite($id_rubrique, 'rubrique', 'titre');
// pour etre sur de passer par tous les traitements
if ('' !== ($rang = recuperer_numero($row['titre']))) {
$rang = "{$rang}. ";
}
if (autoriser('voir', 'rubrique', $id_rubrique)) {
$les_sous_enfants = sous_enfant_rub($id_rubrique);
changer_typo($row['lang']);
$lang_dir = lang_dir($row['lang']);
$descriptif = propre($row['descriptif']);
if ($voir_logo) {
if ($logo = $chercher_logo($id_rubrique, 'id_rubrique', 'on')) {
list($fid, $dir, $nom, $format) = $logo;
$logo = image_reduire("<img src='{$fid}' alt='' />", 48, 36);
if ($logo) {
$logo = inserer_attribut($logo, 'class', 'logo');
}
}
}
$lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? "" : http_img_pack('auteur-0minirezo-16.png', '', " width='16' height='16'", _T('image_administrer_rubrique'))) . " <a dir='{$lang_dir}'" . ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . " href='" . generer_url_entite($id_rubrique, 'rubrique') . "'>" . $rang . $titre . "</a>";
$titre = (is_string($logo) ? $logo : '') . bouton_block_depliable($lib_bouton, $les_sous_enfants ? false : -1, "enfants{$id_rubrique}");
$res[] = debut_cadre_sous_rub($id_parent ? "rubrique-24.png" : "secteur-24.png", true, "", $titre) . (!$descriptif ? '' : "\n<div class='descriptif'>{$descriptif}</div>") . $les_sous_enfants . fin_cadre_sous_rub(true);
}
}
changer_typo($GLOBALS['spip_lang']);
# remettre la typo de l'interface pour la suite
return $res;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:53,代码来源:presenter_enfants.php
示例6: image_masque
//.........这里部分代码省略.........
if ($mode == "masque") {
$color_t = ImageColorAllocateAlpha($im3, 128, 128, 128, 0);
} else {
$color_t = ImageColorAllocateAlpha($im3, 128, 128, 128, 127);
}
imagefill($im3, 0, 0, $color_t);
imagecopy($im3, $im2, $dx, $dy, 0, 0, $x_m, $y_m);
imagedestroy($im2);
$im2 = imagecreatetruecolor($x_i, $y_i);
@imagealphablending($im2, false);
@imagesavealpha($im2, true);
imagecopy($im2, $im3, 0, 0, 0, 0, $x_i, $y_i);
imagedestroy($im3);
$x_m = $x_i;
$y_m = $y_i;
}
$rapport = $x_i / $x_m;
if ($y_i / $y_m < $rapport) {
$rapport = $y_i / $y_m;
}
$x_d = ceil($x_i / $rapport);
$y_d = ceil($y_i / $rapport);
if ($x_i < $x_m or $y_i < $y_m) {
$x_dest = $x_i;
$y_dest = $y_i;
$x_dec = 0;
$y_dec = 0;
} else {
$x_dest = $x_m;
$y_dest = $y_m;
$x_dec = round(($x_d - $x_m) / 2);
$y_dec = round(($y_d - $y_m) / 2);
}
$nouveau = _image_valeurs_trans(image_reduire($im, $x_d, $y_d), "");
if (!is_array($nouveau)) {
return "";
}
$im_n = $nouveau["fichier"];
$im = $nouveau["fonction_imagecreatefrom"]($im_n);
imagepalettetotruecolor($im);
if ($nouveau["format_source"] == "gif" and function_exists('ImageCopyResampled')) {
$im_ = imagecreatetruecolor($x_dest, $y_dest);
// Si un GIF est transparent,
// fabriquer un PNG transparent
// Conserver la transparence
if (function_exists("imageAntiAlias")) {
imageAntiAlias($im_, true);
}
@imagealphablending($im_, false);
@imagesavealpha($im_, true);
@ImageCopyResampled($im_, $im, 0, 0, 0, 0, $x_dest, $y_dest, $x_dest, $y_dest);
imagedestroy($im);
$im = $im_;
}
$im_ = imagecreatetruecolor($x_dest, $y_dest);
@imagealphablending($im_, false);
@imagesavealpha($im_, true);
$color_t = ImageColorAllocateAlpha($im_, 255, 255, 255, 127);
imagefill($im_, 0, 0, $color_t);
// calcul couleurs de chaque pixel selon les modes de fusion
for ($x = 0; $x < $x_dest; $x++) {
for ($y = 0; $y < $y_dest; $y++) {
$rgb = ImageColorAt($im2, $x, $y);
// image au dessus
$a = $rgb >> 24 & 0xff;
$r = $rgb >> 16 & 0xff;
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:67,代码来源:images_transforme.php
示例7: image_masque
//.........这里部分代码省略.........
@imagesavealpha($im2,true);
imagecopy ( $im2, $im3, 0, 0, 0, 0, $x_i, $y_i);
imagedestroy($im3);
$x_m = $x_i;
$y_m = $y_i;
}
$rapport = $x_i / $x_m;
if (($y_i / $y_m) < $rapport ) {
$rapport = $y_i / $y_m;
}
$x_d = ceil($x_i / $rapport);
$y_d = ceil($y_i / $rapport);
if ($x_i < $x_m OR $y_i < $y_m) {
$x_dest = $x_i;
$y_dest = $y_i;
$x_dec = 0;
$y_dec = 0;
} else {
$x_dest = $x_m;
$y_dest = $y_m;
$x_dec = round(($x_d - $x_m) /2);
$y_dec = round(($y_d - $y_m) /2);
}
$nouveau = _image_valeurs_trans(image_reduire($im, $x_d, $y_d),"");
if (!is_array($nouveau)) return("");
$im_n = $nouveau["fichier"];
$im = $nouveau["fonction_imagecreatefrom"]($im_n);
imagepalettetotruecolor($im);
if ($nouveau["format_source"] == "gif" AND function_exists('ImageCopyResampled')) {
$im_ = imagecreatetruecolor($x_dest, $y_dest);
// Si un GIF est transparent,
// fabriquer un PNG transparent
// Conserver la transparence
if (function_exists("imageAntiAlias")) imageAntiAlias($im_,true);
@imagealphablending($im_, false);
@imagesavealpha($im_,true);
@ImageCopyResampled($im_, $im, 0, 0, 0, 0, $x_dest, $y_dest, $x_dest, $y_dest);
imagedestroy($im);
$im = $im_;
}
$im_ = imagecreatetruecolor($x_dest, $y_dest);
@imagealphablending($im_, false);
@imagesavealpha($im_,true);
$color_t = ImageColorAllocateAlpha( $im_, 255, 255, 255 , 127 );
imagefill ($im_, 0, 0, $color_t);
for ($x = 0; $x < $x_dest; $x++) {
for ($y=0; $y < $y_dest; $y++) {
$rgb = ImageColorAt($im2, $x, $y);
$a = ($rgb >> 24) & 0xFF;
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
开发者ID:rhertzog,项目名称:lcs,代码行数:67,代码来源:images_transforme.php
示例8: image_reduire_par
/**
* Réduit les images d'un certain facteur
*
* @see image_reduire()
*
* @param string $img
* Chemin de l'image ou texte
* @param int $val
* Facteur de réduction
* @param bool $force
* @return string
* Code HTML de l'image ou du texte.
**/
function image_reduire_par($img, $val = 1, $force = false)
{
list($hauteur, $largeur) = taille_image($img);
$l = round($largeur / $val);
$h = round($hauteur / $val);
if ($l > $h) {
$h = 0;
} else {
$l = 0;
}
$img = image_reduire($img, $l, $h, $force);
return $img;
}
开发者ID:JLuc,项目名称:SPIP,代码行数:26,代码来源:filtres_images_mini.php
示例9: afficher_forum_thread
function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $i, $retour, $arg, $script, $argscript) {
global $spip_lang_right, $spip_display;
static $voir_logo = array(); // pour ne calculer qu'une fois
if (is_array($voir_logo)) {
$voir_logo = (($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non") ?
"position: absolute; $spip_lang_right: 0px; margin: 0px; margin-top: -3px; margin-$spip_lang_right: 0px;"
: '');
}
$id_forum=$row['id_forum'];
$id_parent=$row['id_parent'];
$id_rubrique=$row['id_rubrique'];
$id_article=$row['id_article'];
$id_breve=$row['id_breve'];
$id_message=$row['id_message'];
$id_syndic=$row['id_syndic'];
$id_auteur=$row["id_auteur"];
$titre=$row['titre'];
$texte=$row['texte'];
$nom_site=$row['nom_site'];
$url_site=$row['url_site'];
$statut=$row['statut'];
$ip=$row["ip"];
$h = (!$id_article ? '' : generer_url_entite($id_article, 'article'))
. "#forum$id_forum";
$titre_boite = "<a href='$h' id='forum$id_forum'>"
. typo($titre)
. '</a>';
if ($spip_display == 4) {
$res = $titre_boite ."<br id='id$id_forum' />";
} else {
if ($id_auteur AND $voir_logo) {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($logo = $chercher_logo($id_auteur, 'id_auteur', 'on')) {
list($fid, $dir, $nom, $format) = $logo;
include_spip('inc/filtres_images_mini');
$logo = image_reduire("<img src='$fid' alt='' />", 48, 48);
if ($logo)
$titre_boite = "\n<div style='$voir_logo'>$logo</div>$titre_boite" ;
}
}
$res = "<tr id='id$id_forum'>"
. afficher_forum_4($compteur_forum, $nb_forum, $i)
. "\n<td style='width: 100%' valign='top'>"
. (($compteur_forum == 1)
? debut_cadre_forum(forum_logo($statut), true, "", $titre_boite)
: debut_cadre_thread_forum("", true, "", $titre_boite));
}
// Si refuse, cadre rouge
if ($statut=="off") {
$style =" style='border: 2px dashed red; padding: 5px;'";
}
// Si propose, cadre jaune
else if ($statut=="prop") {
$style = " style='border: 1px solid yellow; padding: 5px;'";
}
// Si original, cadre vert
else if ($statut=="original") {
$style = " style='border: 1px solid green; padding: 5px;'";
} else $style = '';
$mots = afficher_forum_mots($id_forum);
$res .= "<table$style width='100%' cellpadding='5' cellspacing='0'>\n<tr><td>"
. afficher_forum_auteur($row)
. (!$controle_id_article ? '' :
boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip, $script, $argscript))
. "<div style='font-weight: normal;'>"
. safehtml(justifier(propre($texte)))
. "</div>\n"
. (!$nom_site ? '' :
((strlen($url_site) > 10) ? "\n<div style='text-align: left' class='verdana2'><b><a href='$url_site'>$nom_site</a></b></div>"
: "<b>$nom_site</b>"))
. ($controle_id_article ? '' :
repondre_forum($row, $titre, $statut, "$retour?$arg", _T('lien_repondre_message')))
. $mots
. "</td></tr></table>";
if ($spip_display == 4) return "\n<li>$res</li>\n";
if ($compteur_forum == 1) $res .= fin_cadre_forum(true);
else $res .= fin_cadre_thread_forum(true);
$res .= "</td></tr>";
return "<table width='100%' cellpadding='0' cellspacing='0' border='0'>$res</table>\n";
}
开发者ID:rhertzog,项目名称:lcs,代码行数:93,代码来源:forum.php
示例10: massicoter_logo_document
/**
* Massicoter un logo document
*
* Traitement automatique sur les balises #LOGO_DOCUMENT
*
* @param string $fichier : Le logo
*
* @return string : Un logo massicoté
*/
function massicoter_logo_document($logo, $doc = array())
{
include_spip('inc/filtres');
include_spip('inc/filtres_images_mini');
/* S'il n'y a pas de fichier dans la pile, on va le chercher dans
la table documents */
if (!isset($doc['fichier'])) {
include_spip('base/abstract_sql');
$rows = sql_allfetsel('fichier, extension', 'spip_documents', 'id_document=' . intval($doc['id_document']));
$doc['fichier'] = $rows[0]['fichier'];
$doc['extension'] = $rows[0]['extension'];
}
/* Si le document en question n'est pas une image, on ne fait rien */
if (!$logo or preg_match('/^(jpe?g|png|gif)$/i', $doc['extension']) === 0) {
return $logo;
}
/* S'il y a un lien sur le logo, on le met de côté pour le
remettre après massicotage */
if (preg_match('#(<a.*?>)<img.*$#', $logo) === 1) {
$lien = preg_replace('#(<a.*?>)<img.*$#', '$1', $logo);
}
$fichier = extraire_attribut($logo, 'src');
/* On se débarasse d'un éventuel query string */
$fichier = preg_replace('#\\?[0-9]+#', '', $fichier);
list($largeur_logo, $hauteur_logo) = getimagesize($fichier);
$balise_img = charger_filtre('balise_img');
$fichier_massicote = massicoter_document(get_spip_doc($doc['fichier']));
/* Comme le logo reçu en paramètre peut avoir été réduit grâce aux
paramètres de la balise LOGO_, il faut s'assurer que l'image
qu'on renvoie fait bien la même taille que le logo qu'on a
reçu. */
$balise = image_reduire($balise_img($fichier_massicote, extraire_attribut($logo, 'alt'), extraire_attribut($logo, 'class')), $largeur_logo, $hauteur_logo);
if (isset($lien)) {
$balise = $lien . $balise . '</a>';
}
return $balise;
}
开发者ID:RadioCanut,项目名称:site-radiocanut,代码行数:46,代码来源:massicot_fonctions.php
示例11: inc_formater_article_dist
function inc_formater_article_dist($row, $own='')
{
global $spip_lang_right, $spip_display;
static $pret = false;
static $chercher_logo, $img_admin, $formater_auteur, $nb, $langue_defaut, $afficher_langue, $puce_statut;
$id_article = $row['id_article'];
if (!autoriser('voir','article',$id_article)) return '';
if (!$pret) {
$chercher_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non");
if ($chercher_logo)
$chercher_logo = charger_fonction('chercher_logo', 'inc');
$formater_auteur = charger_fonction('formater_auteur', 'inc');
$img_admin = http_img_pack("admin-12.gif", "", " width='12' height='12'", _T('titre_image_admin_article'));
if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') {
$afficher_langue = true;
$langue_defaut = !isset($GLOBALS['langue_rubrique'])
? $GLOBALS['meta']['langue_site']
: $GLOBALS['langue_rubrique'];
}
$puce_statut = charger_fonction('puce_statut', 'inc');
$pret = true;
}
if ($chercher_logo) {
if ($logo = $chercher_logo($id_article, 'id_article', 'on')) {
list($fid, $dir, $nom, $format) = $logo;
include_spip('inc/filtres_images_mini');
$logo = "<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>" .
image_reduire("<img src='$fid' alt='' />", 26, 20) .
"</span>";
} else $logo = '';
} else $logo ='';
$titre = supprime_img($row['titre'],'');
$id_rubrique = $row['id_rubrique'];
$date = $row['date'];
$statut = $row['statut'];
$descriptif = $row['descriptif'];
$lang = $row['lang'];
$dir = "dir='" . lang_dir($lang ? changer_typo($lang) : '') . "'";
if ($lang AND $afficher_langue AND $lang != $GLOBALS['meta']['langue_site'])
$lang = " <span class='spip_xx-small' style='color: #666666' "
. $dir
. '>('
. traduire_nom_langue($lang)
. ')</span>';
else $lang = '';
$arg = "id_article=$id_article";
$url_a = generer_url_ecrire("articles", $arg);
if (!$row['petition'])
$petition = '';
else
$petition = " <a href='" . generer_url_ecrire('controle_petition', $arg) . "' class='spip_xx-small' style='color: red'>"._T('lien_petitions') . "</a>";
$lien = "<div>"
. $logo
. (acces_restreint_rubrique($id_rubrique) ? $img_admin : '')
. "<a href='"
. $url_a
. "'"
. (!$descriptif ? '': (' title="'.attribut_html(typo($descriptif)).'"'))
. " $dir>"
. typo(strlen($titre) ? $titre : _T('ecrire:info_sans_titre'))
. "</a>"
. $lang
. $petition
. "</div>";
if ($spip_display == 4) return array($lien);
$puce = $puce_statut($id_article, $statut, $id_rubrique,'article');
$auteurs = auteurs_article($id_article);
foreach ($auteurs as $k => $r) {
list(, $mail, $nom,,) = $formater_auteur($r['id_auteur']);
$auteurs[$k]= "$mail $nom";
}
$date = affdate_jourcourt($date);
if (!$date) $date = ' ';
$num = afficher_numero_edit($id_article, 'id_article', 'article');
// Afficher le numero (JMB)
return array($puce, $lien, join('<br />', $auteurs), $date, $num);
}
开发者ID:rhertzog,项目名称:lcs,代码行数:92,代码来源:formater_article.php
示例12: geodiv_lire_media
/**
* Récupère le contenu d'un média
*
* Arguments possibles :
* -* login
* -* pass
* -* id_article int (Obligatoire)
* -* champs_demandes string (champs que l'on souhaite récupérer, séparés par une virgule, sinon, on retourne l'ensemble)
* -* document_largeur int (largeur maximale du document, si c'est une image, défaut largeur du document original)
* -* document_hauteur int (hauteur maximale du document, si c'est une image, défaut hauteur du document original)
* -* vignette_format string (carre ou autre, autre n'a pas de fonction)
* -* vignette_largeur int (largeur de la vignette en px, défaut 100)
* -* vignette_hauteur int (hauteur de la vignette en px, défaut 100)
*/
function geodiv_lire_media($args)
{
global $spip_xmlrpc_serveur;
if (!intval($args['id_article']) > 0) {
$erreur = _T('xmlrpc:erreur_identifiant', array('objet' => 'article'));
return new IXR_Error(-32601, attribut_html($erreur));
}
$champs_demandes = is_array($args['champs_demandes']) ? $args['champs_demandes'] : array();
$format_vignette = $args['vignette_format'];
$config = lire_config('geol', array());
$secteur_medias = intval($config['secteur_medias']) > 0 ? $config['secteur_medias'] : 1;
$args_media = array_merge($args, array('objet' => 'article', 'id_objet' => $args['id_article']));
$res = $spip_xmlrpc_serveur->read($args_media);
if (!$res) {
return $spip_xmlrpc_serveur->error;
}
$id_secteur = $res['result'][0]['id_secteur'] ? $res['result'][0]['id_secteur'] : sql_getfetsel('id_secteur', 'spip_articles', 'id_article=' . intval($args['id_article']));
/**
* Sécurité : L'article demandé n'est pas un média
*/
if ($id_secteur != $secteur_medias) {
$erreur = _T('xmlrpc_geodiv:erreur_article_media', array('id_article' => $args['id_article']));
return new IXR_Error(-32601, attribut_html($erreur));
}
/**
* Si on demande précisément certains champs, on ne fait que les renvoyer
*/
if (count($champs_demandes) != 0) {
foreach ($res['result'][0] as $champ => $valeur) {
if (!in_array($champ, array('id_article')) && !in_array($champ, $champs_demandes)) {
unset($res['result'][0][$champ]);
}
}
}
/**
* On ajoute le booléen "modifiable" :
* Uniquement si on ne demande pas de champs spécifique ou qu'il soit dedans
*/
if (count($champs_demandes) == 0 || in_array('modifiable', $champs_demandes)) {
if (autoriser('modifier', 'id_article', $args['id_article'], $GLOBALS['visiteur_session'])) {
$res['result'][0]['modifiable'] = 1;
} else {
$res['result'][0]['modifiable'] = 0;
}
}
/**
* On ajoute le logo de l'article :
* Uniquement si on ne demande pas de champs spécifique ou qu'il soit dedans
*/
if (count($champs_demandes) == 0 || in_array('logo', $champs_demandes)) {
$logo = quete_logo('id_article', 'on', $res['result'][0]['id_article'], '', false);
if (is_array($logo)) {
$res['result'][0]['logo'] = url_absolue($logo[0]);
}
}
/**
* On a les infos de l'article, on récupère maintenant :
* (si pas de champs demandés spécifiés ou les champs en question sont demandés)
* -* Son document
* -* Sa vignette
* -* Sa géoloc
* -* Ses mots clés
* -** tags
* -** échelle
* -* Ses commentaires
*/
/**
* On commence par le document principal
*/
if (count($champs_demandes) == 0 || in_array('document', $champs_demandes) || in_array('vignette', $champs_demandes)) {
$document = sql_fetsel('*', 'spip_documents as documents LEFT JOIN spip_documents_liens AS lien ON documents.id_document=lien.id_document', 'lien.objet=' . sql_quote('article') . ' AND lien.id_objet=' . intval($args['id_article']), array(), array(), 1);
if (is_array($document)) {
include_spip('inc/documents');
include_spip('inc/filtres_images_mini');
include_spip('filtres/images_transforme');
if (count($champs_demandes) == 0 || in_array('document', $champs_demandes)) {
$largeur_document = $args['document_largeur'];
$hauteur_document = $args['document_hauteur'];
if (in_array($document['extension'], array('gif', 'png', 'jpg')) && ($largeur_document || $hauteur_document)) {
$res['result'][0]['document'] = url_absolue(extraire_attribut(image_reduire(get_spip_doc($document['fichier']), $largeur_document, $hauteur_document), 'src'));
} else {
$res['result'][0]['document'] = url_absolue(get_spip_doc($document['fichier']));
}
$res['result'][0]['media'] = $document['media'];
$res['result'][0]['extension'] = $document['extension'];
}
//.........这里部分代码省略.........
开发者ID:BenFer,项目名称:geodiversite,代码行数:101,代码来源:geol_xmlrpc.php
示例13: plugin_resume
function plugin_resume($info, $dir_plugins, $plug_file, $url_page)
{
$desc = plugin_propre($info['description']);
$dir = $dir_plugins.$plug_file;
if (($p=strpos($desc, "<br />"))!==FALSE)
$desc = substr($desc, 0,$p);
$url = parametre_url($url_page, "plugin", $dir);
if (isset($info['icon']) and $i = trim($info['icon'])) {
include_spip("inc/filtres_images_mini");
$i = inserer_attribut(image_reduire("$dir/$i", 32),'alt','');
$i = "<div class='icon'><a href='$url' rel='info'>$i</a></div>";
} else $i = '';
return "<div class='resume'>"
. "<h3 class='nom'><a href='$url' rel='info'>"
. typo($info['nom'])
. "</a></h3>"
. " <span class='version'>".$info['version']."</span>"
. " <span class='etat'> - "
. plugin_etat_en_clair($info['etat'])
. "</span>"
. "<div class='short'>".couper($desc,70)."</div>"
. $i
. "</div>";
}
开发者ID:rhertzog,项目名称:lcs,代码行数:27,代码来源:afficher_plugin.php
示例14: mon_reflet
function mon_reflet($image) {
$est = image_reduire($image, 200,150);
$est = image_recadre($est, 200,75,bottom);
$est = image_alpha($est, 50);
$est = image_flip_horizontal($est, "src");
$ret = image_masque($est, "degrade.png");
return $ret;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:8,代码来源:tispipskelet_fonctions.php
示例15: etat_base_accueil
function etat_base_accueil()
{
global $spip_display, $spip_lang_left, $connect_id_rubrique;
$where = count($connect_id_rubrique)
? sql_in('id_rubrique', $connect_id_rubrique) : '';
$res = '';
if ($spip_display != 1) {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($r = $chercher_logo(0, 'id_syndic', 'on')) {
list($fid, $dir, $nom, $format) = $r;
include_spip('inc/filtres_images_mini');
$r = image_reduire("<img src='$fid' alt='' />", 170, 170);
if ($r)
$res ="<div style='text-align:center; margin-bottom: 5px;'>$r</div>";
}
}
$res .= "<div class='verdana1'>";
$res .= propre($GLOBALS['meta']["descriptif_site"]);
$q = sql_select("COUNT(*) AS cnt, statut", 'spip_articles', '', 'statut', '','', "COUNT(*)<>0");
$cpt = array();
$cpt2 = array();
$defaut = $where ? '0/' : '';
while($row = sql_fetch($q)) {
$cpt[$row['statut']] = $row['cnt'];
$cpt2[$row['statut']] = $defaut;
}
if ($cpt) {
if ($where) {
$q = sql_select("COUNT(*) AS cnt, statut", 'spip_articles', $where, "statut");
while($row = sql_fetch($q)) {
$r = $row['statut'];
$cpt2[$r] = intval($row['cnt']) . '/';
}
}
$res .= afficher_plus(generer_url_ecrire("articles_page",""))."<b>"._T('info_articles')."</b>";
$res .= "<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>";
if (isset($cpt['prepa'])) $res .= "<li>"._T("texte_statut_en_cours_redaction").": ".$cpt2['prepa'] . $cpt['prepa'] .'</li>';
if (isset($cpt['prop'])) $res .= "<li>"._T("texte_statut_attente_validation").": ".$cpt2['prop'] . $cpt['prop'] . '</li>';
if (isset($cpt['publie'])) $res .= "<li><b>"._T("texte_statut_publies").": ".$cpt2['publie'].$cpt['publie'] ."</b>" . '</li>';
$res .= "</ul>";
}
$q = sql_select("COUNT(*) AS cnt, statut", 'spip_breves', '', 'statut', '','', "COUNT(*)<>0");
$cpt = array();
$cpt2 = array();
$defaut = $where ? '0/' : '';
while($row = sql_fetch($q)) {
$cpt[$row['statut']] = $row['cnt'];
$cpt2[$row['statut']] = $defaut;
}
if ($cpt) {
if ($where) {
$q = sql_select("COUNT(*) AS cnt, statut", 'spip_breves', $where, "statut");
while($row = sql_fetch($q)) {
$r = $row['statut'];
$cpt2[$r] = intval($row['cnt']) . '/';
}
}
$res .= afficher_plus(generer_url_ecrire("breves",""))."<b>"._T('info_breves_02')."</b>";
$res .= "<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>";
if (isset($cpt['prop'])) $res .= "<li>"._T("texte_statut_attente_validation").": ".$cpt2['prop'].$cpt['prop'] . '</li>';
if (isset($cpt['publie'])) $res .= "<li><b>"._T("texte_statut_publies").": ".$cpt2['publie'] .$cpt['publie'] . "</b>" .'</li>';
$res .= "</ul>";
}
$q = sql_select('COUNT(*) AS cnt, statut', 'spip_forum', sql_in('statut', array('publie', 'prop')), 'statut', '','', "COUNT(*)<>0");
$cpt = array();
$cpt2 = array();
$defaut = $where ? '0/' : '';
while($row = sql_fetch($q)) {
$cpt[$row['statut']] = $row['cnt'];
$cpt2[$row['statut']] = $defaut;
}
if ($cpt) {
if ($where) {
include_spip('inc/forum');
list($f, $w) = critere_statut_controle_forum('public');
$q = sql_select("COUNT(*) AS cnt, F.statut", "$f", "$w ", "F.statut");
while($row = sql_fetch($q)) {
$r = $row['statut'];
$cpt2[$r] = intval($row['cnt']) . '/';
}
}
if (autoriser('modererforum'))
$res .= afficher_plus(generer_url_ecrire("controle_forum",""));
$res .= "<b>" ._T('onglet_messages_publics') ."</b>";
$res .= "<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>";
if (isset($cpt['prop'])) $res .= "<li>"._T("texte_statut_attente_validation").": ".$cpt2['prop'] .$cpt['prop'] . '</li>';
if (isset($cpt['publie'])) $res .= "<li><b>"._T("texte_statut_publies").": ".$cpt2['publie'] .$cpt['publie'] . "</b>" .'</li>';
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:accueil.php
示例16: afficher_objet_boucle
function afficher_objet_boucle($row, $own)
{
global $connect_statut, $spip_lang_right;
static $chercher_logo = true;
list($afficher_langue, $affrub, $langue_defaut, $formater,$type,$primary) = $own;
$vals = array();
$id_objet = $row[$primary];
if (autoriser('voir',$type,$id_objet)){
$date_heure = isset($row['date'])?$row['date']:(isset($row['date_heure'])?$row['date_heure']:"");
$statut = isset($row['statut'])?$row['statut']:"";
if (isset($row['lang']))
changer_typo($lang = $row['lang']);
else $lang = $langue_defaut;
$lang_dir = lang_dir($lang);
$id_rubrique = isset($row['id_rubrique'])?$row['id_rubrique']:0;
$puce_statut = charger_fonction('puce_statut', 'inc');
$vals[] = $puce_statut($id_objet, $statut, $id_rubrique, $type);
list($titre,$suite) = afficher_titre_objet($type,$row);
$flogo = '';
if ($chercher_logo) {
if ($chercher_logo !== true
OR $chercher_logo = charger_fonction_logo_if())
if ($logo = $chercher_logo($id_objet, $primary, 'on')) {
list($fid, $dir, $nom, $format) = $logo;
include_spip('inc/filtres_images_mini');
$logo = image_reduire("<img src='$fid' alt='' />", 26, 20);
if ($logo)
$flogo = "\n<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>$logo</span>";
}
}
if ($titre) {
$titre = "<a href='"
. lien_voir_objet($type,$primary,$id_objet)
. "'>"
. $titre
. "</a>";
}
$vals[] = "\n<div>$flogo$titre$suite</div>";
$s = "";
if ($afficher_langue){
if (isset($row['langue_choisie'])){
$s .= " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>";
if ($row['langue_choisie'] == "oui") $s .= "<b>".traduire_nom_langue($lang)."</b>";
else $s .= "(".traduire_nom_langue($lang).")";
$s .= "</span>";
}
elseif ($lang != $langue_defaut)
$s .= " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>".
($lang
? "(".traduire_nom_langue($lang).")"
: ''
)
."</span>";
}
$vals[] = $s;
$vals[] = afficher_complement_objet($type,$row);
$s = "";
if ($affrub && $id_rubrique) {
$rub = sql_fetsel("id_rubrique, titre", "spip_rubriques", "id_rubrique=$id_rubrique");
$id_rubrique = $rub['id_rubrique'];
$s .= "<a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "' style=\"display:block;\">".typo($rub['titre'])."</a>";
} else
if ($statut){
if ($statut != "prop")
$s = affdate_jourcourt($date_heure);
else
$s .= _T('info_a_valider');
}
$vals[] = $s;
$vals[] = afficher_numero_edit($id_objet, $primary, $type, $row);
}
return $vals;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:82,代码来源:afficher_objets.php
示例17: vignette_automatique
function vignette_automatique($img, $doc, $lien, $x = 0, $y = 0, $align = '', $class = 'spip_logos')
{
include_spip('inc/distant');
include_spip('inc/texte');
include_spip('inc/filtres_images_mini');
$e = $doc['extension'];
if (!$img) {
if ($img = image_du_document($doc)) {
if (!$x and !$y) {
// eviter une double reduction
$img = image_reduire($img);
}
} else {
$f = charger_fonction('vignette', 'inc');
$img = $f($e, false);
$size = @getimagesize($img);
$img = "<img src='{$img}' " . $size[3] . " />";
}
} else {
$size = @getimagesize($img);
$img = "<img src='{$img}' " . $size[3] . " />";
}
// on appelle image_reduire independamment de la presence ou non
// des librairies graphiques
// la fonction sait se debrouiller et faire de son mieux dans tous les cas
if ($x or $y) {
$img = image_reduire($img, $x, $y);
}
$img = inserer_attribut($img, 'alt', '');
$img = inserer_attribut($img, 'class', $class);
if ($align) {
$img = inserer_attribut($img, 'align', $align);
}
if (!$lien) {
return $img;
}
$titre = supprimer_tags(typo($doc['titre']));
$titre = " - " . taille_en_octets($doc['taille']) . ($titre ? " - {$titre}" : "");
$type = sql_fetsel('titre, mime_type', 'spip_types_documents', "extension
|
请发表评论