The news idioms are stored as a blob in the OP database, but are stored as plain text in the SFC3 database.
SFC3 news table:
create table NewsStory
(
ID bigint not null,
Locked DateTime,
LockID int,
PersistenceLevel bigint not null,
UrgencyLevel bigint not null,
Category bigint not null,
MessageEnglish text not null,
MessageGerman text not null,
NewsTime bigint not null,
TimeDetail bigint not null,
Color bigint not null,
primary key (ID)
);
SFC:OP news table
CREATE TABLE newsstory (
ID int(11) NOT NULL default '0',
LOCKED datetime default NULL,
LOCKID int(11) default NULL,
PersistenceLevel int(11) NOT NULL default '0',
UrgencyLevel int(11) NOT NULL default '0',
Category int(11) NOT NULL default '0',
IdiomSize int(11) NOT NULL default '0',
Idiom blob NOT NULL,
NewsTime int(11) NOT NULL default '0',
TimeDetail int(11) NOT NULL default '0',
Color int(11) NOT NULL default '0',
PRIMARY KEY (ID)
) TYPE=MyISAM;
So you can just dump the code that translates the blob into plain text and try something like this:
<?php
$UrgencyLevel = array();
$Category = array();
$MessageEnglish = array();
$caturgcolor = array();
$caturgcolor[0][0] = "#B6B7FE";
$caturgcolor[0][1] = "#A9A9F1";
$caturgcolor[0][2] = "#9594E0";
$caturgcolor[0][3] = "#8282CE";
$caturgcolor[0][4] = "#6C6CBA";
$caturgcolor[0][5] = "#5B5CAA";
$caturgcolor[1][0] = "#EB873D";
$caturgcolor[1][1] = "#DE7032";
$caturgcolor[1][2] = "#CE5524";
$caturgcolor[1][3] = "#BE3B18";
$caturgcolor[1][4] = "#AF210B";
$caturgcolor[1][5] = "#A20C01";
$caturgcolor[2][0] = "#00EB72";
$caturgcolor[2][1] = "#00D668";
$caturgcolor[2][2] = "#00BC5B";
$caturgcolor[2][3] = "#00A44F";
$caturgcolor[2][4] = "#008A42";
$caturgcolor[2][5] = "#007639";
$link = mysql_connect($D2dbhostname .":" .$D2dbport, $D2dbuser, $D2dbpass);
mysql_select_db($D2db);
$query = "SELECT UrgencyLevel,Category,MessageEnglish FROM NewsStory ORDER BY NewsTime,MessageEnglish";
$result = mysql_query($query);
$a=0;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$UrgencyLevel[$a] = $line['UrgencyLevel'];
$Category[$a] = $line['Category'];
$MessageEnglish[$a] = $line['MessageEnglish'];
$a=$a+1;
}
mysql_free_result($result);
mysql_close($link);
$news_html = '<br>
';
for ($i=$a;$i--;) {
$news_html .= '<b><font color="'. $caturgcolor[$Category[$i]][$UrgencyLevel[$i]]. '">'. $MessageEnglish[$i]. '</font></b><br><br>
';
}
echo $news_html;
?>
Quite a bit simpler and should work for you. (<?php ?> tags added to code snippet here for forums syntax highligting only).