s4salman Posted June 19, 2009 Share Posted June 19, 2009 Hi i was using the code below to display adsense ads between records, but when i changed number of column to 8 (because now i want to display records in 8 columns), that is, $cols = 1; //number of coloms , it all mess up like at this URL : http://salmobile.info/index.php Please help me how to correct this. //Custom Table Stsrt// $cols = 1; //number of coloms $i =1; echo "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\" id=\"table1\" bordercolor=\"#E2E2E2\" bgcolor=\"#E2E2E2\">" ."<tr>"; while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $id=$r["id"]; $name=$r["name"]; $details=$r["details"]; $url=$r["url"]; $image=$r["image"]; $mirririmg=$r["mirrorimg"]; $mirror3gp=$r["mirror3gp"]; //display the row $mybox = " <br> <a href='http://funxy.com/beta/3gp-download$id.html' class=\"classd\"><b><font-size=\"9px\"><u> $name</u></b></font></a> <BR> <span class=\"text\"> $details</span> <BR> <span class=\"text2\"> www.funxy.com/beta/3gp-download$id.html</span> <br>"; if (is_int($i / $cols)){ echo "<td width='336' align='left' style=\"border-style: dotted; border-width: 1\">$mybox</td></tr><tr>"; }else{ echo "<td width='336' align='left' style=\"border-style: dotted; border-width: 1\">$mybox</td>"; } if ( $i / $cols == 3) echo "<td colspan='3' align=\"left\"> <script type=\"text/javascript\"><!-- google_ad_client = \"pub-8599219576830682\"; /* funxy forex 336x280, created 4/3/09 */ google_ad_slot = \"4524729891\"; google_ad_width = 336; google_ad_height = 280; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script> </td></tr><tr>"; if ( $i / $cols == echo "<td colspan='3' align=\"left\"> <script type=\"text/javascript\"><!-- google_ad_client = \"pub-8599219576830682\"; /* funxy forex 336x280, created 4/3/09 */ google_ad_slot = \"4524729891\"; google_ad_width = 336; google_ad_height = 280; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script> </td></tr><tr>"; $i++; //end if }//end while echo "</tr></table>"; //Custom Table End// //ends my addition // output paging system (could also do it before we output the page content) if ($page == 1) // this is the first page - there is no previous page echo "Previous"; else // not the first page, link to the previous page echo "<a href=\"http://funxy.com/beta/3gp-videos-" . ($page - 1) . ".html\" id=\"navigationURL\">Previous</a>"; for ($i = 1; $i <= $pager->numPages; $i++) { echo " | "; if ($i == $pager->page) echo " $i"; else echo "<a href=\"http://funxy.com/beta/3gp-videos-$i.html\" id=\"navigationURL\"> $i</a>"; } if ($page == $pager->numPages) // this is the last page - there is no next page echo "Next"; else // not the last page, link to the next page echo " <a href=\"http://funxy.com/beta/3gp-videos-" . ($page + 1) . ".html\" id=\"navigationURL\">Next</a>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/162913-ad-between-reocrds/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.