diff --git a/src/news.c b/src/news.c index 5c89ef4d..97032d21 100644 --- a/src/news.c +++ b/src/news.c @@ -118,10 +118,12 @@ news_select(const GArray *news_array, gchar *title, gchar *subtitle, *title_id = *subtitle_id = -1; for(i=0;ilen;i++) + { if((!news_check_article_for_repetition(g_array_index(news_array, NewsArticle, order_articles[i]).id) || g_array_index(news_array, NewsArticle, order_articles[i]).priority > 20) && misc_parse_condition(g_array_index(news_array, NewsArticle, order_articles[i]).condition, token_rep_news)) - break; + break; + } if(i == news_array->len) for(i=0;ilen;i++) @@ -648,6 +650,23 @@ news_set_league_cup_tokens(const Fixture *fix) query_league_cup_has_property(cup->id, "hide") || query_league_cup_has_property(cup->id, "omit_from_history")); } + else + { + misc_token_add_bool(token_rep_news, + option_int("string_token_bool_cup_knockout", &tokens), + FALSE); + + misc_token_add_bool(token_rep_news, + option_int("string_token_bool_cup_home_away", &tokens), + FALSE); + + misc_token_add_bool(token_rep_news, + option_int("string_token_bool_cup_first_leg", &tokens), + FALSE); + misc_token_add_bool(token_rep_news, + option_int("string_token_bool_cup_second_leg", &tokens), + FALSE); + } } /** Set the news tokens related to the fixture. */ @@ -797,7 +816,7 @@ news_free_tokens(void) /* printf("-------------------------------------\n"); */ for(i=token_rep_news[0]->len - 1;i >= 0; i--) { -/* printf("%s // %s\n", */ +/* printf("%s // %s\n", */ /* (gchar*)g_ptr_array_index(token_rep_news[0], i), */ /* (gchar*)g_ptr_array_index(token_rep_news[1], i)); */ g_free(g_ptr_array_index(token_rep_news[0], i)); diff --git a/src/xml_loadsave_cup.c b/src/xml_loadsave_cup.c index 45a26f07..99870b1a 100644 --- a/src/xml_loadsave_cup.c +++ b/src/xml_loadsave_cup.c @@ -52,6 +52,7 @@ enum TAG_CUP_CHOOSE_TEAM_FROM_TABLE, TAG_CUP_CHOOSE_TEAM_PRELOAD, TAG_CUP_ROUND, + TAG_CUP_ROUND_NAME, TAG_CUP_ROUND_NEW_TEAMS, TAG_CUP_ROUND_BYES, TAG_CUP_ROUND_TEAMS_FILE, @@ -148,6 +149,7 @@ xml_loadsave_cup_end_element (GMarkupParseContext *context, tag == TAG_WEEK_GAP || tag == TAG_WEEK_BREAK || tag == TAG_WEEK_BREAK_LENGTH || + tag == TAG_SKIP_WEEKS_WITH || tag == TAG_PROPERTY || tag == TAG_CUP_LAST_WEEK || tag == TAG_CUP_ADD_WEEK || @@ -183,6 +185,7 @@ xml_loadsave_cup_end_element (GMarkupParseContext *context, tag == TAG_CUP_ROUND_TEAM_PTR_ID || tag == TAG_CUP_ROUND_TABLE_FILE || tag == TAG_CUP_ROUND_NEW_TEAMS || + tag == TAG_CUP_ROUND_NAME || tag == TAG_CUP_ROUND_BYES || tag == TAG_CUP_ROUND_REPLAY || tag == TAG_CUP_ROUND_NEUTRAL || @@ -246,6 +249,8 @@ xml_loadsave_cup_text (GMarkupParseContext *context, new_week_break.length = int_value; g_array_append_val(new_cup->week_breaks, new_week_break); } + else if(state == TAG_SKIP_WEEKS_WITH) + g_ptr_array_add(new_cup->skip_weeks_with, g_strdup(buf)); else if(state == TAG_YELLOW_RED) new_cup->yellow_red = int_value; else if(state == TAG_PROPERTY) @@ -288,6 +293,8 @@ xml_loadsave_cup_text (GMarkupParseContext *context, new_round.home_away = int_value; else if(state == TAG_CUP_ROUND_NEW_TEAMS) new_round.new_teams = int_value; + else if(state == TAG_CUP_ROUND_NAME) + new_round.name = g_strdup(buf); else if(state == TAG_CUP_ROUND_BYES) new_round.byes = int_value; else if(state == TAG_CUP_ROUND_TEAMS_FILE) @@ -425,9 +432,14 @@ xml_loadsave_cup_write(const gchar *prefix, const Cup *cup) xml_write_string(fil, (gchar*)g_ptr_array_index(cup->properties, i), TAG_PROPERTY, I0); + for(i = 0; i < cup->skip_weeks_with->len; i++) + xml_write_string(fil, (gchar*)g_ptr_array_index(cup->skip_weeks_with, i), + TAG_SKIP_WEEKS_WITH, I0); + for(i=0;irounds->len;i++) xml_loadsave_cup_write_round(fil, prefix, cup, i); + for(i = 0; i < cup->week_breaks->len; i++) { xml_write_int(fil, g_array_index(cup->week_breaks, WeekBreak, i).week_number, TAG_WEEK_BREAK, I0); @@ -473,6 +485,8 @@ xml_loadsave_cup_write_round(FILE *fil, const gchar *prefix, const Cup *cup, gin xml_loadsave_teams_write(buf, cup_round->teams); } + xml_write_string(fil, cup_round->name, + TAG_CUP_ROUND_NAME, I1); xml_write_int(fil, cup_round->new_teams, TAG_CUP_ROUND_NEW_TEAMS, I1); xml_write_int(fil, cup_round->byes, diff --git a/support_files/news/news_en.xml b/support_files/news/news_en.xml index 66064082..b8f18245 100644 --- a/support_files/news/news_en.xml +++ b/support_files/news/news_en.xml @@ -1,7 +1,7 @@ match - _TLAYERDIFF_ = 0 and _GD_ G 3 + _TLAYERDIFF_ = 0 and _GD_ G 3 and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties @@ -32,7 +32,7 @@ match - _TLAYERDIFF_ = 0 and _GD_ G 2 + _TLAYERDIFF_ = 0 and _GD_ G 2 and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties @@ -45,7 +45,7 @@ _TW_ dominates at _TL_ _TW_ dominates away _TW_ victorious despite _GOALS_TLN__ goals against - _GOALS_TLN__ not enough for _TL_ + _GOALS_TLN__ goals not enough for _TL_ _TW_ controls _TL_ in _REW_ effort. _TW_ dispatches _TL_ with a _RE_ home win. _TW_ keeps the upper hand in a match with numerous goals. @@ -65,10 +65,10 @@ match - _TLAYERDIFF_ = 0 and _GOALS0_ != _GOALS1_ + _TLAYERDIFF_ = 0 and _GOALS0_ != _GOALS1_ and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) 5 - _TW_ besiegt _TL_ mit _REW_ - _TL_ unterliegt _TW_ _REL_ + _TW_ [beats|overcomes|defeats] _TL_ _REW_ + _TL_ loses to _TW_ _REL_ _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties @@ -121,78 +121,73 @@ match - _TLAYERDIFF_ = 0 and _GDAGG_ = 0 + _TLAYERDIFF_ = 0 and _GD_ = 0 and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties _TW_ hold their nerves in penalty shoot-out - _T1_ holt Unentschieden bei _T0_ - _T0_ kommt zuhause nicht über ein _RE_ hinaus - Mageres Unentschieden für [_T0_|_T1_] - Torloses Unentschieden bei _T0_ gegen _T_ - _T0_ und _T1_ trennen sich _RE_ - Punkteteilung bei _T0_ gegen _T1_ - Abwechslungsreiches Remis für _T0_ - Langeweile pur bei _T0_ gegen _T1_ - [_T0_|_T1_] scheitert an Problemen in der Defensivabteilung. - [_T0_|_T1_] lässt _GOALS1_ Tore zu und muss sich über ein Remis nicht wundern. - [_T0_|_T1_] muss _GOALS1_ Treffer hinnehmen und holt nur ein Unentschieden. - Tore von _SCORERS0_ reichen _T0_ nur für ein _RE_. - _SCORERS0_ rettet Unentschieden für _T0_ gegen _T1_. - _SCORERS1_ rettet Unentschieden für _T1_ in _T0_. - _T0_ und _T1_ langweilen _AT_ Zuschauer mit Rumpelfussball und einem unsäglichen _RE_. - Beiden Teams fehlte die Energie in dieser Partie. - Faire Punkteteilung nach ausgeglichenem Spiel. - Das Remis hilft aber keinem der beiden Teams weiter. - Weder _T0_ noch _T1_ können mit einem Unentschieden zufrieden sein. - Zahlreiche der _AT_ Zuschauer sterben an Langeweile während dieses unterirdischen Spiels. - Die beiden Teams liefern einen Grottenkick aus der Zeit des Catenaccio. - _AT_ werden trotz Unentschieden beim _RE_ gut unterhalten. - Trainer von [_T0_|_T1_] will sich in den nächsten Wochen auf die Defensive konzentrieren. - Gute Offensivleistung von [_T0_|_T1_] wird durch Leichtsinnsfehler kaputtgemacht. - [_T0_|_T1_] verschenkt durch Fehler in der Verteidigung den Sieg. - Ein Fehler kostet [_T0_|_T1_] den Sieg. - Mangelhafte Chancenverwertung raubt _T0_ die Chance auf den Sieg. - Mangelhafte Chancenverwertung raubt _T1_ die Chance auf den Sieg. - Ein verschenkter Elfmeter wird den Spielern von _T1_ noch lange den Schlaf rauben. - Ein verschenkter Elfmeter wird den Spielern von _T0_ noch lange den Schlaf rauben. - _T0_ holt nur Unentschieden, ist aber seit _UNBEATEN0_ Matches ungeschlagen. - Vor _AT_ Zuschauern bleibt _T0_ auch im _UNBEATEN0_-ten Spiel ohne Niederlage. - _T0_ ist in der Liga auch für _T1_ nicht zu knacken und baut die Serie ohne Niederlage auf _UNBEATEN0_ aus. - Mit dem _RE_ ist _T0_ nun schon seit _UNBEATEN0_ Begegnungen in der Liga ungeschlagen. + _T1_ gets the draw at _T0_ + _T0_ manages only a _RE_ tie at home + Meagre draw for [_T0_|_T1_] + Goal-less draw in _T0_ vs. _T1_ + _T0_ and _T1_ share the points + Eventful draw for [_T0_|_T1_] + _T0_ vs. _T1_ is pure boredom + [_T0_|_T1_] let down by horrible defense. + [_T0_|_T1_] allows _GOALS1_ goals and should be satisfied with a tie. + [_T0_|_T1_] allows _GOALS1_ and gets only a draw. + Goals by _SCORERS0_ only ensure a _RE_ for _T0_. + _SCORERS0_ saves the draw for _T0_ against _T1_. + _SCORERS1_ saves the draw for _T1_ at _T0_. + _T0_ and _T1_ bore _AT_ spectators with horrible, horrible play and an utterly disappointing _RE_. + Both teams clearly lacked the energy in this match. + The draw doesn't help either team. + Neither _T0_ nor _T1_ can really be satisfied with a tie. + Several of the _AT_ spectators die of boredom during an atrocious game. + The two teams deliver repulsing football reminiscent of the days of Catenaccio. + _AT_ spectators enjoy a lively game despite the _RE_ draw. + The coach of [_T0_|_T1_] vows to concentrate on getting the defense in shape during the coming weeks. + [_T0_|_T1_] combines good offense with costly mistakes and only gets the draw. + [_T0_|_T1_] commits some easy mistakes and wastes victory. + One mistake by [_T0_|_T1_] wastes victory. + _T0_ waste their scoring chances and only get the draw. + _T1_ waste their scoring chances and only get the draw. + A wasted penalty shot will haunt _T1_'s players for a long time. + A wasted penalty shot will haunt _T0_'s players for a long time. + _T0_ only gets the draw but the unbeaten streak of _UNBEATEN0_ matches is still alive. + _AT_ spectators watch _T0_ extend their unbeaten streak to _UNBEATEN0_. + _T0_ unbeatable for _T1_ and extends streak to _UNBEATEN0_ matches without loss in _LEAGUECUPNAME_. match - _TLAYERDIFF_ = 0 and _GD_ = 1 + _TLAYERDIFF_ = 0 and _GD_ = 1 and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties _TW_ hold their nerves in penalty shoot-out - Knappes _REW_ für _TW_ - _TW_ siegt knapp gegen _TL_ - _TW_ bezwingt _TL_ knapp - Hauchdünner Sieg für _TW_ - _TL_ ärgert sich über unnötige Niederlage - _TL_ unterliegt _TW_ knapp - Spannung pur bei _T0_ gegen _T1_ - Enges Spiel endet glücklich für _TW_ - Spannende Partie bei _T0_ - Glücklicher Heimsieg für _TW_ - _TW_ siegt bei _TL_ denkbar knapp - Vor _AT_ Zuschauern behält _TW_ mit einem Tor Vorsprung die Oberhand. - _AT_ Zuschauer sehen ein spannendes Spiel von zwei ausgeglichenen Mannschaften. - _TW_ gewinnt mit einem knappen, aber verdienten _REW_ gegen _TL_. - Es wäre für _TL_ wesentlich mehr als das undankbare _REL_ drin gewesen. - Es wäre für _TL_ wesentlich mehr als das undankbare _REL_ drin gewesen. - _SCORERS_TWN__ entscheidet das Spiel mit seinem Tor. - Ein einziges Tor reicht für _TW_ für den Erfolg. - Ein einziges Tor reicht für _TW_ für drei Punkte. + Tight _REW_ for _TW_ + _TW_ [beats|overcomes|defeats] _TL_ in a [tight|close|tense] match + _TW_ wins in a [tight|close|tense] match + _TL_ frustrated about unnecessary loss + _TL_ loses to _TW_ in a [tight|close|tense] encounter + Pure excitement in _T0_ vs. _T1_ + Close match with happy ending for _TW_ + Exciting game at _T0_ + _TW_ fortunate to get home win + _TW_ wins at _TL_ in a [tight|close|tense] game + _AT_ spectators watch _TW_ come out only one goal ahead of _TL_. + _AT_ spectators see a [tight|close|tense] encounter between two equal teams. + _TW_ gets a [tight|close|tense] but deserved _REW_ against _TL_. + _TL_ should have gotten more than a disappointing and unfortunate _REL_ out of this match. + _SCORERS_TWN__ gets the game winning goal. + One goal is enough for _TW_ to get the win in this match. + One goal is enough for _TW_ to grab three points. match - _TLAYERDIFF_ = 0 and _GD_ != 0 and _TAVSKILLDIFF_ > 7 + _TLAYERDIFF_ = 0 and _GD_ != 0 and _TAVSKILLDIFF_ > 7 and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties @@ -216,7 +211,7 @@ match - _TLAYERDIFF_ > 0 + _TLAYERDIFF_ > 0 and (_CUPKO_ = 0 or _CUPHOMEAWAY_ = 0 or _CUPFIRSTLEG_ = 1) _TW_ [beats|overcomes|defeats] _TL_ in extra time _TW_ victorious in extra time _TW_ [beats|overcomes|defeats] _TL_ _REW_ in penalties