Jump to content

Output help


fewchurpro

Recommended Posts

Im putting parsed info into a box. But im having trouble with some of the parts repeating itself. Is there something I need to add to stop that?

Here is the code for the output

[pre]// output HTML
// print ("<div class=\"channelname\">" . $rss_channel["TITLE"] . "</div>");

if (isset($rss_channel["ITEMS"])) {
if (count($rss_channel["ITEMS"]) > 0) {
for($i = 0;$i < 5;$i++) {
if (isset($rss_channel["ITEMS"][$i]["LINK"])) {
print ("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td background=\"wow5summ_01.jpg\" height=\"33\" width=\"64\"></td><td background=\"wow5summ_02.jpg\" height=\"33\">\n<div class=\"itemtitle\"><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\"><strong><font color =\"#ffcc00\" size =\"3\" Verdana, Arial, Helvetica, sans-serif>" . $rss_channel["ITEMS"][$i]["TITLE"] . "</font></strong></a></td><td background=\"wow5summ_03.jpg\" width=\"46\" height=\"33\"></td></tr></div>");
} else {
print ("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"64\" background=\"wow5summ_01.jpg\" height=\"33\"></td><td background=\"wow5summ_02.jpg\" height=\"33\">\n<div class=\"itemtitle\"><strong><font color=\"#b7baab\" size=\"2\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</font></strong></td><td background=\"wow5summ_03.jpg\" width=\"46\" height=\"33\"></td></tr></div>");
}
print ("<tr><td background=\"wow5summ_04.jpg\" width=\"64\" height=\"20\"></td><td background=\"wow5summ_05.jpg\"></td><td background=\"wow5summ_06.jpg\" width=\"46\" height=\"20\"></td></tr>");
print ("<tr><td background=\"wow5summ_07.jpg\" width=\"64\" height=\"86\"></td><td background=\"wow5summ_08.jpg\"><font size=\"2\"><div class=\"itemdescription\">" . $rss_channel["ITEMS"][$i]["DESCRIPTION"] . "</font></td><td background=\"wow5summ_09.jpg\" width=\"64\" height=\"86\"></td></tr></div>");
print ("<tr><td background=\"wow5summ_10.jpg\" width=\"64\" height=\"25\"></td><td background=\"wow5summ_11.jpg\"></td><td background=\"wow5summ_12.jpg\" width=\"46\" height=\"25\"></td></tr></table><br/>");            }
} else {
print ("<b>There are no articles in this feed.</b>");
}
}
[/pre]


And here you can see what is happening. Ive added box at the bottom to show what it should look like as well.

[url=http://guild-studio.com/kb/parse.php]Parsed Output[/url]

also if there is anyway to make the text for the title bar look the same as the css file part I would really appreciate the help on that too.

Here is the setup for the css file for the title section. Unfortunately in my output i was unable to make a class work for that.

[pre].summ1 {background-image: url(wow5summ_02.jpg); color:#FFCC00;font-weight:bold; font-size:12px;}
.summ1 a:link,.summ1 a:active,.summ1 a:visited {font-weight:bold; font-size:12px; color:#FFCC00;}
.summ1 a:hover {color:#000000;}[/pre]
Link to comment
https://forums.phpfreaks.com/topic/24755-output-help/
Share on other sites

You are obviously nesting a table/cell within a table/cell somewhere, but is very difficult to see exactly where you are going wrong. If it were me, I would redo the script using the good table you have, and use the heredoc syntax. This will allow you to do away with all those escaped quotation marks, and you will be able to use variables directly as well.

[url=http://uk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc]http://uk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc[/url]

Have a look at my example below as well...

[code]

<?php

$deltagfieldlimit = 5;
$deltagcounter = 1;

while( $deltagcounter <= $deltagfieldlimit ) {

$del_tag_fields .= <<<DELTAGEOF

<tr class="upload">
<td class="uploadlbl">tag</td>
<td class="upload"><select name="cvbtag_name[]"><option value="" class="fieldcell" >select</option>$delete_tag_list</select></td>
</tr>

DELTAGEOF;

$deltagcounter++;

}

?>

[/code]

This example will build 5 drop down lists... Note how the variable $delete_tag_list is used directly?

HTH
Link to comment
https://forums.phpfreaks.com/topic/24755-output-help/#findComment-112815
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.