TheRaskol - 2013-01-12 15:22 GMT -
Merhaba;
randpolls eklentisinde anasayfada ??kan anketlere cevap verdi?imizde (g?nder butonu) a??lan sayfan?n yeni pencerede a??lmas?n? nas?l yapabiliriz?
?u ?ekilde olmad? malesef
te?ekk?rler.
Bu mesaj TheRaskol tarafından 2013-01-12 15:35 GMT, 4971 Gün önce düzenlendi.
Merhaba;
randpolls eklentisinde anasayfada ??kan anketlere cevap verdi?imizde (g?nder butonu) a??lan sayfan?n yeni pencerede a??lmas?n? nas?l yapabiliriz?
?u ?ekilde olmad? malesef
Kod:
$res .= "<input type=\"hidden\" name=\"id\" target=\"_blank\" value=".$poll_id.">";
$res .= "<input type=\"hidden\" name=\"a\" value=\"send\" target=\"_blank\">";
$res .= "<br /><p style=\"text-align: center; \"><input type=\"submit\" class=\"submit\" target=\"_blank\" value=\"G?nder\">";
$res .= "<br /><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a><br /><a href=\"javascript:polls('viewall')\">".$L['polls_viewarchives']."</a></p></form>";
$res .= "<input type=\"hidden\" name=\"a\" value=\"send\" target=\"_blank\">";
$res .= "<br /><p style=\"text-align: center; \"><input type=\"submit\" class=\"submit\" target=\"_blank\" value=\"G?nder\">";
$res .= "<br /><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a><br /><a href=\"javascript:polls('viewall')\">".$L['polls_viewarchives']."</a></p></form>";
te?ekk?rler.
Bu mesaj TheRaskol tarafından 2013-01-12 15:35 GMT, 4971 Gün önce düzenlendi.
Kaan - 2013-01-14 22:48 GMT -
Tam olarak anlamad?m g?nder butonu a??lan penceredemi olucak?
Tam olarak anlamad?m g?nder butonu a??lan penceredemi olucak?
TheRaskol - 2013-01-14 23:27 GMT -
hay?r g?nder butonu zaten anasayfa blokta. o g?nder'e t?klad???m?z anda anket sonucu yeni pencerede a??lacak.
hay?r g?nder butonu zaten anasayfa blokta. o g?nder'e t?klad???m?z anda anket sonucu yeni pencerede a??lacak.
Kaan - 2013-01-14 23:47 GMT -
Eklentinin kodlar?n? buraya ekle bakal?m.
Eklentinin kodlar?n? buraya ekle bakal?m.
TheRaskol - 2013-03-08 14:06 GMT -
Kod:
<?PHP
/* ====================
Seditio - Website engine
Copyright Neocrome
<a href="http://www.neocrome.net" target="_blank"><b>http://www.neocrome.net</b></a>
[BEGIN_SED]
File=plugins/randpolls/inc/randpolls.inc.php
Version=110
Updated=2006-jun-15
Type=Core
Author=Neocrome
Description=Functions
[END_SED]
==================== */
if (!defined('SED_CODE')) { die('Wrong URL.'); }
/* ------------------ */
function sed_get_randpolls()
{
global $L, $db_polls, $db_polls_voters, $db_polls_options, $usr, $plu_empty;
$res .= "<form action=\"polls.php?\" method=\"get\">";
$sql = sed_sql_query("SELECT poll_id, poll_text FROM $db_polls WHERE 1 AND poll_state=0 AND poll_type=0 ORDER by RAND() DESC LIMIT 1");
if ($row = sed_sql_fetcharray($sql))
{
$poll_id = $row['poll_id'];
if ($usr['id']>0)
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND (pv_userid='".$usr['id']."' OR pv_userip='".$usr['ip']."') LIMIT 1"); }
else
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND pv_userip='".$usr['ip']."' LIMIT 1"); }
if (sed_sql_numrows($sql2)>0)
{
$alreadyvoted =1;
$sql2 = sed_sql_query("SELECT SUM(po_count) FROM $db_polls_options WHERE po_pollid='$poll_id'");
$totalvotes = sed_sql_result($sql2,0,"SUM(po_count)");
}
else
{ $alreadyvoted =0; }
$res .= stripslashes($row['poll_text'])."<br /> <br />";
$sql = sed_sql_query("SELECT po_id, po_text, po_count FROM $db_polls_options WHERE po_pollid='$poll_id' ORDER by po_id ASC");
while ($row = sed_sql_fetcharray($sql))
{
if ($alreadyvoted)
{
$percentbar = floor(($row['po_count'] / $totalvotes) * 100);
$res .= "<table class=\"cells\">";
$res .= "<tr><td>";
$res .= $row['po_text'];
$res .= "</td><td><div class=\"bar_back\"><div class=\"bar_front\" style=\"width:".$percentbar."%;\"></div></div></div></td><td>$percentbar%</td><td>(".$row['po_count'].")</td></tr></td></tr>";
$res .= "</table>";
}
else
{
$res .= "<input type='radio' value='".$row['po_id']."' name='vote' class='radio' /> ".stripslashes($row['po_text'])."<br />";
}
}
if ($alreadyvoted)
{
$res .= "<p style=\"text-align: center;\"><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a><br /><a href=\"javascript:polls('viewall')\" target=\"_blank\">".$L['polls_viewarchives']."</a></p></form>";
}
else
{
$res .= "<input type=\"hidden\" name=\"id\" target=\"_blank\" value=".$poll_id.">";
$res .= "<input type=\"hidden\" name=\"a\" value=\"send\" target=\"_blank\">";
$res .= "<br /><p style=\"text-align: center; \"><input type=\"submit\" class=\"submit\" target=\"_blank\" value=\"G?nder\">";
$res .= "<br /><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a><br /><a href=\"javascript:polls('viewall')\">".$L['polls_viewarchives']."</a></p></form>";
}
}
else
{ $res = $plu_empty; }
return($res);
}
/* ============= */
?>
/* ====================
Seditio - Website engine
Copyright Neocrome
<a href="http://www.neocrome.net" target="_blank"><b>http://www.neocrome.net</b></a>
[BEGIN_SED]
File=plugins/randpolls/inc/randpolls.inc.php
Version=110
Updated=2006-jun-15
Type=Core
Author=Neocrome
Description=Functions
[END_SED]
==================== */
if (!defined('SED_CODE')) { die('Wrong URL.'); }
/* ------------------ */
function sed_get_randpolls()
{
global $L, $db_polls, $db_polls_voters, $db_polls_options, $usr, $plu_empty;
$res .= "<form action=\"polls.php?\" method=\"get\">";
$sql = sed_sql_query("SELECT poll_id, poll_text FROM $db_polls WHERE 1 AND poll_state=0 AND poll_type=0 ORDER by RAND() DESC LIMIT 1");
if ($row = sed_sql_fetcharray($sql))
{
$poll_id = $row['poll_id'];
if ($usr['id']>0)
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND (pv_userid='".$usr['id']."' OR pv_userip='".$usr['ip']."') LIMIT 1"); }
else
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND pv_userip='".$usr['ip']."' LIMIT 1"); }
if (sed_sql_numrows($sql2)>0)
{
$alreadyvoted =1;
$sql2 = sed_sql_query("SELECT SUM(po_count) FROM $db_polls_options WHERE po_pollid='$poll_id'");
$totalvotes = sed_sql_result($sql2,0,"SUM(po_count)");
}
else
{ $alreadyvoted =0; }
$res .= stripslashes($row['poll_text'])."<br /> <br />";
$sql = sed_sql_query("SELECT po_id, po_text, po_count FROM $db_polls_options WHERE po_pollid='$poll_id' ORDER by po_id ASC");
while ($row = sed_sql_fetcharray($sql))
{
if ($alreadyvoted)
{
$percentbar = floor(($row['po_count'] / $totalvotes) * 100);
$res .= "<table class=\"cells\">";
$res .= "<tr><td>";
$res .= $row['po_text'];
$res .= "</td><td><div class=\"bar_back\"><div class=\"bar_front\" style=\"width:".$percentbar."%;\"></div></div></div></td><td>$percentbar%</td><td>(".$row['po_count'].")</td></tr></td></tr>";
$res .= "</table>";
}
else
{
$res .= "<input type='radio' value='".$row['po_id']."' name='vote' class='radio' /> ".stripslashes($row['po_text'])."<br />";
}
}
if ($alreadyvoted)
{
$res .= "<p style=\"text-align: center;\"><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a><br /><a href=\"javascript:polls('viewall')\" target=\"_blank\">".$L['polls_viewarchives']."</a></p></form>";
}
else
{
$res .= "<input type=\"hidden\" name=\"id\" target=\"_blank\" value=".$poll_id.">";
$res .= "<input type=\"hidden\" name=\"a\" value=\"send\" target=\"_blank\">";
$res .= "<br /><p style=\"text-align: center; \"><input type=\"submit\" class=\"submit\" target=\"_blank\" value=\"G?nder\">";
$res .= "<br /><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a><br /><a href=\"javascript:polls('viewall')\">".$L['polls_viewarchives']."</a></p></form>";
}
}
else
{ $res = $plu_empty; }
return($res);
}
/* ============= */
?>
Kaan - 2013-03-26 23:57 GMT -
Alttakiyle de?i?tir senin kodlar? dene yedek almay? unutma
Alttakiyle de?i?tir senin kodlar? dene yedek almay? unutma
Kod:
function sed_get_randpolls()($mask)
{
global $L, $db_polls, $db_polls_voters, $db_polls_options, $usr, $plu_empty;
$sql_p = sed_sql_query("SELECT poll_id, poll_text FROM $db_polls WHERE 1 AND poll_state=0 AND poll_type=0 ORDER by RAND() DESC LIMIT 1");
while ($row_p = sed_sql_fetchassoc($sql_p))
{
unset($res);
$poll_id = $row_p['poll_id'];
if ($usr['id']>0)
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND (pv_userid='".$usr['id']."' OR pv_userip='".$usr['ip']."') LIMIT 1"); }
else
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND pv_userip='".$usr['ip']."' LIMIT 1"); }
if (sed_sql_numrows($sql2)>0)
{
$alreadyvoted =1;
$sql2 = sed_sql_query("SELECT SUM(po_count) FROM $db_polls_options WHERE po_pollid='$poll_id'");
$totalvotes = sed_sql_result($sql2,0,"SUM(po_count)");
}
else
{ $alreadyvoted =0; }
$res .= "<h5>".sed_parse(sed_cc($row_p['poll_text']), 1, 1, 1)."</h5>";
$sql = sed_sql_query("SELECT po_id, po_text, po_count FROM $db_polls_options WHERE po_pollid='$poll_id' ORDER by po_id ASC");
while ($row = sed_sql_fetchassoc($sql))
{
if ($alreadyvoted)
{
$percentbar = floor(($row['po_count'] / $totalvotes) * 100);
$res .= sed_parse(sed_cc($row['po_text']), 1, 1, 1)." : $percentbar%<div style=\"width:95%;\"><div class=\"bar_back\"><div class=\"bar_front\" style=\"width:".$percentbar."%;\"></div></div></div>";
}
else
{
$res .= "<a href=\"javascript:pollvote('".$poll_id."','".$row['po_id']."')\">";
$res .= sed_parse(sed_cc($row['po_text']), 1, 1, 1)."</a><br />";
}
}
$res .= "<p style=\"text-align:center;\"><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a> ";
$res .= "<a href=\"javascript:polls('viewall')\">".$L['polls_viewarchives']."</a></p>";
$res_all .= sprintf($mask, $res);
}
// { $res = $plu_empty; }
return($res_all);
}
{
global $L, $db_polls, $db_polls_voters, $db_polls_options, $usr, $plu_empty;
$sql_p = sed_sql_query("SELECT poll_id, poll_text FROM $db_polls WHERE 1 AND poll_state=0 AND poll_type=0 ORDER by RAND() DESC LIMIT 1");
while ($row_p = sed_sql_fetchassoc($sql_p))
{
unset($res);
$poll_id = $row_p['poll_id'];
if ($usr['id']>0)
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND (pv_userid='".$usr['id']."' OR pv_userip='".$usr['ip']."') LIMIT 1"); }
else
{ $sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$poll_id' AND pv_userip='".$usr['ip']."' LIMIT 1"); }
if (sed_sql_numrows($sql2)>0)
{
$alreadyvoted =1;
$sql2 = sed_sql_query("SELECT SUM(po_count) FROM $db_polls_options WHERE po_pollid='$poll_id'");
$totalvotes = sed_sql_result($sql2,0,"SUM(po_count)");
}
else
{ $alreadyvoted =0; }
$res .= "<h5>".sed_parse(sed_cc($row_p['poll_text']), 1, 1, 1)."</h5>";
$sql = sed_sql_query("SELECT po_id, po_text, po_count FROM $db_polls_options WHERE po_pollid='$poll_id' ORDER by po_id ASC");
while ($row = sed_sql_fetchassoc($sql))
{
if ($alreadyvoted)
{
$percentbar = floor(($row['po_count'] / $totalvotes) * 100);
$res .= sed_parse(sed_cc($row['po_text']), 1, 1, 1)." : $percentbar%<div style=\"width:95%;\"><div class=\"bar_back\"><div class=\"bar_front\" style=\"width:".$percentbar."%;\"></div></div></div>";
}
else
{
$res .= "<a href=\"javascript:pollvote('".$poll_id."','".$row['po_id']."')\">";
$res .= sed_parse(sed_cc($row['po_text']), 1, 1, 1)."</a><br />";
}
}
$res .= "<p style=\"text-align:center;\"><a href=\"javascript:polls('".$poll_id."')\">".$L['polls_viewresults']."</a> ";
$res .= "<a href=\"javascript:polls('viewall')\">".$L['polls_viewarchives']."</a></p>";
$res_all .= sprintf($mask, $res);
}
// { $res = $plu_empty; }
return($res_all);
}
TheRaskol - 2013-03-29 17:28 GMT -
bu ?ekilde anketler hi? g?r?nm?yor.
bu ?ekilde anketler hi? g?r?nm?yor.