Commit 547c905d authored by Floréal Cabanettes's avatar Floréal Cabanettes

Change options to new Wordpress send methods: remove addrPub and distDir +...

Change options to new Wordpress send methods: remove addrPub and distDir + improve wordpress post: pictures url set server-side
parent 65cc308a
......@@ -74,16 +74,16 @@ 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, int config);
static QString getSimpleListWithSubLists(QStringList items, int config);
QString conseils);
static QString getSimpleListWithSubLists(QStringList items);
static QStringList makeSimpleList(QString text, bool isMat=false);
static QStringList makeSimpleListWithSubLists(QString text);
static QString getSimpleList(QStringList items, int config);
static QString getNumberedList(QStringList items, int config);
static QString getSimpleList(QStringList items);
static QString getNumberedList(QStringList items);
static QStringList makeNumberedList(QString text);
static QString insertLinks(QString data);
static int restoreLinks(QString *data, QMap<QString, QString> *liens, int nbLien);
static QString insertPictures(QString data, int config);
static QString insertPictures(QString data);
static QString insertMovies(QString data);
static QStringList getSelectedCategories(QMap<QCheckBox*, QString> categories);
static QStringList makeTimes (int hPrep, int minPrep, int hCuis, int minCuis, int jRep,
......@@ -105,6 +105,7 @@ public:
static QString get_ingredient_type(QString ingr);
static bool validate_quantity(QString qte);
static QStringList get_wp_tags(QVariantList tags);
static QString get_img_wp_tag(QString img);
};
#endif // FUNCTIONS_H
This diff is collapsed.
......@@ -54,9 +54,7 @@ QString dirTmp = userDir + "/AppData/Local/Temp/QRecipeWriter";
#endif
QString cmdNav = ""; //Command to launch navigator
QString dirSav; //Directory used to save recipes or "conseils & technics"
QString dirDistPict = ""; //Distant directory where pictures are saved in server
QString addrSite = ""; //Address of the website
QString addrPub = ""; //Address of publication (XML-RPC)
QString typeServer = "wordpress";
QString editPict = ""; //Program for advanced picture editor
QString corrOrtho = ""; //Main dictionnary path
......
This diff is collapsed.
......@@ -36,9 +36,7 @@ extern QString dirPict;
extern QString dirTmp;
extern QString cmdNav;
extern QString dirSav;
extern QString dirDistPict;
extern QString addrSite;
extern QString addrPub;
extern QString typeServer;
extern QString systExp;
extern QString editPict;
......@@ -1755,28 +1753,28 @@ void QRecipeWriter::makeHtmlCode(int config)
}
QString ingredients = "";
if (allIngr.size() > 0)
ingredients = Functions::getSimpleListWithSubLists(allIngr, config);
ingredients = Functions::getSimpleListWithSubLists(allIngr);
QStringList allMat;
for (int it = 0; it < model2->rowCount(); ++it) {
allMat.append(model2->item(it)->text());
}
QString materiel = "";
if (allMat.size() != 0)
materiel = Functions::getSimpleList(allMat, config);
materiel = Functions::getSimpleList(allMat);
QStringList allPrep;
for (int it = 0; it < model3->rowCount(); ++it) {
allPrep.append(model3->item(it)->text());
}
QString preparation = "";
if (allPrep.size() > 0)
preparation = Functions::getNumberedList(allPrep, config);
preparation = Functions::getNumberedList(allPrep);
QStringList allCons;
for (int it = 0; it < model4->rowCount(); ++it) {
allCons.append(model4->item(it)->text());
}
QString conseils = "";
if (allCons.size() > 0)
conseils = Functions::getSimpleList(allCons, config);
conseils = Functions::getSimpleList(allCons);
QString description = Functions::insertLinks(ui->description->toPlainText());
QString descTmp = description;
QRegExp exp ("<a href=\"[^\"]+\" target=\"[^\"]+\">");
......@@ -1794,7 +1792,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, config);
description, ingredients, materiel, preparation, conseils);
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(),
......
This diff is collapsed.
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