Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML CSS

images like a gallery

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: macek, egami, gesf

images like a gallery

Postby techker » Sat Jan 03, 2009 2:38 pm

hey guys i have a pictur gallery made in php and i can't figure out how to make the images show like a picture galley instead of horizontal or verticlal?

like when you use an echo (picture)

they show like

pic pic pic pic pic

or if you add a br tag

pic
pic
pic
pic

i need pic pic pic pic

pic pic pic pic

thx!
techker
New php-forum User
New php-forum User
 
Posts: 9
Joined: Sun Nov 04, 2007 8:05 pm

Re: images like a gallery

Postby AeroX » Thu Jan 22, 2009 6:27 am

Please post the code so that we can help.
User avatar
AeroX
New php-forum User
New php-forum User
 
Posts: 142
Joined: Sun May 11, 2008 1:40 am
Location: London, UK

Re: images like a gallery

Postby techker » Thu Jan 22, 2009 2:56 pm

this is my lates version it works but not completly.the page numbering is mest up i i see a litle line next to the pic?


[php]
<?php // Connects to your Database
mysql_connect("localhost", "techker_techker", "techker") or die(mysql_error()) ;
mysql_select_db("techker_softcore") or die(mysql_error()) ;

$QQQ = mysql_query("SELECT * FROM softcore WHERE type='sketch'");


if (!$QQQ) die(mysql_error());
// Get the total number of rows
$total_items = mysql_num_rows($QQQ);

// Get the page limit & page
$limit = $_GET['limit'];
$page = $_GET['page'];

// Do default setting
if((!$limit) || (is_numeric($limit) == false) || ($limit < 1) || ($limit > 5)) {
$limit = 50; //default
}

// Do default setting
if((!$page) || (is_numeric($page) == false) || ($page < 0) || ($page > $total_items)) {
$page = 1; //default
}

// Calculate the number to page to display
$total_pages = ceil($total_items / $limit);
$set_limit = $page * $limit - ($limit);

$QQQ1 = mysql_query("SELECT * FROM softcore WHERE type='sketch'");
if(!$QQQ1) die(mysql_error());
$err = mysql_num_rows($QQQ1);
//if($err == 0) die("No matches met your criteria.");

// Let user decide how many result to show in each page
// echo "Results per page: ";
//echo "<a href='list_store.php?limit=2&page=1'>2</a> |
//<a href='list_store.php?limit=5&page=1'>5</a> |
//<a href='list_store.php?limit=10&page=1'>10</a>";

//Count Message
$count = 1;

//to loop the results into the table rows code goes here
//while($FFF = mysql_fetch_assoc($QQQ1)) {
?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> SOFTCORE</title>
<style type="text/css">
<!--
body {
background-image: url(images/sketches_15.gif);
background-color: #000000;
}
-->
</style></head>

<body>
<div align="left"><? echo '<table><tr>';
$cnt = 0;
while ($row = mysql_fetch_assoc($QQQ1)) {
echo '<td><a href="/admin/pic_view.php?id='. $row['id'] .'" target="_blank" >
<img src="/admin/art/'. $row['thumb'] .'" border="0" alt="" />
</a></td>'; // output the img tag
$cnt++; // increase count, as we have added a pic now
if (($cnt % 8) == 0) {
// if $cnt modulus 4 equals 0, we have added 4 pictures,
// and makes a new line/row
echo '</tr><tr>'; // echo end of row
for ($cell = 0; $cell < ($cnt % 8); $cell++) {
echo '<td>&nbsp;</td>';
}
// end the table
echo '</tr></table>';
}
}?>

</div>
<div align="left">
<?php

$prev_page = $page - 1;

if($prev_page >= 1) {
echo(" <a href=pic_galleryS.php?limit=$limit&page=$prev_page><b>Prev</b></a>");
}

for($i = 1; $i <= $total_pages; $i++){
if($i == $page){
echo($i." ");
}else{
echo("<a href=\"pic_galleryS.php?limit=$limit&page=$i\">$i</a> ");
}
}

$next_page = $page + 1;
if($next_page <= $total_pages) {
echo("</b><a href=pic_galleryS.php?limit=$limit&page=$next_page><b>Next</b></a> ");
}

//dbDisconnect($conn2);
?>
</div>
</td>
</tr>
</table>
</p>
</div>
</body>
</html>

[/php]

see it for your self and thx for the help!

http://www.softcoredesign.com/sketches.html
techker
New php-forum User
New php-forum User
 
Posts: 9
Joined: Sun Nov 04, 2007 8:05 pm

Re: images like a gallery

Postby chicalicdan » Wed Jul 28, 2010 12:27 am

http://checalicdan.blogspot.com/2010/07 ... abase.html

This will do the magic..

I have a simpler table, just check my older post..


feel free to leave a comment if u have other question..
chicalicdan
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jul 28, 2010 12:23 am

Re: images like a gallery

Postby mxicoders » Fri May 06, 2011 3:13 am

Please give me information about CSS.Which are the types of CSS? :-x
mxicoders
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri May 06, 2011 3:03 am

Re: images like a gallery

Postby WebOutGateway » Tue Aug 05, 2014 6:32 pm

Cascading Style Sheets, or CSS, gives color and life to a website. It is how you want your content or output to be displayed.

There are three (3) types of CSS:
1. Internal which is defined under your <head> section and will only be used within that web page;
ex.
Code: Select all
<head>
    <style type="text/css">
        #video-gallery{
             width: 350px;
             padding: 12px;
             margin: 15px auto;
        }
    </style>
</head>


2. Inline which is defined in your HTML tags to style a every particular element;
ex.
Code: Select all
<p style= "font-size: 14px; color: purple;"></p>


and

3. External which is in a separate file with the .css extension, defined under your <head> section. This is the one you will link to your web page/s.
ex.
Code: Select all
<link rel="stylesheet" type="text/css" href="main.css" >


I hope this helps. Thank you.

Source: http://www.expression-web-tutorial.com/ ... -GPjuOSyAk
For more of CSS: http://www.w3schools.com/css/default.asp
User avatar
WebOutGateway
New php-forum User
New php-forum User
 
Posts: 37
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines


Return to CSS

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.