Haked
Narys
Kapitonas
Pranešimai: 569
Įstojęs: 2008 Vas. 24 17:02:25
|
kaip padaryti, kad svečiai galėtu balsuoti?
štai kodas:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
if (isset($poll_id) && !isNum($poll_id)) fallback("index.php");
openside_header($locale['100']);
if (isset($_POST['cast_vote'])) {
$result = dbquery("SELECT * FROM ".$db_prefix."poll_votes WHERE vote_user='".$userdata['user_id']."' AND poll_id='$poll_id'");
if (dbrows($result) == "0") {
$result = dbquery("INSERT INTO ".$db_prefix."poll_votes (vote_user, vote_opt, poll_id) VALUES ('".$userdata['user_id']."', '$voteoption', '$poll_id')");
header("Location: ".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
}
}
$result = dbquery("SELECT * FROM ".$db_prefix."polls ORDER BY poll_started DESC LIMIT 1");
if (dbrows($result) != 0) {
$data = dbarray($result);
$poll_title = $data['poll_title'];
for ($i=0; $i<=9; $i++) {
if ($data["poll_opt_".$i]) $poll_option[$i] = $data["poll_opt_".$i];
}
if (iMEMBER) $result2 = dbquery("SELECT * FROM ".$db_prefix."poll_votes WHERE vote_user='".$userdata['user_id']."' AND poll_id='".$data['poll_id']."'");
if ((!iMEMBER || !dbrows($result2)) && $data['poll_ended'] == 0) {
$poll = ""; $i = 0; $num_opts = count($poll_option);
while ($i < $num_opts) {
$poll .= "<input type='radio' name='voteoption' value='$i'> $poll_option[$i]<br><br>\n";
$i++;
}
echo "<form name='voteform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "")."'>
<b><span style='color:#555'>$poll_title</span></b><br><br>
$poll<center><input type='hidden' name='poll_id' value='".$data['poll_id']."'>\n";
if (iMEMBER) {
echo "<input type='submit' name='cast_vote' value='".$locale['101']."' class='button_2'></center>\n";
} else {
echo $locale['102']."</center>\n";
}
echo "</form>\n";
} else {
$poll = ""; $i = 0; $num_opts = count($poll_option);
$poll_votes = dbcount("(vote_opt)", "poll_votes", "poll_id='".$data['poll_id']."'");
while ($i < $num_opts) {
$num_votes = dbcount("(vote_opt)", "poll_votes", "vote_opt='$i' AND poll_id='".$data['poll_id']."'");
$opt_votes = ($poll_votes ? number_format(100 / $poll_votes * $num_votes) : 0);
$poll .= "<div>".$poll_option[$i]."</div>
<div><img src='".THEME."images/pollbar.gif' alt='".$poll_option[$i]."' height='12' width='$opt_votes' class='poll'></div>
<div>".$opt_votes."% [".$num_votes."/".$poll_votes."]</div><br>\n";
$i++;
}
echo "<b><span style='color:#555'>".$poll_title."</span></b><br><br>
$poll
<center>";
$result = dbquery("SELECT * FROM ".$db_prefix."polls");
if (dbrows($result) > 1) {
echo "<img src='".THEME."images/bullet.gif' alt=''>
<a href='".INFUSIONS."member_poll_panel/polls_archive.php' class='side'>".$locale['108']."</a> <img src='".THEME."images/bulletb.gif' alt=''>\n";
}
echo "</center>\n";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}
closeside_header();
?>
|
ramon
Narys
Ekspertas
Pranešimai: 2977
Įstojęs: 2006 Gru. 18 11:12:50
|
Imk.
|
mXt
Narys
Viršesnis už Dievą
Pranešimai: 5775
Įstojęs: 2006 Bir. 9 16:06:09
|
if(iMEMBER) nieko nesako?
ex best admin! |
Haked
Narys
Kapitonas
Pranešimai: 569
Įstojęs: 2008 Vas. 24 17:02:25
|
o ką keisti vietoj member?
|
mXt
Narys
Viršesnis už Dievą
Pranešimai: 5775
Įstojęs: 2006 Bir. 9 16:06:09
|
ramon tau jau pilna moda dave
ex best admin! |
Haked
Narys
Kapitonas
Pranešimai: 569
Įstojęs: 2008 Vas. 24 17:02:25
|
man reikia būtent to aš naudoju tokia tema shabby tai ten ta netinka man reikia šita suredaguoti
|
Peacemaker
Narys
Ekspertas
Pranešimai: 3085
Įstojęs: 2007 Lie. 31 17:07:59
|
Ten kur davė bus viskas taip pat, skirtumas, kad galės balsuoti ir svečiai.
Kiekvienam žmogui yra skirta dovana, tik ne kiekvienas sugeba ją atrasti. |
Haked
Narys
Kapitonas
Pranešimai: 569
Įstojęs: 2008 Vas. 24 17:02:25
|
nu man išsikraipo kai ta įdedu ką reikia keisti, kad būtu svečiams tame if members
|
Taskalas
Narys
Buldozeris
Pranešimai: 313
Įstojęs: 2008 Bal. 13 14:04:09
|
GAl guest
Redagavo Taskalas 2008 Lie. 26 16:07:32 |
MAnjack
Garbės narys
Legenda
Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
|
Gal panaudok IP_poll panel kurią davė ramon ir būsi laimingas.
|
Haked
Narys
Kapitonas
Pranešimai: 569
Įstojęs: 2008 Vas. 24 17:02:25
|
nu man neiseina ten tai temai yra special member poll
va mano theme.php
<?php
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";
// theme settings
$body_text = "#C0B5B3";
$body_bg = "#F7F7EF";
$theme_width = "715";
$theme_width_l = "220";
$theme_width_r = "220";
function render_header($header_content) {
global $theme_width,$settings,$db_prefix,$locale,$data,$userdata,$user_data,$poll_id,$voteoption,$poll_option,$itemsubject,$aidlink;
echo "<table align='center' cellspacing='0' cellpadding='0' width='$theme_width'>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='100%' class='navigation'>
<tr><td class='header'></td></tr>
</table>
<table cellpadding='0' cellspacing='0' width='100%' class='navigation'>
<tr>
<td align='center'>".showsublinks("","white")."</td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='330'>\n<tr>
<td class='line'><marquee scrollamount='1' scrolldelay='50' onmouseover='this.stop()' onmouseout='this.start()'>".stripslashes($settings['description'])."</marquee</td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td class='sub'></td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='$theme_width' class='paneles'>\n<tr>
<td align='left' width='120'>";
include THEME."user_info_panel.php";
echo "</td>
<td align='center' width='97'><br><br>";
echo ($userdata['user_avatar'] ? "<img src='".IMAGES."avatars/".$userdata['user_avatar']."' width='70' height='70'></center><br>\n" : "<center><a href='".BASEDIR."edit_profile.php'><img src='".THEME."images/avatar.gif' border='0' width='70' height='70'></a></center>\n")."";
echo "</td>
<td align='center' width='306'>";
include THEME."forum_threads_panel.php";
echo "</td>
<td align='center' width='195'>";
include THEME."members_poll_panel.php";
echo "</td>
</tr>
</table><br>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
}
function render_footer($license=false) {
global $theme_width,$settings;
echo "</tr>\n</table>\n";
echo "<table align='center' cellpadding='0' cellspacing='0' width='$theme_width' class='footer'>
<tr>
<td width='92'><a href='news.php?readmore=".$info['news_id']."' style='color:#000;'>PHP-Fusion</a> </td>
<td width='530'> ".stripslashes($settings['footer'])."</td>
<td width='93'><img src='".THEME."images/made_by.png'> <a href='http://www.emotive.in/' target='_blank'><img src='".THEME."images/emotive.png' border='0'></a></td>
</tr>
</table>
</td>
</tr>
</table>\n";
}
function render_news($subject, $news, $info) {
global $aidlink,$item_type;
$res = "";
echo "<table align='center' cellpadding='0' cellspacing='0' width='485'>
<tr>
<td class='capmain'>$subject<br><span style='font-size : 10px;font-weight : normal;'>parašė: <a href='profile.php?lookup=".$info['user_id']."' style='color:#EBE2D1;'>".$info['user_name']."</a>, ".showdate("shortdate", $info['news_date'])."</span></td>
</tr>
<tr>
<td class='main-body'>$news</td>
</tr>
<tr>
<form name='editnews".$info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$info['news_id']."'>
<td align='right' class='news-footer'>komentarų: ".$info['news_comments']." - <a href='news.php?readmore=".$info['news_id']."' style='color:#E6DED1;'>žiūrėti</a> ";
if (iADMIN && checkrights(N)) {
echo "- <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$info['news_id'].".submit();' style='color:#E6DED1;'>redaguoti</a>";
}
echo "</td>
</form>
</tr>
</table>\n";
}
function render_article($subject, $article, $info) {
global $aidlink,$item_type;
$res = "";
echo "<table align='center' cellpadding='0' cellspacing='0' width='485'>
<tr>
<td class='capmain'>$subject<br><span style='font-size : 10px;font-weight : normal;'>parašė: <a href='profile.php?lookup=".$info['user_id']."' style='color:#EBE2D1;'>".$info['user_name']."</a>, ".showdate("shortdate", $info['article_date'])."</span></td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<form name='editarticle".$item_id."' method='post' action='".ADMIN."articles.php".$aidlink."&article_id=".$item_id."'>
<td class='news-footer'>komentarų: ".$info['article_comments']." - <a href='print.php?type=A&item_id=".$info['article_id']."' style='color:#E6DED1;'>spausdinti</a> ";
if (iADMIN && checkrights(A)) {
echo "- <input type='hidden' name='edit' value='edit'><a href='javascript:document.editarticle".$info['articles_id'].".submit();' style='color:#E6DED1;'>redaguoti</a>";
}
echo "</td>
</form>
</tr>
</table>\n";
}
function opentable($title) {
echo "<table align='center' cellpadding='0' cellspacing='0' width='485'>
<tr>
<td class='capmain'>$title</td>
</tr>
<tr>
<td class='main-body'>\n";
}
function closetable() {
echo "</td>
</tr>
<td align='center' class='news-footer'></td>
</table>\n";
}
function openside($title) {
echo "<table align='center' cellpadding='0' cellspacing='0' width='220'>
<tr>
<td class='scapmain'>$title</td>
</tr>
<tr>
<td class='side-body'>\n";
}
function closeside() {
echo "</td>
</tr>
<tr><td><img src='".THEME."images/scapmain_bot.gif'></td></tr>
</table>\n";
tablebreak();
}
function openside_header($title) {
echo "<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='side-body-header'>\n";
}
function closeside_header() {
echo "</td>
</tr>
</table>\n";
tablebreak();
}
function opensidex($title,$state="on") {
$boxname = str_replace(" ", "", $title);
echo "<table align='center' cellpadding='0' cellspacing='0' width='220'>
<tr>
<td class='scapmain'>$title</td>
<td class='scapmain' align='right'>".panelbutton($state,$boxname)."</td>
</tr>
<tr>
<td colspan='2' class='side-body'>
<div id='box_$boxname'".($state=="off"?" style='display:none'":"").">\n";
}
function closesidex() {
echo "</div>
</td>
</tr>
<tr><td><img src='".THEME."images/scapmain_bot.gif'></td></tr>
</table>\n";
tablebreak();
}
function tablebreak() {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n<td height='5'></td>\n</tr>\n</table>\n";
}
?>
|
MAnjack
Garbės narys
Legenda
Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
|
Pire ko ta theme.php ir iš kur ištraukei special member poll?
|
sydow
Narys
Buldozeris
Pranešimai: 206
Įstojęs: 2008 Geg. 16 07:05:42
|
[b]MAnjack parašė:
Pire ko ta theme.php ir iš kur ištraukei special member poll?
shabby themei yra memberpoll po headeriu pritvirtintas, delto ir kisa cia theme.php nors siaip yra parasyta
include THEME."members_poll_panel.php";
tai ta panel tegu deda
Redagavo sydow 2008 Lie. 26 20:07:24 |
Lietuvos_pilietis
Narys
Buldozeris
Pranešimai: 249
Įstojęs: 2008 Bal. 27 20:04:43
|
member pollsql cia jo? man sql neideda kazko...
Create database tables.
$inf_newtable_[1] = "ip_polls (
poll_id smallint(5) unsigned NOT NULL auto_increment,
poll_title varchar(200) NOT NULL default '',
poll_opt_0 varchar(200) NOT NULL default '',
poll_opt_1 varchar(200) NOT NULL default '',
poll_opt_2 varchar(200) NOT NULL default '',
poll_opt_3 varchar(200) NOT NULL default '',
poll_opt_4 varchar(200) NOT NULL default '',
poll_opt_5 varchar(200) NOT NULL default '',
poll_opt_6 varchar(200) NOT NULL default '',
poll_opt_7 varchar(200) NOT NULL default '',
poll_opt_8 varchar(200) NOT NULL default '',
poll_opt_9 varchar(200) NOT NULL default '',
poll_votes_0 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_1 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_2 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_3 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_4 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_5 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_6 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_7 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_8 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_9 smallint(5) unsigned NOT NULL NULL default '0',
poll_ips text NOT NULL default '',
poll_started int(10) unsigned NOT NULL default '',
poll_ended int(10) unsigned NOT NULL default '0',
PRIMARY KEY (poll_id)
) TYPE=MyISAM;";
Per sql kaip teisynga forma turetu ardoditi kad pavyktu ja tiesiogiai idet?
Create tables
"ip_polls (
poll_id smallint(5) unsigned NOT NULL auto_increment,
poll_title varchar(200) NOT NULL default '',
poll_opt_0 varchar(200) NOT NULL default '',
poll_opt_1 varchar(200) NOT NULL default '',
poll_opt_2 varchar(200) NOT NULL default '',
poll_opt_3 varchar(200) NOT NULL default '',
poll_opt_4 varchar(200) NOT NULL default '',
poll_opt_5 varchar(200) NOT NULL default '',
poll_opt_6 varchar(200) NOT NULL default '',
poll_opt_7 varchar(200) NOT NULL default '',
poll_opt_8 varchar(200) NOT NULL default '',
poll_opt_9 varchar(200) NOT NULL default '',
poll_votes_0 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_1 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_2 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_3 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_4 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_5 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_6 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_7 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_8 smallint(5) unsigned NOT NULL NULL default '0',
poll_votes_9 smallint(5) unsigned NOT NULL NULL default '0',
poll_ips text NOT NULL default '',
poll_started int(10) unsigned NOT NULL default '',
poll_ended int(10) unsigned NOT NULL default '0',
PRIMARY KEY (poll_id)
) TYPE=MyISAM;";
Bet kažko nepavyksta...
http://Cyberwonderland.tk/ Smalsumas žudo? Nesikankink!!
Redagavo Lietuvos_pilietis 2008 Rugs. 5 13:09:27 |