هل أعمله بهذا الشكل
كود PHP:
$GLOBALS['QuestionTitle'] = $title;
$GLOBALS['QuestionTitle'] = $title1;
كود PHP:
/**
* ShowNewQuestion
* Show the page for creating a new question
*
* @return void
*/
function ShowNewQuestion()
{
// Check they have permission to be here
if (!$_SESSION['user']->verify('question', 'edit')) {
$this->NoPermission();
return;
}
// Create a new question
// First up, get form variables if there's an error
$title = "";
$cat = -1;
$answer = "";
$sort = 0;
$visible = true;
$GLOBALS['HidePanels'][] = 'QuestionEmailSubmitter';
$GLOBALS['HidePanels'][] = 'QuestionLastUpdated';
$GLOBALS['HidePanels'][] = 'QuestionBecomeAuthor';
// Nothing to show in misc panel on new questions
$GLOBALS['HidePanels'][] = 'QuestionMiscellaneous';
$GLOBALS['sanDisabled'] = "disabled=\"disabled\"";
$GLOBALS['AKB_CLASS_HELPER']->populateArticleDates();
$applies = array();
if (is_array($_SESSION['user']->groups)
&& !empty($_SESSION['user']->groups)) {
foreach ($_SESSION['user']->groups as $group) {
if (isset($group->applies['category'])
&& is_array($group->applies['category'])) {
$applies = array_merge($applies, $group->applies['category']);
}
}
}
$GLOBALS['Title'] = GetLang('AddQuestionTitle');
$GLOBALS['Intro'] = GetLang('AddQuestionIntro');
$GLOBALS['FormAction'] = 'saveNewQuestion';
$GLOBALS['QuestionTitle'] = $title;
$GLOBALS['CategoryOptions'] = $GLOBALS['AKB_CLASS_CATEGORY']->GetCategoryOptions($cat);
$GLOBALS['RelatedCategoryOptions'] = $GLOBALS['AKB_CLASS_CATEGORY']->GetCategoryOptions(array(0), '<option %s value="%d">%s</option>', 'selected', '- ', false, $applies);
$GLOBALS['RelatedQuestions'] = $this->GetSomeQuestionsAsOptions();
$GLOBALS['WYSIWYG'] = $this->GetWYSIWYGEditor($answer);
$GLOBALS['SortOrder'] = $sort;
$GLOBALS['QuestionKeywords'] = '';
$GLOBALS['QuestId'] = '';
$GLOBALS['SubmittedQuestId'] = '';
$GLOBALS['MetaKeywords'] = '';
$GLOBALS['MetaDescription'] = '';
$GLOBALS['ExistingAttachments'] = '';
$GLOBALS['DisableVisible'] = '';
$GLOBALS['DetectRelated'] = '';
$GLOBALS['LastUpdated'] = '';
// Are we starting from a user submitted question?
if (isset($_GET["submittedQuestId"])) {
$sQuestId = $_GET["submittedQuestId"];
$query = sprintf("select * from %ssubmittedquestions where subquestid='%d'", $GLOBALS["tablePrefix"], $sQuestId);
$result = $GLOBALS['AKB_DB']->Query($query);
if ($row = $GLOBALS['AKB_DB']->Fetch($result)) {
$GLOBALS["QuestionTitle"] = htmlspecialchars($row["subject"], ENT_QUOTES, $GLOBALS['charset']);
$GLOBALS["WYSIWYG"] = $this->GetWYSIWYGEditor(htmlspecialchars($row["message"], ENT_QUOTES, $GLOBALS['charset']));
$GLOBALS["SubmittedQuestId"] = $sQuestId;
$GLOBALS['lastupdated'] = $row['posted'];
foreach (array_keys($GLOBALS['HidePanels'], 'QuestionEmailSubmitter') as $key) {
unset($GLOBALS['HidePanels'][$key]);
}
}
}
//Setup groups
$GLOBALS['groups'] = $this->getGroupsForSelect();
$GLOBALS['groupListSize'] = 5;
$GLOBALS['lblRestrictPublic'] = GetLang("RestrictPublicQuest");
$GLOBALS['lblRestrictPrivate'] = GetLang("RestrictPrivateQuest");
//New question. No groups associated.
$GLOBALS['HasGroups'] = 0;
$GLOBALS["CheckVisible"] = ($visible) ? 'CHECKED' : '';
if (!$_SESSION['user']->verify('question', 'approve')) {
$GLOBALS["CheckVisible"] = "";
$GLOBALS["DisableVisible"] = "DISABLED";
}
$GLOBALS['CustomFields'] = $this->processCustomFields();
$GLOBALS["AKB_CLASS_TEMPLATE"]->SetTemplate("question.form");
$GLOBALS["AKB_CLASS_TEMPLATE"]->ParseTemplate();
}