PDA

View Full Version : Activetopics- Need a little bit of help from the pros?


10-22-2000, 10:28 PM
Can someone remove the bit about displaying Icon?
When I do it I get a error!

It asks for icon0.gif but that dosen't exist so please can someone remove the Icon part of this code below and post the code here?

Thanks

<?
require("/home/*****/*****/***/admin/config.php");

$num_active = 10;
$num_chars = 500;

$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);

$querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' order by lastpost desc limit $num_active";

$resultlatest = mysql_query($querylatest,$db);

print("<center><table width=\"100%%\" cellspacing=\"0\" cellpadding=\"2\">");

while ($latest_array = mysql_fetch_array($resultlatest)) {

// Get Forum Infomation
$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
$result_forum = mysql_query($query_forum,$db);
$forum_info_array = mysql_fetch_array($result_forum);

printf("<tr><td colspan=\"2\" bgcolor=\"#87A4C2\"><b><font color=\"#000000\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s: %s</font></b></td></tr>",$forum_info_array["title"],$latest_array["title"]);

// split the date up a bit
$datestr1 = substr($latest_array["dateline"],0,10);
$datetime = substr($latest_array["dateline"],11,8);
printf ("<tr valign=\"top\"><td width=\"15%%\" bgcolor=\"#B9B9B9\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>%s</b><br>Updated: %s<br>Replies: %s</font></td>", $latest_array["postusername"], $datetime, $latest_array["replycount"]);

$querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

$result_thread_text= mysql_query($querythread,$db);

$result_thread_array = mysql_fetch_array($result_thread_text);
printf ("<td width=\"85%%\" bgcolor=\"#cccccc\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><img src=\"/board/images/icons/icon%s.gif\"> Last Post By: %s<hr>%s...<br><a href=\"/board/showthread.php?threadid=%s\">Click here for more</font></td></tr>",$result_thread_array["iconid"],$latest_array["lastposter"],substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars),$latest_array["threadid"]);
printf ("<tr><td colspan=\"2\" width=\"100%%\"> </td></tr>");
}

printf ("</table></center>");
?>

10-22-2000, 11:36 PM
all i did was get an icon1.gif and and make a copy named icon0.gif

much easier :D

10-23-2000, 06:43 AM
<?
require("./admin/config.php");
require("global.php");
$num_active = 20;
$num_chars = 90;

$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);

$querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' or forumid='4' or forumid='5' or forumid='6' or forumid='7' or forumid='8' or forumid='9' or forumid='10' or forumid='11' or forumid='12' or forumid='13' or forumid='14' or forumid='15' or forumid='16' or forumid='17' or forumid='18' or forumid='19' or forumid='20' or forumid='22' or forumid='23' or forumid='25' or forumid='26' or forumid='27' or forumid='28' or forumid='29' or forumid='30' or forumid='31' or forumid='32' or forumid='34' or forumid='35' or forumid='36' or forumid='37' or forumid='38' order by lastpost desc limit $num_active";

$resultlatest = mysql_query($querylatest,$db);

print("<table width=\"98%%\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\" bgcolor=\"#232323\"><tr><td><table width=\"100%%\" cellspacing=\"1\" cellpadding=\"4\">");

while ($latest_array = mysql_fetch_array($resultlatest)) {

// Get Forum Infomation
$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
$result_forum = mysql_query($query_forum,$db);
$forum_info_array = mysql_fetch_array($result_forum);

printf("<tr><td colspan=\"2\" bgcolor=\"#333333\"><b><font color=\"#CCCCCC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s: %s</font></b></td></tr>",$forum_info_array["title"],$latest_array["title"]);

// split the date up a bit
//corrected (-;
$datestr1 = date("d-m-Y",$latest_array["lastpost"]);
$datetime = date("H:i",$latest_array["lastpost"]);
printf ("<tr valign=\"top\"><td nowrap bgcolor=\"#333333\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>%s</b><br>$datestr1 ? %s<br>???????: %s</font></td>", $latest_array["postusername"], $datetime, $latest_array["replycount"]);

$querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

$result_thread_text= mysql_query($querythread,$db);

$result_thread_array = mysql_fetch_array($result_thread_text);
// remove bbcode
$messtext = bbcodeparse($result_thread_array["pagetext"]);
// remove [~img]xxx[~/img]
$messtext=eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]","",$messtext);

printf ("<td width=\"100%%\" bgcolor=\"#3E3E3E\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><img src=\"images/icons/icon%s.gif\"> ????????? ????????? ??: %s<hr size=\"1\" noshade color=\"#232323\">%s...<br><a href=\"showthread.php?threadid=%s\">????????? ></font></td></tr>",$result_thread_array["iconid"],$latest_array["lastposter"],substr(strip_tags($messtext),0,$num_chars),$lates t_array["threadid"]);
printf ("</td></tr>");
}

printf ("</table></td></tr></table>");
?>

10-24-2000, 08:48 AM
thanks :D :) ;)