http://www.phpwcms.de/forum/viewtopic.p ... light=poll
Hallo Leute!
1. Ich habe mein poll umgeändert so das man jetz ein poll sperren kann (checkbox im backend cnt-poll). Wenn er also gesperrt wird sieht man im Frontend nur die Anzahl der Stimmen ohne das man abstimmen kann. Somit ist es möglich auch alle geschlossenen polls anzuzeigen.
2. Beim editieren des polls werden immer alle votes automatisch auf null gesetzt. Das habe ich auch umgeändert. Jetz ist es möglich Verbesserungen am Text durchzuführen ohne das die votes auf null gesetzt werden. Mit einer checkbox im backend cnt-poll kann man jetz alle votes auf null setzen.
Hier die Änderungen:
Datei: /include/inc_tmpl/content/cnt89.inc.php
In der letzten Zeile (in the last line):
Code: Select all
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10"></td></tr>
Code: Select all
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
<tr>
<td align="right" class="chatlist"><?php echo $BL['be_login_cpactive'] ?>: </td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#E7E8EB"><input name="cpoll_final" type="checkbox" id="cpoll_final" value="1" <?php is_checked(1, $content['poll_form']['final']); ?>></td>
<td bgcolor="#E7E8EB" class="v10" align="left"> <?php echo $BL['be_fprivfunc_cactive'] ?> </td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
<tr>
<td align="right" class="chatlist">Reset: </td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#E7E8EB"><input name="cpoll_reset" type="checkbox" id="cpoll_reset" value="1" <?php is_checked(1, $content['reset_poll']); ?>></td>
<td bgcolor="#E7E8EB" class="v10" align="left"> auf Null setzen </td>
</tr>
</table>
</td>
</tr>
----------------------------------------------------------------------------------
Datei: /include/inc_lib/content/cnt89.readform.inc.php
Nach dieser Zeile (after this line):
Code: Select all
$content["poll_zoom"] = isset($_POST["cpoll_zoom"]) ? 1 : 0;
Code: Select all
//---------------------------final-------------------------------
$content['poll_final'] = isset($_POST["cpoll_final"]) ? 1 : 0;
$content['reset_poll'] = isset($_POST["cpoll_reset"]) ? 1 : 0;
//---------------------------end final---------------------------
Code: Select all
$content['poll_form']['count'] = array();
$content['poll_form']['ip'] = array();
Code: Select all
//---------------------------final-------------------------------
if($content['reset_poll']==1){
//---------------------------end final---------------------------
$content['poll_form']['count'] = array();
$content['poll_form']['ip'] = array();
//---------------------------final-------------------------------
}
//---------------------------end final---------------------------
Code: Select all
foreach($content['poll_cctext'] as $key => $value)
{
$content['poll_form']['count'][$key] = 0; // initialize count to zero
}
Code: Select all
//---------------------------final-------------------------------
$content['poll_form']['final'] = $content["poll_final"];
if($content['reset_poll']==1){
//---------------------------end final---------------------------
foreach($content['poll_cctext'] as $key => $value)
{
$content['poll_form']['count'][$key] = 0; // initialize count to zero
}
//---------------------------final-------------------------------
}
//---------------------------end final---------------------------
----------------------------------------------------------------------------------
Datei: /include/inc_front/content/cnt89.article.inc.php
Folgenden Code - search for this code (ca. Zeile/line 47):
Code: Select all
if($poll_id == $crow['acontent_id'] && isset($_POST["poll"]) && !in_array($remoteIP, $poll_form["ip"])) {
Code: Select all
if($poll_id == $crow['acontent_id'] && isset($_POST["poll"]) && !in_array($remoteIP, $poll_form["ip"]) && $poll_form["final"]==1) {
Code: Select all
if(in_array(remoteIP, $poll_form["ip"])) {
Code: Select all
if(in_array($remoteIP, $poll_form["ip"]) || $poll_form["final"]==0) {
Bei Problemen einfach posten oder eine PN senden!
Viel Spaß mit dem poll hack