| Articles |
Fiqh
(41 articles)
Halal food, Marriage & Divorce, General
|
|
|
|
Family Affairs
(13 articles)
Spouse relations, Parents, Children, General
|
|
|
|
|
|
|
|
Current News
(22 articles)
News articles affecting the muslim world
|
|
Stories
(24 articles)
New Muslim Stories, General, Australia
|
|
Salvation
(27 articles)
Doing good, Rewards, Abstaining from evil
|
|
Marriage
(20 articles)
Husband and wife affairs, sunnah
|
|
|
|
Ramadhaan
(48 articles)
Acts to perform in this month, fasting, etc
|
|
Zakaat
(11 articles)
Duties and rules pertaining to Zakaat
|
|
Haj
(12 articles)
Pilgrimage to Mecca, How to perform, blessing of Haj
|
|
ore polls
$polls_arr =& XoopsPoll::getAll(array(), true, "weight ASC, end_time DESC", $limit+1, $start);
$polls_count = count($polls_arr);
$max = ( $polls_count > $limit ) ? $limit : $polls_count;
for ( $i = 0; $i < $max; $i++ ) {
$polls = array();
$polls['pollId'] = $polls_arr[$i]->getVar("poll_id");
if ( $polls_arr[$i]->getVar("end_time") > time() ) {
$polls['pollEnd'] = formatTimestamp($polls_arr[$i]->getVar("end_time"),"m");
$polls['pollQuestion'] = "
".$polls_arr[$i]->getVar("question")."";
} else {
$polls['pollEnd'] = "
"._PL_EXPIRED."";
$polls['pollQuestion'] = $polls_arr[$i]->getVar("question");
}
$polls['pollVoters'] = $polls_arr[$i]->getVar("voters");
$polls['pollVotes'] = $polls_arr[$i]->getVar("votes");
$xoopsTpl->append('polls', $polls);
unset($polls);
}
include XOOPS_ROOT_PATH."/footer.php";
} elseif ( !empty($HTTP_POST_VARS['option_id']) ) {
$voted_polls = (!empty($HTTP_COOKIE_VARS['voted_polls'])) ? $HTTP_COOKIE_VARS['voted_polls'] : array();
$mail_author = false;
$poll = new XoopsPoll($poll_id);
if ( !$poll->hasExpired() ) {
if ( empty($voted_polls[$poll_id]) ) {
if ( $xoopsUser ) {
if ( XoopsPollLog::hasVoted($poll_id, xoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid")) ) {
setcookie("voted_polls[$poll_id]", 1, 0);
$msg = _PL_ALREADYVOTED;
} else {
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid"));
$poll->updateCount();
setcookie("voted_polls[$poll_id]", 1, 0);
$msg = _PL_THANKSFORVOTE;
}
} else {
if($xoopsModuleConfig['election'] == 0) {
if ( XoopsPollLog::hasVoted($poll_id, xoops_getenv('REMOTE_ADDR')) ) {
setcookie("voted_polls[$poll_id]", 1, 0);
$msg = _PL_ALREADYVOTED;
} else {
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'));
$poll->updateCount();
setcookie("voted_polls[$poll_id]", 1, 0);
$msg = _PL_THANKSFORVOTE;
}
} else $msg = _PL_LOGINTOVOTE;
}
} else {
$msg = _PL_ALREADYVOTED;
}
} else {
$msg = _PL_SORRYEXPIRED;
if ( $poll->getVar("mail_status") != POLL_MAILED ) {
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/xoopspoll/language/".$xoopsConfig['language']."/mail_template/");
$xoopsMailer->setTemplate("mail_results.tpl");
$author = new XoopsUser($poll->getVar("user_id"));
$xoopsMailer->setToUsers($author);
$xoopsMailer->assign("POLL_QUESTION", $poll->getVar("question"));
$xoopsMailer->assign("POLL_START", formatTimestamp($poll->getVar("start_time"), "l", $author->timezone()));
$xoopsMailer->assign("POLL_END", formatTimestamp($poll->getVar("end_time"), "l", $author->timezone()));
$xoopsMailer->assign("POLL_VOTES", $poll->getVar("votes"));
$xoopsMailer->assign("POLL_VOTERS", $poll->getVar("voters"));
$xoopsMailer->assign("POLL_ID", $poll->getVar("poll_id"));
$xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
$xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']);
$xoopsMailer->assign("SITEURL", $xoopsConfig['xoops_url']."/");
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf(_PL_YOURPOLLAT,$author->uname(),$xoopsConfig['sitename']));
if ( $xoopsMailer->send() != false ) {
$poll->setVar("mail_status", POLL_MAILED);
$poll->store();
}
}
}
//election mode
if($xoopsModuleConfig['election'] == 1) redirect_header(XOOPS_URL."/modules/xoopspoll/index.php", 2, $msg);
else redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=$poll_id", 2, $msg);
exit();
} elseif ( !empty($poll_id) ) {
//global $xoopsModuleConfig;
$xoopsOption['template_main'] = 'xoopspoll_view.html';
include XOOPS_ROOT_PATH."/header.php";
$poll = new XoopsPoll($poll_id);
$renderer = new XoopsPollRenderer($poll);
$renderer->assignForm($xoopsTpl);
$xoopsTpl->assign('lang_vote' , _PL_VOTE);
$xoopsTpl->assign('lang_results' , _PL_RESULTS);
if($xoopsModuleConfig['election'] == 1) $xoopsTpl->assign('election' , 1);
include XOOPS_ROOT_PATH."/footer.php";
}
?>