Commit 8b3939bc authored by Floréal Cabanettes's avatar Floréal Cabanettes

Wordpress: fix recPrinter from config, not the current one, Fixes #11

parent 550869be
......@@ -82,7 +82,7 @@ public:
static QString generateHtmlCode(QString titre, QString mainPicture, int hPrep, int minPrep, int hCuis, int minCuis, int jRep,
int hRep, int minRep, int nbPersonnes, int nbPersonnes2, QString precision,
QString description, QString ingredients, QString materiel, QString preparation,
QString conseils);
QString conseils, int config);
static QString getSimpleListWithSubLists(QStringList items);
static QStringList makeSimpleList(QString text, bool isMat=false);
static QStringList makeSimpleListWithSubLists(QString text);
......
......@@ -1414,7 +1414,7 @@ QString Functions::get_img_wp_tag(QString img) {
QString Functions::generateHtmlCode(QString titre, QString mainPicture, int hPrep, int minPrep, int hCuis, int minCuis, int jRep,
int hRep, int minRep, int nbPersonnes, int nbPersonnes2, QString precision,
QString description, QString ingredients, QString materiel, QString preparation,
QString conseils)
QString conseils, int config)
{
QString htmlCode = "";
description = "<p>"+description.replace("\n", "<br/>\n")+"</p>";
......@@ -1470,7 +1470,7 @@ QString Functions::generateHtmlCode(QString titre, QString mainPicture, int hPre
htmlCode = htmlCode + "<conseils><p><b>" + QObject::tr("Conseils :") + "</b></p>"+conseils+"</conseils>";
}
//Adding "Version imprimable" balise, only if the website is Cool Cooking, because others might not use it:
if (recPrinter) {
if (serverConfs[config]["recPrinter"] == "1") {
htmlCode = htmlCode + "<br/>[VERSION_IMPRIMABLE]";
}
//Replace oe by "e dans l'o", because we speak French :
......
......@@ -1798,7 +1798,7 @@ void QRecipeWriter::makeHtmlCode(int config)
htmlCode = Functions::generateHtmlCode(ui->titre->text(), imgFileName, ui->hPrep->value(), ui->minPrep->value(),
ui->hCuis->value(), ui->minCuis->value(), ui->jRep->value(), ui->hRep->value(),
ui->minRep->value(), ui->nbPersonnes->value(), ui->nbPersonnes_2->value(), ui->precision->text(),
description, ingredients, materiel, preparation, conseils);
description, ingredients, materiel, preparation, conseils, config);
if (serverConfs[config]["richSnippets"] == "1") {
htmlCode = Functions::makeRichSnippets(ui->titre->text(), imgFileName, ui->hPrep->value(), ui->minPrep->value(),
ui->hCuis->value(), ui->minCuis->value(), ui->jRep->value(), ui->hRep->value(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment