NEW Add a counter of number of words of pages in website module

This commit is contained in:
Laurent Destailleur 2020-08-02 15:53:34 +02:00
parent 728460fa1b
commit 367914015c
3 changed files with 16 additions and 1 deletions

View File

@ -5465,7 +5465,7 @@ function picto_required()
* @param integer $strip_tags 0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag) * @param integer $strip_tags 0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag)
* @return string String cleaned * @return string String cleaned
* *
* @see dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags() * @see dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags(), dolStripPhpCode()
*/ */
function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0) function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0)
{ {

View File

@ -199,6 +199,9 @@ input, select {
border-collapse: collapse; border-collapse: collapse;
border: none; border: none;
} }
#mainbody span.websitetools input.button:not(.buttongen):not(.bordertransp) {
color: #000 !important;
}
#mainbody input.buttongen, #mainbody button.buttongen { #mainbody input.buttongen, #mainbody button.buttongen {
padding: 3px 4px; padding: 3px 4px;
} }

View File

@ -3832,6 +3832,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']); print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>'; print '</tr>';
@ -3891,6 +3892,17 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
print $answerrecord->lang; print $answerrecord->lang;
print '</td>'; print '</td>';
// Number of words
print '<td class="center">';
$textwithouthtml = dol_string_nohtmltag(dolStripPhpCode($answerrecord->content));
$characterMap = 'áàéèëíóúüñùç0123456789';
$nbofwords = str_word_count($textwithouthtml, 0, $characterMap);
if ($nbofwords) {
print $nbofwords.' '.$langs->trans("words");
}
print '</td>';
// Edit properties, HTML sources, status // Edit properties, HTML sources, status
print '<td class="tdwebsitesearchresult right nowraponall">'; print '<td class="tdwebsitesearchresult right nowraponall">';
$disabled = ''; $disabled = '';