if ($announcement=$DB_site->query_first("SELECT announcementid,startdate,title,user.username,user.userid,user.usertitle,user.customtitle
FROM announcement
LEFT JOIN user
ON user.userid=announcement.userid
WHERE startdate<=$datenow AND enddate>=$datenow AND $forumlist ORDER BY startdate DESC
LIMIT 1")) {
if ($foruminfo[allowratings]) {
$thread[rating]='clear.gif';
eval("\$threadrating = \"".gettemplate('forumdisplaybit_threadrate')."\";");
$backcolor = '#DFDFDF';
$bgclass = "alt2";
} else {
unset($threadrating);
$backcolor = '#F1F1F1';
$bgclass = "alt1";
}
if ($announcement[customtitle]==2)
$announcement[usertitle] = htmlspecialchars($announcement[usertitle]);
$announcement[postdate]=vbdate($dateformat,$announcement[startdate]);
if ($announcement=$DB_site->query_first("SELECT announcementid,startdate,title,user.username,user.userid,user.usertitle,user.customtitle,visits
FROM announcement
LEFT JOIN user
ON user.userid=announcement.userid
WHERE startdate<=$datenow AND enddate>=$datenow AND $forumlist ORDER BY startdate DESC
LIMIT 1")) {
if ($foruminfo[allowratings]) {
$thread[rating]='clear.gif';
eval("\$threadrating = \"".gettemplate('forumdisplaybit_threadrate')."\";");
$backcolor = '#DFDFDF';
$bgclass = "alt2";
} else {
unset($threadrating);
$backcolor = '#F1F1F1';
$bgclass = "alt1";
}
if ($announcement[customtitle]==2) {
$announcement[usertitle] = htmlspecialchars($announcement[usertitle]);
}
$announcement[postdate]=vbdate($dateformat,$announcement[startdate]);
$announcements=$DB_site->query("
SELECT
announcementid,startdate,enddate,announcement.title,pagetext,user.*,userfield.*
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM announcement
LEFT JOIN user ON user.userid=announcement.userid
LEFT JOIN userfield ON userfield.userid=announcement.userid
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=announcement.userid","")\
."
WHERE startdate<='$datenow' AND enddate>='$datenow' AND $forumlist ORDER BY startdate DESC");
And replace it with the following:
PHP Code:
$announcements=$DB_site->query("
SELECT
announcementid,startdate,enddate,announcement.title,pagetext,visits,user.*,userfield.*
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM announcement
LEFT JOIN user ON user.userid=announcement.userid
LEFT JOIN userfield ON userfield.userid=announcement.userid
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=announcement.userid","")\
."
WHERE startdate<='$datenow' AND enddate>='$datenow' AND $forumlist ORDER BY startdate DESC");
Unfortunately, the code we have to search for has changed in 2.2.6, and I am reluctant to experiment with it. Zzed, could you provide us with updated instructions?
Here is the code I have for the forimdisplay.php part. How do I do the code to replace it?
PHP Code:
// get announcements
$datenow=time();
$forumlist=getforumlist($forumid,'forumid');
$doneannouncements = 0;
$announcementbit="";
$announcements=$DB_site->query("SELECT announcementid,startdate,title,user.username,user.userid,user.usertitle,user.customtitle
FROM announcement
LEFT JOIN user
ON user.userid=announcement.userid
WHERE startdate<=$datenow AND enddate>=$datenow AND $forumlist ORDER BY startdate DESC");
while($announcement=$DB_site->fetch_array($announcements)) {
if ($foruminfo[allowratings]) {
$thread[rating]='clear.gif';
eval("\$threadrating = \"".gettemplate('forumdisplaybit_threadrate')."\";");
$backcolor = '{secondaltcolor}';
$bgclass = "alt2";
} else {
unset($threadrating);
$backcolor = '{firstaltcolor}';
$bgclass = "alt1";
}
if ($announcement[customtitle]==2) {
$announcement[usertitle] = htmlspecialchars($announcement[usertitle]);
}
$announcement[postdate]=vbdate($dateformat,$announcement[startdate]);
if ($announcement=$DB_site->query_first("SELECT announcementid,startdate,title,user.username,user.userid,user.usertitle,user.customtitle
FROM announcement
LEFT JOIN user
ON user.userid=announcement.userid
WHERE startdate<=$datenow AND enddate>=$datenow AND $forumlist ORDER BY startdate DESC
LIMIT 1")) {
if ($foruminfo[allowratings]) {
$thread[rating]='clear.gif';
eval("\$threadrating = \"".gettemplate('forumdisplaybit_threadrate')."\";");
$backcolor = '{secondaltcolor}';
$bgclass = "alt2";
} else {
unset($threadrating);
$backcolor = '{firstaltcolor}';
$bgclass = "alt1";
}
if ($announcement[customtitle]==2) {
$announcement[usertitle] = htmlspecialchars($announcement[usertitle]);
}
$announcement[postdate]=vbdate($dateformat,$announcement[startdate]);
if ($announcement=$DB_site->query_first("SELECT announcementid,startdate,title,user.username,user.userid,user.usertitle,user.customtitle,visits
FROM announcement
LEFT JOIN user
ON user.userid=announcement.userid
WHERE startdate<=$datenow AND enddate>=$datenow AND $forumlist ORDER BY startdate DESC
LIMIT 1")) {
if ($foruminfo[allowratings]) {
$thread[rating]='clear.gif';
eval("\$threadrating = \"".gettemplate('forumdisplaybit_threadrate')."\";");
$backcolor = '{secondaltcolor}';
$bgclass = "alt2";
} else {
unset($threadrating);
$backcolor = '{firstaltcolor}';
$bgclass = "alt1";
}
if ($announcement[customtitle]==2) {
$announcement[usertitle] = htmlspecialchars($announcement[usertitle]);
}
$announcement[postdate]=vbdate($dateformat,$announcement[startdate]);
$announcements=$DB_site->query("
SELECT
announcementid,startdate,enddate,announcement.title,pagetext,user.*,userfield.*
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM announcement
LEFT JOIN user ON user.userid=announcement.userid
LEFT JOIN userfield ON userfield.userid=announcement.userid
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=announcement.userid","")."
WHERE startdate<='$datenow' AND enddate>='$datenow' AND $forumlist ORDER BY startdate DESC");
while ($post=$DB_site->fetch_array($announcements)) {
Replace with:
PHP Code:
$announcements=$DB_site->query("
SELECT
announcementid,startdate,enddate,announcement.title,pagetext,visits,user.*,userfield.*
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM announcement
LEFT JOIN user ON user.userid=announcement.userid
LEFT JOIN userfield ON userfield.userid=announcement.userid
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=announcement.userid","")."
WHERE startdate<='$datenow' AND enddate>='$datenow' AND $forumlist ORDER BY startdate DESC");
while ($post=$DB_site->fetch_array($announcements)) {
I'm sorry guys. I am on vacation in Vancouver BC. And my resources are limited. I have this hack working on my 2.2.6. I will have to take a closer look at the problem that was reported by Boofo When I come back this coming weekend. Please accept my apologies.