Google Answers Logo
View Question
 
Q: XML Feed (Yahoo Search Marketing Code) Display Problems ( No Answer,   5 Comments )
Question  
Subject: XML Feed (Yahoo Search Marketing Code) Display Problems
Category: Computers > Programming
Asked by: nyoung-ga
List Price: $45.00
Posted: 14 Sep 2006 05:57 PDT
Expires: 14 Oct 2006 05:57 PDT
Question ID: 765228
I am having a problem displaying Yahoo's Search Marketing results.  I
currently display 9 results from YSM within one table in a list view.

I now need this data displayed 5 in a list and the other 4 results
down the right hand side of my page. Therefore in two tables.  I am
unsure how to accomplish this.

Basically I need help in displaying the XML results, one table
displaying results 1-5 and the other table displaying 6-9.

Hope someone can help.

Clarification of Question by nyoung-ga on 18 Sep 2006 07:49 PDT
Please note the code is written in PHP, where the results are displayed.

Clarification of Question by nyoung-ga on 20 Sep 2006 01:02 PDT
Hi thanks for the answer, yes you are correct i am looking for my code
to be adapted.

Please see my existing code below which displays all 9 results in one
table, as i said i need the results split so 5 are in one table and 4
are in another.  let me know if you need any more info.

// Display the results
  echo '<table align="default" border="0" width="736" cellpadding="0"><tr><td>';
    foreach ($listings as $key=>$val) {
    echo '<table align="default" width="736" height="1"
cellpadding="1" border="0" cellspacing="0"><tr> <td colspan="2"
bgcolor="#ECF5FA">';
    echo '<b>';
	 echo '<br><li><a href="/clickcount/click.php?url=';
    echo $val['CLICKURL'];
    echo '"SPAN style="font-size: 11pt; font-weight:bold"
text-decoration: underline"  onclick="dmclick=1;">';
	echo $val['TITLE'];
	echo '</a></span></b><br>';	
	echo '<a href="/clickcount/click.php?url=';
	echo $val['CLICKURL'];
	echo '"SPAN style="font-size: 9pt; color: #000000; font-weight:500"
onclick="dmclick=1;">';
    echo $val['DESCRIPTION'];
    echo '</span></font><em>';
	echo '&nbsp;<a href="/clickcount/click.php?url=';
    echo $val['CLICKURL'];
    echo '"SPAN style="font-size: 9pt; font-weight:900" onclick="dmclick=1;">';
	 echo '</a></em>';	 
	 echo '<a href="/clickcount/click.php?url=';
    echo $val['CLICKURL'];
    echo '"SPAN style="font-size: 10pt; color: #318000; font-style:
italic; font-weight: 500; text-decoration: underline"
onclick="dmclick=1;">';
    echo $val['SITEHOST'];
	 echo '</a></span></em>';
   if( 'true' == $val['BIDDEDLISTING'] ) {
      echo ' <font size="2"></font>';
	  echo '</tr> </table>'; }
    }
    echo '</p>';
  echo '</td></tr>';
  
  echo '</table>';
?>

Clarification of Question by nyoung-ga on 20 Sep 2006 12:48 PDT
Excellent, exactly what I was after, works a dream.

Can you post in the answer section then I can close this and pay you.

Thanks again for your speedy accurate work.

Nic
Answer  
There is no answer at this time.

Comments  
Subject: Re: XML Feed (Yahoo Search Marketing Code) Display Problems
From: paul_thomas-ga on 19 Sep 2006 07:37 PDT
 
You can float things to the right no problem. But having two inline
tables isn't that great. You could use cells from the same table. Or
better still don't use tables but divs.

I don't really understand you question. Are you asking for help
adapting you php code to output what you want?
Subject: Re: XML Feed (Yahoo Search Marketing Code) Display Problems
From: paul_thomas-ga on 19 Sep 2006 08:26 PDT
 
In genral if you have an array of 9 results you can output them with php like so 

<?php

//Array of 9 results

$results = Array( 1 => "result1", 
		  2 => "result2",
		  3 => "result3",
		  4 => "result4",
		  5 => "result5",
		  6 => "result6",
		  7 => "result7",
		  8 => "result8",
		  9 => "result9",);
//output

$ouput = <<<EOT
<html>
<head>
<style type="text/css">
.set1 {display:inline; float:left;width:200px}
.set2 {display:inline; float:right;width:200px}
</style>
</head>
<body>
<div class='set1'>
<li>$results[1]</li>
<li>$results[2]</li>
<li>$results[3]</li>
<li>$results[4]</li>
<li>$results[5]</li>
</div>

<div class='set2'>
$results[6]<br>
$results[7]<br>
$results[8]<br>
$results[9]<br>
</div>
</body>
</html>
EOT;

//display
echo $ouput;
?>

Here is the example in practice:
http://www.pttools.co.uk/listload.php

In order to adapt the yahoo feed and implement the xml correctly I
will have to look at your Yahoo code first
Subject: Re: XML Feed (Yahoo Search Marketing Code) Display Problems
From: paul_thomas-ga on 19 Sep 2006 08:30 PDT
 
note there shouldn't really be a comma after "result9"
Subject: Re: XML Feed (Yahoo Search Marketing Code) Display Problems
From: paul_thomas-ga on 20 Sep 2006 07:07 PDT
 
This is how I would do it:

http://www.pttools.co.uk/yahoofeed.php

I tidied up the code a bit and corrected some syntax errors. The code:

<?php

/*

# test values
 
for ($x=0; $x<=9; $x++){

$listings[$x] =  Array('CLICKURL' => 'click'.$x ,'TITLE' =>
'title'.$x, 'DESCRIPTION' => 'desc'.$x, 'SITEHOST' => 'host'.$x,
'BIDDEDLISTING' => 'bid'.$x);

}

*/

// Display the results

echo "<div style='display:inline;float:left;vertical-align:top'>";
    foreach ($listings as $key=>$val) {

if ($key<=5){
		
		echo '<table  width="250" height="1"
		cellpadding="1" border="0" cellspacing="0"><tr><td
colspan="2"bgcolor="#ECF5FA">';
    			echo '<b>';
	 		echo '<br><li><a href="/clickcount/click.php?url=';

    				echo $val['CLICKURL'];

    			echo '"><SPAN style="font-size: 11pt; font-weight:bold;
text-decoration: underline"  onclick="dmclick=1;">';
				
				echo $val['TITLE'];

			echo '</span></a></li></b><br>';	
			echo '<a href="/clickcount/click.php?url=';
				
				echo $val['CLICKURL'];

			echo '"><SPAN style="font-size: 9pt; color: #000000;
font-weight:500" onclick="dmclick=1;">';
    				
				echo $val['DESCRIPTION'];

    			echo '</span></a>';

			echo '&nbsp;<a href="/clickcount/click.php?url=';
    
				echo $val['CLICKURL'];

    			echo '"><SPAN style="font-size: 9pt; font-weight:900"
onclick="dmclick=1;">';
	   
				#what goes here?
			
			echo '</span></a>';	 
	 
			echo '<a href="/clickcount/click.php?url=';

    				echo $val['CLICKURL'];

    			echo '"><SPAN style="font-size: 10pt; color: #318000;
font-style: italic; font-weight: 500; text-decoration: underline"
onclick="dmclick=1;">';
    
				echo $val['SITEHOST'];
    				
			echo '</span></a>';

		if( 'true' == $val['BIDDEDLISTING'] ) {

      		echo ' <font size="2">'.$val['BIDDEDLISTING']>'</font>';

		}
	  	echo '</td></tr> </table>'; 
		if($key==5){echo "</div>";}
	

}else{
		if($key==6){echo "<div
style='display:inline;float:right;vertical-align:top;background-color:red;'>";}
		echo '<table width="250" height="1"
		cellpadding="1" border="0" cellspacing="0"><tr><td
colspan="2"bgcolor="#ECF5FA">';
    			echo '<b>';
	 		echo '<br><li><a href="/clickcount/click.php?url=';

    				echo $val['CLICKURL'];

    			echo '"><SPAN style="font-size: 11pt; font-weight:bold;
text-decoration: underline"  onclick="dmclick=1;">';
				
				echo $val['TITLE'];

			echo '</span></a></li></b><br>';	
			echo '<a href="/clickcount/click.php?url=';
				
				echo $val['CLICKURL'];

			echo '"><SPAN style="font-size: 9pt; color: #000000;
font-weight:500" onclick="dmclick=1;">';
    				
				echo $val['DESCRIPTION'];

    			echo '</span></a>';

			echo '&nbsp;<a href="/clickcount/click.php?url=';
    
				echo $val['CLICKURL'];

    			echo '"><SPAN style="font-size: 9pt; font-weight:900"
onclick="dmclick=1;">';
	   
				#what goes here?
			
			echo '</span></a>';	 
	 
			echo '<a href="/clickcount/click.php?url=';

    				echo $val['CLICKURL'];

    			echo '"><SPAN style="font-size: 10pt; color: #318000;
font-style: italic; font-weight: 500; text-decoration: underline"
onclick="dmclick=1;">';
    
				echo $val['SITEHOST'];
    				
			echo '</span></a>';

		if( 'true' == $val['BIDDEDLISTING'] ) {

      		echo ' <font size="2">'.$val['BIDDEDLISTING']>'</font>';

		}
	  	echo '</td></tr> </table>'; 

}
    }
echo "</div>";
?>
Subject: Re: XML Feed (Yahoo Search Marketing Code) Display Problems
From: paul_thomas-ga on 23 Sep 2006 04:07 PDT
 
Hi Nic I don't think I can post in the answer section because Google
answers are not accepting Researcher applications at the moment for
some reason. If you want to discuss it with  me you can at dt01pqt_pt
at yahoo dot com or any other requirements you have.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy