本文整理汇总了PHP中Argument::questionId方法的典型用法代码示例。如果您正苦于以下问题:PHP Argument::questionId方法的具体用法?PHP Argument::questionId怎么用?PHP Argument::questionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Argument
的用法示例。
在下文中一共展示了Argument::questionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawArgument
function drawArgument(Question $q, Argument $a, $basePath, $abstract = true)
{
global $sTemplate, $sUser;
$url = $a->url($basePath);
$urlCounterArguments = $a->urlCounterArguments($basePath);
$suffix = "";
$content = '
<div class = "argument_wrapper" id = "argument_wrapper_' . $a->questionId() . '_' . $a->argumentId() . '">
';
if ($a->parentId() == 0) {
$numArguments = $a->numArguments();
$content .= '
<a href = "' . $urlCounterArguments . '">
<div class = "counter_argument_box ' . ($a->type() == ARGUMENT_PRO ? "counter_argument_box_pro" : "counter_argument_box_con") . '">
<div class = "count">' . $a->numArguments() . '</div>
<div class = "count_text">' . $sTemplate->getStringNumber("NUM_COUNTER_ARGUMENTS", array(), array(), $numArguments) . '</div>
<div class = "plus_sign"></div>
<div class = "line"></div>
</div>
</a>';
} else {
$suffix = "_no_counter";
}
$numPoints = $a->score();
$content .= '
<div class = "argument ' . ($a->type() == ARGUMENT_PRO ? "argument_pro" . $suffix : "argument_con" . $suffix) . '">
<div class = "stats argument_stats">
<div class = "points argument_points">' . $numPoints . '</div>
<div class = "points_text argument_points_text">' . $sTemplate->getStringNumber("QUESTION_POINTS", array(), array(), $numPoints) . '</div>
' . voteUp('argument_vote_up', $a->questionId(), $a->argumentId(), $a->type(), $q->type(), $q->flags()) . '
' . voteDn('argument_vote_dn', $a->questionId(), $a->argumentId(), $a->type(), $q->type(), $q->flags()) . '
</div>';
if ($a->details()) {
$content .= '
<div class = "argument_headline">
<a href = "' . $url . '">' . $a->headline() . '</a>
</div>';
} else {
$content .= '
<div class = "argument_headline">
' . $a->headline() . '
</div>';
}
if ($abstract) {
if (!$a->details()) {
$content .= '<div class = "argument_abstract">' . $a->abstractText() . '</div>';
} else {
$content .= '<div class = "argument_abstract">' . $a->abstractText() . ' <a class="read_more" href = "' . $url . '">>></a></div>';
}
} else {
$content .= '<div class = "argument_abstract argument_abstract_cursive">' . $a->abstractText() . '</div>';
$content .= '<div class = "argument_details">' . $a->details() . '</div>';
}
if ($a->canEdit($sUser)) {
$content .= '<div class = "author question_author"><a href = "' . $a->url($basePath) . 'edit/">' . $sTemplate->getString("ARGUMENT_EDIT", array("[TIMELEFT]"), array($a->timeLeftEdit())) . '</a></div>';
} else {
$content .= '<div class = "author question_author">' . $sTemplate->getString("QUESTION_AUTHOR", array("[TIMESINCE]", "[USERNAME]"), array($a->timeSince(), $a->authorLink())) . '</div>';
}
$content .= '
<div class = "argument_' . ($a->type() == ARGUMENT_PRO ? "pro" : "con") . '_bar"></div>
</div>
</div>
';
return $content;
}