Jump to content

y2yang

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by y2yang

  1. nvm, i think i finally solved the puzzle thank to you. Here is what i got: so if comment.php has id=RANDOM ID, say comment.php?id=1029 ,then i can use <?php if(!isset($_GET['page'])) { $page = 1; } else { $page = (int) $_GET['page']; } ?> inside of comment.php and in comment.php: <?php $page_id = "<?php echo $page ?>"; ?> than no two id in $page_id can be the same. Thank you soo much gevans
  2. sorry if i don't make sense, let me explain it in detailed. There are 2 pages: page.php?id=#s, which has many pages in it and it's the read page for my paragraph. comment.php?id=#s, which thank to you, i solved the puzzle of not having to create many comment pages and just use ?id. But inside of comment.php, off all the code in there, only one thing need to be changing from page to page so that no two id in in page_id are the same, and that is <?php $page_id = "THIS AND IT CAN BE ANYTHING, # OR LETTER"; ?>
  3. In comment.php, there is a code: <?php $page_id = "UniqueID"; ?> and no two UniqueID may be the same. You probably say this earlier but what can I do to make sure no two UniqueID are the same in comment.php?
  4. The thing is that I have a code: <div class="tal"> <img src="http://image.vickizhao.net/style_guide/txt/txt_starhome_comment.gif" alt="" /> <img id="imgobj" src="http://image.vickizhao.net/style_guide/icn/icn_starhome_hidden.gif" onclick="openReply('http://image.vickizhao.net')" class="hand" alt="" /> </div> <p style="margin:5px;"></p> Which is used to hide and show the comment, but it must be in an iframe as the original coder make it that way and I think it would be a big mess trying to make it not iframe. So is there a way? or would i be better off creating a folder and put comment1.php comment2.php comment3.php and so on and use your first option, which to have the script to generate its ID by it page name?
  5. Sorry I still a little confused, can you clarify a little for me. Say my comment script is in comment.php and my main read page is page.php?id=#s script: <?php $page_id = "ID1"; ?> is inside of comment.php, which i needed the ID to have change from page.php?id=1 to page.php?id=2. say if page.php?id=1, then in comment.php, it should have ID1. and in page.php?id=2, comment.php should have ID2, without me changing anything in comment.php. and on page.php, i used : <div id="viewComment" style="display: block;"> <iframe style="height: 118px; width: 580px;" src="comment.php" name="ifrmComment" id="ifrmComment" scrolling="no" width="580" frameborder="0"></iframe> </div> to call upon comment.php
  6. how do i implement the $_GET global to make it work? Yes every page has it own ?page=# The thing is that news page is inside an iframe on ?page=# will it still work?
  7. Would it be possible to have just one news page and have the script to generate increment int in the script instead of having to have the script to refer to the page name for it id?
  8. How to make the number in red change on different page? <?php $page_id = "photo_23"; ?> This code is used on an iframe page. I wanted the number in red to change on every page, as it defined the comment page to its article. Parent page code: <div id="viewComment" style="display: block;"> <iframe style="height: 118px; width: 580px;" src="comment/news_1.php" name="ifrmComment" id="ifrmComment" scrolling="no" width="580" frameborder="0"></iframe> </div> Iframe page code (news_1.php): <?php $page_id = "photo_1"; ?>
  9. Thanks, I'll give it a try. btw, it's 2:18 am here, I'm as crazy.
  10. lol, I was messing with the code. Can you believe it, I test the site ONLINE, wow bad me. It was only supposed to show 4 on top and 4 on bottom. visit again plz.
  11. You're the best Ken2ky. Yes there is a way to know the exact total pages in total. If I keep track of how many images I have uploaded, and divide that by 8 (total images per page), than I get the total pages. Kinda old school but it work, and the hard part is already taking care of by you. Thank you again. Solved, for now hehe, the road is till long ahead.
  12. You are totally right, only thing is I'm going to html it into two row of images, with 4 images on each row and a single dotted line in between the two row of images, and that's where the problem come in. How to implement that dotted line in between the tow row of images? To get the two rows, I can just set it 0,8 and fetch it and my table would have arranged it nicely into 2 rows, but than I won't get that nice dotted line in between as well, so sad. Here is what i'm talking about: vickizhao.net/starhome/photo/list.php
  13. The First and Prev has no link as this is the first 10 set but has Next and Last. The selected number is spanned to be b=bold, fs11=font size 11px, fc7=font color. <table width="100%"> <tr style="height:33px;background:#f3f3f3;"> <td class="tac vam"><span class="fs11"> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="PREV FIRST" style="margin:2px; 0 0 0;" /> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;"> <span class="b fs11 fc7">1</span> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a> <span class="fs10 fc7"> / </span> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a> </span> </td> </tr> </table>
  14. I am running two query with LIMIT on the same page, which I pulled from my MySQL with field id. $query = "SELECT * FROM thumb LIMIT 0, 4"; and $query = "SELECT * FROM thumb LIMIT 4, 4"; Would it be possible to have this programmed to change automatically with page id. Example, on ?id=1, it would have the above query but on ?id=2, it would run a query like the one below. $query = "SELECT * FROM thumb LIMIT 8, 4"; and $query = "SELECT * FROM thumb LIMIT 12, 4"; To put it simple: First query on ?id=1 would start pulling data from row 1 to 4 and the second query on ?id=1 to start pulling data from row 5 to row 8. While query 1 on ?id=2 start pulling data from row 9 to row 12 and query 2 on ?id=2 from row 13 to row 16. Here is example of code: <?php // database connection info $query = "SELECT * FROM thumb LIMIT 0, 4"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { ?> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <?php } ?> <div style="clear:left;overflow:hidden;width:0;height:0;"></div> <p style="margin:20px;"></p> <div class="dotHLine1"></div> <p style="margin:20px;"></p> <?php $query = "SELECT * FROM thumb LIMIT 4, 4"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { ?> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <?php } ?> The main reason why I wanted to perform 2 LIMIT on one page is that I wanted 8 images to show on one page with a dotted line in between my two row of image. The code to go between the 2 row of images is: <div style="clear:left;overflow:hidden;width:0;height:0;"></div> <p style="margin:20px;"></p> <div class="dotHLine1"></div> <p style="margin:20px;"></p>
  15. Thank you but wasn't what i looking for. Here is a better code for you to get an idea: <table width="100%"> <tr style="height:33px;background:#f3f3f3;"> <td class="tac vam"><span class="fs11"><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="PREV FIRST" style="margin:2px; 0 0 0;" /> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;"> <span class="b fs11 fc7">1</span><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a></span></td> </tr> </table> I put this into a php page and uploaded to the site: vickizhao.net/pagination2.php With my css and it should look like vickizhao.net/starhome/photo/list.php?Pid=2 I wanted to make it programmed rather than hard coded. Each of the #s correlated to the URL id, bold 5 = URL id 5.
  16. It's from the "Basic Pagination" posted on this forum, with minor fix/touch only. <?php /****** build the pagination links ******/ // range of num links to show $range = 3; // if not on page 1, don't show back links if ($currentpage > 1) { // show << link to go back to page 1 echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif' class='vat' alt='PREV FIRST' style='margin:2px; 0 0 0;'></a> "; // get previous page num $prevpage = $currentpage - 1; // show < link to go back to 1 page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif' class='vat' alt='PREV' style='margin: 2px;'></a> "; } // end if for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { // if it's a valid page number... $slash = ($x != ($currentpage - $range) || $x != $totalpages)?"/":""; if (($x > 0) && ($x <= $totalpages)) { // if we're on current page... if ($x == $currentpage) { // 'highlight' it but don't make a link echo " <span class='b fs11'>$x</span> {$slash}"; // if not current page... } else { // make it a link echo " <span class='fs11'><a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a></span> {$slash}"; } // end else } // end if } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif' class='vat' alt='NEXT' style='margin:2px; 0 0 0;'></a> "; // echo forward link for lastpage echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif' class='vat' alt='NEXT' style='margin:2px; 0 0 0;'></a> "; } // end if /****** end build pagination links ******/ ?>
  17. What I wanted to do is have php LIMIT to add 4 to [0, 4] on the next page id. What's going on is I am pulling data from MySQL and would like for page id 2 to add 4 to LIMIT so that it would start pulling data from row 5 and not row 1. <?php // database connection info $query = "SELECT * FROM thumb LIMIT 0, 4"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { ?> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <?php } ?> <div style="clear:left;overflow:hidden;width:0;height:0;"></div> <p style="margin:20px;"></p> <div class="dotHLine1"></div> <p style="margin:20px;"></p> <?php $query = "SELECT * FROM thumb LIMIT 4, 4"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { ?> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <?php } ?> I am running 2 query on the same page, one with LIMIT 0, 4 and another one with LIMIT 4,4
  18. How to make this programmed rather than doing it hard coded by hand on every pages. Would be like living in stone age ??? Here is the code I used, will explain further down exactly what I'm seeking. <table width="100%"> <tr style="height:33px;background:#f3f3f3;"> <td class="tac vam"><span class="fs11"><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="PREV FIRST" style="margin:2px; 0 0 0;" /> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;"> <span class="b fs11 fc7">1</span><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a></span></td> </tr> </table> Here is how the code looks like on my page http://vickizhao.net/starhome/photo/list.php?Pid=2 What I wanted to do is have the selected # in bold to correlated to my URL page id i.e. list.php?id=2 would have the pagination 2 in bold like in the image. I can do this perfectly hard coded but not sure how to do it programmed. I have looked over the "Basic Pagination" example but I not sure how to change it to make it look like the one show in the image. On every page id is 8 images; 4 on top 4 on bottom with the pagination on bottom. Thank you.
  19. I have red through the tutorial but I don't know how to get the / in between the #. example: 1 / 2 / 3 Anyhelp?
  20. I need help in making this pagination programmed rather than hard coded. <table width="100%"> <tr style="height:33px;background:#f3f3f3;"> <td class="tac vam"><span class="fs11"><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="PREV FIRST" style="margin:2px; 0 0 0;" /> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;"> <span class="b fs11 fc7">1</span><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a></span></td> </tr> </table> Here is an example of what I have it in hard coded: I would like for current page to be bold, with a next, last, prev, first link at all time. The code I'm looking into is the one famous "Basic pagination" on this forum: /****** build the pagination links ******/ // range of num links to show $range = 3; // if not on page 1, don't show back links if ($currentpage > 1) { // show << link to go back to page 1 echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif' class='vat' alt='PREV FIRST' style='margin:2px; 0 0 0;'></a> "; // get previous page num $prevpage = $currentpage - 1; // show < link to go back to 1 page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif' class='vat' alt='PREV' style='margin: 2px;'></a> "; } // end if // loop to show links to range of pages around current page for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { // if it's a valid page number... if (($x > 0) && ($x <= $totalpages)) { // if we're on current page... if ($x == $currentpage) { // 'highlight' it but don't make a link echo " <span class='b fs11'>$x</span> "; // if not current page... } else { // make it a link echo " <span class='fs11'><a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a></span> "; } // end else } // end if } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif' class='vat' alt='NEXT' style='margin:2px; 0 0 0;'></a> "; // echo forward link for lastpage echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'><img src='http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif' class='vat' alt='NEXT' style='margin:2px; 0 0 0;'></a> "; } // end if /****** end build pagination links ******/ Any help please. :'(
  21. Hello, I have a PHP-MySQL script that need help with. I would like a images pagination. 2 rows, 4 column. With a dotted line in between the row. What I want is to have image with id 1-4 to show on bottom row and image id 5-8 to show on top row, there's more images but that's on other page id. Here is my code: <?php // database connection info $conn = mysql_connect('..','..','..') or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('..',$conn) or trigger_error("SQL", E_USER_ERROR); $query = "SELECT * FROM thumb"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { ?> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <?php } ?> <div style="clear:left;overflow:hidden;width:0;height:0;"></div> <p style="margin:20px;"></p> <div class="dotHLine1"></div> <p style="margin:20px;"></p> <?php $query = "SELECT * FROM thumb"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { ?> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <?php } ?> The dotted line in between the two rows of images is generated with this code: <div style="clear:left;overflow:hidden;width:0;height:0;"></div> <p style="margin:20px;"></p> <div class="dotHLine1"></div> <p style="margin:20px;"></p> I would like for images with id 1-4 to show on bottom row and images with id 5-8 to show on top row. And images with id 9-12 to show on bottom row of next page and images 13-16 to show on top row of that page. To see how the list looks like, please visit: http://vickizhao.net/starhome/photo/list.php Thanks.
  22. Thank you so much ignace. You just saved my days.
  23. Can anyone help me how to make MySQL store the information in red and use php to call upon it? <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=56"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00004.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=55"><img id="reSizeImg0" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00003.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=54"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00002.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=53"><img id="reSizeImg0" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00001.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="clear:left;overflow:hidden;width:0;height:0;"></div> <p style="margin:20px;"></p> <div class="dotHLine1"></div> <p style="margin:20px;"></p> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=52"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00000.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=51"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0429/zhaowei_shopguide_04292009_s00001.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=50"><img id="reSizeImg0" src="http://file.vickizhao.net/files/2009/0428/zhaowei_shopguide_04282009_sl00002.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;"> <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;"> <tr style="height:132px;"> <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=49"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0428/zhaowei_shopguide_04282009_sl00001.jpg" style="border:solid 1px #ffffff;" alt="" /></a></td> </tr> </table> </div> <div style="clear:left"></div> <p style="margin:28px;"></p> <div class="BLine3"></div> <!-- paging --> <table width="100%"> <tr style="height:33px;background:#f3f3f3;"> <td class="tac vam"><span class="fs11"><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;"> <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=1">1</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a><span class="fs10 fc7"> / </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a><span class="fs10 fc7"> / </span><span class="b fs11 fc7">7</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a>--><span class="fs10 fc7"> / </span><span class="fs11 fc10">8</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a>--><span class="fs10 fc7"> / </span><span class="fs11 fc10">9</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a>--><span class="fs10 fc7"> / </span><span class="fs11 fc10">10</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a>--> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /><!--<a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a>--> <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></span></td> </tr> </table> The first part: Is to get my image url path. Each page id have 8 images. The second part: How to make this hard coded paging into more auto. If it help, the exact page i'm using the code on is at vickizhao.net/starhome/photo/list.php?Pid=7 Thank anyone for your time. Sorry if I didn't put my code inside a code box but only way i can make what i wanted you to se ein red.
×
×
  • 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.