mendoz Posted September 25, 2006 Share Posted September 25, 2006 [code]<?phpmysql_connect( "localhost", "username", "password" ); // Use correct stuff theremysql_select_db( "databse" ); // Use Database Name$cat=$_GET['cat'];// Select total results for pagination$result = mysql_query("SELECT count(id) FROM $cat");$num_records = mysql_result($result,0,0);// Set maximum number of rows and columns$max_num_rows = 2;$max_num_columns = 3;$per_page = $max_num_columns * $max_num_rows;// Work out how many pages there are$total_pages = ceil($num_records / $per_page);// Get the current page numberif (isset($_GET['page'])) $page = $_GET['page']; else $page = 1;// Work out the limit offset$start = ($page - 1) * $per_page;// Select the results we want including limit and offset$result = mysql_query("SELECT id FROM $cat ORDER BY id LIMIT $start, $per_page");$num_columns = ceil(mysql_num_rows($result)/$max_num_rows);$num_rows = ceil(mysql_num_rows($result)/$num_columns);// Echo the resultsecho "<center><table bgcolor=\"#D5D5D5\" border=\"0\">\n";for ($r = 0; $r < $max_num_rows; $r++){ echo "<tr>\n"; for ($c = 0; $c < $max_num_columns; $c++){ // 1 $x = $r * $max_num_columns + $c; if ($x < mysql_num_rows($result)){// $y = mysql_result($result, $x, 0); // Commented out so I could show your example $num = mysql_result($result, $x, 0); $id=$x+$start; $y = <<<HTML<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"> </td> <td background="about_files/top_mid.gif" height="16"> <img src="about_files/top_mid.gif" alt="a"> </td> <td width="16"> <img src="about_files/top_rig.gif" alt="a" width="16" height="16"> </td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"> <img src="about_files/cen_lef.gif" alt="a"> </td> <td align="left" bgcolor="#ffffff" valign="middle"> <div align="center"> <a href="movie.php?cat={$cat}&id={$id}"> <img src="movies_img/{$cat}/thumb/{$num}.jpg" width="114" height="86" border="1"></a> </div> </td> <td background="about_files/cen_rig.gif" width="16"> <img src="about_files/cen_rig.gif" alt="a"> </td> </tr> <tr> <td height="16" width="16"> <img src="about_files/bot_lef.gif" alt="a" width="16" height="16"> </td> <td background="about_files/bot_mid.gif" height="16"> <img src="about_files/bot_mid.gif" alt="a"> </td> <td height="16" width="16"> <img src="about_files/bot_rig.gif" alt="a" width="16" height="16"> </td> </tr></table>HTML; } else { $y = '<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/top_mid.gif" height="16"><img src="about_files/top_mid.gif" alt="a"></td> <td width="16"><img src="about_files/top_rig.gif" alt="a" width="16" height="16"></td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"><img src="about_files/cen_lef.gif" alt="a"></td> <td align="left" bgcolor="#ffffff" valign="middle"><div align="center"> <img src="html/images/bekarov.jpg" width="114" height="86" border="1"></font></div></td> <td background="about_files/cen_rig.gif" width="16"><img src="about_files/cen_rig.gif" alt="a"></td> </tr> <tr> <td height="16" width="16"><img src="about_files/bot_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/bot_mid.gif" height="16"><img src="about_files/bot_mid.gif" alt="a"></td> <td height="16" width="16"><img src="about_files/bot_rig.gif" alt="a" width="16" height="16"></td> </tr> </table>'; } echo "<td>"; echo "$y"; echo "</td>"; } echo "</tr>\n";}// Echo page numbersecho "</table>\n";for ($i=1;$i <= $total_pages;$i++) { if ($i == $page) echo " $i "; else echo " <a href=\"?cat=$cat&page=$i\">$i</a> ";}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/ Share on other sites More sharing options...
HuggieBear Posted September 25, 2006 Share Posted September 25, 2006 I'm assuming that the current code you have is taking care of the pagination and cells ok, it's just the additonal cells you want filling?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-98110 Share on other sites More sharing options...
mendoz Posted September 25, 2006 Author Share Posted September 25, 2006 I think I'll make a page called 'tables.php' with a table in it with two rows and three columns,inside every cell I'll put an <? include ([color=blue]'table.php[/color]'); ?>.'tables.php' will connect to a specific database via a var ('tables.php?cat=[color=red]cat1[/color]').Then I want it to check how many rows are in that database.I want up to 6 <? include ('[color=blue]table.php[/color]'); ?>. in a page.So, if for example I have 10 rows in database '[color=green]cat1[/color]', I'll have a page with 6 <? include ('[color=blue]table.php[/color]'); ?>, and a second page with 4 <? include ('[color=blue]table.php[/color]'); ?>,And two <? include ('[color=brown]table-no.php[/color]'); ?>,'tables.php?cat=cat1?id=0':[table][tr][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][/tr][tr][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][/tr][/table]next'tables.php?cat=cat1?id=1':[table][tr][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][/tr][tr][td]<? include ('[color=blue]table.php[/color]'); ?>,[/td][td]<? include ('[color=brown]table-no.php[/color]'); ?>,[/td][td]<? include ('[color=brown]table-no.php[/color]'); ?>,[/td][/tr][/table]previous Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-98248 Share on other sites More sharing options...
HuggieBear Posted September 25, 2006 Share Posted September 25, 2006 Yes, obviously a conditional loop with includes should be fine.I have something similar to this already, are you displaying the results ordered horizontally or vertically?[pre]Horizontal:1 2 3 45 6 7 89 10 11 12Vertical:1 4 7 102 5 8 113 6 9 12[/pre]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-98273 Share on other sites More sharing options...
mendoz Posted September 25, 2006 Author Share Posted September 25, 2006 [pre]Horizontal:1 2 3 4 5 6[/pre]Something like this.I'll owe you big time if you can pull this one! Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-98355 Share on other sites More sharing options...
mendoz Posted September 26, 2006 Author Share Posted September 26, 2006 bump,Please tell me if this is against the rules Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-98723 Share on other sites More sharing options...
HuggieBear Posted September 26, 2006 Share Posted September 26, 2006 I'll post my code for you this evening when I get home.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-98786 Share on other sites More sharing options...
mendoz Posted September 26, 2006 Author Share Posted September 26, 2006 Thanks huggie :) Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99073 Share on other sites More sharing options...
HuggieBear Posted September 26, 2006 Share Posted September 26, 2006 Hey, haven't been home this evening, but should be able to post tomorrow when I do.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99310 Share on other sites More sharing options...
mendoz Posted September 27, 2006 Author Share Posted September 27, 2006 No rush man.I started working on those tables since I acidently destroyed my database. :P Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99402 Share on other sites More sharing options...
HuggieBear Posted September 27, 2006 Share Posted September 27, 2006 OK,Here's the code I came up with, the only problem is you'll have to substitute it with your sql as opposed to mine... but you can see it in action [url=http://www.dizzie.co.uk/php/sbspage2.php]here[/url][code]<?php// Connect to DBinclude('connect.php');// Select total results for pagination$result = mysql_query('SELECT count(countryName) FROM tblCountry');$num_records = mysql_result($result,0,0);// Set maximum number of rows and columns$max_num_rows = 2;$max_num_columns = 2;$per_page = $max_num_columns * $max_num_rows;// Work out how many pages there are$total_pages = ceil($num_records / $per_page);// Get the current page numberif (isset($_GET['page'])) $page = $_GET['page']; else $page = 1;// Work out the limit offset$start = ($page - 1) * $per_page;// Select the results we want including limit and offset$result = mysql_query("SELECT countryName FROM tblCountry ORDER BY countryName LIMIT $start, $per_page");$num_columns = ceil(mysql_num_rows($result)/$max_num_rows);$num_rows = ceil(mysql_num_rows($result)/$num_columns);// Echo the resultsecho "<table border=\"2\">\n";for ($r = 0; $r < $max_num_rows; $r++){ echo "<tr>\n"; for ($c = 0; $c < $max_num_columns; $c++){ // 1 $x = $r * $max_num_columns + $c; if ($x < mysql_num_rows($result)){// $y = mysql_result($result, $x, 0); // Commented out so I could show your example $y = "include('table.php')"; } else { $y = "include('table-no.php')"; } echo "<td>$y</td>"; } echo "</tr>\n";}// Echo page numbersecho "</table>\n";for ($i=1;$i <= $total_pages;$i++) { if ($i == $page) echo " $i "; else echo " <a href=\"?page=$i\">$i</a> ";}?>[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99661 Share on other sites More sharing options...
mendoz Posted September 27, 2006 Author Share Posted September 27, 2006 Huggie, I can't thank you enough.If you ever need something graphics/web desgin related email me atdror.wolmer@gmail.comI'll test this ASAPthanks Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99715 Share on other sites More sharing options...
HuggieBear Posted September 27, 2006 Share Posted September 27, 2006 No problem, but I have a feeling you'll be back before it's totally finished ;)RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99721 Share on other sites More sharing options...
mendoz Posted September 27, 2006 Author Share Posted September 27, 2006 Yeah, you were right.I posted the same problem on another forum and got this:[quote]To give you a literal answer, you need fixed number of iterations and change inclusion file after you ouput the number of rows in the table that fit your category. For example:[/quote][code]// SELECT COUNT(*) FROM tablename WHERE cat='$category'// get result into $numrowsdefine ('MAX_ROWS', 6);define ('COLUMNS', 3);$j=0;echo "<table><tr>\n";for ($i=0; $i<MAX_ROWS; $i++) { if ($i>($numrows-1)) { echo '<td>'; include 'table-no.php'; echo '</td>'; } else { echo '<td>'; include 'table.php'; echo '</td>'; } $j++; if (($j==COLUMNS) && ($i!=(MAX_ROWS-1))) { echo "</tr><tr>\n"; $j=0; }}echo '</tr></table>'; [/code]Then I posted the code you gave me and got this reply.[quote]The code you have listed will not work because it echoes the include command into HTML where it has no meaning outside PHP. And by the way, do not include, but rather use different functions.As for your desired implementation of the code itself, you want to present a table of images (or something), six per page in 3x2 layout, correct? Then you can use the code that I gave you above, except you have to construct proper SQL query which tracks which page it presents and how many rows are per page (6).Tracking pages is simple, through &page=num (or whatever you want to call it) in the URL. You get the desired page number from $_GET['page'], don't forget to cast it into int, and construct the LIMIT clause:[/quote][code]//$num_rows contains the total number of rows in the table$page= (isset($_GET['page'])) ? (int) $_GET['page'] : 1;if ($page>floor($num_rows/6)) $page= floor($num_rows / 6);if ($page<1) $page=1;$start= ($page-1) * 6;$query= "SELECT data FROM table WHERE cat='$cat' LIMIT $start, 6";// perform query and display results [/code] Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99829 Share on other sites More sharing options...
HuggieBear Posted September 27, 2006 Share Posted September 27, 2006 [quote]The code you have listed will not work because it echoes the include command into HTML where it has no meaning outside PHP.[/quote]I'm fully aware of that :)I only put that there for an example. I don't have any files to include, so it would have been pointless me including them. I personally don't think you should use include files either, you should construct the tables manually in the php.Anyway, I'm assuming that although you've posted elsewhere and been told it's not correct (which we already knew) the code itself actually works?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-99930 Share on other sites More sharing options...
mendoz Posted September 28, 2006 Author Share Posted September 28, 2006 Yes huggie, it works.I'll try not using includes and construct the tables there.http://10bayad.com/test.php Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100043 Share on other sites More sharing options...
mendoz Posted September 28, 2006 Author Share Posted September 28, 2006 There are two problems:1. trouble with the <image src=>2. pagination doesn't workHere is an example.http://10bayad.com/test.php?cat=starHere is the modified code:[code]<?phpmysql_connect( "localhost", "user", "pass" ); // Use correct stuff theremysql_select_db( "database" ); // Use Database Name$cat=$_GET['cat'];// Select total results for pagination$result = mysql_query("SELECT count(id) FROM $cat");$num_records = mysql_result($result,0,0);// Set maximum number of rows and columns$max_num_rows = 2;$max_num_columns = 3;$per_page = $max_num_columns * $max_num_rows;// Work out how many pages there are$total_pages = ceil($num_records / $per_page);// Get the current page numberif (isset($_GET['page'])) $page = $_GET['page']; else $page = 1;// Work out the limit offset$start = ($page - 1) * $per_page;// Select the results we want including limit and offset$result = mysql_query("SELECT id FROM $cat ORDER BY id LIMIT $start, $per_page");$num_columns = ceil(mysql_num_rows($result)/$max_num_rows);$num_rows = ceil(mysql_num_rows($result)/$num_columns);// Echo the resultsecho "<table bgcolor=\"#D5D5D5\" border=\"2\">\n";for ($r = 0; $r < $max_num_rows; $r++){ echo "<tr>\n"; for ($c = 0; $c < $max_num_columns; $c++){ // 1 $x = $r * $max_num_columns + $c; if ($x < mysql_num_rows($result)){// $y = mysql_result($result, $x, 0); // Commented out so I could show your example $y = '<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/top_mid.gif" height="16"><img src="about_files/top_mid.gif" alt="a"></td> <td width="16"><img src="about_files/top_rig.gif" alt="a" width="16" height="16"></td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"><img src="about_files/cen_lef.gif" alt="a"></td> <td align="left" bgcolor="#ffffff" valign="middle"><div align="center"> <img src="$cat/$i.jpg" width="114" height="86" border="1"></font></div></td> <td background="about_files/cen_rig.gif" width="16"><img src="about_files/cen_rig.gif" alt="a"></td> </tr> <tr> <td height="16" width="16"><img src="about_files/bot_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/bot_mid.gif" height="16"><img src="about_files/bot_mid.gif" alt="a"></td> <td height="16" width="16"><img src="about_files/bot_rig.gif" alt="a" width="16" height="16"></td> </tr> </table>'; } else { $y = "table-no.php"; } echo "<td>"; echo "$y"; echo "</td>"; } echo "</tr>\n";}// Echo page numbersecho "</table>\n";for ($i=1;$i <= $total_pages;$i++) { if ($i == $page) echo " $i "; else echo " <a href=\"?cat=$cat?page=$i\">$i</a> ";}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100156 Share on other sites More sharing options...
steveclondon Posted September 28, 2006 Share Posted September 28, 2006 had a look, makes it very hard without line numbers Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100160 Share on other sites More sharing options...
HuggieBear Posted September 28, 2006 Share Posted September 28, 2006 You've got it!... Well done...The reason you have this tiny error is that you have 1 character wrong, a (?) instead of an (&)...Where the page numbers are displayed at the bottom of the page, change this line:[code=php:0]<a href=\"?cat=$cat?page=$i\">[/code]To this:[code=php:0]<a href=\"?cat=$cat[/code][b]&[/b][color=red]page=$i\">[/color]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100161 Share on other sites More sharing options...
mendoz Posted September 28, 2006 Author Share Posted September 28, 2006 Wow, it works!Now, the last thing I need is to get the <image src=> right[code]<?php//the piece of the code which isn't working $y = '<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/top_mid.gif" height="16"> <img src="about_files/top_mid.gif" alt="a"></td> <td width="16"> <img src="about_files/top_rig.gif" alt="a" width="16" height="16"></td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"> <img src="about_files/cen_lef.gif" alt="a"></td> <td align="left" bgcolor="#ffffff" valign="middle"> <div align="center"> <img src="$cat/$i.jpg" width="114" height="86" border="1"></div></td> //problem <td background="about_files/cen_rig.gif" width="16"> <img src="about_files/cen_rig.gif" alt="a"></td> </tr> <tr> <td height="16" width="16"> <img src="about_files/bot_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/bot_mid.gif" height="16"> <img src="about_files/bot_mid.gif" alt="a"></td> <td height="16" width="16"> <img src="about_files/bot_rig.gif" alt="a" width="16" height="16"></td> </tr></table>'; echo "$y";?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100167 Share on other sites More sharing options...
HuggieBear Posted September 28, 2006 Share Posted September 28, 2006 OK, try changing to this:[code]<?php$y = <<<HTML<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"> </td> <td background="about_files/top_mid.gif" height="16"> <img src="about_files/top_mid.gif" alt="a"> </td> <td width="16"> <img src="about_files/top_rig.gif" alt="a" width="16" height="16"> </td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"> <img src="about_files/cen_lef.gif" alt="a"> </td> <td align="left" bgcolor="#ffffff" valign="middle"> <div align="center"> <img src="{$cat}/{$i}.jpg" width="114" height="86" border="1"> </div> </td> <td background="about_files/cen_rig.gif" width="16"> <img src="about_files/cen_rig.gif" alt="a"> </td> </tr> <tr> <td height="16" width="16"> <img src="about_files/bot_lef.gif" alt="a" width="16" height="16"> </td> <td background="about_files/bot_mid.gif" height="16"> <img src="about_files/bot_mid.gif" alt="a"> </td> <td height="16" width="16"> <img src="about_files/bot_rig.gif" alt="a" width="16" height="16"> </td> </tr></table>HTML;echo "$y";?>[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100172 Share on other sites More sharing options...
mendoz Posted September 28, 2006 Author Share Posted September 28, 2006 Seems to work good.Is there a var in your script whose value is the row number?I tought it was $i but it wasn't.<img src="{$cat}/thumbs/{$i}.jpg" width="114" height="86" border="1">Then I tried using $r but it just gave 0 and 1, i know why.Maybe I need to add a while function? Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100179 Share on other sites More sharing options...
HuggieBear Posted September 28, 2006 Share Posted September 28, 2006 There was, but I didn't think you'd be using it... It's in the code, but it's commented out:[code]<?php$y = mysql_result($result, $x, 0); // Commented out so I could show your example?>[/code]What this does is get the data for a particular cell. Check the manual for the [url=http://uk.php.net/manual/en/function.mysql-result.php]mysql_result[/url] function. I've given it three parameters. The first is the result set to use, the second is the database row number, as you can see, I've used $x as that's my table row number and finally a field offset. My data was in the first column, so I had no need to offset, hence the 0.This maybe a little confusing, but you should be OK.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100182 Share on other sites More sharing options...
HuggieBear Posted September 28, 2006 Share Posted September 28, 2006 Something else you should probably change, underneath this code:[code]<?phpmysql_connect( "localhost", "user", "pass" ); // Use correct stuff theremysql_select_db( "database" ); // Use Database Name?>[/code]Replace this:[code=php:0]$cat=$_GET['cat'];[/code]With this:[code=php:0]if (isset($_GET['cat'])) $cat = $_GET['page']; else $cat = "star";[/code]Is this line, all it does is provide a default category incase someone attempts to get to test.php on its own without specifiying one.Let me know if you're still having problems.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100220 Share on other sites More sharing options...
mendoz Posted September 28, 2006 Author Share Posted September 28, 2006 Well, most of the code seems to work rightThe only thing missing is that the first img is 5.jpg and not 1.jpghttp://10bayad.com/test.php?cat=star[code]<?phpmysql_connect( "XX", "XX", "XX" ); // Use correct stuff theremysql_select_db( "10bayad" ); // Use Database Name$cat=$_GET['cat'];// Select total results for pagination$result = mysql_query("SELECT count(id) FROM $cat");$num_records = mysql_result($result,0,0);// Set maximum number of rows and columns$max_num_rows = 2;$max_num_columns = 3;$per_page = $max_num_columns * $max_num_rows;// Work out how many pages there are$total_pages = ceil($num_records / $per_page);// Get the current page numberif (isset($_GET['page'])) $page = $_GET['page']; else $page = 1;// Work out the limit offset$start = ($page - 1) * $per_page;// Select the results we want including limit and offset$result = mysql_query("SELECT id FROM $cat ORDER BY id LIMIT $start, $per_page");$num_columns = ceil(mysql_num_rows($result)/$max_num_rows);$num_rows = ceil(mysql_num_rows($result)/$num_columns);// Echo the resultsecho "<table bgcolor=\"#D5D5D5\" border=\"2\">\n";for ($r = 0; $r < $max_num_rows; $r++){ echo "<tr>\n"; for ($c = 0; $c < $max_num_columns; $c++){ // 1 $x = $r * $max_num_columns + $c; if ($x < mysql_num_rows($result)){// $y = mysql_result($result, $x, 0); // Commented out so I could show your example $num = mysql_result($result, $x, 0); $y = <<<HTML<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"> </td> <td background="about_files/top_mid.gif" height="16"> <img src="about_files/top_mid.gif" alt="a"> </td> <td width="16"> <img src="about_files/top_rig.gif" alt="a" width="16" height="16"> </td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"> <img src="about_files/cen_lef.gif" alt="a"> </td> <td align="left" bgcolor="#ffffff" valign="middle"> <div align="center"> <img src="{$cat}/thumb/{$num}.jpg" width="114" height="86" border="1"> </div> </td> <td background="about_files/cen_rig.gif" width="16"> <img src="about_files/cen_rig.gif" alt="a"> </td> </tr> <tr> <td height="16" width="16"> <img src="about_files/bot_lef.gif" alt="a" width="16" height="16"> </td> <td background="about_files/bot_mid.gif" height="16"> <img src="about_files/bot_mid.gif" alt="a"> </td> <td height="16" width="16"> <img src="about_files/bot_rig.gif" alt="a" width="16" height="16"> </td> </tr></table>HTML; } else { $y = '<table align="center" border="0" cellpadding="0" cellspacing="0" width="145"> <tr> <td width="16"><img src="about_files/top_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/top_mid.gif" height="16"><img src="about_files/top_mid.gif" alt="a"></td> <td width="16"><img src="about_files/top_rig.gif" alt="a" width="16" height="16"></td> </tr> <tr> <td background="about_files/cen_lef.gif" width="16"><img src="about_files/cen_lef.gif" alt="a"></td> <td align="left" bgcolor="#ffffff" valign="middle"><div align="center"> <img src="html/images/bekarov.jpg" width="114" height="86" border="1"></font></div></td> <td background="about_files/cen_rig.gif" width="16"><img src="about_files/cen_rig.gif" alt="a"></td> </tr> <tr> <td height="16" width="16"><img src="about_files/bot_lef.gif" alt="a" width="16" height="16"></td> <td background="about_files/bot_mid.gif" height="16"><img src="about_files/bot_mid.gif" alt="a"></td> <td height="16" width="16"><img src="about_files/bot_rig.gif" alt="a" width="16" height="16"></td> </tr> </table>'; } echo "<td>"; echo "$y"; echo "</td>"; } echo "</tr>\n";}// Echo page numbersecho "</table>\n";for ($i=1;$i <= $total_pages;$i++) { if ($i == $page) echo " $i "; else echo " <a href=\"?cat=$cat&page=$i\">$i</a> ";}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21969-solved/#findComment-100438 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.