本文整理汇总了PHP中Poll::getNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Poll::getNumber方法的具体用法?PHP Poll::getNumber怎么用?PHP Poll::getNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poll
的用法示例。
在下文中一共展示了Poll::getNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$poll->setProperty('date_end', $f_date_end);
$poll->setProperty('votes_per_user', $f_votes_per_user);
$poll->setProperty('nr_of_answers', $f_nr_of_answers);
$poll->setProperty('is_extended', $f_is_extended);
foreach ($f_answers as $nr_answer => $text) {
if ($text !== '__undefined__') {
$answer = new PollAnswer($f_fk_language_id, $f_poll_nr, $nr_answer);
if ($answer->exists()) {
$answer->setProperty('answer', $text);
} else {
$answer->create($text);
}
}
}
PollAnswer::SyncNrOfAnswers($f_fk_language_id, $f_poll_nr);
} else {
// create new poll
$poll = new Poll($f_fk_language_id);
$success = $poll->create($f_title, $f_question, $f_date_begin, $f_date_end, $f_nr_of_answers, $f_votes_per_user);
if ($success) {
$poll->setProperty('is_extended', $f_is_extended);
foreach ($f_answers as $nr_answer => $text) {
if ($text !== '__undefined__') {
$answer = new PollAnswer($f_fk_language_id, $poll->getNumber(), $nr_answer);
$success = $answer->create($text);
}
}
}
}
$f_from = Input::Get('f_from', 'string', 'index.php');
camp_html_goto_page($f_from);
示例2: p
<TD><A HREF="<?php p(urldecode($f_from)) ?>"><B><?php putGS("Attach Polls"); ?></B></A></TD>
</TR>
</TABLE>
<?php
}
include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");
camp_html_display_msgs();
?>
<P>
<FORM NAME="edit_poll" METHOD="POST" ACTION="do_edit.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<?php if ($poll->exists()) { ?>
<INPUT TYPE="HIDDEN" NAME="f_poll_nr" VALUE="<?php p($poll->getNumber()); ?>">
<?php } ?>
<?php if ($f_from) { ?>
<INPUT TYPE="HIDDEN" NAME="f_from" VALUE="<?php p(htmlspecialchars($f_from)); ?>">
<?php } ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="6" class="table_input">
<TR>
<td valign="top">
<table>
<TR>
<TD ALIGN="RIGHT" ><?php putGS("Language"); ?>:</TD>
<TD style="padding-top: 3px;">
<?php if (count($allLanguages) > 1) { ?>
<SELECT NAME="f_fk_language_id" alt="select" emsg="<?php putGS("You must select a language.")?>" class="input_select">
<option value="0"><?php putGS("---Select language---"); ?></option>
<?php
示例3: p
}
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
camp_html_display_msgs();
?>
<P>
<FORM NAME="edit_poll" METHOD="POST" ACTION="do_edit.php" onsubmit="return <?php
camp_html_fvalidate();
?>
;">
<?php
echo SecurityToken::FormParameter();
if ($poll->exists()) {
?>
<INPUT TYPE="HIDDEN" NAME="f_poll_nr" VALUE="<?php
p($poll->getNumber());
?>
">
<?php
}
if ($f_from) {
?>
<INPUT TYPE="HIDDEN" NAME="f_from" VALUE="<?php
p(htmlspecialchars($f_from));
?>
">
<?php
}
?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="6" class="table_input">
<TR>
示例4: createCopy
/**
* Create a copy of an poll.
*
* @param string $p_title
* @param string $p_question
* @param array $p_answers
* @return Poll
*/
public function createCopy($p_data, $p_answers)
{
// Construct the duplicate poll object.
$poll_copy = new Poll();
$poll_copy->m_data['poll_nr'] = Poll::generatePollNumber();
$poll_copy->m_data['parent_poll_nr'] = $this->m_data['poll_nr'];
$poll_copy->m_data['fk_language_id'] = $this->m_data['fk_language_id'];
// Create the record
$values = array('title' => $p_data['title'], 'question' => $p_data['question'], 'date_begin' => $p_data['date_begin'], 'date_end' => $p_data['date_end'], 'nr_of_answers' => count($p_answers), 'votes_per_user' => $p_data['votes_per_user']);
$success = $poll_copy->__create($values);
if (!$success) {
return false;
}
// create an set of answers
PollAnswer::CreateCopySet($poll_copy->getNumber(), $this->m_data['fk_language_id'], $this->m_data['poll_nr'], $p_answers);
$poll_copy->triggerStatistics();
/*
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Article #$1 "$2" ($3) translated to "$5" ($4)',
$this->getArticleNumber(), $this->getTitle(), $this->getLanguageName(),
$articleCopy->getTitle(), $articleCopy->getLanguageName());
Log::Message($logtext, null, 31);
*/
return $poll_copy;
}
示例5: putGS
<TR>
<TD><A HREF="index.php"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD>
<TD><A HREF="index.php"><B><?php putGS("Poll List"); ?></B></A></TD>
</TR>
</TABLE>
<?php
include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");
camp_html_display_msgs();
?>
<P>
<FORM NAME="edit_poll" METHOD="POST" ACTION="do_translate.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<?php if ($poll) { ?>
<INPUT TYPE="HIDDEN" NAME="f_poll_nr" VALUE="<?php p($poll->getNumber()); ?>">
<INPUT TYPE="HIDDEN" NAME="f_fk_language_id" VALUE="<?php p($poll->getLanguageId()); ?>">
<?php } ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="6" class="table_input">
<TR>
<td valign="top">
<table>
<TR>
<TD ALIGN="RIGHT" ><?php putGS("Language"); ?>:</TD>
<TD style="padding-top: 3px;">
<?php if (count($allLanguages) > 1) { ?>
<SELECT NAME="f_target_language_id" alt="select" emsg="<?php putGS("You must select a language.")?>" class="input_select">
<option value="0"><?php putGS("---Select language---"); ?></option>
<?php
foreach ($allLanguages as $tmpLanguage) {
if (!array_key_exists($tmpLanguage->getLanguageId(), $existing)) {