Hi there Dom.
The refresh of what was the last post in a forum using a plugin seems to have stopped working probably due to another change I made using arrays to have the thread prefix working. The move itself to the correct forum is fine but not the forum details update - keen to have this working again. (think it is at the bottom of the code below)
We added a plugin that moved the thread to the correct forum (newthread_post_complete) and it has the following:
if ($fid == 1)
{
$forumid = $q['forumid'];
$dataman =& datamanager_init('Thread', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dataman->set_existing($threadinfo);
$dataman->setr('forumid', $forumid);
$dataman->pre_save();
if (count($dataman->errors) > 0)
{
foreach ($errors as $error)
{
$errorss .= $error. "<br />";
}
$errormessage = "Form failed to submit. The following error(s) occured: <br /> ".$errorss;
eval(standard_error($errormessage));
}
else
{
$dataman->save();
$foruminfo = fetch_foruminfo($forumid);
$threadinfo = fetch_threadinfo($newpost['threadid']);
mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
build_thread_counters($newpost['threadid']);
build_forum_counters($forumid);
}
}
I have pasted below the code for the custom question from the form that I think is related:
$newarray = array(
158 => $vbulletin->forumcache['158'],
160 => $vbulletin->forumcache['160'],
161 => $vbulletin->forumcache['161'],
162 => $vbulletin->forumcache['162'],
163 => $vbulletin->forumcache['163'],
165 => $vbulletin->forumcache['165'],
167 => $vbulletin->forumcache['167'],
168 => $vbulletin->forumcache['168'],
169 => $vbulletin->forumcache['169'],
170 => $vbulletin->forumcache['170'],
172 => $vbulletin->forumcache['172'],
174 => $vbulletin->forumcache['174'],
175 => $vbulletin->forumcache['175'],
177 => $vbulletin->forumcache['177'],
179 => $vbulletin->forumcache['179'],
181 => $vbulletin->forumcache['181'],
61 => $vbulletin->forumcache['61'],
182 => $vbulletin->forumcache['182'],
183 => $vbulletin->forumcache['183'],
184 => $vbulletin->forumcache['184'],
186 => $vbulletin->forumcache['186'],
188 => $vbulletin->forumcache['188'],
190 => $vbulletin->forumcache['190'],
191 => $vbulletin->forumcache['191'],
193 => $vbulletin->forumcache['193'],
56 => $vbulletin->forumcache['56'],
194 => $vbulletin->forumcache['194'],
195 => $vbulletin->forumcache['195'],
197 => $vbulletin->forumcache['197'],
);
$answer = "<select name=\"$formbit[id]\" id=\"q_" . $formbit[id] . "\">";
foreach ($newarray AS $forumid => $forum)
{
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";
I have also pasted the code for the newthread_form_start -
if (in_array($forumid, array(158,160,161,162,163,165,167,168,169,170,172, 174,175,177,179,181,61,182,183 ,184,186,188,190,191,193,56,194,195,197)))
{
header('Location: /listings/misc.php?do=form&fid=1');
}
Can you advise please?
Thank you
Mark
|