Fork me on GitHub


 Bas   Précédent   Suivant

« 1 ... 21 22 23 (24) 25 26 27 ... 19803 »


Installation Xoops
Régulier
Inscrit: 27/11/2011 18:07
De Morbihan
Messages: 331
Bonjour,

J'ai publié un site il y a plus de dix ans... et j'ai oublié les bases !!!

J'ai donc installé XOOPS en local puis j'ai installé le module Publisher pour créer mon premier article.
Mon problème est maintenant le suivant: comment faire apparaitre en haut de page un menu où je peux retrouver un lien vers ce nouvel article ??
Je ne trouve pas de module Menu... Est-ce normal et faut-il installer un module Menu particulier ?

Je suis complètement perdu;;;

Merci de m'aider.

Posté le : 13/02/2023 12:44
_________________
Chti en Morbihan
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Semi pro
Inscrit: 26/07/2011 14:05
De Fleurus (W-B) (Belgique)
Messages: 795
JDai moi je n’est pas cette option là moi c'est quand même asse embêtant sa

Open in new window

Posté le : 13/02/2023 12:24
_________________
Je suis souvent copié mais "copié = Synonyme de célébrité" Alors continuez mes fans.
Site Radioamateur Belge
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Team FrXoops
Inscrit: 14/05/2004 22:32
Messages: 2554
Open in new window

Posté le : 13/02/2023 11:43
_________________
Ne pas perdre patience, même si cela semble impossible, c'est déjà de la patience.
Origami
Conseil des Sages
Sur gitHub
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Semi pro
Inscrit: 26/07/2011 14:05
De Fleurus (W-B) (Belgique)
Messages: 795
Comment on fait pour attacher le fichier car je ne trouve pas comment faire désoler

Posté le : 13/02/2023 09:17
_________________
Je suis souvent copié mais "copié = Synonyme de célébrité" Alors continuez mes fans.
Site Radioamateur Belge
Transférer la contribution vers d'autres applications Transférer


Re: Migrer un vieux site en HTTPS ?
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Bonjour,
le https n'a rien a voir avec la sécurité dans ton cas.
Ton hébergeur a bloqué ton site car tu utilises certainement une vieille version de XOOPS pour laquelle la version de PHP ne doit pas être à minima 7.x mais encore 5.x.

De plus, le module concerné, dont tu ne précises ni son nom exact si sa version doit être très ancien et doit comporter des failles.

La vie d'un site web passe évidement par l'ajout de contenu MAIS AUSSI par sa maintenance via l'application des mises à jour de XOOPS et de ses modules.

J'espère t'avoir éclairé quand au problème que tu rencontres avec ton hébergeur. Je pense que celui a du te contacter depuis au moins 1 an ou 2 pour indiquer qu'il ne prendrai plus en charge les site en PHP 5.x mais tu n'en a pas tenu compte.

En résumé, MAJ XOOPS via la procédure, MAJ des modules ou passages à de modules mieux développé et suivis.
Attention, pour effectuer une MAJ, il convient de tester celle-ci sur un site de test avant de se lancer en direct sur ton site officiel.

Alain

Posté le : 12/02/2023 21:01
_________________
Open in new window
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Team FrXoops
Inscrit: 14/05/2004 22:32
Messages: 2554
Pas le code, le fichier STP

Posté le : 12/02/2023 19:36
_________________
Ne pas perdre patience, même si cela semble impossible, c'est déjà de la patience.
Origami
Conseil des Sages
Sur gitHub
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Semi pro
Inscrit: 26/07/2011 14:05
De Fleurus (W-B) (Belgique)
Messages: 795
Citation :
JJDai a écrit :
bin attacher un fichier ci-dessous


<?php

declare(strict_types=1);

namespace XoopsModules\Cb;

/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
* @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @since 1.0
* @author trabis <lusopoemas@gmail.com>
* @author The SmartFactory <www.smartfactory.ca>
*/

require_once \dirname(__DIR__) . '/include/common.php';

/**
* Class Metagen
*/
class Metagen
{
/**
* @var Helper
*/
public $helper;
/**
* @var \MyTextSanitizer
*/
public $myts;
/**
* @var string
*/
public $title;
/**
* @var string
*/
public $originalTitle;
/**
* @var string
*/
public $keywords;
/**
* @var string
*/
public $categoryPath;
/**
* @var string
*/
public $description;
/**
* @var int
*/
public $minChar = 4;

/**
* @param string $title
* @param string $keywords
* @param string $description
* @param string $categoryPath
*/
public function __construct($title, $keywords = '', $description = '', $categoryPath = '')
{
/** @var Helper $this->helper */
$this->helper = Helper::getInstance();
$this->myts = \MyTextSanitizer::getInstance();
$this->setCategoryPath($categoryPath);
$this->setTitle($title);
$this->setDescription($description);
if ('' == $keywords) {
$keywords = $this->createMetaKeywords();
}
$this->setKeywords($keywords);
}

/**
* @param string $title
*/
public function setTitle($title)
{
$this->title = $this->html2text($title);
$this->originalTitle = $this->title;
$titleTag = [];
$titleTag['module'] = $this->helper->getModule()->getVar('name');
if (isset($this->title) && ('' != $this->title) && (\mb_strtoupper($this->title) != \mb_strtoupper($titleTag['module']))) {
$titleTag['title'] = $this->title;
}
if (isset($this->categoryPath) && ('' != $this->categoryPath)) {
$titleTag['category'] = $this->categoryPath;
}
$ret = $titleTag['title'] ?? '';
if (isset($titleTag['category']) && '' != $titleTag['category']) {
if ('' != $ret) {
$ret .= ' - ';
}
$ret .= $titleTag['category'];
}
if (isset($titleTag['module']) && '' != $titleTag['module']) {
if ('' != $ret) {
$ret .= ' - ';
}
$ret .= $titleTag['module'];
}
$this->title = $ret;
}

/**
* @param string $keywords
*/
public function setKeywords($keywords)
{
$this->keywords = $keywords;
}

/**
* @param string $categoryPath
*/
public function setCategoryPath($categoryPath)
{
$categoryPath = $this->html2text($categoryPath);
$this->categoryPath = $categoryPath;
}

/**
* @param string $description
*/
public function setDescription($description)
{
$description = $this->html2text($description);
$description = $this->purifyText($description);
$this->description = $description;
}

/**
* Does nothing
*/
public function createTitleTag()
{
}

/**
* @param int $maxWords
*
* @return string
*/
public function createMetaDescription($maxWords = 30)
{
$description = $this->purifyText($this->description);
$description = $this->html2text($description);
$words = \explode(' ', $description);
$ret = '';
$i = 1;
$wordCount = \count($words);
foreach ($words as $word) {
$ret .= $word;
if ($i < $wordCount) {
$ret .= ' ';
}
++$i;
}

return $ret;
}

/**
* @param string $text
* @param int $minChar
*
* @return array
*/
public function findMetaKeywords($text, $minChar)
{
$keywords = [];
$text = $this->purifyText($text);
$text = $this->html2text($text);
$originalKeywords = \explode(' ', $text);
foreach ($originalKeywords as $originalKeyword) {
$secondRoundKeywords = \explode("'", $originalKeyword);
foreach ($secondRoundKeywords as $secondRoundKeyword) {
if (\mb_strlen($secondRoundKeyword) >= $minChar) {
if (!\in_array($secondRoundKeyword, $keywords, true)) {
$keywords[] = \trim($secondRoundKeyword);
}
}
}
}

return $keywords;
}

/**
* @return string
*/
public function createMetaKeywords()
{
$keywords = $this->findMetaKeywords($this->originalTitle . ' ' . $this->description, $this->minChar);
$moduleKeywords = $this->helper->getConfig('seo_meta_keywords');
if ('' != $moduleKeywords) {
$moduleKeywords = \explode(',', $moduleKeywords);
$keywords = \array_merge($keywords, \array_map('\trim', $moduleKeywords));
}
$ret = \implode(',', $keywords);

return $ret;
}

/**
* Does nothing
*/
public function autoBuildMetaKeywords()
{
}

/**
* Build Metatags
*/
public function buildAutoMetaTags()
{
$this->keywords = $this->createMetaKeywords();
$this->description = $this->createMetaDescription();
//$this->title = $this->createTitleTag();
}

/**
* Creates meta tags
*/
public function createMetaTags()
{
global $xoopsTpl, $xoTheme;
if ('' != $this->keywords) {
$xoTheme->addMeta('meta', 'keywords', $this->keywords);
}
if ('' != $this->description) {
$xoTheme->addMeta('meta', 'description', $this->description);
}
if ('' != $this->title) {
$xoopsTpl->assign('xoops_pagetitle', $this->title);
}
}

/**
* Return true if the string is length > 0
*
* @credit psylove
* @param mixed $var
* @return bool
*/
public static function emptyString($var)
{
return ('' !== $var);
}

/**
* Create a title for the short_url field of an article
*
* @credit psylove
*
* @param string|array $title title of the article
* @param bool $withExt do we add an html extension or not
*
* @return string short url for article
*/
public static function generateSeoTitle($title = '', $withExt = true)
{
// Transformation de la chaine en minuscule
// Codage de la chaine afin d'éviter les erreurs 500 en cas de caractères imprévus
$title = \rawurlencode(\mb_strtolower($title));
// Transformation des ponctuations

$pattern = [
'/%09/', // Tab
'/%20/', // Space
'/%21/', // !
'/%22/', // "
'/%23/', // #
'/%25/', // %
'/%26/', // &
'/%27/', // '
'/%28/', // (
'/%29/', // )
'/%2C/', // ,
'/%2F/', // /
'/%3A/', // :
'/%3B/', // ;
'/%3C/', // <
'/%3D/', // =
'/%3E/', // >
'/%3F/', // ?
'/%40/', // @
'/%5B/', // [
'/%5C/', // \
'/%5D/', // ]
'/%5E/', // ^
'/%7B/', // {
'/%7C/', // |
'/%7D/', // }
'/%7E/', // ~
'/\./', // .
];
$repPat = ['-', '-', '-', '-', '-', '-100', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-at-', '-', '-', '-', '-', '-', '-', '-', '-', '-'];
$title = \preg_replace($pattern, $repPat, $title);
// Transformation des caractères accentués
$pattern = [
'/%B0/', // °
'/%E8/', // è
'/%E9/', // é
'/%EA/', // ê
'/%EB/', // ë
'/%E7/', // ç
'/%E0/', // à
'/%E2/', // â
'/%E4/', // ä
'/%EE/', // î
'/%EF/', // ï
'/%F9/', // ù
'/%FC/', // ü
'/%FB/', // û
'/%F4/', // ô
'/%F6/', // ö
];
$repPat = ['-', 'e', 'e', 'e', 'e', 'c', 'a', 'a', 'a', 'i', 'i', 'u', 'u', 'u', 'o', 'o'];
$title = \preg_replace($pattern, $repPat, $title);
$tableau = \explode('-', $title); // Transforms the string in table //Transforme la chaine de caractères en tableau
$tableau = \array_filter($tableau, [__CLASS__, 'emptyString']); // Remove empty strings of the table //Supprime les chaines vides du tableau
$title = \implode('-', $tableau); // Transforms a character string in table separated by a hyphen //Transforme un tableau en chaine de caractères séparé par un tiret
if ($title && !(\is_array($title))) {
if ($withExt) {
$title .= '.html';
}

return $title;
}

return '';
}

/**
* @param $text
* @param bool $keyword
*
* @return mixed
*/
public function purifyText($text, $keyword = false)
{
// $text = str_replace(['&nbsp;', ' '], ['<br>', ' '], $text); //for php 5.4
$text = \str_replace('&nbsp;', ' ', $text);
$text = \str_replace('<br>', ' ', $text);
$text = \strip_tags($text);
$text = \html_entity_decode($text);
$text = $this->myts->undoHtmlSpecialChars($text);

$text = \str_replace(')', ' ', $text);
$text = \str_replace('(', ' ', $text);
$text = \str_replace(':', ' ', $text);
$text = \str_replace('&euro', ' euro ', $text);
$text = \str_replace('&hellip', '...', $text);
$text = \str_replace('&rsquo', ' ', $text);
$text = \str_replace('!', ' ', $text);
$text = \str_replace('?', ' ', $text);
$text = \str_replace('"', ' ', $text);
$text = \str_replace('-', ' ', $text);
$text = \str_replace('\n', ' ', $text);

// $text = str_replace([')','(',':','&euro','&hellip','&rsquo','!','?','"','-','\n'], [' ' , ' ', ' ', ' euro ', '...', ' ', ' ', ' ', ' ', ' ', ' '], $text); //for PHP 5.4

if ($keyword) {
$text = \str_replace('.', ' ', $text);
$text = \str_replace(',', ' ', $text);
$text = \str_replace('\'', ' ', $text);
// $text = str_replace(['.', ' '], [',', ' '], ['\'', ' '], $text); //for PHP 5.4
}
$text = \str_replace(';', ' ', $text);

return $text;
}

/**
* @param string $document
*
* @return mixed
*/
public function html2text($document)
{
if (empty($document)) {
return '';
}
// PHP Manual:: function preg_replace
// $document should contain an HTML document.
// This will remove HTML tags, javascript sections
// and white space. It will also convert some
// common HTML entities to their text equivalent.
// Credits : newbb2
$search = [
"'<script[^>]*?>.*?</script>'si", // Strip out javascript
"'<img.*?>'si", // Strip out img tags
"'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace HTML entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
]; // evaluate as php

$replace = [
'',
'',
'',
'\\1',
'"',
'&',
'<',
'>',
' ',
\chr(161),
\chr(162),
\chr(163),
\chr(169),
];

$text = \preg_replace($search, $replace, $document);

\preg_replace_callback(
'/&#(\d+);/',
static function ($matches) {
return \chr($matches[1]);
},
$document
);

return $text;
}
}


Voila mon code

Posté le : 12/02/2023 17:14
_________________
Je suis souvent copié mais "copié = Synonyme de célébrité" Alors continuez mes fans.
Site Radioamateur Belge
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Team FrXoops
Inscrit: 14/05/2004 22:32
Messages: 2554
bin attacher un fichier ci-dessous

Posté le : 12/02/2023 16:15
_________________
Ne pas perdre patience, même si cela semble impossible, c'est déjà de la patience.
Origami
Conseil des Sages
Sur gitHub
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Semi pro
Inscrit: 26/07/2011 14:05
De Fleurus (W-B) (Belgique)
Messages: 795
Citation :
JJDai a écrit :
Peux-tu envoyer ce fichier ?

Bonjour JJDai, comment je fait pour vous l'envoyer?

Posté le : 12/02/2023 15:17
_________________
Je suis souvent copié mais "copié = Synonyme de célébrité" Alors continuez mes fans.
Site Radioamateur Belge
Transférer la contribution vers d'autres applications Transférer


Re: Publisher 1.08
Team FrXoops
Inscrit: 14/05/2004 22:32
Messages: 2554
Peux-tu envoyer ce fichier ?

Posté le : 12/02/2023 14:32
_________________
Ne pas perdre patience, même si cela semble impossible, c'est déjà de la patience.
Origami
Conseil des Sages
Sur gitHub
Transférer la contribution vers d'autres applications Transférer



 Haut
« 1 ... 21 22 23 (24) 25 26 27 ... 19803 »




Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

103 Personne(s) en ligne (92 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 103 | Plus ...