Seite 1 von 1

[3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 12:17
von eumelchen
Hallo zusammen,

nachdem mir hier so toll bei meinem Umfrage- bzw. Abstimmungs-Problem geholfen wurde, habe ich noch eine Frage zur Umfrage.

Wenn ich eine Umfrage erstelle, dann erscheint erst die Umfrage und dann der Themen-Text.

Kann man diese Reihenfolge ändern, also dass zuerst der Themen-Text erscheint und dann die Umfrage?

LG Rolf (eumelchen)

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 12:24
von chris1278
Dafür müsste man wahrscheinlich das Template der Posting body oder viewtopic anpassen. Dafür würde ich aber raten einen eigenen style zu erstellen falls du nur prosilver nutzt.

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 13:17
von eumelchen
Das hatte ich mir schon gedacht, wäre aber kein Problem.
Ich benutze einen eigenen modifizierten Prosilver-Style (Prosilver ist Parent-Style).

Das Problem ist nur, dass ich nicht weiß, was ich in der viewtopic_body.html ändern bzw. wie verschieben muss.

Kann mir da jemand helfen?

Noch als Zusatz-Information, ich benutze zusätzlich die Extension Advanced Polls
Link zur Ext: https://www.phpbb.com/community/viewtopic.php?t=2460191

LG Rolf (eumelchen)

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 14:40
von Talk19zehn
phpBB-3.3.4 - prosilver Standard

Hallöchen, du lädst dir die viewtopic_body.html herunter, um sie zu bearbeiten. Die auf dem Server liegende viewtopic_body.html benennst du um: Beispielsweise in original_viewtopic_body.html, so wird diese nicht geladen und du hast das Original als Sicherung parat. Das kann hilfreich sein, wenn du inhaltliche Änderungen abstimmen musst.

In der zur Bearbeitung stehenden viewtopic_body.html suchst du die Zeilen 77 - 132, markierst sie und schneidest diese aus:

Code: Alles auswählen

<!-- EVENT viewtopic_body_poll_before -->

<!-- IF S_HAS_POLL -->
	<form method="post" action="{S_POLL_ACTION}" data-ajax="vote_poll" data-refresh="true" class="topic_poll">

	<div class="panel">
		<div class="inner">

		<div class="content">
			<h2 class="poll-title"><!-- EVENT viewtopic_body_poll_question_prepend -->{POLL_QUESTION}<!-- EVENT viewtopic_body_poll_question_append --></h2>
			<p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE --><span class="poll_max_votes">{L_MAX_VOTES}</span><!-- ENDIF --></p>

			<fieldset class="polls">
			<!-- BEGIN poll_option -->
				<!-- EVENT viewtopic_body_poll_option_before -->
				<dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-alt-text="{L_POLL_VOTED_OPTION}" data-poll-option-id="{poll_option.POLL_OPTION_ID}">
					<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
					<!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
					<dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd>
					<dd class="poll_option_percent<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd>
				</dl>
				<!-- EVENT viewtopic_body_poll_option_after -->
			<!-- END poll_option -->

				<dl class="poll_total_votes<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->">
					<dt>&nbsp;</dt>
					<dd class="resultbar">{L_TOTAL_VOTES}{L_COLON} <span class="poll_total_vote_cnt">{TOTAL_VOTES}</span></dd>
				</dl>

			<!-- IF S_CAN_VOTE -->
				<dl style="border-top: none;" class="poll_vote">
					<dt>&nbsp;</dt>
					<dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
				</dl>
			<!-- ENDIF -->

			<!-- IF not S_DISPLAY_RESULTS -->
				<dl style="border-top: none;" class="poll_view_results">
					<dt>&nbsp;</dt>
					<dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
				</dl>
			<!-- ENDIF -->
			</fieldset>
			<div class="vote-submitted hidden">{L_VOTE_SUBMITTED}</div>
		</div>

		</div>
		{S_FORM_TOKEN}
		{S_HIDDEN_FIELDS}
	</div>

	</form>
	<hr />
<!-- ENDIF -->

<!-- EVENT viewtopic_body_poll_after -->
Nun suchst du erneut:

Code: Alles auswählen

<!-- IF S_QUICK_REPLY -->
	<!-- INCLUDE quickreply_editor.html -->
<!-- ENDIF -->
und fügst davor in einer neuen Zeile ein:

Code: Alles auswählen


<!-- EVENT viewtopic_body_poll_before -->

<!-- IF S_HAS_POLL -->
	<hr>
	<form method="post" action="{S_POLL_ACTION}" data-ajax="vote_poll" data-refresh="true" class="topic_poll">

	<div class="panel">
		<div class="inner">

		<div class="content">
			<h2 class="poll-title"><!-- EVENT viewtopic_body_poll_question_prepend -->{POLL_QUESTION}<!-- EVENT viewtopic_body_poll_question_append --></h2>
			<p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE --><span class="poll_max_votes">{L_MAX_VOTES}</span><!-- ENDIF --></p>

			<fieldset class="polls">
			<!-- BEGIN poll_option -->
				<!-- EVENT viewtopic_body_poll_option_before -->
				<dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-alt-text="{L_POLL_VOTED_OPTION}" data-poll-option-id="{poll_option.POLL_OPTION_ID}">
					<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
					<!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
					<dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd>
					<dd class="poll_option_percent<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd>
				</dl>
				<!-- EVENT viewtopic_body_poll_option_after -->
			<!-- END poll_option -->

				<dl class="poll_total_votes<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->">
					<dt>&nbsp;</dt>
					<dd class="resultbar">{L_TOTAL_VOTES}{L_COLON} <span class="poll_total_vote_cnt">{TOTAL_VOTES}</span></dd>
				</dl>

			<!-- IF S_CAN_VOTE -->
				<dl style="border-top: none;" class="poll_vote">
					<dt>&nbsp;</dt>
					<dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
				</dl>
			<!-- ENDIF -->

			<!-- IF not S_DISPLAY_RESULTS -->
				<dl style="border-top: none;" class="poll_view_results">
					<dt>&nbsp;</dt>
					<dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
				</dl>
			<!-- ENDIF -->
			</fieldset>
			<div class="vote-submitted hidden">{L_VOTE_SUBMITTED}</div>
		</div>

		</div>
		{S_FORM_TOKEN}
		{S_HIDDEN_FIELDS}
	</div>

	</form>
	<hr />
<!-- ENDIF -->

<!-- EVENT viewtopic_body_poll_after -->

Nun lädst du die phpBB-konform bearbeitete und gespeicherte viewtopic_body.html wieder herauf. Im Anschluss bitte alle Caches bereinigen und prüfst dein Ergebnis. Es sollte funktionieren, sofern deine erwähnte EXT und/oder etwaige unbekannte Codierungen deiner individuell angepassten Version nicht dazwischen funken. Probiere es einfach aus, es kann ja nichts kaputt gehen, denke ich zumindest.
Instinktiv habe ich eine Linie <hr> nach <!-- IF S_HAS_POLL --> hinzugefügt, um das Ensemble ein wenig abzugrenzen.

Beste Grüße

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 17:25
von eumelchen
Hallo Talk19zehn,

ich habe es ausprobiert. Es funktioniert! Vielen Dank!

Allerdings gibt es noch ein Problem, wenn jemand in der Umfrage eine Antwort postet wird die eigentliche Umfrage immer weiter an den Schluss geschoben.

Kann man das so ändern, dass die Abstimmung immer hinter dem Eingangs-Post bleibt?

LG Rolf (eumelchen)

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 20:22
von Talk19zehn
Korrekt, daran ändert wohl auch nichts, wenn man die Sortierreihenfolge "auf-, absteigend" persönlich verändert (ungeprüft). Wenn dieser Fall eintritt, verbleibe bitte zunächst beim Original, da meine spontane Erstidee nicht in dem Sinne durchgreift, die du gerne im nächsten Schritt umsetzen möchtest.

Erinnerlich hatten wir das Thema mal in Olympus (phpBB-3.0) gelöst. Okay, die Tiefen seitens phpBB haben sich zwischenzeitlich extrem verändert.

Ein Versuch war es wert. Eventuell wird/kann ein "Insider" ausführlich für dein nun spezielleres, detailliertes Anliegen tätig werden / Auskünfte geben.

LG

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 20:31
von Kirk
Hallo
In der eigentlichen html Datei funktioniert es nicht, du könntest aber in der advancedpolls EXT folgendes machen:
  • Gehe in das Verzeichnis root/ext/wolfsblvt/advancedpolls/styles/prosilver/template/event/
  • Erstelle dort eine Datei Namens viewtopic_body_postrow_post_after.html
  • Trage in diese Datei den Code von Talk19zehn ein, finde dort jenes <!-- IF S_HAS_POLL --> ersetze es mit <!-- IF S_HAS_POLL && postrow.S_FIRST_POST -->
  • Mache die Änderungen in der viewtopic_body.html rückgängig, finde dort jenes <!-- IF S_HAS_POLL --> ersetze es mit <!-- IF 0-->
Danach den Foren und Browser Cache leeren!
Funktioniert aber nur wenn die Sortierreihenfolge auf "Aufsteigend" gesetzt ist.

Re: [3.3] Reihenfolge Umfrage - Themen-Text ändern?

Verfasst: 01.10.2021 20:55
von eumelchen
Hallo Kirk,

das scheint zu funktionieren. Vielen Dank.

LG Rolf (eumel)